getDocumentPoint method

Point getDocumentPoint(
  1. Object local, [
  2. Point? result
])

Returns the Point in document coordinates for a given Spot in this object's bounds or for a Point in local coordinates.

For example, for an instance of a Node like this:

myDiagram.nodeTemplate =
  $(go.Node, "Auto",
    $(go.Shape, "RoundedRectangle",
      new go.Binding("fill", "color")),
    $(go.TextBlock,
      { name: "TB", margin: 3 },
      new go.Binding("text", "key")));

where the Node is positioned at 100, 200,

  node.findObject("TB").getDocumentPoint(go.Spot.Center)

could return a Point that is approximately at 122, 213. @param {Spot|Point} local a real Spot describing a relative location in or near this GraphObject, or a real Point in local coordinates. @param {Point=} result an optional Point that is modified and returned. @return {Point} in document coordinates. @see #getDocumentBounds @see #getLocalPoint

Implementation

_i3.Point getDocumentPoint(
  _i2.Object local, [
  _i3.Point? result,
]) =>
    _i4.callMethod(
      this,
      'getDocumentPoint',
      [
        local,
        result ?? _i5.undefined,
      ],
    );