Defualt the Diagram with the shapes rotated 90 degrees

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")
        { margin: 15, },
        new go.Binding("text", "name"))

// define a Link template that routes orthogonally, with no arrowhead
myDiagram.linkTemplate =
        { 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?


There really isn’t any difference between a “RoundedRectangle” Shape that is rotated 90 degrees and one that has swapped its width and height values.

What look are you trying to accomplish?

Yeah, i should have updated the code the actual shape we’d like to use is a Hexagon ( we want pointy ends going East-West instead of North-South)

Sorry about the confusion.

Just set angle: 90 on the Shape.

Hey, do you like the changes in Cobol 2014?

Just kidding – I never learned any version of Cobol.

Do you guys give cobol libraries? Maybe a SCOBOL (Screen COBOL) library for showing charts on a terminal window? Just kidding.

is it possible to round the points on the hexagon?

You would need to define such a custom figure yourself. GoJS Shapes -- Northwoods Software

We’ll work on a diagramming library in COBOL when we happen to get some time and interest in doing so.