@joint/react
    Preparing search index...

    Interface MarkupApi

    Markup utilities returned by useMarkup.

    interface MarkupApi {
        magnetRef: (
            selector: string,
            options?: MagnetRefOptions,
        ) => (node: Element | null) => void;
        selectorRef: (selector: string) => (node: Element | null) => void;
    }
    Index

    Properties

    magnetRef: (
        selector: string,
        options?: MagnetRefOptions,
    ) => (node: Element | null) => void

    Returns a React ref callback that registers the node under the given selector name AND marks it as a JointJS magnet, a valid endpoint for link connections.

    Type Declaration

      • (selector: string, options?: MagnetRefOptions): (node: Element | null) => void
      • Parameters

        • selector: string

          Unique selector name within the element (e.g. 'port-in', 'row-0').

        • Optionaloptions: MagnetRefOptions

          Magnet behavior options.

          Options for MarkupApi's magnetRef.

          • Optional Readonlypassive?: boolean

            When true, the magnet is passive: a valid connection target but not a source. When false, it is active and links can also start from it.

            false
            

        Returns (node: Element | null) => void

    If selector is one of the reserved names (__portal__, root, portRoot).

    selectorRef: (selector: string) => (node: Element | null) => void

    Returns a React ref callback that registers the node under the given selector name so links and tools can target it by name.

    Type Declaration

      • (selector: string): (node: Element | null) => void
      • Parameters

        • selector: string

          Unique selector name within the element (e.g. 'body', 'item-0').

        Returns (node: Element | null) => void

    If selector is one of the reserved names (__portal__, root, portRoot).