Ir al contenido

Node

Defined in: parts/Node.ts:16

A visual node in a diagram.

new Node(key?, bounds?): Node

Defined in: parts/Part.ts:67

NodeKey

Rect

Node

Part.constructor

get actualBounds(): Rect

Defined in: parts/Part.ts:230

GoJS-compatible: The actual bounds of this part in document coordinates.

Rect

set actualBounds(value): void

Defined in: parts/Part.ts:234

Rect

void

Part.actualBounds


get adornments(): ReadonlyMap<string, Adornment>

Defined in: parts/Part.ts:572

Get all adornments on this part.

ReadonlyMap<string, Adornment>

Part.adornments


get angle(): number

Defined in: parts/Part.ts:313

The rotation angle in degrees.

number

set angle(value): void

Defined in: parts/Part.ts:317

number

void

Part.angle


get background(): string | null

Defined in: parts/Part.ts:185

GoJS-compatible: The background color of this part.

string | null

set background(value): void

Defined in: parts/Part.ts:189

string | null

void

Part.background


get bindings(): readonly Binding[]

Defined in: parts/Part.ts:603

Get all bindings on this part.

readonly Binding[]

Part.bindings


get bounds(): Rect

Defined in: parts/Part.ts:135

Rect

set bounds(value): void

Defined in: parts/Part.ts:139

Rect

void

Part.bounds


get category(): string

Defined in: parts/Part.ts:368

GoJS-compatible: The category of this part (used to select a template).

string

set category(value): void

Defined in: parts/Part.ts:372

string

void

Part.category


get center(): object

Defined in: parts/Part.ts:663

Get the center point.

object

x: number

y: number

Part.center


get containingGroup(): Part | null

Defined in: parts/Part.ts:405

Get the containing group, or null if top-level.

Part | null

set containingGroup(value): void

Defined in: parts/Part.ts:410

Set the containing group.

Group | null

void

Part.containingGroup


get contextMenu(): Panel | HTMLInfo | null

Defined in: parts/Part.ts:488

GoJS-compatible: a context menu shown on right-click — a Panel template drawn to canvas, or an HTMLInfo for full control over an HTML element.

Panel | HTMLInfo | null

set contextMenu(value): void

Defined in: parts/Part.ts:492

Panel | HTMLInfo | null

void

Part.contextMenu


get copyable(): boolean

Defined in: parts/Part.ts:118

GoJS-compatible: Whether this part can be copied.

boolean

set copyable(value): void

Defined in: parts/Part.ts:122

boolean

void

Part.copyable


get cornerRadius(): number

Defined in: parts/Node.ts:61

number

set cornerRadius(value): void

Defined in: parts/Node.ts:65

number

void


get cursor(): string

Defined in: parts/Part.ts:203

GoJS-compatible: The cursor shown when hovering this part.

string

set cursor(value): void

Defined in: parts/Part.ts:207

string

void

Part.cursor


get data(): NodeData | null

Defined in: parts/Part.ts:359

GoJS-compatible: Reference to the model data object for this part.

NodeData | null

set data(value): void

Defined in: parts/Part.ts:363

NodeData | null

void

Part.data


get deletable(): boolean

Defined in: parts/Part.ts:96

GoJS-compatible: Whether this part can be deleted.

boolean

set deletable(value): void

Defined in: parts/Part.ts:100

boolean

void

Part.deletable


get desiredSize(): Size | null

Defined in: parts/Part.ts:162

GoJS-compatible: The desired size of this part.

Size | null

set desiredSize(value): void

Defined in: parts/Part.ts:167

Size | { height: number; width: number; } | null

void

Part.desiredSize


get diagram(): Diagram | null

Defined in: parts/Part.ts:443

GoJS-compatible: The diagram that this part is in (or null).

Diagram | null

set diagram(value): void

Defined in: parts/Part.ts:448

Set the diagram this part belongs to.

Diagram | null

void

Part.diagram


get dragAlpha(): number

Defined in: parts/Part.ts:377

GoJS-compatible: The opacity used when this part is being dragged.

number

set dragAlpha(value): void

Defined in: parts/Part.ts:381

number

void

Part.dragAlpha


get draggable(): boolean

Defined in: parts/Part.ts:506

Whether this part can be dragged.

boolean

set draggable(value): void

Defined in: parts/Part.ts:510

boolean

void

Part.draggable


get elements(): readonly GraphObject[]

Defined in: parts/Node.ts:84

GoJS-compatible: Get the elements in this node’s visual tree.

readonly GraphObject[]

Part.elements


get fill(): string

Defined in: parts/Part.ts:280

string

set fill(value): void

Defined in: parts/Part.ts:284

string

void

Part.fill


get hasPanel(): boolean

Defined in: parts/Node.ts:70

Check whether this node uses a panel for rendering.

boolean


get height(): number

Defined in: parts/Part.ts:153

GoJS-compatible: The height of this part (delegates to its bounds).

number

set height(value): void

Defined in: parts/Part.ts:157

number

void

Part.height


get isHighlighted(): boolean

Defined in: parts/Part.ts:127

GoJS-compatible: Whether this part is currently highlighted.

boolean

set isHighlighted(value): void

Defined in: parts/Part.ts:131

boolean

void

Part.isHighlighted


get isInDocumentBounds(): boolean

Defined in: parts/Part.ts:386

GoJS-compatible: Whether this part is within the document bounds.

boolean

set isInDocumentBounds(value): void

Defined in: parts/Part.ts:390

boolean

void

Part.isInDocumentBounds


get isMemberOfGroup(): boolean

Defined in: parts/Part.ts:415

GoJS-compatible: Whether this part is a member of a group.

boolean

Part.isMemberOfGroup


get isPositioned(): boolean

Defined in: parts/Part.ts:420

GoJS-compatible: Whether this part has been given a position/bounds.

boolean

Part.isPositioned


get isSelected(): boolean

Defined in: parts/Part.ts:264

boolean

set isSelected(value): void

Defined in: parts/Part.ts:268

boolean

void

Part.isSelected


get isTreeExpanded(): boolean

Defined in: parts/Part.ts:109

GoJS-compatible: Whether this part’s tree-children (per findTreeChildrenNodes) are shown. Distinct from Group.isSubGraphExpanded — this applies to any Part and is what TreeExpanderButton toggles via Diagram.collapseTree/expandTree.

boolean

set isTreeExpanded(value): void

Defined in: parts/Part.ts:113

boolean

void

Part.isTreeExpanded


get isVisibleObject(): boolean

Defined in: parts/Part.ts:239

GoJS-compatible: Whether this part and its ancestors are visible.

boolean

Part.isVisibleObject


get key(): NodeKey

Defined in: parts/Part.ts:72

NodeKey

Part.key


get label(): string

Defined in: parts/Node.ts:37

string

set label(value): void

Defined in: parts/Node.ts:41

string

void


get labelColor(): string

Defined in: parts/Node.ts:45

string

set labelColor(value): void

Defined in: parts/Node.ts:49

string

void


get labelFont(): string

Defined in: parts/Node.ts:53

string

set labelFont(value): void

Defined in: parts/Node.ts:57

string

void


get layer(): Layer | null

Defined in: parts/Part.ts:425

Get the layer this part belongs to.

Layer | null

set layer(value): void

Defined in: parts/Part.ts:430

Set the layer this part belongs to.

Layer | null

void

Part.layer


get layerName(): string

Defined in: parts/Part.ts:395

GoJS-compatible: The name of the layer this part belongs to.

string

set layerName(_value): void

Defined in: parts/Part.ts:399

string

void

Part.layerName


get location(): Point

Defined in: parts/Part.ts:326

GoJS-compatible: The location point of this part — the point within the bounds at locationSpot. With the default locationSpot (0.5, 0.5) this is the center; changing locationSpot moves the part so the spot stays put.

Point

set location(value): void

