Skip to content

Commit e2eda8e

Browse files
committed
WIP(chord): doc
1 parent 7f9b29c commit e2eda8e

2 files changed

Lines changed: 233 additions & 0 deletions

File tree

zh/option/option.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
{{import: series-gauge}}
5151
{{import: series-pictorialBar}}
5252
{{import: series-themeRiver}}
53+
{{import: series-chord}}
5354
{{import: series-custom}}
5455

5556
# darkMode(boolean)

zh/option/series/chord.md

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
2+
{{ target: series-chord }}
3+
4+
# series.chord(Object)
5+
6+
{{ use: partial-version(
7+
version = "6.0.0"
8+
) }}
9+
10+
和弦图是一种用于可视化不同实体之间相互关系和流量的数据图表。它通过优美的弧形和弦连接,展示数据流动的方向和比例。
11+
12+
**示例:**
13+
14+
~[600x600](${galleryViewPath}chord-style&edit=1&reset=1)
15+
16+
17+
<ExampleBaseOption name="chord" title="基础和弦图" title-en="Basic Chord">
18+
const option = {
19+
tooltip: {},
20+
legend: {},
21+
series: [
22+
{
23+
type: 'chord',
24+
clockwise: false,
25+
label: { show: true },
26+
lineStyle: { color: 'target' },
27+
data: [{ name: 'A' }, { name: 'B' }, { name: 'C' }, { name: 'D' }],
28+
links: [
29+
{ source: 'A', target: 'B', value: 40 },
30+
{ source: 'A', target: 'C', value: 20 },
31+
{ source: 'B', target: 'D', value: 20 }
32+
]
33+
}
34+
]
35+
};
36+
</ExampleBaseOption>
37+
38+
## type(string) = 'chord'
39+
40+
{{ use: partial-component-id(
41+
prefix = "#"
42+
) }}
43+
44+
{{ use: partial-series-name() }}
45+
46+
{{ use: component-circular-layout(
47+
componentName = "和弦图",
48+
defaultRadius = "['70%', '80%']"
49+
) }}
50+
51+
{{ use: partial-coord-sys(
52+
version = '6.0.0',
53+
seriesType = "chord",
54+
coordSysDefault = "'none'",
55+
calendar = true,
56+
matrix = true,
57+
none = true
58+
) }}
59+
60+
## data(Array)
61+
62+
和弦图的节点数据列表。
63+
64+
```ts
65+
data: [{
66+
name: 'A'
67+
}, {
68+
name: 'B',
69+
value: 100
70+
}, {
71+
name: 'C',
72+
itemStyle: {
73+
color: 'red'
74+
}
75+
}]
76+
```
77+
78+
**注意:** 节点的`name`不能重复。
79+
80+
### name(string)
81+
82+
数据项名称。
83+
84+
### value(number|Array)
85+
86+
数据项值。
87+
88+
### itemStyle(Object)
89+
90+
该节点的样式。
91+
92+
{{ use: partial-item-style(
93+
prefix = "###",
94+
useColorPalatte = true
95+
) }}
96+
97+
### label(Object)
98+
99+
该节点标签的样式。
100+
101+
{{ use: partial-label(
102+
prefix = "###",
103+
labelMargin = true
104+
) }}
105+
106+
### emphasis(Object)
107+
108+
该节点的高亮状态。
109+
110+
{{ use: partial-emphasis-disabled(
111+
prefix = "###"
112+
) }}
113+
114+
{{ use: graph-node-state(
115+
state = 'emphasis'
116+
) }}
117+
118+
### blur(Object)
119+
120+
{{ use: partial-version(
121+
version = "5.0.0"
122+
) }}
123+
124+
该节点的淡出状态。
125+
126+
{{ use: graph-node-state(
127+
state = 'blur'
128+
) }}
129+
130+
### select(Object)
131+
132+
{{ use: partial-version(
133+
version = "5.0.0"
134+
) }}
135+
136+
该节点的选中状态。
137+
138+
{{ use: partial-select-disabled(
139+
prefix = "###"
140+
) }}
141+
142+
{{ use: graph-node-state(
143+
state = 'select'
144+
) }}
145+
146+
{{ use: partial-tooltip-in-series-data() }}
147+
148+
## nodes(Array)
149+
150+
别名,同 [data](~series-graph.data)
151+
152+
## links(Array)
153+
154+
节点间的关系数据。示例:
155+
```ts
156+
links: [{
157+
source: 'n1',
158+
target: 'n2'
159+
}, {
160+
source: 'n2',
161+
target: 'n3'
162+
}]
163+
```
164+
165+
### source(string|number)
166+
167+
边的[源节点名称](~series-graph.data.name)的字符串,也支持使用数字表示源节点的索引。
168+
169+
### target(string|number)
170+
171+
边的[目标节点名称](~series-graph.data.name)的字符串,也支持使用数字表示源节点的索引。
172+
173+
### value(number)
174+
175+
边的数值,可以在力引导布局中用于映射到边的长度。
176+
177+
### lineStyle(Object)
178+
179+
关系边的线条样式。
180+
181+
{{ use: partial-line-style(
182+
prefix = "###"
183+
) }}
184+
185+
### emphasis(Object)
186+
187+
该关系边的高亮状态。
188+
189+
{{ use: partial-emphasis-disabled(
190+
prefix = "###"
191+
) }}
192+
193+
{{ use: chord-edge-state(
194+
state = 'emphasis'
195+
) }}
196+
197+
### blur(Object)
198+
199+
该关系边的淡出状态。
200+
201+
{{ use: chord-edge-state(
202+
state = 'blur'
203+
) }}
204+
205+
### select(Object)
206+
207+
该关系边的选中状态。
208+
209+
{{ use: partial-select-disabled(
210+
prefix = "###"
211+
) }}
212+
213+
{{ use: chord-edge-state(
214+
state = 'select'
215+
) }}
216+
217+
218+
{{ target: chord-edge-state }}
219+
220+
#### lineStyle(Object)
221+
222+
{{ use: partial-line-style(
223+
prefix = "####",
224+
hasInherit = ${state} === 'emphasis'
225+
) }}
226+
227+
#### label(Object)
228+
229+
{{ use: partial-label(
230+
prefix = "####",
231+
defaultShow = true
232+
) }}

0 commit comments

Comments
 (0)