fperucic / treant-js

Treant.js - javascript library for drawing tree diagrams
MIT License
864 stars 314 forks source link

Is there a way to indicate that node is having children? #123

Open ymihir opened 6 years ago

ymihir commented 6 years ago

I am able to create org chart with library Thank you. We are having almost 2000 employees. So if I try to load the chart with root, it will take a lot of time to load, since I am getting relationships with REST query in SharePoint user profiles. Instead i want to show initially only two levels. When user click on expand button then I can load next two levels. But I am not able to found any way to do this. If there is some property in json object like, nodeHasChildren:true then show particular node with adding "+" symbol. When user click on "+" symbol, ajax call will happen to load few more nodes. Is this possible to implement?

dlgoodchild commented 6 years ago

This library doesn't support many things like that. I opted to use d3 instead for such functionality

ymihir commented 6 years ago

Could you please give me link for D3 library? Is this the one https://github.com/BernhardZuba/d3js-orgchart? Will it support properties like, node having children, showing pictures of people, custom styling etc?

bba278 commented 5 years ago

@ymihir

Not sure if this is still relevant but you can use jQuery to manipulate the DOM which TreantJS creates. From there you can insert an element which states 'Show/Hide Children'