CanvasViewCanvasNode
Unofficial
Represents a node on the canvas with position, size, content, and connection capabilities.
Import:
import type { CanvasViewCanvasNode } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface CanvasViewCanvasNode extends CanvasViewCanvasNodeBaseExtends: CanvasViewCanvasNodeBase
Properties
| Property | Type | Description | |
|---|---|---|---|
| alwaysKeepLoaded | boolean | Whether this node should always remain loaded even when off-screen. | |
| app | App | Reference to the Obsidian app instance. | |
| aspectRatio | number | Aspect ratio of the node (width / height). | |
| bbox | BBox | Bounding box of the node for spatial indexing. | |
| canvas | CanvasViewCanvas | Reference to the parent canvas instance. | |
| child | WidgetEditorView | Child editor view for the node's content. | |
| color | string | Color of the node (CSS color string or preset name). | |
| containerEl | HTMLDivElement | Outermost container element of the node. | |
| contentBlockerEl | HTMLDivElement | Overlay element that blocks interaction with content when not editing. | |
| contentEl | HTMLDivElement | Element containing the node's editable content. | |
| destroyed | boolean | Whether the node has been destroyed. | |
| file | TFile | Reference to the associated file, if this is a file node. | |
| filePath | string | Path to the associated file, if this is a file node. | |
| height | number | Height of the node in canvas units. | |
| id | string | Unique identifier for this node. | |
| initialized | boolean | Whether the node has been initialized. | |
| isContentMounted | boolean | Whether the node's content is currently mounted in the DOM. | |
| isEditing | boolean | Whether the node is currently in editing mode. | |
| nodeEl | HTMLDivElement | Main node element for rendering. | |
| placeholderEl | HTMLDivElement | Placeholder element shown while the node content is loading. | |
| renderedZIndex | number | The last rendered z-index value. | |
| resizeDirty | boolean | Whether the node needs to recalculate its size. | |
| subpath | string | Subpath within the linked file (e.g., heading or block reference). | |
| unknownData | CanvasViewCanvasNodeUnknownData | Additional data properties not covered by known fields. | |
| width | number | Width of the node in canvas units. | |
| x | number | X coordinate of the node's top-left corner in canvas space. | |
| y | number | Y coordinate of the node's top-left corner in canvas space. | |
| zIndex | number | Z-index stacking order of the node. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| blur() | unknown | Remove focus from the node. | |
| destroy() | unknown | Destroy the node and release its resources. (Inherited from CanvasViewCanvasNodeBase) | |
| focus() | unknown | Set focus on the node. | |
| getData() | unknown | Get the serialized data for this node. | |
| initFile() | unknown | Initialize the file association for a file-type node. | |
| initialize() | unknown | Initialize the node after construction. | |
| isEditable() | unknown | Check whether this node supports editing. (Inherited from CanvasViewCanvasNodeBase) | |
| moveAndResize(arg1) | unknown | Move and resize the node to the specified bounds. (Inherited from CanvasViewCanvasNodeBase) | |
| onClick(arg1) | unknown | Handle click events on the node. (Inherited from CanvasViewCanvasNodeBase) | |
| onFileFocus() | unknown | Handle the node's file receiving focus. | |
| onLabelClick(arg1) | unknown | Handle click events on the node's label. | |
| onLabelDblClick(arg1) | unknown | Handle double-click events on the node's label. | |
| onPointerdown(arg1) | unknown | Handle pointer down events on the node. | |
| onResizeDblclick(arg1, arg2) | unknown | Handle double-click on a resize handle to auto-size the node. (Inherited from CanvasViewCanvasNodeBase) | |
| render() | unknown | Render the node to the canvas. | |
| setData(arg1) | unknown | Set the serialized data for this node. | |
| setFile(arg1, arg2, arg3) | unknown | Set the file associated with this node. | |
| setFilePath(arg1, arg2) | unknown | Set the file path for this node. | |
| showMenu(arg1) | unknown | Show the context menu for this node. | |
| startEditing(arg1?) | unknown | Enter editing mode for the node's content. (Inherited from CanvasViewCanvasNodeBase) | |
| unloadChild() | unknown | Unload the child editor view. (Inherited from CanvasViewCanvasNodeBase) | |
| updateBreakpoint(arg1) | unknown | Update the rendering breakpoint based on the node's current size. | |
| updateNodeLabel(arg1) | unknown | Update the displayed label text of the node. |
Links to this page: