Skip to content

CanvasViewCanvasNode

Unofficial

Represents a node on the canvas with position, size, content, and connection capabilities.

Import:

import type { CanvasViewCanvasNode } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface CanvasViewCanvasNode extends CanvasViewCanvasNodeBase

Extends: CanvasViewCanvasNodeBase

Properties

PropertyTypeDescription
alwaysKeepLoadedbooleanWhether this node should always remain loaded even when off-screen.
appAppReference to the Obsidian app instance.
aspectRationumberAspect ratio of the node (width / height).
bboxBBoxBounding box of the node for spatial indexing.
canvasCanvasViewCanvasReference to the parent canvas instance.
childWidgetEditorViewChild editor view for the node's content.
colorstringColor of the node (CSS color string or preset name).
containerElHTMLDivElementOutermost container element of the node.
contentBlockerElHTMLDivElementOverlay element that blocks interaction with content when not editing.
contentElHTMLDivElementElement containing the node's editable content.
destroyedbooleanWhether the node has been destroyed.
fileTFileReference to the associated file, if this is a file node.
filePathstringPath to the associated file, if this is a file node.
heightnumberHeight of the node in canvas units.
idstringUnique identifier for this node.
initializedbooleanWhether the node has been initialized.
isContentMountedbooleanWhether the node's content is currently mounted in the DOM.
isEditingbooleanWhether the node is currently in editing mode.
nodeElHTMLDivElementMain node element for rendering.
placeholderElHTMLDivElementPlaceholder element shown while the node content is loading.
renderedZIndexnumberThe last rendered z-index value.
resizeDirtybooleanWhether the node needs to recalculate its size.
subpathstringSubpath within the linked file (e.g., heading or block reference).
unknownDataCanvasViewCanvasNodeUnknownDataAdditional data properties not covered by known fields.
widthnumberWidth of the node in canvas units.
xnumberX coordinate of the node's top-left corner in canvas space.
ynumberY coordinate of the node's top-left corner in canvas space.
zIndexnumberZ-index stacking order of the node.

Methods

MethodReturnsDescription
blur()unknownRemove focus from the node.
destroy()unknownDestroy the node and release its resources.
(Inherited from CanvasViewCanvasNodeBase)
focus()unknownSet focus on the node.
getData()unknownGet the serialized data for this node.
initFile()unknownInitialize the file association for a file-type node.
initialize()unknownInitialize the node after construction.
isEditable()unknownCheck whether this node supports editing.
(Inherited from CanvasViewCanvasNodeBase)
moveAndResize(arg1)unknownMove and resize the node to the specified bounds.
(Inherited from CanvasViewCanvasNodeBase)
onClick(arg1)unknownHandle click events on the node.
(Inherited from CanvasViewCanvasNodeBase)
onFileFocus()unknownHandle the node's file receiving focus.
onLabelClick(arg1)unknownHandle click events on the node's label.
onLabelDblClick(arg1)unknownHandle double-click events on the node's label.
onPointerdown(arg1)unknownHandle pointer down events on the node.
onResizeDblclick(arg1, arg2)unknownHandle double-click on a resize handle to auto-size the node.
(Inherited from CanvasViewCanvasNodeBase)
render()unknownRender the node to the canvas.
setData(arg1)unknownSet the serialized data for this node.
setFile(arg1, arg2, arg3)unknownSet the file associated with this node.
setFilePath(arg1, arg2)unknownSet the file path for this node.
showMenu(arg1)unknownShow the context menu for this node.
startEditing(arg1?)unknownEnter editing mode for the node's content.
(Inherited from CanvasViewCanvasNodeBase)
unloadChild()unknownUnload the child editor view.
(Inherited from CanvasViewCanvasNodeBase)
updateBreakpoint(arg1)unknownUpdate the rendering breakpoint based on the node's current size.
updateNodeLabel(arg1)unknownUpdate the displayed label text of the node.

Links to this page: