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

Is there any way to get position of a port

$
0
0

@lenxeon wrote:

use example as https://gojs.net/latest/samples/dynamicPorts.html

I want to get the shortest distance of two ports. but the position of port is NAN.

click the example link href and open chrome console.

myDiagram.model.nodeDataArray[0]
// {key: 1, name: "Unit One", loc: "101 204", leftArray: Array(1), topArray: Array(1), …}
let node = myDiagram.findNodeForKey(1)
let p = node.ports.first()
p.position
//H {x: NaN, y: NaN, s: true}

As you can see, the x and y of position is NAN

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles