BALKANGraph / OrgChartJS

OrgChart JS is a simple, flexible and highly customizable organization chart plugin for presenting the structure of your organization and the relationships in an elegant way.
https://balkan.app/orgchartjs
247 stars 84 forks source link

Auto width node #837

Closed DepreesterEwoud closed 2 months ago

DepreesterEwoud commented 2 months ago

Hi!

I have another question. I am trying to make an auto width for each node according to the text inside the node. Now, i encounter following issue.

I am using blazor. So when i pass my data for loading the chart like this from blazor to the js file image And request the data in my js file like this image And print all the nodes (var allNodesRect = document.querySelectorAll('[data-n-id] rect');) it is all null image

Now when i hardcode the data in my chart like this, it works. So i don't really know what i am doing wrong here. image

This is my code block for the auto width of the node image

Thanks in advance!

ZornitsaPesheva commented 2 months ago

Here is a code demo for auto width: https://code.balkan.app/org-chart-js/dynamic-width#JS

DepreesterEwoud commented 2 months ago

That works, thanks @ZornitsaPesheva !