bumbeishvili / org-chart

Highly customizable org chart. Integrations available for Angular, React, Vue
https://stackblitz.com/edit/web-platform-o5t1ha
MIT License
928 stars 330 forks source link

How to get current chart direction #341

Closed kosirm closed 11 months ago

kosirm commented 11 months ago

Hi, I just discovered this library and I'm amazed with quality and usefulness of this library! It is the best Christmas present for me this year :) Thank you so much for sharing this code!

I would like to make a few visual changes regarding the direction of the chart. I found this nice function which rotates the chart: onclick='chart.layout(["right","bottom","left","top"][index++%4]).render().fit() but I don't know how can I get direction programatically... If I try to see direction with console.log("Direction:"+JSON.stringify(chart.layout(["top"]))) I expected true/false, but I get empty object: Direction:{}

Thanks for any hint.

Merry Christmas and Happy New Year 2024!

bumbeishvili commented 11 months ago

Hi, I'd suggest taking a look at installing section to understand how the library works and what/how you can customize/get/modify

https://github.com/bumbeishvili/org-chart?tab=readme-ov-file#installing

In your case,

chart.layout('top') // this sets the layout

chart.layout() // this gets the current layout
kosirm commented 11 months ago

Perfect, thank you!