Minimap 小地图
阅读时间约 2 分钟
参考示例:
minimap
| string
此插件已内置,你可以通过 type: 'minimap'
来使用它。
string
缩略图画布类名,传入外置容器时不生效
HTMLElement | string
缩略图挂载的容器,无则挂载到 Graph 所在容器
CSSStyleDeclaration
缩略图的容器样式,传入外置容器时不生效
number Default:
128
延迟更新时间(毫秒),用于性能优化
(id: string, elementType: 'node' | 'edge' | 'combo') => boolean
过滤器,用于过滤不必显示的元素
CSSStyleDeclaration
遮罩的样式
number | number[] Default:
10
内边距
[number, number] | 'left' | 'right' | 'top' | 'bottom' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' Default:
'right-bottom'
缩略图相对于画布的位置
IRenderer
渲染器,默认使用 Canvas 渲染器
'key' | ((id: string, elementType: 'node' | 'edge' | 'combo') => DisplayObject)
Default: 'key'
元素缩略图形的生成方法
[number, number] Default:
[240, 160]
宽度和高度
destroy(): void;
update(options: Partial<MinimapOptions>): void;
参数 | 类型 | 描述 | 默认值 | 必选 |
---|---|---|---|---|
options | Partial<MinimapOptions> | 配置项 | - | ✓ |