Defined in: parts/Part.ts:334

Point

void

Part.location


get locationSpot(): object

Defined in: parts/Part.ts:341

GoJS-compatible: The spot in the part that corresponds to the location point.

object

x: number

y: number

set locationSpot(value): void

Defined in: parts/Part.ts:345

number

number

void

Part.locationSpot


get maxSize(): object

Defined in: parts/Part.ts:221

GoJS-compatible: The maximum size of this part.

object

height: number

width: number

set maxSize(value): void

Defined in: parts/Part.ts:225

number

number

void

Part.maxSize


get minSize(): object

Defined in: parts/Part.ts:212

GoJS-compatible: The minimum size of this part.

object

height: number

width: number

set minSize(value): void

Defined in: parts/Part.ts:216

number

number

void

Part.minSize


get name(): string

Defined in: parts/Part.ts:87

GoJS-compatible: an arbitrary name for this part. Real GoJS has this because Part extends GraphObject, which has its own .name (used for findObject-style lookups); graphojs’s Part is a separate class, so it needs its own copy of the same property rather than inheriting it — most relevant for a bare decorative Part (see Diagram.add), which ported GoJS code may still identify by .name the way it would identify any other GraphObject.

string

set name(value): void

Defined in: parts/Part.ts:91

string

void

Part.name


get opacity(): number

Defined in: parts/Part.ts:272

number

set opacity(value): void

Defined in: parts/Part.ts:276

number

void

Part.opacity


get panel(): Panel | null

Defined in: parts/Part.ts:533

GoJS-compatible: Get the panel used to render this part’s visual tree.

Panel | null

set panel(value): void

Defined in: parts/Part.ts:538

GoJS-compatible: Set the panel used to render this part’s visual tree.

Panel | null

void

Part.panel


get pickable(): boolean

Defined in: parts/Part.ts:194

GoJS-compatible: Whether this part is pickable (hit-testable).

boolean

set pickable(value): void

Defined in: parts/Part.ts:198

boolean

void

Part.pickable


get portCount(): number

Defined in: parts/Node.ts:110

Get the number of ports.

number


get ports(): readonly Port[]

Defined in: parts/Node.ts:105

Get all ports on this node.

readonly Port[]


get position(): object

Defined in: parts/Part.ts:668

Get the position (top-left).

object

x: number

y: number

set position(value): void

Defined in: parts/Part.ts:673

Set the position (top-left), preserving size.

number

number

void

Part.position


get resizable(): boolean

Defined in: parts/Part.ts:515

Whether this part can be resized.

boolean

set resizable(value): void

Defined in: parts/Part.ts:519

boolean

void

Part.resizable


get rotatable(): boolean

Defined in: parts/Part.ts:524

Whether this part can be rotated.

boolean

set rotatable(value): void

Defined in: parts/Part.ts:528

boolean

void

Part.rotatable


get scale(): number

Defined in: parts/Part.ts:176

GoJS-compatible: The scale of this part.

number

set scale(value): void

Defined in: parts/Part.ts:180

number

void

Part.scale


get selectable(): boolean

Defined in: parts/Part.ts:256

boolean

set selectable(value): void

Defined in: parts/Part.ts:260

boolean

void

Part.selectable


get selectionObject(): GraphObject | null

Defined in: parts/Part.ts:350

GoJS-compatible: The GraphObject that is used as the selection object (for adornment placement).

GraphObject | null

set selectionObject(_value): void

Defined in: parts/Part.ts:354

GraphObject | null

void

Part.selectionObject


get shape(): NodeShape

Defined in: parts/Node.ts:29

NodeShape

set shape(value): void

Defined in: parts/Node.ts:33

NodeShape

void


get size(): object

Defined in: parts/Part.ts:679

Get the size.

object

height: number

width: number

Part.size


get stroke(): string

Defined in: parts/Part.ts:288

string

set stroke(value): void

Defined in: parts/Part.ts:292

string

void

Part.stroke


get strokeWidth(): number

