You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I really enjoy cytoscape.js and am interested in trying to use it to build an entity-relationship diagram with tables. There seems to be two features required in order to draw one:
In what ways could I explore drawing a table node in a cytoscape.js graph? Could it be a compound node, where the table header and columns would each be a child node? How about building a UI extension where I could introduce a specialized node type TableNode?
I'm a little confused about child node positioning as it doesn't appear to be relative to the parent node. Also, my attempt to set a position on parent nodes doesn't seem to work. Ideally I'd like to just mutate the parent node position and have the child nodes always positioned relative to the parent.
I'd appreciate it if the contributors could review the POC and let me know if this would be the ideal way of implementing this table node. Is the positioning for the nodes correct, or could the child nodes be relatively positioned?
The text was updated successfully, but these errors were encountered:
A compound parent doesn't really have its own position. Its position is inferred from the dimensions of its children, because it must automatically accommodate its children.
To "move" a parent, you would alter the positions of all of its non-parent descendants. That's exactly how the drag gesture operates.
Further, it doesn't make sense to have model position defined relatively to a parent. That would confound model positions and especially rendered positions. If you want relative position, then use node.relativePosition().
Hi there! I really enjoy cytoscape.js and am interested in trying to use it to build an entity-relationship diagram with tables. There seems to be two features required in order to draw one:
In what ways could I explore drawing a table node in a cytoscape.js graph? Could it be a compound node, where the table header and columns would each be a child node? How about building a UI extension where I could introduce a specialized node type TableNode?
I built a POC using compound nodes: https://jsfiddle.net/do5qw18o/.
I'm a little confused about child node positioning as it doesn't appear to be relative to the parent node. Also, my attempt to set a position on parent nodes doesn't seem to work. Ideally I'd like to just mutate the parent node position and have the child nodes always positioned relative to the parent.
I'd appreciate it if the contributors could review the POC and let me know if this would be the ideal way of implementing this table node. Is the positioning for the nodes correct, or could the child nodes be relatively positioned?
The text was updated successfully, but these errors were encountered: