Class Link

A Link is a Part that connects Nodes. The link relationship is directional, going from Link#fromNode to Link#toNode. A link can connect to a specific port element in a node, as named by the Link#fromPortId and Link#toPortId properties.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): Link

Constructs an empty link that does not connect any nodes.

Returns

Link

Properties

public static AvoidsNodes: EnumValue

Used as a value for Link#routing: each segment is horizontal or vertical, but the route tries to avoid crossing over nodes.

public static Bezier: EnumValue

Used as a value for Link#curve, to indicate that the link path uses Bezier curve segments.

public static End: EnumValue

Used as a value for Link#adjusting, to indicate that the link route computation should keep the intermediate points of the previous route, just modifying the first and/or last points; if the routing is orthogonal, it will only modify the first two and/or last two points.

public static JumpGap: EnumValue

Used as a value for Link#curve, to indicate that orthogonal link segments will be discontinuous where they cross over other orthogonal link segments that have a Link#curve or JumpOver or JumpGap.

public static JumpOver: EnumValue

Used as a value for Link#curve, to indicate that orthogonal link segments will veer around where they cross over other orthogonal link segments that have a Link#curve or JumpOver or JumpGap.

public static None: EnumValue

This is the default value for Link#curve and Link#adjusting, to indicate that the path geometry consists of straight line segments and to indicate that the link route computation does not depend on any previous route points; this can also be used as a value for GraphObject#segmentOrientation to indicate that the object is never rotated along the link route -- its angle is unchanged.

public static Normal: EnumValue

Used as the default value for Link#routing: the route goes fairly straight between ports.

public static OrientAlong: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject turned to have the same angle as the route: the GraphObject's angle is always the same as the angle of the link's route at the segment where the GraphObject is attached; use this orientation for arrow heads.

public static OrientMinus90: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject being turned counter-clockwise to be perpendicular to the route: the GraphObject's angle is always 90 degrees less than the angle of the link's route at the segment where the GraphObject is attached.

public static OrientMinus90Upright: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject turned counter-clockwise to be perpendicular to the route, just like Link#OrientMinus90, but is never upside down: the GraphObject's angle always being 90 degrees less than the angle of the link's route at the segment where the GraphObject is attached; this is typically only used for TextBlocks or Panels that contain text.

public static OrientOpposite: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject's angle always being 180 degrees opposite from the angle of the link's route at the segment where the GraphObject is attached.

public static OrientPlus90: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject is turned clockwise to be perpendicular to the route: the GraphObject's angle is always 90 degrees more than the angle of the link's route at the segment where the GraphObject is attached.

public static OrientPlus90Upright: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject turned clockwise to be perpendicular to the route, just like Link#OrientPlus90, but is never upside down: the GraphObject's angle always being 90 degrees more than the angle of the link's route at the segment where the GraphObject is attached; this is typically only used for TextBlocks or Panels that contain text.

public static OrientUpright: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject turned to have the same angle as the route, just like Link#OrientAlong, but is never upside down: the GraphObject's angle always following the angle of the link's route at the segment where the GraphObject is attached; this is typically only used for TextBlocks or Panels that contain text.

public static OrientUpright45: EnumValue

This value for GraphObject#segmentOrientation results in the GraphObject's angle always following the angle of the link's route at the segment where the GraphObject is attached, but never upside down and never angled more than +/- 45 degrees: when the route's angle is within 45 degrees of vertical (90 or 270 degrees), the GraphObject's angle is set to zero; this is typically only used for TextBlocks or Panels that contain text.

public static Orthogonal: EnumValue

Used as a value for Link#routing: each segment is horizontal or vertical.

public static Scale: EnumValue

Used as a value for Link#adjusting, to indicate that the link route computation should scale and rotate the intermediate points so that the link's shape looks approximately the same; if the routing is orthogonal, this value is treated as if it were Link#End.

public static Stretch: EnumValue

Used as a value for Link#adjusting, to indicate that the link route computation should linearly interpolate the intermediate points so that the link's shape looks stretched; if the routing is orthogonal, this value is treated as if it were Link#End.

public actionCancel: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the ActionTool is cancelled and this GraphObject's #isActionable is set to true.

public actionDown: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute on a mouse-down event when this GraphObject's #isActionable is set to true.

public actionMove: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute on a mouse-move event when this GraphObject's #isActionable is set to true.

public actionUp: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute on a mouse-up event when this GraphObject's #isActionable is set to true.

public actualBounds: Rect

Gets the bounds of this GraphObject in container coordinates.

public adjusting: EnumValue

Gets or sets how the route is computed, including whether it uses the points of its old route to determine the new route.

public adornments: Iterator

Gets an iterator over all of the Adornments associated with this part.

public alignment: Spot

Gets or sets the alignment Spot of this GraphObject used in Panel layouts, to determine where in the area allocated by the panel this object should be placed.

public alignmentFocus: Spot

Gets or sets the spot on this GraphObject to be used as the alignment point in Spot and Fixed Panels.

public angle: number

Gets or sets the angle transform, in degrees, of this GraphObject.

public areaBackground: any

Gets or sets the areaBackground Brush (or CSS color string) of this GraphObject.

public background: any

Gets or sets the background Brush (or CSS color string) of this GraphObject, filling the rectangle of this object's local coordinate space.

public category: string

Gets or sets the category of this part, typically used to distinguish different kinds of nodes or links.

public click: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user single-primary-clicks on this object.

public column: number

Gets or sets the column of this GraphObject if it is in a Table Panel.

public columnCount: number

Gets the number of columns in this Panel if it is of #type Panel#Table.

public columnSizing: EnumValue

Gets or sets how this Panel's columns deal with extra space if the Panel is of #type Panel#Table.

public columnSpan: number

Gets or sets the number of columns spanned by this GraphObject if it is in a Table Panel.

public containingGroup: Group

Gets or sets the Group of which this Part or Node is a member.

public containingGroupChanged: (member: go.Part, oldgrp: go.Group, newgrp: go.Group) => void

Gets or sets the function that is called after this Part has changed which Group it belongs to, if any.

public contextClick: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user single-secondary-clicks on this object.

public contextMenu: Adornment

This Adornment is shown upon a context click on this object.

public copyable: boolean

Gets or sets whether the user may copy this part.

public corner: number

Gets or sets how rounded the corners are for adjacent line segments when the #curve is #None #JumpGap, or #JumpOver and the two line segments are orthogonal to each other.

public cursor: string

Gets or sets the mouse cursor to use when the mouse is over this object with no mouse buttons pressed.

public curve: EnumValue

Gets or sets the way the path is generated from the route's points.

public curviness: number

Gets or sets how far the control points are offset when the #curve is #Bezier or when there are multiple links between the same two ports.

public data: Object

Gets or sets the optional model data to which this panel is data-bound.

public defaultAlignment: Spot

Gets or sets the default alignment spot of this Panel, used as the alignment for an element when its GraphObject#alignment value is Spot#Default.

public defaultColumnSeparatorDashArray: Array<any>

Gets or sets the default dash array for a particular column's separator.

public defaultColumnSeparatorStroke: any

Gets or sets the default Brush stroke (or CSS color string) for columns in a Table Panel provided a given column has a nonzero RowColumnDefinition#separatorStrokeWidth.

public defaultColumnSeparatorStrokeWidth: number

Gets or sets the default stroke width for a particular column's separator.

public defaultRowSeparatorDashArray: Array<any>

Gets or sets the default dash array for a particular row's separator.

public defaultRowSeparatorStroke: any

Gets or sets the default Brush stroke (or CSS color string) for rows in a Table Panel provided a given row has a nonzero RowColumnDefinition#separatorStrokeWidth.

public defaultRowSeparatorStrokeWidth: number

Gets or sets the default stroke width for a particular row's separator.

public defaultSeparatorPadding: any

Gets or sets the additional padding for a particular row or column, a Margin (or number for a uniform Margin).

public defaultStretch: EnumValue

Gets or sets the default stretch of this Panel, used as the stretch for an element when its GraphObject#stretch value is GraphObject#Default.

public deletable: boolean

Gets or sets whether the user may delete this part.

public desiredSize: Size

Gets or sets the desired size of this GraphObject in local coordinates.

public diagram: Diagram

Gets the Diagram that this Part is in.

public doubleClick: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user double-primary-clicks on this object.

public dragComputation: (part: go.Part, oldloc: go.Point, newloc: go.Point) => go.Point

Gets or sets the function used to determine the location that this Part can be dragged to.

public elements: Iterator

Gets an iterator over the collection of the GraphObjects that this panel manages.

public fromEndSegmentDirection: EnumValue

Gets or sets how the direction of the last segment is computed when the node is rotated.

public fromEndSegmentLength: number

Gets or sets the length of the last segment.

public fromLinkable: any

Gets or sets whether the user may draw Links from this port.

public fromLinkableDuplicates: boolean

Gets or sets whether the user may draw duplicate Links from this port.

public fromLinkableSelfNode: boolean

Gets or sets whether the user may draw Links that connect from this port's Node.

public fromMaxLinks: number

Gets or sets the maximum number of links that may come out of this port.

public fromNode: Node

Gets or sets the Node that this link comes from.

public fromPort: GraphObject

Gets a GraphObject that is the "from" port that this link is connected from.

public fromPortChanged: (a: go.Link, b: go.GraphObject, c: go.GraphObject) => void

Gets or sets the function that is called after this Link changes which Node or port it connects from.

public fromPortId: string

Gets or sets the identifier of the port that this link comes from.

public fromShortLength: number

Gets or sets how far the end segment stops short of the actual port.

public fromSpot: Spot

Gets or sets where this link should connect at the #fromPort.

public geometry: Geometry

Gets the Geometry that is used by the #path, the link Shape based on the route points.

public gridCellSize: Size

Gets or sets the distance between lines in a #Grid panel.

public gridOrigin: Point

Gets or sets an origin point for the grid cells in a #Grid panel.

public groupable: boolean

Gets or sets whether the user may group this part to be a member of a new Group.

public height: number

Gets or sets the desired height of this GraphObject in local coordinates.

public isActionable: boolean

This property determines whether or not this GraphObject's events occur before all other events, including selection.

public isInDocumentBounds: boolean

Gets or sets whether this Part is part of the document bounds.

public isLabeledLink: boolean

This read-only property is true when this Link has any label Nodes, Nodes that are owned by this Link and are arranged along its path.

public isLayoutPositioned: boolean

Gets or sets whether a Layout positions this Node or routes this Link.

public isOrthogonal: boolean

This read-only property true if #routing is a value that implies that the points of the route should be orthogonal, such that each point shares a common X or a common Y value with the immediately previous and next points.

public isPanelMain: boolean

Gets or sets whether a GraphObject is the "main" object for some types of Panel.

public isSelected: boolean

Gets or sets whether this Part is selected.

public isShadowed: boolean

Gets or sets whether this part will draw shadows.

public isTopLevel: boolean

Gets whether this part is not member of any Group node nor is it a label node for a Link.

public isTreeLink: boolean

Gets or sets whether this Link is part of the tree for tree operations such as Node#findTreeChildrenNodes or Node#collapseTree.

public itemArray: Array<any>

Gets or sets a JavaScript Array of values or objects, each of which will be represented by a Panel as elements in this Panel.

public itemCategoryProperty: any

Gets or sets the name of the item data property that returns a string describing that data's category, or a function that takes an item data object and returns that string; the default value is the name 'category'.

public itemTemplate: Panel

Gets or sets the default Panel template used as the archetype for item data that are in #itemArray.

public itemTemplateMap: Map

Gets or sets a Map mapping template names to Panels.

public labelNodes: Iterator

Gets an iterator over the Nodes that act as labels on this Link.

public layer: Layer

Gets the Layer that this Part is in.

public layerChanged: (part: go.Part, oldlayer: go.Layer, newlayer: go.Layer) => void

Gets or sets the function to execute when this part changes layers.

public layerName: string

Gets or sets the layer name for this part.

public layoutConditions: number

Gets or sets "Layout..." flags that control when the Layout that is responsible for this Part is invalidated.

public leftIndex: number

Gets or sets the first column that this Panel of #type Panel#Table displays.

public location: Point

Gets or sets the position of this part in document coordinates, based on the #locationSpot in this part's #locationObject.

public locationObject: GraphObject

Gets the GraphObject that determines the location of this Part.

public locationObjectName: string

Gets or sets the name of the GraphObject that provides the location of this Part.

public locationSpot: Spot

Gets or sets the location Spot of this Node, the spot on the #locationObject that is used in positioning this part in the diagram.

public margin: any

Gets or sets the size of empty area around this GraphObject, as a Margin (or number for a uniform Margin), in the containing Panel coordinates.

public maxLocation: Point

Gets or sets the maximum location of this Part to which the user may drag using the DraggingTool.

public maxSize: Size

Gets or sets the maximum size of this GraphObject in container coordinates (either a Panel or the document).

public measuredBounds: Rect

Gets the measuredBounds of the GraphObject in container coordinates (either a Panel or the document).

public midAngle: number

Gets the angle of the path at the #midPoint.

public midPoint: Point

Gets the point at the middle of the path.

public minLocation: Point

Gets or sets the minimum location of this Part to which the user may drag using the DraggingTool.

public minSize: Size

Gets or sets the minimum size of this GraphObject in container coordinates (either a Panel or the document).

public mouseDragEnter: (e: go.InputEvent, obj: go.GraphObject, prev: go.GraphObject) => void

Gets or sets the function to execute when the user moves the mouse into this stationary object during a DraggingTool drag.

public mouseDragLeave: (e: go.InputEvent, obj: go.GraphObject, prev: go.GraphObject) => void

Gets or sets the function to execute when the user moves the mouse out of this stationary object during a DraggingTool drag.

public mouseDrop: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when a user drops the selection on this object at the end of a DraggingTool drag.

public mouseEnter: (e: go.InputEvent, obj: go.GraphObject, prev: go.GraphObject) => void

Gets or sets the function to execute when the user moves the mouse into this object without holding down any buttons.

public mouseHold: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user holds the mouse stationary in the background of the diagram while holding down a button over this object.

public mouseHover: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user holds the mouse stationary in the background of the diagram without holding down any buttons over this object.

public mouseLeave: (e: go.InputEvent, obj: go.GraphObject, prev: go.GraphObject) => void

Gets or sets the function to execute when the user moves the mouse into this object without holding down any buttons.

public mouseOver: (e: go.InputEvent, obj: go.GraphObject) => void

Gets or sets the function to execute when the user moves the mouse over this object without holding down any buttons.

public movable: boolean

Gets or sets whether the user may move this part.

public name: string

Gets or sets the name for this object.

public naturalBounds: Rect

Gets the natural bounding rectangle of this GraphObject in local coordinates, before any transformation by #scale or #angle, and before any resizing due to #minSize or #maxSize or #stretch.

public opacity: number

Gets or sets the multiplicative opacity for this Panel and all children.

public padding: any

Gets or sets the space between this Panel's border and its content, as a Margin (or number for a uniform Margin), depending on the type of panel.

public panel: Panel

Gets the GraphObject's containing Panel, or null if this object is not in a Panel.

public part: Part

Gets the Part containing this object, if any.

public path: Shape

Gets the Shape representing the path of this Link.

public pickable: boolean

Gets or sets whether or not this GraphObject can be chosen by visual "find" methods such as Diagram#findObjectAt.

public points: List

Gets or sets the List of Points in the route.

public pointsCount: number

Gets the number of points in the route.

public portId: string

Gets or sets an identifier for an object acting as a port on a Node.

public position: Point

Gets or sets the position of this GraphObject in container coordinates (either a Panel or the document).

public relinkableFrom: boolean

Gets or sets whether the user may reconnect an existing link at the "from" end.

public relinkableTo: boolean

Gets or sets whether the user may reconnect an existing link at the "to" end.

public resegmentable: boolean

Gets or sets whether the user may change the number of segments in this Link, if the link has straight segments.

public reshapable: boolean

Gets or sets whether the user may reshape this part.

public resizable: boolean

Gets or sets whether the user may resize this part.

public resizeAdornmentTemplate: Adornment

Gets or sets the adornment template used to create a resize handle Adornment for this part.

public resizeCellSize: Size

Gets or sets the width and height multiples used when resizing.

public resizeObject: GraphObject

Gets the GraphObject that should get resize handles when this part is selected.

public resizeObjectName: string

Gets or sets the name of the GraphObject that should get a resize handle when this part is selected.

public rotatable: boolean

Gets or sets whether the user may rotate this part.

public rotateAdornmentTemplate: Adornment

Gets or sets the adornment template used to create a rotation handle Adornment for this part.

public rotateObject: GraphObject

Gets the GraphObject that should get rotate handles when this part is selected.

public rotateObjectName: string

Gets or sets the name of the GraphObject that should get a rotate handle when this part is selected.

public routing: EnumValue

Gets or sets whether the link's path tries to avoid other nodes.

public row: number

Gets or sets the row of this GraphObject if it is in a Table Panel.

public rowCount: number

Gets the number of row in this Panel if it is of #type Panel#Table.

public rowSizing: EnumValue

Gets or sets how this Panel's rows deal with extra space if the Panel is of #type Panel#Table.

public rowSpan: number

Gets or sets the number of rows spanned by this GraphObject if it is in a Table Panel.

public scale: number

Gets or sets the scale transform of this GraphObject.

public segmentFraction: number

Gets or sets the fractional distance along a segment of a GraphObject that is in a Link.

public segmentIndex: number

Gets or sets the segment index of a GraphObject that is in a Link.

public segmentOffset: Point

Gets or sets the offset of a GraphObject that is in a Link from a point on a segment.

public segmentOrientation: EnumValue

Gets or sets the orientation of a GraphObject that is in a Link.

public selectable: boolean

Gets or sets whether the user may select this part.

public selectionAdorned: boolean

Gets or sets whether a selection adornment is shown for this part when it is selected.

public selectionAdornmentTemplate: Adornment

Gets or sets the Adornment template used to create a selection handle for this Part.

public selectionChanged: (p: go.Part) => void

Gets or sets the function to execute when this part is selected or deselected.

public selectionObject: GraphObject

Gets the GraphObject that should get a selection handle when this part is selected.

public selectionObjectName: string

Gets or sets the name of the GraphObject that should get a selection handle when this part is selected.

public shadowBlur: number

Gets or sets the numerical value that describes the shadow's blur.

public shadowColor: string

Gets or sets the CSS string that describes a shadow color.

public shadowOffset: Point

Gets or sets the X and Y offset of this part's shadow.

public smoothness: number

Gets or sets how far the control points are from the points of the route when #routing is #Orthogonal and #curve is #Bezier.

public stretch: EnumValue

Gets or sets the stretch of the GraphObject.

public text: string

Gets or sets a text string that is associated with this part.

public textEditable: boolean

Gets or sets whether the user may do in-place text editing on TextBlocks in this part that have TextBlock#editable set to true.

public toEndSegmentDirection: EnumValue

Gets or sets how far the control points are from the points of the route when #routing is #Orthogonal and #curve is #Bezier.

public toEndSegmentLength: number

Gets or sets the length of the last segment.

public toLinkable: any

Gets or sets whether the user may draw Links to this port.

public toLinkableDuplicates: boolean

Gets or sets whether the user may draw duplicate Links to this port.

