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

Self linked node routing is wired

$
0
0

@Kakit wrote:

Hi,

I have the following setting for links and nodes

    var GO = $;
    function getNodeTemplate () {
      return  GO(go.Node, 'Vertical',
        {
          locationObjectName: 'SHAPE',
          locationSpot: go.Spot.MiddleLeft,
          portSpreading: go.Node.SpreadingEvenly,
          deletable: false 
        },
        new go.Binding('location'),
        GO(go.Shape, 'RoundedRectangle',
          {
            name: 'SHAPE',
            stroke: 'gray', strokeWidth: 3,
            minSize: new go.Size(50, 10),
            maxSize: new go.Size(120, 50),
            fromLinkable: true,
            fromSpot: go.Spot.RightSide,
            fromLinkableDuplicates: true,
            fromLinkableSelfNode: true,
            toLinkable: true,
            toSpot: go.Spot.LeftSide,
            toLinkableDuplicates: true,
            toLinkableSelfNode: true,
            portId: ''
          }))

  function getLinkTemplate () {
      return GO(go.Link,
        {
          layerName: 'Background',
          adjusting: go.Link.End,
          fromEndSegmentLength: 50, toEndSegmentLength: 50,
          curve: go.Link.Bezier,
          deletable: false,
          selectionAdornmentTemplate: GO(go.Adornment, 'Link', GO(go.Shape, {isPanelMain: true, stroke: 'rgba(255, 251, 56, 0.3)', strokeWidth: 10}))
        },
        GO(go.Shape,
          {
            isPanelMain: true,
            strokeWidth: 10
          }),
        GO(go.TextBlock,
          {
            name: 'TEXT',
            stroke: 'black',
            opacity: 0,
            //segmentOffset: new go.Point(0, -10),
            segmentOrientation: go.Link.OrientAlong,
            font: '2.5em Segoe UI, sans-serif'
          })
      );

I want to have both self linked node and links between two nodes working. But somehow, the self-linked node looks like this. Notice the bottom link, it starts from the bottom and go back to the bottom. The left and right links are fine.

Could you please advise me how to resolve this problem ?

Regards,
Kakit

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles