Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6969

Setting minimal distance between diagram nodes?

$
0
0

@bagrijroman wrote:

Hi.
I try to use GoJs, and got some problems.
I try to display nodes and relation with values.

But I got a problem. Diagram nodes displayed to close for each other and user can not see arrow labels.

Here is ilustration of my problem link to image

For displaying diagram data I use js object with nodes and relation array.
for example:

const visualizationObjExample = {
  nodes: [
    {key: "A", color: 'red'},
    {key: "B", color: 'red'},
    {key: "C", color: 'red'},
  ],
  links: [
    { from: "A", to: "B", value: '$12'},
    { from: "B", to: "C", value: '$15'},
  ],
};

For initial configuration I use next code

`const { nodes, links } = this.state;
    const diagram = goObj(go.Diagram, this.refs.goJsDiv, {initialContentAlignment: go.Spot.Center});
    const $ = go.GraphObject.make;

diagram.nodeTemplate =
  $(go.Node, "Auto",
    $(go.Shape, "RoundedRectangle", { strokeWidth: 0 },
      new go.Binding("fill", "color")),
    $(go.TextBlock,
      { margin: 8 },
      new go.Binding("text", "key"))
  );
diagram.linkTemplate =
  $(go.Link,
    $(go.Shape),
    $(go.Shape, { toArrow: "Standard" }),
    $(go.TextBlock,
      new go.Binding("text", "value"))
);

diagram.model = new go.GraphLinksModel(nodes, links);`

Is it exist way to set the minimal distance between diagram nodes?

Thanks.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles