StaticTYPEIndicates whether the adapter supports rendering text within the node, which may affect how the node is rendered and whether text-related interactions are enabled.
Returns the text orientation values this node type supports.
Only relevant for nodes that support text (has_text === true).
When not defined, all orientations are assumed to be supported.
Adapters that render text differently (e.g. curved text) should override this to return a restricted subset.
Specifies the connection handles that this node type supports for connecting to other nodes. Each handle is represented by a NodeHandle value, which indicates the position or type of the handle on the node. This property is used to determine where connections can be made to this node and how the diagram control should render connection points. Adapters that support connections should override this to return the appropriate handles for their node type.
The hollow mode determines how the node's hollow property is calculated based on its fill style.
Indicates whether the adapter supports rotation of the node. If true, the diagram control may provide rotation handles and allow the user to rotate the node.
Indicates whether the adapter is for a connector node, which may require special handling for rendering and hit testing.
Indicates whether the node creation process involves multiple steps, such as defining multiple points for a polyline or curve. If true, the diagram control may need to handle additional user interactions during node creation.
Indicates whether the adapter supports single-line text rendering within the node. If true, the text will be rendered on a single line, and any overflow will be handled according to the text_overflow property. If false or undefined, multi-line text rendering may be supported.
The text overflow mode determines how text that exceeds the node's bounding box is handled.
Returns the text baseline values this node type supports.
Only relevant for nodes that support text (has_text === true).
When not defined, all baselines are assumed to be supported.
Adapters that render text differently (e.g. curved text) should override this to return a restricted subset.
The baseline determines how the text is aligned vertically relative to its bounding box or path.
For example, 'top' aligns the top of the text with the top of the bounding box, 'middle' centers the text vertically, and 'bottom' aligns the bottom of the text with the bottom of the bounding box.
StaticregisterRegisters the PolylineAdapter with the NodeRegistry.
Performs a hit test on the given node with the specified point.
The handle of the node that was hit, or NodeHandle.NONE if no hit occurred.
Renders the given node on the specified canvas context.
The node to render.
Optionalshow: "all" | "quick"Renders the selection state of the given node on the specified canvas context.
The node whose selection state to render.
Specifies whether to show all handles or connection handles.
Snaps the given node to the specified grid by modifying its points.
The node to snap.
The grid to snap the node to.
Optionalhandle: NodeHandleThe handle being used to resize the node.
Additional logic to determine whether a connection can be made to this node from the specified direction and handle. This method is called during connection creation to validate whether a connection is allowed based on the node's state, geometry, or other criteria. The target can also be used to decide whether a connection can be made. The target can be the connection iteself or the node that is being connected to. The point parameter can be used to determine the world-space coordinates of the connection point, if available. Adapters that support connections should override this to implement custom connection rules.
The node to which the connection is being made.
The connection handle on the node.
The direction of the connection, either 'from' (outgoing) or 'to' (incoming).
Optionaltarget: Partial<INode>The target node or connection that is being connected to, if available. This can be used to determine whether the connection is allowed based on the target's type or state.
Optionalpoint: IPointThe world-space coordinates of the connection point, if available.
Registers the PolylineAdapter instance with the NodeRegistry.
Optionaldirection: "from" | "to" | "any"Returns a default connection object for this node type, which can be used to create a new connection when the user initiates a connection to this node.
ProtectedhitProtectedrenderWhere to place the text for this node, if it has any. This is used for rendering and in-place editing.
The node whose text placement to determine.
The text placement information, or undefined if the node has no text.
Returns the visual bounding rect of the node's rendered path in world coordinates.
For most nodes this equals the rect computed from their points.
Adapters whose paths extend beyond that rect (e.g. a document node whose
wavy bottom dips below the bottom edge) should override this to return the
true visual bounds so that cover-mode images fill the entire visible shape.
The default implementation returns rect unchanged.
The visual bounding rect.
Writes the given node to a JSON-serializable format using the provided serializer.
The node to serialize.
The serializer to use for converting the node to JSON.
The JSON-serializable representation of the node.
Reads a node from the given JSON data using the provided serializer.
The JSON data to read the node from.
The serializer to use for converting the JSON data to a node.
A promise that resolves to the deserialized node.
CurveAdapter is a node adapter responsible for rendering curve nodes in the diagram. It extends the PolylineAdapter to leverage basic polyline rendering capabilities while adding specific logic for handling curved shapes and hit testing. Registers with the NodeRegistry under the name 'curve'. The curve is rendered using quadratic Bezier curves between points, providing a smooth appearance. Hit testing is performed by checking proximity to control points and the curve path itself, allowing for intuitive interaction with the curve nodes. The adapter also handles rendering of arrows for connection nodes, ensuring that directional indicators are properly displayed on curves.