Skip to content

Commit f714784

Browse files
committed
Merge branch 'master' of github.com:apache/echarts-doc
2 parents cc5f026 + af77f98 commit f714784

82 files changed

Lines changed: 1485 additions & 273 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ slides/webgl
192192
/zh-src
193193
/en-src
194194

195-
/config/env.*-local.js
195+
/config/env.*-override.js

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ It will:
3030

3131
### Local Config
3232

33-
To customize the links of `echarts-examples` and other configurations, you can create a local config file `echarts-doc/config/env.dev-local.js`, which is not tracked by git, and its top-level properties will be used to override the corresponding properties of `echarts-doc/config/env.dev.js` when `npm run dev`.
33+
To customize the links of `echarts-examples` and other configurations, you can create a local config file `echarts-doc/config/env.dev-override.js`, which is not tracked by git, and its top-level properties will be used to override the corresponding properties of `echarts-doc/config/env.dev.js` when `npm run dev`.
3434

35-
For example, create a `echarts-doc/config/env.dev-local.js`:
35+
For example, create a `echarts-doc/config/env.dev-override.js`:
3636
```js
3737
module.exports = {
38-
// These props will override the same props in `echarts-doc/config/env.dev-local.js`
38+
// These props will override the same props in `echarts-doc/config/env.dev.js`
3939
galleryViewPath: 'http://127.0.0.1:3002/en/view.html?local=1&c=',
4040
galleryEditorPath: 'http://127.0.0.1:3002/en/editor.html?local=1&c=',
4141
EMBEDDED_ECHARTS_SCRIPT_URL: 'http://localhost:8001/echarts/echarts/dist/echarts.js',
@@ -51,6 +51,10 @@ Marking "since version" indicates when a new feature was introduced.
5151
For example,
5252
```
5353
{{ use: partial-version(version = "6.0.0") }}
54+
55+
{{ use: partial-version(version = ${version|minVersion('6.0.0')}) }}
56+
That is, if the ${version} is empty or smaller than '6.0.0', use '6.0.0'.
57+
Follow the version comparison rules in Semver 2.0 .
5458
```
5559

5660
### Global Variables
@@ -197,6 +201,15 @@ The template syntax follows [etpl](https://github.com/ecomfe/etpl/blob/master/do
197201
198202
Summary of the commonly used syntax:
199203
```template
204+
--- TEMPLATE EXPRESSION ---
205+
The template syntax and expressions are encolsed by delimiters `{{` and `}}`.
206+
For example,
207+
{{ if: condition_expression }} xxx {{ /if }}
208+
The expressoin within `{{` and `}}` can be considered a (restricted) JS expression.
209+
For example,
210+
{{ if: ${someVar1} + 'abc' === '123abc' }} ... {{ /if }}
211+
{{ if: !${someVar2} }} ... {{ /if }}
212+
200213
--- TEMPLATE VARIABLE ---
201214
Use a variable:
202215
some text ${someVariable} some text
@@ -210,7 +223,8 @@ Declaration or assignment of a target-local variable:
210223
{{ var: myVar = 'some' }}
211224
{{ var: myVar = 123 }}
212225
{{ var: myVar = ${someOtherStr} + 'some_str' }}
213-
226+
NOTICE:
227+
Within a `{{` `}}` pair, DO NOT write {{ if: '${some}_abc' }}{{ /if }}. It should be {{ if: ${some} + '_abc' }}{{ /if }}, as the sentence within `{{` `}}` pair is treated like a normal JS expression.
214228
215229
--- IF ELSE ---
216230
{{ if: ${number1} > 0 }}
@@ -220,6 +234,11 @@ some text yyy
220234
{{ else }}
221235
some text zzz
222236
{{ /if }}
237+
Logical operators can be used in the conditional expression:
238+
{{ if: ${componentNameInLink} == null && ${seriesType} }}
239+
This componentNameInLink is null or undefined
240+
{{ var: componentNameInLink = 'series-' + ${seriesType} }}
241+
{{ /if }}
223242
224243
225244
--- FOR LOOP ---

