I need to provide the user to rotate an image within a node to line up with the link/edge. For example,
I’m able successfully able to rotate the node and have it line up but, the entire diagram ends up rerendering as follows:
The image is perfect square. How can I prevent the diagram from rerendering. Here’s the nodeTemplate:
myDiagram.nodeTemplate =
$(go.Node, "Horizontal",
{
locationSpot: go.Spot.Center, // Node.location is the center of the Shape
locationObjectName: "SHAPE",
selectionObjectName: "SHAPE",
rotatable: true,
locationSpot: go.Spot.Center,
rotateObjectName: "SHAPE",
rotateAdornmentTemplate: // specify appearance of rotation handle
$(go.Adornment,
{ locationSpot: go.Spot.Center },
$(go.Shape, "Circle",
{ width: 12, height: 12, cursor: "pointer",
background: "transparent", stroke: "dodgerblue", strokeWidth: 2
}
)
),
//selectionAdorned: false,
},
new go.Binding("location", "", toLocation).makeTwoWay(fromLocation),
$(go.Panel, "Vertical", {},
$(go.TextBlock, {
alignment: go.Spot.Center,
textAlign: "center",
font: '9px bold sans-serif',
},
new go.Binding("text")),
),
$(go.Panel, "Auto",
$(go.Picture,
{
name: "SHAPE",
angle: 180,
alignment: go.Spot.Center,
portId: ""
},
new go.Binding("source", "type", nodeTypeImage),
new go.Binding("desiredSize", "type", nodeTypeSize)
),
),
Finally, sometimes when I rotate the link/edge follows. I want to be able to rotate a shape independent of the link/edge.