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

Linker Issue - Connect linker to the dynamically created Port

$
0
0

@premthomas95 wrote:

Capture
I tried linking this and there is gap and it doesn’t link to the edge of the diamond…It perfectly links to the edge of the diamond if the text block below is removed. The diamond shape and the text block is inside a “Table”…Pasting the code below.

return go.GraphObject.make(go.Node, ‘Table’,
{
locationObjectName: ‘SHAPE’,
locationSpot: go.Spot.Center,
toolTip: this.tooltiptemplate,
selectionAdorned: false,
resizable: true,
},

  new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
      
      new go.Binding('layerName', 'isSelected', (s: boolean) => s ? 'Foreground' : '').ofObject(),
      // can be resided according to the user's desires
  { /*resizable: true,*/ resizeObjectName: 'SHAPE' },
  // go.GraphObject.make(go.TextBlock,
  //   { row: 0, column: 0, textAlign: 'center', margin:0, editable: false ,/*background:'green'*/},
  //   //new go.Binding('text').makeTwoWay(),
  //   //new go.Binding('font', 'font'),
  //  // new go.Binding('stroke', 'textColor')
  // ),
  go.GraphObject.make(go.Panel, 'Spot',
 // { row: 1, column: 1, name: 'SHAPE',stretch: go.GraphObject.Fill },
      go.GraphObject.make(go.Shape, 'Diamond',
              {
                /*row:0,column:0,*//*margin: new go.Margin(0,0,0,0) ,*/
                strokeWidth: 1, fill: this.GatewayNodeFill, stroke: this.GatewayNodeStroke,
                name: 'SHAPE',
                desiredSize: new go.Size(this.GatewayNodeSize, this.GatewayNodeSize),
                //  portId: '', fromLinkable: true, toLinkable: true, cursor: 'pointer',
                //  fromSpot: go.Spot.NotLeftSide, toSpot: go.Spot.AllSides
              },
              new go.Binding('desiredSize', 'size').makeTwoWay()),  // end main shape

              go.GraphObject.make(go.Shape, 'NotAllowed',
                      { /*row:0,column:0,*/ alignment: go.Spot.Center, stroke: this.GatewayNodeSymbolStroke, fill: this.GatewayNodeSymbolFill },
                      new go.Binding('figure', 'gatewayType', this.nodeGatewaySymbolTypeConverter),
                      // new go.Binding("visible", "gatewayType", function(s) { return s !== 4; }),   // comment out if you want exclusive gateway to be X instead of blank.
                      new go.Binding('strokeWidth', 'gatewayType', (s: number) => {
                        const type = 4;
                        return (s <= type) ? this.GatewayNodeSymbolStrokeWidth : 1;
                      }
                      ),
                      new go.Binding('desiredSize', 'gatewayType', this.nodeGatewaySymbolSizeConverter)),
                    // the next 2 circles only show up for event gateway
                    go.GraphObject.make(go.Shape, 'Circle',  // Outer circle
                            {
                              /*row:0,column:0,*/strokeWidth: 1, stroke: this.GatewayNodeSymbolStroke, fill: null, desiredSize: new go.Size(this.EventNodeSize, this.EventNodeSize)
                            },
                            new go.Binding('visible', 'gatewayType', (s: number) => {
                              const checkval = 5;
                              return s >= checkval;
                            }) // only visible for > 5
  ),  // end main shape
  
                          go.GraphObject.make(go.Shape, 'Circle',  // Inner circle
                            {
                              /*row:0,column:0,*/ alignment: go.Spot.Center, stroke: this.GatewayNodeSymbolStroke,
                              desiredSize: new go.Size(this.EventNodeInnerSize, this.EventNodeInnerSize),
                              fill: null
                            },
                            new go.Binding('visible', 'gatewayType', (s: number) => {
                              const checkval = 5;
                              return s === checkval;
                            }) // inner  only visible for == 5
                          ),
  ),
 
  this.makePort('T', go.Spot.Top, go.Spot.Top, true, false),
  this.makePort('L', go.Spot.Left, go.Spot.Left, false, true),
  this.makePort('R', go.Spot.Right, go.Spot.Right, true, false),
  this.makePort('B', go.Spot.Bottom, go.Spot.Bottom, true, false),

  
  
  go.GraphObject.make(go.TextBlock,
    { row: 2, column: 0, textAlign: 'center',margin:0, /*margin: new go.Margin(0, 0, 0, 0),*/ editable: true },
    new go.Binding('text').makeTwoWay(),
    new go.Binding('font', 'font'),
    new go.Binding('stroke', 'textColor')),

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles