Hi Team
I am using GoJS v1.8.30 in Ubuntu on my local. I am working with Double tree mainly.
I am facing two issues mainly.
-
I need two different types of nodes, one with circle with an image in the center(Root Node) and Rectangle for all others. I tried that using
myDiagram.nodeTemplate =
$(go.Node, “Auto”,
{ isShadowed: false,
defaultAlignment: go.Spot.LeftCenter },
// define the node’s outer shape
$(go.Shape, “Rectangle”,
{ fill: graygrad, stroke: “#D8D8D8”, width: 200, height: 30 },
new go.Binding(“fill”, “color”)),
$(go.Picture,
{ width: 32, height: 32, margin: 4 },
new go.Binding(“source”, “icon”)),
// define the node’s text
$(go.TextBlock,
{ margin: 7, font: “600 12px ‘Roboto’, sans-serif”, stroke: “#000”, textAlign: ‘left’ },
new go.Binding(“text”, “key”),
new go.Binding(“textAlign”, “alignment”))
);myDiagram.nodeTemplateMap.add(“problem”,
$(go.Node, “Auto”,
{ width: 100 },
$(go.Shape, “Circle”,
{ fill: “#fff”, stroke: “#fff”, strokeWidth: 3 })),
$(go.Picture,
{ width: 32, height: 32, margin: 4, source: “…/images/dashboard-companies-icon.png” },
new go.Binding(“source”, “icon”))
);
But the image is not showing.
If that doesn’t work I need to center the text for only that root node at center. textAlign didn’t work for me either.
- I am using link routing as Orthogonal, but when the nodes of any of the side increases there is a link starting from the center to the nodes. I don’t want the links starting from center. Instead left and right from the root node is fine. i could not get a code to avoid this. please help.