Is it possible to overlay text on a diagram that stays fixed as viewport is moved?
We attempted to create a template that is unmovable while adjusting the x, y coordinates based on viewportBoundsChanged
listener with diagram.viewportBounds
variables, but the nodes are moving around and not staying fixed in the diagram.
Our implementation of our template:
export const someTemplate = makeGraph(
go.Node,
"Auto",
{ movable: false },
makeGraph(
go.TextBlock,
{
margin: 5,
stroke: "white",
textAlign: "center",
editable: false,
font: "20px Segoe-UI, sans-serif",
},
new go.Binding("text", "key"),
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
),
)
Is there an easier way to do this? Thank you in advance!