Interface ReactViewNodeOptions

Extension of node definition in a view that adds jsx/component.

interface ReactViewNodeOptions {
    allowLoopback?: boolean;
    allowVertexLoopback?: boolean;
    anchorPositionFinder?: ((el: Element, pos: PointXY, vertex: Node | Group, def: ViewNodeOptions, evt: Event) => ArrayAnchorSpec);
    anchorPositions?: ObjectAnchorSpec[];
    component?: Component<{}, {}, any>;
    defaultSize?: Size;
    events?: ViewEventOptions;
    jsx?: ((ctx: JsxWrapperProps<Node>) => any);
    maxConnections?: number;
    mergeStrategy?: string;
    parameters?: Record<string, any>;
    parent?: string | string[];
}

Hierarchy

  • Omit<ViewNodeOptions, "template" | "templateId">
    • ReactViewNodeOptions

Properties

allowLoopback?: boolean

Whether or not to allow edges from this vertex back to itself. Defaults to true. This flag will not prevent an edge from a port back to the node/group to which it belongs - for that, see allowVertexLoopback.

allowVertexLoopback?: boolean

Whether or not to allow edges from a port back to the vertex it belongs to. Defaults to true.

anchorPositionFinder?: ((el: Element, pos: PointXY, vertex: Node | Group, def: ViewNodeOptions, evt: Event) => ArrayAnchorSpec)

Optional function to call on connection drop, to determine the location for the target anchor for the new connection. Returning null from this indicates no preference, and the Toolkit will use its own computed value. Note that the return value from this method is ArrayAnchorSpec, meaning an array in the format [ x, y, orientationX, orientationY, offsetX, offsetY ]. Note also that offsetX and offsetY are optional, and will be defaulted to 0.

anchorPositions?: ObjectAnchorSpec[]

Optional array of anchor positions to use.

component?: Component<{}, {}, any>

Component used to render this node type. Supply this or JSX.

This is likely to be removed in an upcoming version.

defaultSize?: Size

Optional default size to use for the vertex. This is not used to set the size in the DOM for a vertex - it is used to insert width and height values into the backing data for any vertex of this type that does not have them set.

events?: ViewEventOptions

Optional map of event bindings.

jsx?: ((ctx: JsxWrapperProps<Node>) => any)

JSX used to render this node type. Supply this or a Component.

maxConnections?: number

Maximum number of connections this vertex supports. Default is 1. A value of -1 means no limit.

mergeStrategy?: string

When merging a type description into its parent(s), values in the child for connector, anchor and anchors will always overwrite any such values in the parent. But other values, such as overlays, will be merged with their parent's entry for that key. You can force a child's type to override every corresponding value in its parent by setting mergeStrategy:'override'.

parameters?: Record<string, any>

A map of parameters that the template engine will merge with the backing data when rendering the vertex.

parent?: string | string[]

Optional ID of one or more edge definitions to include in this definition. The child definition is merged on top of the parent definition(s). Circular references are not allowed and will throw an error.

Version :