Skip to content

Commit af77f98

Browse files
authored
Merge pull request #468 from apache/v6-doc-supplement
V6 doc supplement
2 parents daa0cba + 417df8b commit af77f98

21 files changed

Lines changed: 330 additions & 161 deletions

en/option/component/axis-common.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,14 @@ The maximum length for the truncated text. Any text exceeding this length will b
651651

652652
The content displayed at the end of the text after truncation.
653653

654+
{{ if: ${componentType} === 'xAxis' || ${componentType} === 'yAxis' }}
655+
#${prefix} nameMoveOverlap(boolean) = true
656+
657+
{{ use: partial-version(version = "6.0.0") }}
658+
659+
Whether to move axis name to avoid overlap with axis labels.
660+
{{ /if }}
661+
654662
#${prefix} inverse(boolean) = false
655663

656664
<ExampleUIControlBoolean />

en/option/component/geo-common.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33

44
{{ if: ${inMap} }}
55
{{ var: componentNameInLink = 'series-map' }}
6+
{{ var: componentMainType = 'series' }}
7+
{{ var: componentSubType = 'map' }}
68
{{ else }}
79
{{ var: componentNameInLink = 'geo' }}
10+
{{ var: componentMainType = 'geo' }}
11+
{{ var: componentSubType = null }}
812
{{ /if }}
913

1014
#${prefix} map(string) = ''
@@ -81,9 +85,6 @@ See also [Flight Seatmap](${galleryEditorPath}geo-seatmap-flight).
8185

8286
The demo above shows that SVG format can be used in ECharts. See more info in [SVG Base Map](tutorial.html#SVG%20Base%20Map%20in%20Geo%20Coords%20and%20Map%20Series).
8387

84-
#${prefix} roam(boolean|string) = false
85-
86-
{{ use: partial-roam() }}
8788

8889
#${prefix} projection(Object)
8990

@@ -160,22 +161,13 @@ series: {
160161

161162
Note: `stream` is not required in the `projection`.
162163

163-
#${prefix} center(Array)
164164

165-
Center of current view-port, in longitude and latitude by default. Use the projected coordinates if `projection` is set.
165+
{{ use: partial-view-coord-sys-common(
166+
prefix = ${prefix},
167+
componentMainType = ${componentMainType},
168+
componentSubType = ${componentSubType}
169+
) }}
166170

167-
Example:
168-
169-
```ts
170-
center: [115.97, 29.71]
171-
```
172-
173-
```ts
174-
projection: {
175-
projection: (pt) => project(pt)
176-
},
177-
center: project([115.97, 29.71])
178-
```
179171

180172
#${prefix} aspectScale(number) = 0.75
181173

@@ -203,15 +195,6 @@ boundingCoords: [
203195
],
204196
```
205197

206-
#${prefix} zoom(number) = 1
207-
208-
Zoom rate of current view-port.
209-
210-
#${prefix} scaleLimit(Object)
211-
212-
{{ use: partial-scale-limit(
213-
prefix = "#" + ${prefix}
214-
) }}
215198

216199
#${prefix} nameMap(Object)
217200

en/option/component/visual-map.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,24 @@ Each column of the above array is regarded as a `dimension`. For example, when p
305305

306306
Use the last dimension of `data` by default.
307307

308-
## seriesIndex(number|Array)
308+
## seriesIndex(number|string|Array)
309309

310310
Specify visual mapping should be performed on which series, from which
311311
[series.data](~series.data) is fetched.
312312

313+
Options:
314+
- A index number
315+
- An array of index numbers
316+
- `'all'`/`null`/`undefined` (default): means all of the series.
317+
318+
## seriesId(number|string|Array)
319+
320+
{{ use: partial-version(version = "6.0.0") }}
321+
322+
Specify visual mapping should be performed on which series, from which
323+
[series.data](~series.data) is fetched.
324+
325+
Can be a id or a list of ids.
313326
All series are used by default.
314327

315328
## hoverLink(boolean) = true

en/option/option.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ Global font style.
122122
defaultFontSize: 12
123123
) }}
124124

125-
{{import: partial-rich-inherit-plain-label}}
126-
127125
{{import: partial-animation }}
128126

129127
# stateAnimation(Object)
@@ -166,6 +164,8 @@ Notice: the setting only affects "display time", not "parse time".
166164
For how time value (like `1491339540396`, `'2013-01-04'`, ...) is parsed in echarts, see [the time part in date](~series-line.data).
167165

168166

167+
{{import: partial-rich-inherit-plain-label}}
168+
169169
# options(Array)
170170

171171
Option array used in [timeline](option.html#timeline). Each item of this array is an echarts option (`ECUnitOption`).

en/option/partial/coord-sys.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,29 @@ The id of the [singleAxis coordinate system](~singleAxis) to base on. When mutip
265265

266266
The index of the [geographic coordinate system](~geo) to base on. When mutiple `geographic` exist within an ECharts instance, use this to specify the corresponding `geographic`.
267267

268+
{{ if: ${seriesType} === 'map' }}
269+
When `geoIndex` and `geoId` is not specified, map series creates an exclusive `geo` component for itself. `geoIndex` or `geoId` can be used to specify an outer [geo component](~geo), which can be shared with other series like [pie](~series-pie). Moreover, the region color of the outer [geo component](~geo) can be controlled by the map series (via [visualMap](~visualMap)).
270+
271+
When `geoIndex` or `geoId` is specified, [series-map.map](~series-map.map) other style configurations like [series-map.itemStyle](~series-map.itemStyle) will not work, but corresponding configurations in [geo component](~geo) will be used.
272+
{{ /if }}
273+
274+
**See example**: [geo-choropleth-scatter](${galleryEditorPath}geo-choropleth-scatter&reset=1&edit=1)
275+
268276
## geoId(number) = undefined
269277

270278
{{ if: ${version} }}
271279
{{ use: partial-version(version = ${version}) }}
272280
{{ /if }}
273281

274282
The id of the [geographic coordinate system](~geo) to base on. When mutiple `geographic` exist within an ECharts instance, use this to specify the corresponding `geographic`.
283+
284+
{{ if: ${seriesType} === 'map' }}
285+
When `geoIndex` and `geoId` is not specified, map series creates an exclusive `geo` component for itself. `geoIndex` or `geoId` can be used to specify an outer [geo component](~geo), which can be shared with other series like [pie](~series-pie). Moreover, the region color of the outer [geo component](~geo) can be controlled by the map series (via [visualMap](~visualMap)).
286+
287+
When `geoIndex` or `geoId` specified, [series-map.map](~series-map.map) other style configurations like [series-map.itemStyle](~series-map.itemStyle) will not work, but corresponding configurations in [geo component](~geo) will be used.
288+
{{ /if }}
289+
290+
**See example**: [geo-choropleth-scatter](${galleryEditorPath}geo-choropleth-scatter&reset=1&edit=1)
275291
{{ /if }}
276292

277293
{{ if: ${parallel} }}

en/option/partial/rich-inherit-plain-label.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,24 @@
66

77
Whether rich text inherits plain text style.
88

9-
Since v6, the rich text styles (`fontStyle`, `fontWeight`, `fontSize`, `fontFamily`, `textShadowColor`, `textShadowBlur`, `textShadowOffsetX`, `textShadowOffsetY`) inherit the plain text style. To disable this behavior, you can set `richInheritPlainLabel: false` at the root level of an echarts option or the same level of the label style options. See also [#20977](https://github.com/apache/echarts/pull/20977).
9+
This option is just for backward compatibility.
10+
11+
> The [label.rich / textStyle.rich](~series-scatter.label.rich) `fontStyle`, `fontWeight`, `fontSize`, `fontFamily`, `textShadowColor`, `textShadowBlur`, `textShadowOffsetX`, `textShadowOffsetY` are changed to inherit the corresponding [plain label styles](~series-scatter.label) since echarts v6. You can use `richInheritPlainLabel: false` to restore it. For example,
12+
> ```js
13+
> option = {
14+
> richInheritPlainLabel: false, // In most cases, this is enough.
15+
> xxx1: {
16+
> // Can also set it here to only control this label.
17+
> label: {
18+
> richInheritPlainLabel: false,
19+
> rich: {/* ... */},
20+
> }
21+
> },
22+
> xxx2: {
23+
> textStyle: {
24+
> richInheritPlainLabel: false,
25+
> rich: {/* ... */},
26+
> }
27+
> }
28+
> }
29+
> ```
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{{ target: partial-view-coord-sys-common }}
2+
3+
{{ if: ${componentMainType} && ${componentSubType} }}
4+
{{ var: componentNameInLink = ${componentMainType} + '-' + ${componentSubType} }}
5+
{{ else }}
6+
{{ var: componentNameInLink = ${componentMainType} }}
7+
{{ /if }}
8+
9+
{{ if: ${componentNameInLink} === 'geo'
10+
|| ${componentNameInLink} === 'series-map'
11+
}}
12+
{{ var: isGeoOrMap = true }}
13+
{{ var: sourceName = "source map" }}
14+
{{ else }}
15+
{{ var: sourceName = "graphic elements" }}
16+
{{ /if }}
17+
18+
19+
#${prefix} center(Array)
20+
21+
{{ if: ${componentNameInLink} === 'series-graph' || ${componentNameInLink} === 'series-sankey' }}
22+
<ExampleUIControlVector default="0,0" dims="x,y" />
23+
{{ /if }}
24+
25+
`center` specifies which point on the ${sourceName} should be placed at the center of the viewport (i.e., typically, the center of the canvas).
26+
27+
{{ if: ${isGeoOrMap} }}
28+
It is in longitude and latitude by default. Use the projected coordinates if [proejction](~${componentNameInLink}.projection) is set.
29+
30+
Example:
31+
32+
```ts
33+
// Place this [lng, lat] at the center of the viewport (canvas).
34+
center: [115.97, 29.71]
35+
```
36+
37+
```ts
38+
projection: {
39+
projection: (pt) => project(pt)
40+
},
41+
center: project([115.97, 29.71])
42+
```
43+
{{ /if }}
44+
45+
Center can also be a percentage string, like `'30%'`, based on the ${sourceName} bounding rect width/height {{ if: ${isGeoOrMap} }}(by min/max latitude/longitude, or min/max projected coordinates if [proejction](~${componentNameInLink}.projection) is set){{ /if }}. You can use `'0%'` to place the top or left of ${sourceName} to the center of the viewport (canvas), or use `'100%'` to place the right or bottom to the center of the viewport (canvas).
46+
For example:
47+
```ts
48+
center: [115.97, '30%']
49+
// Place the top of ${sourceName} to the center of the viewport (canvas)
50+
center: [115.97, '0%']
51+
// Place the left of ${sourceName} to the center of the viewport (canvas)
52+
center: ['0%', 13]
53+
// Place the bottom of ${sourceName} to the center of the viewport (canvas)
54+
center: [115.97, '100%']
55+
// Place the right of ${sourceName} to the center of the viewport (canvas)
56+
center: ['100%', 13]
57+
```
58+
59+
> The percentage string is introduced since `v5.3.3`. It is initially based on canvas width/height. But that is not reasonable, and then changed to be based on the bounding rect since `v6.0.0`.
60+
61+
62+
#${prefix} zoom(number) = 1
63+
64+
{{ if: ${componentNameInLink} === 'series-graph' || ${componentNameInLink} === 'series-sankey' }}
65+
<ExampleUIControlNumber default="1" min="0" step="0.1" />
66+
{{ /if }}
67+
68+
Zoom rate of current viewport.
69+
70+
#${prefix} scaleLimit(Object)
71+
72+
{{ use: partial-scale-limit(
73+
prefix = "#" + ${prefix}
74+
) }}
75+
76+
#${prefix} roam(boolean|string) = false
77+
78+
{{ use: partial-roam() }}

en/option/series/graph.md

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,6 @@ Graph is a diagram to represent [nodes](~series-graph.nodes) and the [links](~se
3333
matrix = true,
3434
) }}
3535

36-
## center(Array)
37-
38-
<ExampleUIControlVector default="0,0" dims="x,y" />
39-
40-
Center of current view-port. It can be an array containing two `number`s in pixels or `string`s in percentage relative to the container width/height.
41-
`string` is supported from version `5.3.3`.
42-
43-
Example:
44-
```ts
45-
center: [115.97, '30%']
46-
```
47-
48-
## zoom(number) = 1
49-
50-
<ExampleUIControlNumber default="1" min="0" step="0.1" />
51-
52-
Zoom rate of current view-port.
53-
5436
## layout(string) = 'none'
5537

5638
<ExampleUIControlEnum options="none,force,circular" />
@@ -128,16 +110,14 @@ It will slow down the nodes' movement. The value range is from 0 to 1.
128110

129111
But it is still an experimental option, see [#11024](https://github.com/apache/echarts/issues/11024).
130112

131-
## roam(boolean|string) = false
132-
133-
{{ use: partial-roam() }}
134-
135-
## scaleLimit(Object)
136113

137-
{{ use: partial-scale-limit(
138-
prefix = "##"
114+
{{ use: partial-view-coord-sys-common(
115+
prefix = '#',
116+
componentMainType = 'series',
117+
componentSubType = 'graph'
139118
) }}
140119

120+
141121
## nodeScaleRatio(number) = 0.6
142122

143123
<ExampleUIControlNumber min="0" max="1" step="0.01" default="0.6" />

en/option/series/map.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,6 @@ Series of same [map type](~series-map.map) will show in one map. At this point,
3131
geo = true
3232
) }}
3333

34-
## center(Array)
35-
36-
Center of current view-port. It can be an array containing two `number`s in pixels or `string`s in percentage relative to the container width/height.
37-
`string` is supported from version `5.3.3`.
38-
39-
Example:
40-
```ts
41-
center: [115.97, '30%']
42-
```
43-
44-
## geoIndex(number) = null
45-
46-
In default case, map series create exclusive `geo` component for themselves. But `geoIndex` can be used to specify an outer [geo component](~geo), which can be shared with other series like [pie](~series-pie). Moreover, the region color of the outer [geo component](~geo) can be controlled by the map series (via [visualMap](~visualMap)).
47-
48-
When `geoIndex` specified, [series-map.map](~series-map.map) other style configurations like [series-map.itemStyle](~series-map.itemStyle) will not work, but corresponding configurations in [geo component](~geo) will be used.
49-
50-
For example:
51-
~[600x400](${galleryViewPath}geo-map-scatter&reset=1&edit=1)
52-
5334
## mapValueCalculation(string) = 'sum'
5435

5536
Value of multiple series with the same [map type](~series-map.map) can use this option to get a statistical value.

en/option/series/sankey.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ The layout direction of the nodes in the Sankey diagram, which can be horizontal
9191

9292
The drag-and-drop interaction of the node, which is enabled by default. After opening, the user can drag any node in the Sankey diagram to any position. To turn this interaction off, simply set the value to `false`.
9393

94+
95+
{{ use: partial-view-coord-sys-common(
96+
prefix = '#',
97+
componentMainType = 'series',
98+
componentSubType = 'sankey'
99+
) }}
100+
101+
94102
## edgeLabel(Object)
95103

96104
{{ use: sankey-edge-label(

0 commit comments

Comments
 (0)