Search code examples
gojs

rotate GoJs shape 90 degree


I want to rotate a shape 90 degrees in my diagram. Here is source that we're using to create a diagram consisting of round rectangles, how do i rotate the shapes 90 degrees when the model renders?

myDiagram.nodeTemplate =
            $(go.Node, go.Panel.Auto,
            $(go.Shape, "RoundedRectangle",
                { fill: "lightgrey" },
                new go.Binding("figure", "fig"),
                new go.Binding("fill","color")
            ),
            $(go.TextBlock, 
                { margin: 15, },
                new go.Binding("text", "name"))
            );

Solution

  • It doesn't really matter for a "RoundedRectangle" figure, but for a figure such as "Hexagon", just set angle: 90 on the Shape.