public toLinkableSelfNode: boolean

Gets or sets whether the user may draw Links that connect to this port's Node.

public toMaxLinks: number

Gets or sets the maximum number of links that may go into this port.

public toNode: Node

Gets or sets the Node that this link goes to.

public toPort: GraphObject

Gets a GraphObject that is the "to" port that this link is connected to.

public toPortChanged: (a: go.Link, b: go.GraphObject, c: go.GraphObject) => void

Gets or sets the function that is called after this Link changes which Node or port it connects to.

public toPortId: string

Gets or sets the identifier of the port that this link goes to.

public toShortLength: number

Gets or sets how far the end segment stops short of the actual port.

public toSpot: Spot

Gets or sets where this link should connect at the #toPort.

public toolTip: Adornment

This Adornment is shown when the mouse hovers over this object.

public topIndex: number

Gets or sets the first row that this this Panel of #type Panel#Table displays.

public type: EnumValue

Gets or sets the type of the Panel.

public viewboxStretch: EnumValue

Gets or sets how a #Viewbox panel will resize its content.

public visible: boolean

Gets or sets whether a GraphObject is visible.

public width: number

Gets or sets the desired width of this GraphObject in local coordinates.

Methods

public add(element: GraphObject): any

Adds a GraphObject to the end of this Panel's list of elements, visually in front of all of the other elements.

Parameters

Returns

any

public addAdornment(category: string, ad: Adornment): any

Associate an Adornment with this Part, perhaps replacing any existing adornment.

Parameters

  • category: string

    a string identifying the kind or role of the given adornment for this Part.

  • ad: Adornment

Returns

any

public bind(binding: Binding): any

Add a data-binding of a property on this GraphObject to a property on a data object.

Parameters

Returns

any

public canCopy(): boolean

This predicate returns true if #copyable is true, if the layer's Layer#allowCopy is true, and if the diagram's Diagram#allowCopy is true.

Returns

boolean

public canDelete(): boolean

This predicate returns true if #deletable is true, if the layer's Layer#allowDelete is true, and if the diagram's Diagram#allowDelete is true.

Returns

boolean

public canEdit(): boolean

This predicate returns true if #textEditable is true, if the layer's Layer#allowTextEdit is true, and if the diagram's Diagram#allowTextEdit is true.

Returns

boolean

public canGroup(): boolean

This predicate returns true if #groupable is true, if the layer's Layer#allowGroup is true, and if the diagram's Diagram#allowGroup is true.

Returns

boolean

public canLayout(): boolean

This predicate is called by Layout implementations to decide whether this Part should be positioned and might affect the positioning of other Parts.

Returns

boolean

public canMove(): boolean

This predicate returns true if #movable is true, if the layer's Layer#allowMove is true, and if the diagram's Diagram#allowMove is true.

Returns

boolean

public canRelinkFrom(): boolean

This predicate returns true if #relinkableFrom is true, if the layer's Layer#allowRelink is true, and if the diagram's Diagram#allowRelink is true.

Returns

boolean

public canRelinkTo(): boolean

This predicate returns true if #relinkableTo is true, if the layer's Layer#allowRelink is true, and if the diagram's Diagram#allowRelink is true.

Returns

boolean

public canReshape(): boolean

This predicate returns true if #reshapable is true, if the layer's Layer#allowReshape is true, and if the diagram's Diagram#allowReshape is true.

Returns

boolean

public canResize(): boolean

This predicate returns true if #resizable is true, if the layer's Layer#allowResize is true, and if the diagram's Diagram#allowResize is true.

Returns

boolean

public canRotate(): boolean

This predicate returns true if #rotatable is true, if the layer's Layer#allowRotate is true, and if the diagram's Diagram#allowRotate is true.

Returns

boolean

public canSelect(): boolean

This predicate returns true if #selectable is true, if the layer's Layer#allowSelect is true, and if the diagram's Diagram#allowSelect is true.

Returns

boolean

public clearAdornments(): any

Remove all adornments associated with this part.

