g6/packages/site/docs/apis/plugins/WIP-TooltipConfig.en.md
2023-11-07 21:39:59 +08:00

5.1 KiB

title
TooltipConfig

Overview - v5.0.0-alpha.9 / Modules / plugins / TooltipConfig

plugins.TooltipConfig

The TooltipConfig interface contains the following properties:

  • getContent: An optional function for getting the content of the tooltip. It takes an optional argument of type IG6GraphEvent, and returns a value of type HTMLDivElement, string, or Promise (resolving to HTMLDivElement or string).
  • offsetX: An optional number representing the offset of the tooltip in the X direction.
  • offsetY: An optional number representing the offset of the tooltip in the Y direction.
  • shouldBegin: An optional function for determining whether the tooltip should be displayed. It takes an optional argument of type IG6GraphEvent, and returns a boolean value.
  • itemTypes: An optional array of strings representing the types of items for which the tooltip is allowed to be displayed. The possible values are 'node', 'edge', 'combo', and 'canvas'.
  • trigger: An optional string, either 'pointerenter' or 'click', representing the event type that triggers the display of the tooltip.
  • fixToNode: An optional array of two numbers, a string representing a placement, or undefined, representing how to fix the tooltip to a node.
  • loadingContent: An optional HTMLDivElement or string representing the loading DOM.

Hierarchy

  • IPluginBaseConfig

    TooltipConfig

Properties

className

Optional className: string

Inherited from

IPluginBaseConfig.className

Defined in

packages/g6/src/types/plugin.ts:6


container

Optional container: string | HTMLDivElement

Inherited from

IPluginBaseConfig.container

Defined in

packages/g6/src/types/plugin.ts:5


fixToNode

Optional fixToNode: [number, number] | Placement

How to fix tooltip to node

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:85


getContent

Optional getContent: (evt?: IG6GraphEvent) => string | HTMLDivElement | Promise<string | HTMLDivElement>

Type declaration

▸ (evt?): string | HTMLDivElement | Promise<string | HTMLDivElement>

Function for getting tooltip content

Parameters
Name Type
evt? IG6GraphEvent
Returns

string | HTMLDivElement | Promise<string | HTMLDivElement>

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:71


graph

Optional graph: IGraph<BehaviorRegistry, ThemeRegistry>

Inherited from

IPluginBaseConfig.graph

Defined in

packages/g6/src/types/plugin.ts:7


itemTypes

Optional itemTypes: ("node" | "edge" | "combo" | "canvas")[]

Types of items for which tooltip is allowed to be displayed

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:81


loadingContent

Optional loadingContent: string | HTMLDivElement

Loading DOM

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:87


offsetX

Optional offsetX: number

Offset of tooltip in X direction

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:75


offsetY

Optional offsetY: number

Offset of tooltip in Y direction

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:77


shouldBegin

Optional shouldBegin: (evt?: IG6GraphEvent) => boolean

Type declaration

▸ (evt?): boolean

Determine whether to display tooltip

Parameters
Name Type
evt? IG6GraphEvent
Returns

boolean

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:79


trigger

Optional trigger: "click" | "pointerenter"

Event type that triggers display of tooltip

Defined in

packages/g6/src/stdlib/plugin/tooltip/index.ts:83