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

Question regarding to highlighting #808

Closed joshuacos1977 closed 6 months ago

joshuacos1977 commented 8 months ago

the link above demonstrated how to highlight child node to parent node. Can you explain the line of the code below: chart.onInit(() => { setHighlightStyle(chart.getNode(5), 5); }); based on the documentation: getNode(nodeId: string | number): OrgChart.node;

5 is nodeId either string or number in that case it is number. so why it is 5?

joshuacos1977 commented 8 months ago

joshuacos1977 commented 8 months ago

[https://code.balkan.app/organizational-chart-path-highlighting-and-selection#JS]

joshuacos1977 commented 8 months ago

here is the code link above

ZornitsaPesheva commented 8 months ago

This is just to show some highlight on initial load. We have selected 5 for the example and we highlight nodes from 5 to the root.