Returns

any

public copy(): Panel

Creates a deep copy of this Panel and returns it.

Returns

Panel

public elt(idx: number): GraphObject

Returns the GraphObject in this Panel's list of elements at the specified index.

Parameters

  • idx: number

    a zero-based index

Returns

GraphObject

public ensureBounds(): any

Returns

any

public findAdornment(category: string): Adornment

Find an Adornment of a given category associated with this Part.

Parameters

  • category: string

Returns

Adornment

public findClosestSegment(p: Point): number

Find the index of the segment that is closest to a given point.

Parameters

  • p: Point

    the Point, in document coordinates.

Returns

number

public findColumnForLocalX(x: number): number

Returns the cell at a given x-coordinate in local coordinates.

Parameters

  • x: number

Returns

number

public findCommonContainingGroup(other: Part): Group

Find the Group that contains both this part and another one.

Parameters

Returns

Group

public findObject(name: string): GraphObject

Search the visual tree starting at this Panel for a GraphObject whose GraphObject#name is the given name.

Parameters

  • name: string

    The name to search for, using a case-sensitive string comparison.

Returns

GraphObject

public findRowForLocalY(y: number): number

Returns the row at a given y-coordinate in local coordinates.

Parameters

  • y: number

Returns

number

public findTopLevelPart(): Part

Gets the top-level Part for this part, which is itself when #isTopLevel is true.

Returns

Part

public getColumnDefinition(idx: number): RowColumnDefinition

Gets the RowColumnDefinition for a particular column in this Table Panel.

Parameters

  • idx: number

    the non-negative zero-based integer column index.

Returns

RowColumnDefinition

public getDocumentAngle(): number

Returns the effective angle that the object is drawn at, in document coordinates.

Returns

number

public getDocumentPoint(s: Spot, result?: Point): Point

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

Parameters

  • s: Spot

    a real Spot describing a location relative to the GraphObject.

  • result?: Point optional

    an optional Point that is modified and returned.

Returns

Point

public getDocumentScale(): number

Returns the total scale that the object is drawn at, in document coordinates.

Returns

number

public getLinkDirection(node: Node, port: GraphObject, linkpoint: Point, spot: Spot, from: boolean, ortho: boolean, othernode: Node, otherport: GraphObject): number

Compute the direction in which a link should go from a given connection point.

Parameters

  • node: Node
  • port: GraphObject

    the GraphObject representing a port on the node.

  • linkpoint: Point

    the connection point, in document coordinates.

  • spot: Spot

    a Spot value describing where the link should connect.

  • from: boolean

    true if the link is coming out of the port; false if going to the port.

  • ortho: boolean

    whether the link should have orthogonal segments.

  • othernode: Node

    the node at the other end of the link.

  • otherport: GraphObject

    the GraphObject port at the other end of the link.

Returns

number

public getLinkPoint(node: Node, port: GraphObject, spot: Spot, from: boolean, ortho: boolean, othernode: Node, otherport: GraphObject, result?: Point): any

Compute the point on a node/port at which the route of a link should end.

Parameters

  • node: Node
  • port: GraphObject

    the GraphObject representing a port on the node.

  • spot: Spot

    a Spot value describing where the link should connect.

  • from: boolean

    true if the link is coming out of the port; false if going to the port.

  • ortho: boolean

    whether the link should have orthogonal segments.

  • othernode: Node

    the node at the other end of the link.

  • otherport: GraphObject

    the GraphObject port at the other end of the link.

  • result?: Point optional

    an optional Point that is modified and returned; otherwise it allocates and returns a new Point

Returns

any

public getLinkPointFromPoint(node: Node, port: GraphObject, focus: Point, p: Point, from: boolean, result?: Point): Point

Compute the intersection point for the edge of a particular port GraphObject, given a point, when no particular spot or side has been specified.

