myDiagram.model = new go.GraphLinksModel(
[
{ key: "Alpha", color: "lightblue" },
{ key: "Delta", color: "pink" }
],
[
{ from: "Alpha", to: "Alpha" },
{ from: "Delta", to: "Alpha" }
]);
I need to add more values dynamically, how should I do this?
Node data (source: GoJS docs, class Model):
If you want to add or remove node data from the nodeDataArray, call the addNodeData or removeNodeData methods.
Link data (source: GoJS docs, class GraphLinksModel):
If you want to add or remove link data from the linkDataArray, call the addLinkData or removeLinkData methods. If you want to modify the node a link connects to, call the setFromKeyForLinkData and/or setToKeyForLinkData methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With