Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RenderCallbacks<NodeType, EdgeType>

Object containing callbacks for rendering & destroying various entities (like nodes, edges, panels, etc)

Type parameters

  • NodeType

  • EdgeType

Hierarchy

  • RenderCallbacks

Index

Properties

Object containing render callbacks for context menus for various targets. Optional. If provided, diagram maker will use these context menu render callbacks to show a context menu, and suppress the browser rendered context menu.

Callback to cleanup DOM rendered by the consumer properly before diagram maker removes it. In case, consumers are using React or any other rendering framework, the framework attaches event handlers that if not removed correctly, could cause a memory leak.

panels: {}

Object containing render callbacks for several panels keyed on panel name

Type declaration

  • [name: string]: (panel: DiagramMakerPanel, state: DiagramMakerData<NodeType, EdgeType>, diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void) => HTMLElement | undefined | void

    Callback to render a panel.

    param -

    The object representing the current state of the panel being rendered.

    param diagramMakerContainer

    Container managed by diagram maker to render content in Could diff against content already present in the container using React, Preact or any other VDOM.

    param consumerContainer

    Container used by consumer to render. Optional. Useful only when using Preact, since Preact appends by default and needs an Element to diff against in the container.

    returns
    • Element rendered by consumer when using Preact, or undefined or void everywhere else.
      • (panel: DiagramMakerPanel, state: DiagramMakerData<NodeType, EdgeType>, diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void): HTMLElement | undefined | void
      • Callback to render a panel.

        Parameters

        • panel: DiagramMakerPanel
        • state: DiagramMakerData<NodeType, EdgeType>
        • diagramMakerContainer: HTMLElement

          Container managed by diagram maker to render content in Could diff against content already present in the container using React, Preact or any other VDOM.

        • Optional consumerContainer: HTMLElement | void

          Container used by consumer to render. Optional. Useful only when using Preact, since Preact appends by default and needs an Element to diff against in the container.

        Returns HTMLElement | undefined | void

        • Element rendered by consumer when using Preact, or undefined or void everywhere else.

Methods

  • edge(edge: DiagramMakerEdge<EdgeType>, diagramMakerContainer: HTMLElement, consumerContainer?: void | HTMLElement): undefined | void | HTMLElement
  • Callback to render a badge centered within the edge.

    Parameters

    • edge: DiagramMakerEdge<EdgeType>
    • diagramMakerContainer: HTMLElement

      Container managed by diagram maker to render content in Could diff against content already present in the container using React, Preact or any other VDOM.

    • Optional consumerContainer: void | HTMLElement

      Container used by consumer to render. Optional. Useful only when using Preact, since Preact appends by default and needs an Element to diff against in the container.

    Returns undefined | void | HTMLElement

    • Element rendered by consumer when using Preact, or undefined or void everywhere else.
  • node(node: DiagramMakerNode<NodeType>, diagramMakerContainer: HTMLElement, consumerContainer?: void | HTMLElement): undefined | void | HTMLElement
  • Callback to render a node.

    Parameters

    • node: DiagramMakerNode<NodeType>
    • diagramMakerContainer: HTMLElement

      Container managed by diagram maker to render content in Could diff against content already present in the container using React, Preact or any other VDOM.

    • Optional consumerContainer: void | HTMLElement

      Container used by consumer to render. Optional. Useful only when using Preact, since Preact appends by default and needs an Element to diff against in the container.

    Returns undefined | void | HTMLElement

    • Element rendered by consumer when using Preact, or undefined or void everywhere else.
  • potentialNode(node: DiagramMakerPotentialNode, diagramMakerContainer: HTMLElement, consumerContainer?: void | HTMLElement): undefined | void | HTMLElement
  • Callback to render a potential node. Optional. Only useful when user might be dragging new nodes out of a panel.

    Parameters

    • node: DiagramMakerPotentialNode
    • diagramMakerContainer: HTMLElement

      Container managed by diagram maker to render content in Could diff against content already present in the container using React, Preact or any other VDOM.

    • Optional consumerContainer: void | HTMLElement

      Container used by consumer to render. Optional. Useful only when using Preact, since Preact appends by default and needs an Element to diff against in the container.

    Returns undefined | void | HTMLElement

    • Element rendered by consumer when using Preact, or undefined or void everywhere else.

Generated using TypeDoc