Parameters

  • node: Node
  • port: GraphObject

    the GraphObject representing a port on the node.

  • focus: Point

    the point in document coordinates to/from which the link should point, normally the center of the port.

  • p: Point

    often this point is far away from the node, to give a general direction, particularly an orthogonal one.

  • from: boolean

    true if the link is coming out of the port; false if going to the port.

  • result?: Point optional

    an optional Point that is modified and returned; otherwise it allocates and returns a new Point

Returns

Point

public getLocalPoint(p: Point, result?: Point): Point

Given a Point in document coordinates, returns a new Point in local coordinates.

Parameters

  • p: Point

    a Point in document coordinates.

  • result?: Point optional

    an optional Point that is modified and returned.

Returns

Point

public getOtherNode(node: Node): Node

Given a Node, return the node at the other end of this link.

Parameters

Returns

Node

public getOtherPort(port: GraphObject): GraphObject

Given a GraphObject that is a "port", return the port at the other end of this link.

Parameters

Returns

GraphObject

public getPoint(i: number): Point

Gets a particular point of the route.

Parameters

  • i: number

    The zero-based index of the desired point.

Returns

Point

public getRowDefinition(idx: number): RowColumnDefinition

Gets the RowColumnDefinition for a particular row in this Table Panel.

Parameters

  • idx: number

    the non-negative zero-based integer row index.

Returns

RowColumnDefinition

public insertAt(index: number, element: GraphObject): any

Adds a GraphObject to the Panel's list of elements at the specified index.

Parameters

Returns

any

public invalidateLayout(condition?: number): any

Invalidate the Layout that is responsible for positioning this Part.

Parameters

  • condition?: number optional

    the reason that the layout should be invalidated -- some combination of "Layout..." flag values; if this argument is not supplied, any value of #layoutConditions other than Part#LayoutNone will allow the layout to be invalidated.

Returns

any

public isContainedBy(panel: GraphObject): boolean

This predicate is true if this object is an element, perhaps indirectly, of the given panel.

Parameters

  • panel: GraphObject

    or if it is contained by another panel that is contained by the given panel, to any depth; false if the argument is null or is not a Panel.

Returns

boolean

public isMemberOf(part: Part): boolean

This predicate is true if this part is a member of the given Part, perhaps indirectly.

Parameters

Returns

boolean

public isVisible(): boolean

This predicate is true if this Part can be seen.

Returns

boolean

public isVisibleObject(): boolean

This predicate is true if this object is #visible and each of its visual containing panels are also visible.

Returns

boolean

public move(newpos: Point): any

Move this link to a new position.

Parameters

Returns

any

public rebuildItemElements(): any

Create and add new GraphObjects corresponding to and bound to the data in the #itemArray, after removing all existing elements from this Panel.

Returns

any

public remove(element: GraphObject): any

Removes a GraphObject from this Panel's list of elements.

Parameters

Returns

any

public removeAdornment(category: string): any

Remove any Adornment of the given category that may be associated with this Part.

Parameters

  • category: string

    a string identifying the kind or role of the given adornment for this Part.

Returns

any

public removeAt(idx: number): any

Removes an GraphObject from this Panel's list of elements at the specified index.

Parameters

  • idx: number

Returns

any

public removeColumnDefinition(idx: number): any

Removes the RowColumnDefinition for a particular row in this Table Panel.

Parameters

  • idx: number

    the non-negative zero-based integer row index.

Returns

any

public removeRowDefinition(idx: number): any

Removes the RowColumnDefinition for a particular row in this Table Panel.

Parameters

  • idx: number

    the non-negative zero-based integer row index.

Returns

any

public updateAdornments(): any

This is responsible for creating any selection Adornment (if this Part #isSelected) and any tool adornments for this part.

Returns

any

public updateTargetBindings(srcprop?: string): any

Re-evaluate all data bindings on this Part, in order to assign new property values to the GraphObjects in this visual tree based on this this object's #data property values.

Parameters

  • srcprop?: string optional

    An optional source data property name: when provided, only evaluates those Bindings that use that particular property; when not provided or when it is the empty string, all bindings are evaluated.

Returns

any