Defined in: parts/Part.ts:296

number

set strokeWidth(value): void

Defined in: parts/Part.ts:300

number

void

Part.strokeWidth


get tooltip(): string

Defined in: parts/Part.ts:463

The tooltip text shown when hovering over this part.

string

set tooltip(value): void

Defined in: parts/Part.ts:467

string

void

Part.tooltip


get toolTip(): Panel | HTMLInfo | null

Defined in: parts/Part.ts:475

GoJS-compatible: a tooltip shown on hover — a Panel template drawn to canvas, or an HTMLInfo for full control over an HTML element.

Panel | HTMLInfo | null

set toolTip(value): void

Defined in: parts/Part.ts:479

Panel | HTMLInfo | null

void

Part.toolTip


get tooltipVisible(): boolean

Defined in: parts/Part.ts:497

Whether the tooltip is currently visible.

boolean

set tooltipVisible(value): void

Defined in: parts/Part.ts:501

boolean

void

Part.tooltipVisible


get visible(): boolean

Defined in: parts/Part.ts:248

boolean

set visible(value): void

Defined in: parts/Part.ts:252

boolean

void

Part.visible


get width(): number

Defined in: parts/Part.ts:144

GoJS-compatible: The width of this part (delegates to its bounds).

number

set width(value): void

Defined in: parts/Part.ts:148

number

void

Part.width


get zOrder(): number

Defined in: parts/Part.ts:304

number

set zOrder(value): void

Defined in: parts/Part.ts:308

number

void

Part.zOrder

add(element): this

Defined in: parts/Node.ts:89

GoJS-compatible: Add a child element to this node’s visual tree.

GraphObject

this


addAdornment(name, adornment): void

Defined in: parts/Part.ts:582

Add an adornment to this part.

string

Adornment

void

Part.addAdornment


addBinding(binding): this

Defined in: parts/Part.ts:608

Add a binding to this part.

Binding

this

Part.addBinding


addPort(port): this

Defined in: parts/Node.ts:131

Add a port to this node.

Port

this


addVisual(element): this

Defined in: parts/Part.ts:551

GoJS-compatible: Add a child element to this part’s visual tree.

GraphObject

this

Part.addVisual


applyBindings(nodeData): number

Defined in: parts/Part.ts:632

Apply all bindings from model data to this part. Returns the number of properties set.

NodeData

number

Part.applyBindings


applyTwoWayBindings(nodeData): number

Defined in: parts/Part.ts:647

Apply TwoWay bindings: write Part properties back to model data.

NodeData

number

Part.applyTwoWayBindings


clearAdornments(): void

Defined in: parts/Part.ts:598

Remove all adornments from this part.

void

Part.clearAdornments


clearBindings(): void

Defined in: parts/Part.ts:622

Remove all bindings from this part.

void

Part.clearBindings


clearPorts(): void

Defined in: parts/Node.ts:145

Remove all ports.

void


collectPortsFromPanel(): void

Defined in: parts/Node.ts:159

GoJS-compatible: Collect ports declared declaratively in the visual tree (GraphObjects with a non-empty portId), creating Port entries. Uses the object’s relative position within the node bounds as the port spot.

void


containsPoint(point): boolean

Defined in: parts/Part.ts:658

Check if a point is inside this part.

number

number

boolean

Part.containsPoint


copy(): this

Defined in: parts/Part.ts:684

Create a deep copy of this part.

this

Part.copy


findAdornment(name): Adornment | undefined

Defined in: parts/Part.ts:577

Get a specific adornment by name.

string

Adornment | undefined

Part.findAdornment


findAdornmentNamed(name): Adornment | null

Defined in: parts/Part.ts:588

GoJS-compatible: Find an adornment by name, or null if not present.

string

Adornment | null

Part.findAdornmentNamed


findBinding(targetProperty): Binding | undefined

Defined in: parts/Part.ts:627

Find a binding targeting a specific property.

string

Binding | undefined

Part.findBinding


findDiagram(): Diagram | null

