Hi I’d like to create a diagram where the node shapes are rotated 90 degrees. Here is my code so far:
var $ = go.GraphObject.make;
var myDiagram =
$(go.Diagram, this._element.nativeElement,
{
initialContentAlignment: go.Spot.Center, // center Diagram contents,
"isReadOnly": true,
"undoManager.isEnabled": true, // enable Ctrl-Z to undo and Ctrl-Y to redo
layout: $(go.TreeLayout, // specify a Diagram.layout that arranges trees
{ angle: 90, layerSpacing: 35 })
});
// the template we defined earlier
myDiagram.nodeTemplate =
$(go.Node, go.Panel.Auto,
$(go.Shape, "Hexagon",
{ fill: "lightgrey" },
new go.Binding("figure", "fig"),
new go.Binding("fill","color")
),
$(go.TextBlock,
{ margin: 15, },
new go.Binding("text", "name"))
);
// define a Link template that routes orthogonally, with no arrowhead
myDiagram.linkTemplate =
$(go.Link,
{ routing: go.Link.Orthogonal, corner: 5 },
$(go.Shape, { strokeWidth: 3, stroke: "#555" })
); // the link shape
var model = $(go.TreeModel);
model.nodeDataArray =
[
{ key: "1", name: this.cpm.decisions[0].label, fig: "Hexagon", color: "lightgrey" },
{ key: "2", name: this.cpm.decisions[1].label, parent: "1", fig: "Hexagon", color: "lightgrey" },
{ key: "3", name: this.cpm.decisions[2].label, parent: "1", fig: "Hexagon", color: "lightgrey" },
{ key: "4", parent: "3", name: "TODO", fig: "Hexagon", color: "lightgrey" },
{ key: "5", parent: "3", name: "TODO", fig: "Hexagon", color: "lightgrey" },
{ key: "6", parent: "2", name: "TODO", fig: "Hexagon", color: "lightgrey" }
];
myDiagram.model = model;
How do i default the Hexagons to be rotated 90 degrees?
thanks,
Chris