Closed devradhika closed 9 years ago
also want to know about the padding between nodes, so that the charts will not overlap the other nodes
@devradhika how do you have placed the charts over the graph? I'm really interested to see how it works, could you share that?
These charts are only images, I have created it as an example. I have added nodes using the cy.add()
Referred: http://stackoverflow.com/questions/27799220/adding-extra-information-above-the-node-in-cytoscape-js
I suspect this would require a heavily modified strategy in the breadthfirst layout. It tries to maximise space rather than tree flow.
It may be even better to have a separate layout solely for trees, though perhaps you may find Dagre sufficient for your purposes.
In first figure above if I need to add new nodes to any branch of the tree I want it to be appear in straight line(i.e. vertically). is it possible?
If you add nodes, you can position them manually wherever you like -- underneath a predecessor node if you like.
http://jsfiddle.net/naL1byg8/ I have set the position values for first node however, not refecting anything in the output.
You specified a layout. You can't have both, else the layout will override manual positions.
(1) Do manual positioning after layout at init, or
(2) use all manual positions.
Thank you @maxkfranz There is another scenario i.e. tree can have any number of branches, for an example I used four branches. but if number of branches changes dynamically then setting the positions manually will not display the layout correctly.
In (2), you don't use layout but rather position nodes manually according to your own specifications.
Dagre might meet the requirements for this already.
Closing for now, as Dagre should do this.
I have created graph as follows:
Need structure like this:
So that I can add any number of nodes and link them to any hierarchy. Thanks!