Is there any example how to add new nodes to the palette programatically (let’s say in a loop)? Each node’s properties have to be set programatically (colours, number of ports, etc).
I’ve been playing with diagram.nodeTemplate and it looks like $=go.GraphObject.make takes varargs parameters so the numbers of parameters depends on number of ports. I tried to use
where array describes all parameters but I’m getting
"Cannot add a GraphObject that already belongs to another Panel to this Panel: Panel(Panel.Auto)#1110, already contained by Node#1128, cannot be shared by this Panel: Node#11311 "
Is there example to follow?