节点关系图 <NodeGraph />
一个中心节点和环绕它的节点,用线相连,线上可写关系;逐条展开时每个节点带着它的连线出现。
Template and style descriptions are currently available in Chinese only.
- Group
- 结构 · 谁和谁相连
- Component
NodeGraph·#node-graph
Good for
- 4–10 个对象之间的关系:依赖、流向、合作
- 讲一个系统由哪些部分组成、怎么互相影响
Avoid when
- 有先后步骤:用 FlowDiagram
- 有数量流动:用 Sankey
Content limits
| 1 | nodes 4–10 个:label ≤ 6 字,sub ≤ 10 字 |
| 2 | edges ≤ 14 条,label ≤ 6 字 |
| 3 | note ≤ 60 字 |
| 4 | 默认第一个节点居中;所有节点都给 x/y(0–100)时按手动位置 |
Fields
| Field | Type | |
|---|---|---|
kicker · required | string | 标题上方的小节名,2–8 字 |
title · required | string | string[] | 页面标题;传数组可手动断行,每项一行 |
lead | string | 一到两句导语,≤ 60 字 |
source | string | 事实出处;页面上有任何数据或事实时必填 |
hint | ReactNode | 页眉中间的操作提示,可用 <kbd> |
nodes · required | { id, label, sub?, x?, y? }[] | 节点 |
edges · required | { from, to, label?, strong? }[] | 连线;strong 用强调色 |
note | string | 右侧解读 |
Example
<NodeGraph kicker="系统" title="…" nodes={[{ id: 'pv', label: '光伏发电' }, { id: 'store', label: '储能' }, …]} edges={[{ from: 'pv', to: 'store', label: '充电' }]} />