2023-08-31 01:43:08 +08:00
|
|
|
|
帮您翻译
|
|
|
|
|
|
2023-08-30 19:46:37 +08:00
|
|
|
|
---
|
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
## 标题: ToolbarConfig
|
|
|
|
|
|
|
|
|
|
[概述 - v5.0.0-alpha.9](../../README.zh.md) / [模块](../../modules.zh.md) / [插件](../../modules/plugins.zh.md) / ToolbarConfig
|
|
|
|
|
|
|
|
|
|
[插件](../../modules/plugins.zh.md).ToolbarConfig
|
|
|
|
|
|
|
|
|
|
`ToolbarConfig` 接口包含以下属性:
|
|
|
|
|
|
|
|
|
|
- `handleClick`:用于处理工具栏上的点击的可选函数。它接受两个参数:`code`(类型为 string)和 `graph`(类型为 IGraph),并且没有返回值。
|
|
|
|
|
- `getContent`:用于获取工具栏内容的必需函数。它接受一个可选的 `IGraph` 类型参数,并返回 HTMLDivElement 或 string 类型的值。
|
|
|
|
|
- `zoomSensitivity`:表示工具栏的缩放灵敏度的可选数字。默认值为 10。
|
|
|
|
|
- `minZoom`:表示工具栏的最小缩放比例的可选数字。默认值为 0.00001。
|
|
|
|
|
- `maxZoom`:表示工具栏的最大缩放比例的可选数字。默认值为 1000。
|
|
|
|
|
|
|
|
|
|
## 层次结构
|
|
|
|
|
|
|
|
|
|
- `IPluginBaseConfig`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
↳ **`ToolbarConfig`**
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
## 属性
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### className
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• `Optional` **className**: `string`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 继承自
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
IPluginBaseConfig.className
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/types/plugin.ts:6](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/types/plugin.ts#L6)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### container
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• `Optional` **container**: `string` \| `HTMLDivElement`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 继承自
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
IPluginBaseConfig.container
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/types/plugin.ts:5](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/types/plugin.ts#L5)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### getContent
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• **getContent**: (`graph?`: [`IGraph`](../graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>) => `string` \| `HTMLDivElement`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 类型声明
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
▸ (`graph?`): `string` \| `HTMLDivElement`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
用于获取工具栏内容的函数
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
##### 参数
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
| 名称 | 类型 |
|
|
|
|
|
| :------- | :---------------------------------------------------------------------- |
|
|
|
|
|
| `graph?` | [`IGraph`](../graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\> |
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
##### 返回
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
`string` \| `HTMLDivElement`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/stdlib/plugin/toolbar/index.ts:20](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/stdlib/plugin/toolbar/index.ts#L20)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### graph
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• `Optional` **graph**: [`IGraph`](../graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 继承自
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
IPluginBaseConfig.graph
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/types/plugin.ts:7](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/types/plugin.ts#L7)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### handleClick
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• `Optional` **handleClick**: (`code`: `string`, `graph`: [`IGraph`](../graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>) => `void`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 类型声明
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
▸ (`code`, `graph`): `void`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
用于处理工具栏上点击的函数
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
##### 参数
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
| 名称 | 类型 |
|
|
|
|
|
| :------ | :---------------------------------------------------------------------- |
|
|
|
|
|
| `code` | `string` |
|
|
|
|
|
| `graph` | [`IGraph`](../graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\> |
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
##### 返回
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
`void`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/stdlib/plugin/toolbar/index.ts:18](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/stdlib/plugin/toolbar/index.ts#L18)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### maxZoom
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• **maxZoom**: `number`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
工具栏的最大缩放比例
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/stdlib/plugin/toolbar/index.ts:26](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/stdlib/plugin/toolbar/index.ts#L26)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### minZoom
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• **minZoom**: `number`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
工具栏的最小缩放比例
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/stdlib/plugin/toolbar/index.ts:24](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/stdlib/plugin/toolbar/index.ts#L24)
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
---
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
### zoomSensitivity
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
• **zoomSensitivity**: `number`
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
工具栏的缩放灵敏度
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
#### 定义在
|
2023-08-30 19:46:37 +08:00
|
|
|
|
|
2023-08-31 01:43:08 +08:00
|
|
|
|
[packages/g6/src/stdlib/plugin/toolbar/index.ts:22](https://github.com/antvis/G6/blob/a69acd5592/packages/g6/src/stdlib/plugin/toolbar/index.ts#L22)
|