Edit in GitHubLog an issue

@express-document-sdk / ArtboardNode

Class: ArtboardNode

An ArtboardNode represents an artboard object in the scenegraph. All user visual content must be contained on an artboard.

When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.

Hierarchy

Implements

Accessors

allChildren

get allChildren(): Readonly<Iterable<Node>>

Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or GroupNode also provide a mutable children list. Other nodes with a more specific structure can hold children in various discrete "slots"; this allChildren list includes all such children and reflects their overall display z-order.

The children of an Artboard are always other Node classes (never the more minimal BaseNode).

Returns

Readonly<Iterable<Node>>

Implementation of

ContainerNode.allChildren

Overrides

VisualNode.allChildren


boundsLocal

get boundsLocal(): Readonly<Rect>

The bounding box of the node, expressed in the node's local coordinate space (which may be shifted or rotated relative to its parent). Generally matches the selection outline seen in the UI, encompassing the vector path "spine" of the shape as well as its stroke, but excluding effects such as shadows.

The top-left corner of the bounding box corresponds to the visual top-left corner of the node, but this value is not necessarily (0,0) – this is especially true for Text and Path nodes.

Returns

Readonly<Rect>

Implementation of

ContainerNode.boundsLocal

Inherited from

VisualNode.boundsLocal


centerPointLocal

get centerPointLocal(): Readonly<Point>

Position of the node's centerpoint in its own local coordinate space, i.e. the center of the boundsLocal box.

Returns

Readonly<Point>

Implementation of

ContainerNode.centerPointLocal

Inherited from

VisualNode.centerPointLocal


children

get children(): ItemList<Node>

The node's children. Use the methods on this ItemList object to get, add, and remove children.

Returns

ItemList<Node>

Implementation of

ContainerNode.children


fill

get fill(): Readonly<Fill>

Returns

Readonly<Fill>

set fill(fill): void

The background fill of the artboard. Artboards must always have a fill.

Parameters

NameType
fill

Returns

void


height

get height(): number

The height of the artboard.

Returns

number

Implementation of

IRectangularNode.height


id

get id(): string

A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is moved to a different part of the document.

Returns

string

Implementation of

ContainerNode.id

Inherited from

VisualNode.id


parent

get parent(): undefined | PageNode

The node's parent. Undefined if the node is an orphan.

Returns

undefined | PageNode

Implementation of

ContainerNode.parent

Overrides

VisualNode.parent


topLeftLocal

get topLeftLocal(): Readonly<Point>

Position of the node's top-left corner in its own local coordinate space, equal to (boundsLocal.x, boundsLocal.y). If the node is rotated, this is not the same as the top-left corner of boundsInParent.

Returns

Readonly<Point>

Implementation of

ContainerNode.topLeftLocal

Inherited from

VisualNode.topLeftLocal


type

get type(): SceneNodeType

The node's type.

Returns

SceneNodeType

Implementation of

ContainerNode.type

Inherited from

VisualNode.type


visualRoot

get visualRoot(): VisualNode

The highest ancestor that still has visual presence in the document. Typically an Artboard, but for orphaned content, it will be the root of the deleted content (which might be this node itself).

Nodes that are both in the same visualRoot subtree lie within the same "visual space" of the document's structure. Nodes that are in different visual roots have no spatial relation to one another; there is no meaningful comparison or conversion between the bounds or coordinate spaces of such nodes.

Returns

VisualNode

Implementation of

ContainerNode.visualRoot

Inherited from

VisualNode.visualRoot


width

get width(): number

The width of the artboard.

Returns

number

Implementation of

IRectangularNode.width

Methods

localPointInNode

localPointInNode(localPoint, targetNode): Readonly<Point>

Convert a point given in the node’s local coordinate space to a point in the coordinate space of the target node. Both nodes must share the same visualRoot, but can lie anywhere within that subtree relative to one another (the target node need not be an ancestor of this node, nor vice versa).

Parameters

NameType
localPoint
targetNode

Returns

Readonly<Point>

Implementation of

ContainerNode.localPointInNode

Inherited from

VisualNode.localPointInNode


removeFromParent

removeFromParent(): void

Removes the node from its parent - effectively deleting it, if the node is not re-added to another parent before the document is closed.

If parent is a basic ContainerNode, this is equivalent to node.parent.children.remove(node). For nodes with other child "slots," removes the child from whichever slot it resides in, if possible. Throws if the slot does not permit removal. No-op if node is already an orphan.

Returns

void

Implementation of

ContainerNode.removeFromParent

Inherited from

VisualNode.removeFromParent

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.