Skip to content

Commit f93121a

Browse files
authored
Merge pull request #466 from apache/feat-coord-sys
Feat coord sys
2 parents 7054864 + 594cc7d commit f93121a

Some content is hidden

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

72 files changed

+1152
-109
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 ---

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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
{{ target: geo-common }}
33

4+
{{ if: ${inMap} }}
5+
{{ var: componentNameInLink = 'series-map' }}
6+
{{ else }}
7+
{{ var: componentNameInLink = 'geo' }}
8+
{{ /if }}
9+
410
#${prefix} map(string) = ''
511

612
Map name registered in [registerMap](api.html#echarts.registerMap).
@@ -173,9 +179,13 @@ center: project([115.97, 29.71])
173179

174180
#${prefix} aspectScale(number) = 0.75
175181

176-
Used to scale aspect of geo. Will be ignored if `projection` is set.
182+
Used to scale aspect of geo. It will be ignored if [proejction](~${componentNameInLink}.projection) is set.
183+
184+
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).
185+
186+
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.
177187

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

180190
#${prefix} boundingCoords(Array) = null
181191

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" />

en/option/component/polar.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,14 @@ Polar coordinate can be used in scatter and line chart. Every polar coordinate h
1818
disableArray = false
1919
) }}
2020

21+
{{ use: partial-coord-sys(
22+
version = '6.0.0',
23+
nonSeriesComponentMainType = "polar",
24+
coordSysDefault = "'none'",
25+
matrix = true,
26+
calendar = true,
27+
none = true
28+
) }}
29+
2130
{{ use: partial-tooltip-in-coords() }}
2231

en/option/component/radar.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Here is a custom example of radar component.
2020
defaultRadius = "75%"
2121
) }}
2222

23+
{{ use: partial-coord-sys(
24+
version = '6.0.0',
25+
nonSeriesComponentMainType = "radar",
26+
coordSysDefault = "'none'",
27+
matrix = true,
28+
calendar = true,
29+
none = true
30+
) }}
31+
2332
## startAngle(number) = 90
2433

2534
The start angle of coordinate, which is the angle of the first indicator axis.

en/option/component/timeline.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ Position of the play button, whose valid values are `'left'` and `'right'`.
181181
componentName = 'timeline'
182182
) }}
183183

184+
{{ use: partial-coord-sys(
185+
version = '6.0.0',
186+
nonSeriesComponentMainType = "timeline",
187+
coordSysDefault = "'none'",
188+
matrix = true,
189+
calendar = true,
190+
none = true
191+
) }}
192+
184193
## padding(number|Array) = 5
185194

186195
<ExampleUIControlVector default="5,5,5,5" dims="T,R,B,L" />

0 commit comments

Comments
 (0)