跳转到内容

pivotick v3.0.0


拓展 / GraphUI / LegendOptions

接口: LegendOptions ​

定义于:interfaces/GraphUI.ts:668

UI.legend — 画布图例。它具有描述性:它报告渲染器已经解析的颜色并且从不分配颜色,因此使用者仍然是节点着色的唯一所有者。

条目来自 key (源自数据、从渲染器采样的样本)、entries (声明),或来自两者 — key 然后为不携带谓词的条目提供默认谓词。

对于都不是,图例将自身键控在render.nodeTypeAccessor(您已经为nodeStyleMap声明的维度) - 但只有在检查该维度确实是颜色维度之后:每个类别必须解析为恰好一种颜色,必须至少有两种颜色,并且它们的数量足够少才能成为类别。正是这张支票让无人问津的传奇人物变得安全; UI.legend: true 跳过它,false 完全抑制图例。

要一次在多个维度上为图形设置关键帧,请改为传递 LegendGroupOptions。

仅以 full 和 light 模式显示。

示例 ​

js
UI: { legend: { key: 'type', title: 'Node type' } }

延伸 ​

属性 ​

collapsed? ​

optional collapsed: boolean

定义于:interfaces/GraphUI.ts:626

开始崩溃了。

默认值 ​

ts
false

继承自 ​

LegendSection.collapsed


collapsible? ​

optional collapsible: boolean

定义于:interfaces/GraphUI.ts:624

默认值 ​

ts
true

继承自 ​

LegendSection.collapsible


enabled? ​

optional enabled: boolean

定义于:interfaces/GraphUI.ts:586

默认值 ​

ts
true when the block is present

继承自 ​

LegendSection.enabled


entries? ​

optional entries: LegendEntry[] | (graph) => LegendEntry[]

定义于:interfaces/GraphUI.ts:622

声明的条目,或每次图例重建时根据实时图表重新解析的函数(以便列表可以跟随数据)。

继承自 ​

LegendSection.entries


filterable? ​

optional filterable: boolean

定义于:interfaces/GraphUI.ts:630

单击条目可过滤图表。 false 呈现纯键。

默认值 ​

ts
true

继承自 ​

LegendSection.filterable


highlightOnHover? ​

optional highlightOnHover: boolean

定义于:interfaces/GraphUI.ts:637

将条目悬停在画布上可以读取其类别:它所代表的元素保持其外观,其他所有内容都会变暗,直到指针离开。也适用于 filterable: false 键——指向一个类别不需要任何图表。

默认值 ​

ts
true

继承自 ​

LegendSection.highlightOnHover


id? ​

optional id: string

定义于:interfaces/GraphUI.ts:605

稳定身份:该部分自己的过滤键(__legend:<id>)和legendToggle事件的section字段。

默认值 ​

key,否则section-<index>

继承自 ​

LegendSection.id


key? ​

optional key: string

定义于:interfaces/GraphUI.ts:617

派生模式:数据键,其不同值成为条目,每个样本都是从渲染器解析的样式中采样的。当scope为'edge'时,读取节点或边缘。当 entries 声明时没有谓词时,还提供默认谓词。

继承自 ​

LegendSection.key


maxVisibleEntries? ​

optional maxVisibleEntries: number

定义于:interfaces/GraphUI.ts:639

列表滚动之前显示的条目。

默认值 ​

ts
12

继承自 ​

LegendSection.maxVisibleEntries


position? ​

optional position: LegendPosition

定义于:interfaces/GraphUI.ts:675

它停靠在哪个角落。在 full 模式下,默认值为右列,堆叠在小地图上方 - 左边的列属于模式轨及其面板。其他模式保留左下角。

默认值 ​

full 模式下为“右下角”,否则为 'bottom-left'


scope? ​

optional scope: LegendScope

定义于:interfaces/GraphUI.ts:599

本节重点关注哪个集合。 'edge' 使用 line 样本列出图形的关系类型 - 渲染器解析它们时的描边颜色、破折号和标记 - 以及它的切换隐藏边缘 layers:节点保持不变,布局、选择和相机也保持不变。

edge 部分会过滤 UI.filter.edgeFacets 是否声明其键:给定一个它驱动该方面,因此面板和图例是一个过滤器的两个视图;如果没有一个,它就会保留自己的一个方面。

默认值 ​

ts
'node'

继承自 ​

LegendSection.scope


showCounts? ​

optional showCounts: boolean

定义于:interfaces/GraphUI.ts:628

显示每个条目的元素计数。

默认值 ​

ts
true

继承自 ​

LegendSection.showCounts


title? ​

optional title: string

定义于:interfaces/GraphUI.ts:610

标题文本,逐字使用(因此可以翻译)。

默认值 ​

美化的key,否则'Legend'

继承自 ​

LegendSection.title