position property

Point position

Gets or sets the coordinates of this Diagram in the viewport. Value must be of type Point in document coordinates. The default is Point(NaN, NaN), but is typically set to a real value when a Diagram is initialized.

Scrolling and panning the Diagram modify the Diagram's position.

Setting this property does not notify about any changed event. However you can listen with #addDiagramListener for a DiagramEvent with the name "ViewportBoundsChanged".

The #viewportBounds x and y values are always the same as the Diagram's position values.

If you set this property any replacement of the #model will result in a layout and a computation of new #documentBounds, which in turn may cause the diagram to be scrolled and zoomed, depending on various Diagram properties named "initial...". You may want to set #initialPosition instead of setting this property around the time that you are loading a model.

Implementation

_i3.Point get position => _i4.getProperty(
      this,
      'position',
    );
void position=(Point value)

Implementation

set position(_i3.Point value) {
  _i4.setProperty(
    this,
    'position',
    value,
  );
}