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

3.8 KiB

title
ToolbarConfig

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

plugins.ToolbarConfig

The ToolbarConfig interface contains the following properties:

  • handleClick: An optional function for handling clicks on the toolbar. It takes two arguments: code (of type string) and graph (of type IGraph), and has no return value.
  • getContent: A required function for getting the content of the toolbar. It takes an optional argument of type IGraph, and returns a value of type HTMLDivElement or string.
  • zoomSensitivity: An optional number representing the zoom sensitivity of the toolbar. The default value is 10.
  • minZoom: An optional number representing the minimum zoom ratio of the toolbar. The default value is 0.00001.
  • maxZoom: An optional number representing the maximum zoom ratio of the toolbar. The default value is 1000.

Hierarchy

  • IPluginBaseConfig

    ToolbarConfig

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


getContent

getContent: (graph?: IGraph<BehaviorRegistry, ThemeRegistry>) => string | HTMLDivElement

Type declaration

▸ (graph?): string | HTMLDivElement

Function for getting content of toolbar

Parameters
Name Type
graph? IGraph<BehaviorRegistry, ThemeRegistry>
Returns

string | HTMLDivElement

Defined in

packages/g6/src/stdlib/plugin/toolbar/index.ts:20


graph

Optional graph: IGraph<BehaviorRegistry, ThemeRegistry>

Inherited from

IPluginBaseConfig.graph

Defined in

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


handleClick

Optional handleClick: (code: string, graph: IGraph<BehaviorRegistry, ThemeRegistry>) => void

Type declaration

▸ (code, graph): void

Function for handling clicks on toolbar

Parameters
Name Type
code string
graph IGraph<BehaviorRegistry, ThemeRegistry>
Returns

void

Defined in

packages/g6/src/stdlib/plugin/toolbar/index.ts:18


maxZoom

maxZoom: number

Maximum zoom ratio of toolbar

Defined in

packages/g6/src/stdlib/plugin/toolbar/index.ts:26


minZoom

minZoom: number

Minimum zoom ratio of toolbar

Defined in

packages/g6/src/stdlib/plugin/toolbar/index.ts:24


zoomSensitivity

zoomSensitivity: number

Zoom sensitivity of toolbar

Defined in

packages/g6/src/stdlib/plugin/toolbar/index.ts:22