Defined in: parts/Part.ts:453

GoJS-compatible: Find the diagram that contains this part.

Diagram | null

Part.findDiagram


findLayer(): Layer | null

Defined in: parts/Part.ts:458

GoJS-compatible: Find the layer that contains this part.

Layer | null

Part.findLayer


findLinksConnected(): Link[]

Defined in: parts/Node.ts:323

GoJS-compatible: All links connected to this node (in or out).

Link[]


findLinksInto(): Link[]

Defined in: parts/Node.ts:309

GoJS-compatible: All links that point into this node.

Link[]


findLinksOutOf(): Link[]

Defined in: parts/Node.ts:316

GoJS-compatible: All links that point out of this node.

Link[]


findNodesConnected(): Node[]

Defined in: parts/Node.ts:354

GoJS-compatible: All nodes connected to this node by a link.

Node[]


findNodesInto(): Node[]

Defined in: parts/Node.ts:330

GoJS-compatible: The source nodes of the links pointing into this node.

Node[]


findNodesOutOf(): Node[]

Defined in: parts/Node.ts:342

GoJS-compatible: The destination nodes of the links pointing out of this node.

Node[]


findObject(name): GraphObject | null

Defined in: parts/Node.ts:78

GoJS-compatible: Find a GraphObject by name in this node’s visual tree. Searches the panel’s elements recursively.

string

GraphObject | null

Part.findObject


findPort(name): Port | undefined

Defined in: parts/Node.ts:150

Find a port by name.

string

Port | undefined


findTreeChildrenNodes(): Node[]

Defined in: parts/Node.ts:381

GoJS-compatible: The child nodes in the tree structure.

Node[]


findTreeParentNode(): Node | null

Defined in: parts/Node.ts:374

GoJS-compatible: The parent node in the tree structure (or null).

Node | null


getConnectionPoint(target, portName?): object

Defined in: parts/Node.ts:238

Get the point where a link from this node should connect, given a target direction. Uses the port if specified, otherwise computes the edge point toward the target.

number

number

string

object

x: number

y: number


getPortPoint(name?): object

Defined in: parts/Node.ts:218

Compute the point of a port in diagram coordinates. If no port name is given, returns the node center.

string

object

x: number

y: number


isPointOnPort(point, threshold?): boolean

Defined in: parts/Node.ts:115

Whether a diagram point is near any of this node’s ports (within a threshold).

number

number

number = 10

boolean


isTreeLeaf(): boolean

Defined in: parts/Node.ts:369

GoJS-compatible: Whether this node is a tree leaf (no tree children).

boolean


remove(element): boolean

Defined in: parts/Node.ts:99

GoJS-compatible: Remove a child element from this node’s visual tree.

GraphObject

boolean


removeAdornment(name): boolean

Defined in: parts/Part.ts:593

Remove an adornment from this part.

string

boolean

Part.removeAdornment


removeBinding(binding): boolean

Defined in: parts/Part.ts:614

Remove a binding from this part.

Binding

boolean

Part.removeBinding


removePort(port): boolean

Defined in: parts/Node.ts:137

Remove a port by reference.

Port

boolean


removeVisual(element): boolean

Defined in: parts/Part.ts:560

GoJS-compatible: Remove a child element from this part’s visual tree.

GraphObject

boolean

Part.removeVisual


shapeContainsPoint(point): boolean

Defined in: parts/Node.ts:280

Shape-aware hit testing: check whether a point is inside the node’s actual shape geometry, not just its bounding box. Falls back to the bounding box for rect/roundedRect and when the point is clearly outside.

number

number

boolean


updatePortSpots(): void

Defined in: parts/Node.ts:191

Recompute the fractional spot for each existing port from the current element positions (layout happens during draw). Called after rendering so declarative ports resolve to their real edge positions.

void


static fromPosAndSize(key, x, y, width, height): Node

Defined in: parts/Node.ts:25

Create a Node from position and size.

NodeKey

number

number

number

number

Node