build/helper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ exports.readConfigEnvFile = function (envType) {
1111
assert(ENV_TYPE.indexOf(envType) >= 0, 'envType must be one of ' + ENV_TYPE.join(', '));
1212

1313
const configEnvRelativePath = '../config/env.' + envType + '.js';
14-
const configEnvLocalRelativePath = '../config/env.' + envType + '-local.js';
14+
const configEnvOverrideRelativePath = '../config/env.' + envType + '-override.js';
1515

1616
const config = require(configEnvRelativePath);
17-
if (fs.existsSync(path.resolve(__dirname, configEnvLocalRelativePath))) {
18-
const configLocal = require(configEnvLocalRelativePath);
17+
if (fs.existsSync(path.resolve(__dirname, configEnvOverrideRelativePath))) {
18+
const configLocal = require(configEnvOverrideRelativePath);
1919
assert(
2020
typeof configLocal === 'object' && !Array.isArray(configLocal),
21-
configEnvLocalRelativePath + ' must be an object.'
21+
configEnvOverrideRelativePath + ' must be an object.'
2222
);
2323
Object.assign(config, configLocal);
2424
}

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/data-zoom-slider.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,16 @@ Whether to update view while dragging. If it is set as `false`, the view will be
239239
componentName = 'dataZoom-slider'
240240
) }}
241241

242+
{{ use: partial-coord-sys(
243+
version = '6.0.0',
244+
nonSeriesComponentMainType = "dataZoom",
245+
nonSeriesComponentSubType = "slider",
246+
coordSysDefault = "'none'",
247+
calendar = true,
248+
matrix = true,
249+
none = true
250+
) }}
251+
242252
## width(string|number)
243253

244254
<ExampleUIControlNumber default="30"/>

en/option/component/geo-common.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
{{ target: geo-common }}
33

4+
{{ if: ${inMap} }}
5+
{{ var: componentNameInLink = 'series-map' }}
6+
{{ var: componentMainType = 'series' }}
7+
{{ var: componentSubType = 'map' }}
8+
{{ else }}
9+
{{ var: componentNameInLink = 'geo' }}
10+
{{ var: componentMainType = 'geo' }}
11+
{{ var: componentSubType = null }}
12+
{{ /if }}
13+
414
#${prefix} map(string) = ''
515

616
Map name registered in [registerMap](api.html#echarts.registerMap).
@@ -75,9 +85,6 @@ See also [Flight Seatmap](${galleryEditorPath}geo-seatmap-flight).
7585

7686
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).
7787

78-
#${prefix} roam(boolean|string) = false
79-
80-
{{ use: partial-roam() }}
8188

8289
#${prefix} projection(Object)
8390

@@ -154,28 +161,23 @@ series: {
154161

155162
Note: `stream` is not required in the `projection`.
156163

157-
#${prefix} center(Array)
158164

159-
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+
) }}
160170

161-
Example:
162171

163-
```ts
164-
center: [115.97, 29.71]
165-
```
172+
#${prefix} aspectScale(number) = 0.75
166173

167-
```ts
168-
projection: {
169-
projection: (pt) => project(pt)
170-
},
171-
center: project([115.97, 29.71])
172-
```
174+
Used to scale aspect of geo. It will be ignored if [proejction](~${componentNameInLink}.projection) is set.
173175

174-
#${prefix} aspectScale(number) = 0.75
176+
The final calculated `pixelWidth` and `pixelHeight` of the map will satisfy `pixelWidth / pixelHeight = lngSpan / latSpan * aspectScale` (assume [proejction](~${componentNameInLink}.projection) is not specified, and [preserveAspect](~${componentNameInLink}.preserveAspect) is truthy).
175177

176-
Used to scale aspect of geo. Will be ignored if `projection` is set.
178+
If no [proejction](~${componentNameInLink}.projection) is applied, the latitudes and longitudes in GeoJSON are linearly mapped to pixel coordinates diarectly. `aspectScale` offers a simple way to visually compensates for the distortion caused by the fact that the longitudinal spacing shrinks as latitude increases. For example, an `aspectScale` can be roughly calculated as `aspectScale = Math.cos(center_latitude * Maht.PI / 180)`, which is similar to a sinusoidal projection.
177179

178-
The final aspect is calculated by: `geoBoundingRect.width / geoBoundingRect.height * aspectScale`.
180+
See [example](${galleryEditorPath}geo-graph&edit=1&reset=1).
179181

180182
#${prefix} boundingCoords(Array) = null
181183

