I have “special” nodes in my data that are displayed in a box along the bottom of the screen, separate from the main layout, always visible, and do not move with the rest of the diagram at all. To accomplish this, I have:
- Created a custom layer with
isInDocumentBounds = falseandisViewportAligned = true - The parts themselves have
node.layerName = 'special'andnode.isLayoutPositioned = false - I position them using
node.alignment = new go.Spot(0, 1, …) - Whenever something changes the list of special nodes (e.g., add or remove), I update all of their alignments (I have logged out their new alignment values and can see they have changed). However, while their alignment values DO change, they do not visually. Once I move the main diagram at all (like zooming in or panning), then suddenly all of the special nodes update to their new positions.
I have tried calling things diagram.requestUpdate(), diagram.layoutDiagram(), diagram.layoutDiagram(true), and node.ensureBounds(), but nothing seems to cause them to update their drawing until I move the main diagram. I have noticed that if I have to change the “special box” and then change the diagram’s padding, that does trigger an appropriate update. But if the padding is re-set to the same value, then there is no visual update.
If this is not enough information, I will try to create a minimal working example.