Click interaction handler that handles click, double click and right click events on nodes, relationships, and the scene.

For examples, head to the Click Interaction documentation page.

Hierarchy

Constructors

  • Creates a new click interaction handler.

    Parameters

    • nvl: NVL

      The NVL instance to attach the interaction handler to.

    • options: ClickInteractionOptions = ...

      Options for the click interaction handler.

    Returns ClickInteraction

Accessors

  • get currentOptions(): P
  • Returns the current options of the interaction.

    Returns P

    The current options of the interaction.

Methods

  • Removes all related event listeners from the container.

    Returns void

  • Remove a callback for a given event of type.

    Parameters

    • name: string

      The name of the event.

    Returns void

  • Enables or disables global text selection during a drag or pan operation.

    Parameters

    • enable: boolean

      Whether to enable or disable global text selection.

    • OptionaleventFunction: ((this: HTMLElement, ev: MouseEvent) => void)

      The event function to be added/removed when text selection is disabled/enabled.

        • (this, ev): void
        • Parameters

          • this: HTMLElement
          • ev: MouseEvent

          Returns void

    Returns void

  • Add or update a callback for a given event of type.

    Parameters

    • name: string

      The name of the event.

    • callback:
          | undefined
          | boolean
          | ((nodes: Node, hitElements: HitTargets, event: MouseEvent) => void)
          | ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void)
          | ((event: MouseEvent) => void)
          | ((event: MouseEvent) => void)
          | ((event: MouseEvent) => void)
          | ((node: Node, hitElements: HitTargets, event: MouseEvent) => void)
          | ((node: Node, hitElements: HitTargets, event: MouseEvent) => void)
          | ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void)
          | ((relationship: Relationship, hitElements: HitTargets, event: MouseEvent) => void)

      The callback to be called when the event is triggered.

    Returns void