Thank you Shyam, for your reply and example. I can see how to set the layers visible and such.
Can you explain how to add nodes to an existing layer at runtime.?
I added a button to your example and I tried the below but it has no effect. I can of course add it to the diagram using add but then it won't hide when I set the layer invisible
in fact when I add a node to the layer 'objects' and then I try to set invisible I get this error: undefined is not an object (evaluating 's.wrapper')
do I need remove and rebuild the layer each time? Interesting there is no mention in the API of adding objects to a layer at runtime.
Additionally it looks like I also need to add the connections to the layer for them to hide and show?
Appreciate any insight. Thank you.
drawNode() {
let node = {id: 'newNode', width:100, height: 100, offsetX: 200,offsetY: 200};
nodes.push(node);
diagramInstance.layers[0].objects.push(node);
}