@@ -193,15 +195,6 @@ boundingCoords: [
193195
],
194196
```
195197

196-
#${prefix} zoom(number) = 1
197-
198-
Zoom rate of current view-port.
199-
200-
#${prefix} scaleLimit(Object)
201-
202-
{{ use: partial-scale-limit(
203-
prefix = "#" + ${prefix}
204-
) }}
205198

206199
#${prefix} nameMap(Object)
207200

en/option/component/geo.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ Whether to show the geo component.
3737
prefix = '#'
3838
) }}
3939

40+
{{ use: partial-coord-sys(
41+
version = '6.0.0',
42+
nonSeriesComponentMainType = "geo",
43+
coordSysDefault = "'none'",
44+
calendar = true,
45+
matrix = true,
46+
none = true
47+
) }}
48+
4049
## regions(Array)
4150

4251
Configure style for specified regions.

en/option/component/grid.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33

44
# grid(Object)
55

6-
Drawing grid in rectangular coordinate. In a single grid, at most two X and Y axes each is allowed. [Line chart](~series-line), [bar chart](~series-bar), and [scatter chart (bubble chart)](~series-scatter) can be drawn in grid.
6+
The `grid component` is a rectangular container, used to lay out two-dimensional rectangular coordinate system (also known as `cartesian2d` coordinate system).
77

8-
In ECharts 2.x, there could only be one single grid component at most in a single echarts instance. But in ECharts 3, there is no limitation.
8+
A `cartesian2d` coordinate system is composed fo an [xAxis](~xAixs) and a [yAxis](~yAxis). Multiple `cartesian2d` coordinate systems can be arranged within a single `grid component` - that is, multiple [xAxis](~xAixs) and multiple [yAxis](~yAxis) instances can be configured within one `grid component`.
9+
10+
An [xAxis](~xAixs) or a [yAxis](~yAxis) can be shared by multiple `cartesian2d` coordinate systems. For example, one [xAxis](~xAixs) and two [yAxis](~yAxis) form two `cartesian2d` coordinate systems.
11+
12+
[Line chart](~series-line), [bar chart](~series-bar), and [scatter chart (bubble chart)](~series-scatter), etc., can be drawn in `grid component`.
13+
14+
> In ECharts 2.x, there could only be one single grid component at most in a single echarts instance. But since ECharts 3, there is no limitation.
915
1016
**Following is an example of Anscombe Quartet:**
1117

@@ -82,6 +88,7 @@ See also [outerBounds example](${galleryEditorPath}doc-example/grid-outerBounds&
8288
8389
{{ use: partial-rect-layout-width-height(
8490
hostName = "`outerBounds`",
91+
version = "6.0.0",
8592
noZ = true,
8693
prefix = '##',
8794
defaultLeft = 0,
@@ -113,3 +120,11 @@ See also [outerBounds example](${galleryEditorPath}doc-example/grid-outerBounds&
113120
114121
{{ use: partial-tooltip-in-coords() }}
115122
123+
{{ use: partial-coord-sys(
124+
version = '6.0.0',
125+
nonSeriesComponentMainType = "grid",
126+
coordSysDefault = "'none'",
127+
matrix = true,
128+
calendar = true,
129+
none = true
130+
) }}

en/option/component/legend.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ When `'scroll'` used, these options below can be used for detailed configuration
4949
componentName = "legend"
5050
) }}
5151

52+
{{ use: partial-coord-sys(
53+
version = '6.0.0',
54+
nonSeriesComponentMainType = "legend",
55+
coordSysDefault = "'none'",
56+
matrix = true,
57+
calendar = true,
58+
none = true
59+
) }}
60+
5261
## orient(string) = 'horizontal'
5362

5463
<ExampleUIControlEnum options="vertical,horizontal" default="horizontal" />

en/option/component/parallel.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
defaultBottom = 60
2121
) }}
2222

23+
{{ use: partial-coord-sys(
24+
version = '6.0.0',
25+
nonSeriesComponentMainType = "parallel",
26+
coordSysDefault = "'none'",
27+
matrix = true,
28+
calendar = true,
29+
none = true
30+
) }}
31+
32+
2333
## layout(string) = 'horizontal'
2434

2535
<ExampleUIControlEnum options="horizontal,vertical" default="horizontal" />

0 commit comments

Comments
 (0)