You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2025/08/06 23:40:36 UTC
(echarts-examples) branch v6-examples-supplement created (now e4a8c8b4)
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a change to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
at e4a8c8b4 Add thumb for new examples.
This branch includes the following new commits:
new b1a5b739 infra: Suport internal API `retrieveViewCoordSysRects` in example.
new 9ea7b6a9 infra: Rename meta prop `ignore` to `excludeFromGallery` for self-explanatory.
new eaff1c91 infra: Only remove the first JS comment block (treated as metadata).
new 667970d8 infra: Add version since in editor page, and tweak version since in gallery page.
new f2e66f25 infra: (1) Rename 'excludeFromGallery' to 'noExplore'. (2) Support metadata in doc-example/xxx .
new 5299dded Add example.
new afe44a9b (1) Add since and noExplore to examples.
new d723e596 Call build:example to update chart-list-data.js . Previous manually update of chart-list-data.js has been synchronized.
new 452ad527 Fix bug introduced by the previous commit.
new e4a8c8b4 Add thumb for new examples.
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 10/10: Add thumb for new examples.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit e4a8c8b4f312c91467a26ed61459864b378f5d39
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 07:39:20 2025 +0800
Add thumb for new examples.
---
public/data/thumb-dark/geo-choropleth-scatter.png | Bin 0 -> 88181 bytes
public/data/thumb-dark/geo-choropleth-scatter.webp | Bin 0 -> 10638 bytes
public/data/thumb-dark/geo-graph.png | Bin 0 -> 94030 bytes
public/data/thumb-dark/geo-graph.webp | Bin 0 -> 12672 bytes
public/data/thumb-dark/map-iceland-pie.png | Bin 0 -> 81116 bytes
public/data/thumb-dark/map-iceland-pie.webp | Bin 0 -> 12384 bytes
public/data/thumb-dark/matrix-cartesian-tiny.png | Bin 0 -> 104727 bytes
public/data/thumb-dark/matrix-cartesian-tiny.webp | Bin 0 -> 19730 bytes
public/data/thumb/geo-choropleth-scatter.png | Bin 0 -> 73844 bytes
public/data/thumb/geo-choropleth-scatter.webp | Bin 0 -> 8818 bytes
public/data/thumb/geo-graph.png | Bin 0 -> 79292 bytes
public/data/thumb/geo-graph.webp | Bin 0 -> 11444 bytes
public/data/thumb/map-iceland-pie.png | Bin 0 -> 59086 bytes
public/data/thumb/map-iceland-pie.webp | Bin 0 -> 7460 bytes
public/data/thumb/matrix-cartesian-tiny.png | Bin 0 -> 84290 bytes
public/data/thumb/matrix-cartesian-tiny.webp | Bin 0 -> 18554 bytes
16 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/public/data/thumb-dark/geo-choropleth-scatter.png b/public/data/thumb-dark/geo-choropleth-scatter.png
new file mode 100644
index 00000000..1762f197
Binary files /dev/null and b/public/data/thumb-dark/geo-choropleth-scatter.png differ
diff --git a/public/data/thumb-dark/geo-choropleth-scatter.webp b/public/data/thumb-dark/geo-choropleth-scatter.webp
new file mode 100644
index 00000000..549e2428
Binary files /dev/null and b/public/data/thumb-dark/geo-choropleth-scatter.webp differ
diff --git a/public/data/thumb-dark/geo-graph.png b/public/data/thumb-dark/geo-graph.png
new file mode 100644
index 00000000..3359ed79
Binary files /dev/null and b/public/data/thumb-dark/geo-graph.png differ
diff --git a/public/data/thumb-dark/geo-graph.webp b/public/data/thumb-dark/geo-graph.webp
new file mode 100644
index 00000000..ebf42c84
Binary files /dev/null and b/public/data/thumb-dark/geo-graph.webp differ
diff --git a/public/data/thumb-dark/map-iceland-pie.png b/public/data/thumb-dark/map-iceland-pie.png
new file mode 100644
index 00000000..31c54abf
Binary files /dev/null and b/public/data/thumb-dark/map-iceland-pie.png differ
diff --git a/public/data/thumb-dark/map-iceland-pie.webp b/public/data/thumb-dark/map-iceland-pie.webp
new file mode 100644
index 00000000..b93cdea4
Binary files /dev/null and b/public/data/thumb-dark/map-iceland-pie.webp differ
diff --git a/public/data/thumb-dark/matrix-cartesian-tiny.png b/public/data/thumb-dark/matrix-cartesian-tiny.png
new file mode 100644
index 00000000..366c9574
Binary files /dev/null and b/public/data/thumb-dark/matrix-cartesian-tiny.png differ
diff --git a/public/data/thumb-dark/matrix-cartesian-tiny.webp b/public/data/thumb-dark/matrix-cartesian-tiny.webp
new file mode 100644
index 00000000..e45bec8e
Binary files /dev/null and b/public/data/thumb-dark/matrix-cartesian-tiny.webp differ
diff --git a/public/data/thumb/geo-choropleth-scatter.png b/public/data/thumb/geo-choropleth-scatter.png
new file mode 100644
index 00000000..93a4f461
Binary files /dev/null and b/public/data/thumb/geo-choropleth-scatter.png differ
diff --git a/public/data/thumb/geo-choropleth-scatter.webp b/public/data/thumb/geo-choropleth-scatter.webp
new file mode 100644
index 00000000..c8a3c60c
Binary files /dev/null and b/public/data/thumb/geo-choropleth-scatter.webp differ
diff --git a/public/data/thumb/geo-graph.png b/public/data/thumb/geo-graph.png
new file mode 100644
index 00000000..3c453b3d
Binary files /dev/null and b/public/data/thumb/geo-graph.png differ
diff --git a/public/data/thumb/geo-graph.webp b/public/data/thumb/geo-graph.webp
new file mode 100644
index 00000000..6a9a9036
Binary files /dev/null and b/public/data/thumb/geo-graph.webp differ
diff --git a/public/data/thumb/map-iceland-pie.png b/public/data/thumb/map-iceland-pie.png
new file mode 100644
index 00000000..be66fc44
Binary files /dev/null and b/public/data/thumb/map-iceland-pie.png differ
diff --git a/public/data/thumb/map-iceland-pie.webp b/public/data/thumb/map-iceland-pie.webp
new file mode 100644
index 00000000..73d62f8f
Binary files /dev/null and b/public/data/thumb/map-iceland-pie.webp differ
diff --git a/public/data/thumb/matrix-cartesian-tiny.png b/public/data/thumb/matrix-cartesian-tiny.png
new file mode 100644
index 00000000..f630dfad
Binary files /dev/null and b/public/data/thumb/matrix-cartesian-tiny.png differ
diff --git a/public/data/thumb/matrix-cartesian-tiny.webp b/public/data/thumb/matrix-cartesian-tiny.webp
new file mode 100644
index 00000000..3695573e
Binary files /dev/null and b/public/data/thumb/matrix-cartesian-tiny.webp differ
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 02/10: infra: Rename meta prop `ignore` to `excludeFromGallery` for self-explanatory.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit 9ea7b6a9795ba5a91b955e4d4f88be55da220949
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 01:42:43 2025 +0800
infra: Rename meta prop `ignore` to `excludeFromGallery` for self-explanatory.
---
tool/build-example.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tool/build-example.js b/tool/build-example.js
index 71bba40e..321ac327 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -316,8 +316,8 @@ async function takeScreenshot(
};
}
- if (fmResult.data.ignore) {
- // `fmResult.data.ignore` is boolean if writing `/* ignore: true */` in code.
+ if (fmResult.data.excludeFromGallery) {
+ // `fmResult.data.excludeFromGallery` is boolean if writing `/* excludeFromGallery: true */` in code.
continue;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 08/10: Call build:example to update chart-list-data.js . Previous manually update of chart-list-data.js has been synchronized.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit d723e596f4601f7582551877f47b57337abd2f42
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 05:39:37 2025 +0800
Call build:example to update chart-list-data.js . Previous manually update of chart-list-data.js has been synchronized.
---
src/data/chart-list-data-gl.js | 8 +-
src/data/chart-list-data.js | 855 +++++++++++++++++++++++++++++++++++++++--
2 files changed, 822 insertions(+), 41 deletions(-)
diff --git a/src/data/chart-list-data-gl.js b/src/data/chart-list-data-gl.js
index bc2e3939..b453145f 100644
--- a/src/data/chart-list-data-gl.js
+++ b/src/data/chart-list-data-gl.js
@@ -1,6 +1,10 @@
/* eslint-disable */
-// THIS FILE IS GENERATED, DON'T MODIFY */
+
+// -------------------------------------------------
+// ! THIS FILE IS AUTO-GENERATED. DO NOT MODIFY IT !
+// -------------------------------------------------
+
export default [
{
"category": [
@@ -664,4 +668,4 @@ export default [
"titleCN": "Transparent Bar3D",
"difficulty": 10
}
-]
\ No newline at end of file
+]
diff --git a/src/data/chart-list-data.js b/src/data/chart-list-data.js
index 5eaf7d0c..abd405b7 100644
--- a/src/data/chart-list-data.js
+++ b/src/data/chart-list-data.js
@@ -1,6 +1,10 @@
/* eslint-disable */
-// THIS FILE IS GENERATED, DON'T MODIFY */
+
+// -------------------------------------------------
+// ! THIS FILE IS AUTO-GENERATED. DO NOT MODIFY IT !
+// -------------------------------------------------
+
export default [
{
"category": [
@@ -1075,6 +1079,18 @@ export default [
"titleCN": "阶段速度仪表盘",
"difficulty": 3
},
+ {
+ "category": [
+ "map",
+ "graph"
+ ],
+ "id": "geo-graph",
+ "ts": true,
+ "tags": [],
+ "title": "Geo Graph",
+ "titleCN": "地理坐标系上的关系图",
+ "difficulty": 3
+ },
{
"category": [
"graph"
@@ -1761,6 +1777,18 @@ export default [
"titleCN": "得分环",
"difficulty": 5
},
+ {
+ "category": [
+ "map",
+ "scatter"
+ ],
+ "id": "geo-choropleth-scatter",
+ "ts": true,
+ "tags": [],
+ "title": "Geo Choropleth and Scatter",
+ "titleCN": "地理坐标系上的等值区划图和散点图",
+ "difficulty": 5
+ },
{
"category": [
"graph"
@@ -1805,6 +1833,31 @@ export default [
"titleCN": "动态排序折线图",
"difficulty": 5
},
+ {
+ "category": [
+ "map",
+ "pie"
+ ],
+ "id": "map-iceland-pie",
+ "ts": true,
+ "tags": [],
+ "title": "Pie Charts on GEO Map",
+ "titleCN": "在地图上显示饼图",
+ "difficulty": 5,
+ "since": "5.4.0"
+ },
+ {
+ "category": [
+ "matrix"
+ ],
+ "id": "matrix-cartesian-tiny",
+ "ts": false,
+ "tags": [],
+ "title": "Tiny Charts in Matrix (Line Charts)",
+ "titleCN": "矩阵坐标系中的微型折线图",
+ "difficulty": 5,
+ "since": "6.0.0"
+ },
{
"category": [
"pie",
@@ -2648,19 +2701,6 @@ export default [
"titleCN": "地图柱状图变形动画",
"difficulty": 10
},
- {
- "category": [
- "map"
- ],
- "id": "map-bin",
- "ts": false,
- "tags": [
- "bmap"
- ],
- "title": "Binning on Map",
- "titleCN": "在地图上显示分箱图",
- "difficulty": 10
- },
{
"category": [
"map"
@@ -2683,18 +2723,6 @@ export default [
"titleCN": "2012 年美国人口统计",
"difficulty": 10
},
- {
- "category": [
- "map",
- "pie"
- ],
- "id": "map-usa-pie",
- "ts": true,
- "tags": [],
- "title": "Pie Charts on GEO Map",
- "titleCN": "在地图上显示饼图",
- "difficulty": 10
- },
{
"category": [
"map"
@@ -2718,18 +2746,6 @@ export default [
"difficulty": 10,
"since": "6.0.0"
},
- {
- "category": [
- "matrix"
- ],
- "id": "matrix-mbti",
- "ts": true,
- "tags": [],
- "title": "MBTI Partner Compatibility",
- "titleCN": "MBTI 伴侣相容性",
- "difficulty": 11,
- "since": "6.0.0"
- },
{
"category": [
"pictorialBar"
@@ -3052,6 +3068,18 @@ export default [
"titleCN": "自定义螺旋线竞速",
"difficulty": 11
},
+ {
+ "category": [
+ "matrix"
+ ],
+ "id": "matrix-mbti",
+ "ts": true,
+ "tags": [],
+ "title": "MBTI Partner Compatibility",
+ "titleCN": "MBTI 伴侣相容性",
+ "difficulty": 11,
+ "since": "6.0.0"
+ },
{
"category": [
"line",
@@ -3074,5 +3102,754 @@ export default [
"title": "Logarithmic Regression",
"titleCN": "对数回归(使用统计插件)",
"difficulty": 16
+ },
+ {
+ "category": [
+ "scatter"
+ ],
+ "id": "effectScatter-map",
+ "ts": true,
+ "tags": [],
+ "noExplore": true,
+ "title": "Air Quality",
+ "titleCN": "全国主要城市空气质量",
+ "difficulty": 2
+ },
+ {
+ "category": [
+ "heatmap"
+ ],
+ "id": "heatmap-map",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "Air Qulity",
+ "titleCN": "全国主要城市空气质量",
+ "difficulty": 3
+ },
+ {
+ "category": [],
+ "id": "doc-example/aria-decal",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/aria-decal-newspaper",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/aria-decal-simple",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/aria-pie",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/axis-label-align-min-max",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/axisPointer-handle-image",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/bar-dataZoom-filterMode",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/bar-large",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/bar-media-timeline",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/barGrid-barGap",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/candlestick-axisPointer",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/canvas-vs-svg",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/canvas-vs-svg-en",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/custom-transition-simple",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/data-transform-multiple-sort-bar",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/dataset-encode-simple0",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/geo-roam-indicator",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "geo roam indicator demo",
+ "difficulty": 10,
+ "since": "6.0.0"
+ },
+ {
+ "category": [],
+ "id": "doc-example/geo-svg-label-basic",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/geo-svg-layout-basic",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/geo-svg-named-basic",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/getting-started",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/graphic-bounding",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/grid-outerBounds",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "grid outerBounds example",
+ "difficulty": 10,
+ "since": "6.0.0"
+ },
+ {
+ "category": [],
+ "id": "doc-example/label-position",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/line-stack-tiled",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/map-example",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/map-visualMap-continuous",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/map-visualMap-continuous-text",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/map-visualMap-pieces",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/map-visualMap-piecewise-text",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/matrix-graph-box",
+ "ts": true,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10,
+ "since": "6.0.0"
+ },
+ {
+ "category": [],
+ "id": "doc-example/mix-timeline-all",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/parallel-all",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-clip",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-graphicType",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-patternSize",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-position",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-repeat",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-repeatDirection",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-repeatLayout",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-symbolBoundingDataArray",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pictorialBar-symbolSize",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pie-highlight",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pie-label-bleedMargin",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pie-label-distanceToLabelLine",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pie-label-margin",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/pie-media",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/polar-anticlockwise",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/polar-end-angle",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/polar-start-angle",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/radar",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-dataZoom-all",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-jitter-avoidOverlap",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-tutorial-dataZoom-1",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-tutorial-dataZoom-2",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-tutorial-dataZoom-3",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-visualMap-categories",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/scatter-visualMap-piecewise",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/sunburst-color",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/sunburst-highlight-ancestor",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/sunburst-highlight-descendant",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/sunburst-label-align",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/sunburst-simple",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/text-block-fragment",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/text-fregment-align",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/text-options",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/timeline-dynamic-series",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/title-block",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/treemap-borderColor",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-async",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-dynamic-data",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-loading",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step0",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step1",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step2",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step3",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step4",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/tutorial-styling-step5",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [],
+ "id": "doc-example/value-animation-simple",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "map"
+ ],
+ "id": "geo-lines",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "Migration",
+ "titleCN": "模拟迁徙",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "map"
+ ],
+ "id": "geo-map-scatter",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "map and scatter share a geo",
+ "titleCN": "map and scatter share a geo",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "map"
+ ],
+ "id": "map-bin",
+ "ts": false,
+ "tags": [
+ "bmap"
+ ],
+ "noExplore": true,
+ "title": "Binning on Map",
+ "titleCN": "在地图上显示分箱图",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "map"
+ ],
+ "id": "map-polygon",
+ "ts": false,
+ "tags": [
+ "bmap"
+ ],
+ "noExplore": true,
+ "title": "Draw Polygon on Map",
+ "titleCN": "在地图上绘制多边形",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "scatter"
+ ],
+ "id": "scatter-map",
+ "ts": false,
+ "tags": [],
+ "noExplore": true,
+ "title": "Air Quality",
+ "titleCN": "全国主要城市空气质量",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "scatter"
+ ],
+ "id": "scatter-map-brush",
+ "ts": true,
+ "tags": [],
+ "noExplore": true,
+ "title": "Scatter Map Brush",
+ "titleCN": "Scatter Map Brush",
+ "difficulty": 10
+ },
+ {
+ "category": [
+ "scatter"
+ ],
+ "id": "scatter-weibo",
+ "ts": true,
+ "tags": [],
+ "noExplore": true,
+ "title": "Sign in of weibo",
+ "titleCN": "微博签到数据点亮中国",
+ "difficulty": 10
}
-]
\ No newline at end of file
+]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 01/10: infra: Suport internal API `retrieveViewCoordSysRects` in example.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit b1a5b7397a779266005f120691a0c70fbf8c9987
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 01:40:12 2025 +0800
infra: Suport internal API `retrieveViewCoordSysRects` in example.
---
src/editor/sandbox/setup.js | 64 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/src/editor/sandbox/setup.js b/src/editor/sandbox/setup.js
index 968c7ca2..4226f42e 100644
--- a/src/editor/sandbox/setup.js
+++ b/src/editor/sandbox/setup.js
@@ -252,6 +252,8 @@ function setup(isShared) {
appEnv = {};
appStore = store;
+ initInternalAPI(appEnv);
+
try {
// run the code
const compiledCode = store.runCode
@@ -486,6 +488,68 @@ function setup(isShared) {
});
}
+ /**
+ * This is some features that requires echarts internal API.
+ * Inappropriate to public to users for production usage, but useful in demo.
+ * Usage in examples code:
+ * ```js
+ * app.__internalAPI.xxx(myChart, otherArgs);
+ * ```
+ */
+ function initInternalAPI(appEnv) {
+ const internalAPI = appEnv.__internalAPI = {};
+
+ /**
+ * @param {{
+ * mainType: ComponentMainType;
+ * subType?: ComponentSubType;
+ * index?: number | number[];
+ * id?: OptionId | OptionId[];
+ * name?: OptionName | OptionName[];
+ * }} queryParam For example:
+ * {mainType: 'series', subType: 'map', id: 'xxx'}
+ * {mainType: 'geo', id: 'xxx'}
+ */
+ internalAPI.retrieveViewCoordSysRects = function (myChart, queryParam) {
+ if (!queryParam
+ || (
+ queryParam.index == null
+ && queryParam.id == null
+ && queryParam.name == null
+ )
+ ) {
+ throw new Error('queryParam must have either index, id or name.');
+ }
+ const component = myChart.getModel().queryComponents(queryParam)[0];
+ if (!component) {
+ throw new Error('No component found for the given queryParam.');
+ }
+ const viewCoordSys = component.coordinateSystem;
+ if (!viewCoordSys) {
+ throw new Error('The component does not have a view coordinate system.');
+ }
+ ecInternalAPIExistingCheck(viewCoordSys, 'getViewRect');
+ ecInternalAPIExistingCheck(viewCoordSys, 'getBoundingRect');
+
+ const viewRect = viewCoordSys.getViewRect().clone();
+ const contentBoundingRect = viewCoordSys.getBoundingRect().clone();
+ const trans = viewCoordSys.getComputedTransform();
+ if (trans) {
+ contentBoundingRect.applyTransform(trans);
+ }
+ return {
+ viewRect,
+ contentBoundingRect
+ };
+ };
+
+ function ecInternalAPIExistingCheck(host, apiName) {
+ if (!host[apiName]) {
+ throw new Error(`The internal API \`${apiName}\` probably have breaking changes.`);
+ }
+ }
+ }
+
echarts.registerPreprocessor(function (option) {
if (appStore.enableDecal) {
option.aria = option.aria || {};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 05/10: infra: (1) Rename 'excludeFromGallery' to 'noExplore'. (2) Support metadata in doc-example/xxx .
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit f2e66f25f4e7cb843d231e1ea5dc0d3f70436a1c
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 04:40:03 2025 +0800
infra: (1) Rename 'excludeFromGallery' to 'noExplore'. (2) Support metadata in doc-example/xxx .
---
README.md | 8 +--
src/explore/Explore.vue | 3 +
tool/build-example.js | 170 ++++++++++++++++++++++++++----------------------
3 files changed, 101 insertions(+), 80 deletions(-)
diff --git a/README.md b/README.md
index 0b3bef9b..19a267df 100644
--- a/README.md
+++ b/README.md
@@ -40,20 +40,20 @@ since: 6.0.0
Note:
- The metadata, i.e., the first JavaScript comment block, will be removed when displaying the source code in editor page.
-- If you want the example to be included in the [example gallery page](https://echarts.apache.org/examples/en/index.html)
+- If you want the example to be included in the [example exploration page](https://echarts.apache.org/examples/en/index.html)
- metadata properies `title` and `category` must be provided.
- - must no `excludeFromGallery: true`.
+ - must no `noExplore: true`.
- The example should under `public/examples/ts/` folder directly, rather than in folder `public/examples/ts/doc-example/`.
- **Do not modify the file path of existing examples**, unless you search and update all the links in `echarts-doc` correspondingly.
Metadata properties can be:
+ `title`: Optional. String.
+ `titleCN`: Optional. String.
-+ `category`: Optional. String list. That is the main categories in [example gallery page](https://echarts.apache.org/examples/en/index.html). If multiple categories need to be specified, use quotation marks and commas like `/* category: 'line, visualMap' */`
++ `category`: Optional. String list. That is the main categories in [example exploration page](https://echarts.apache.org/examples/en/index.html). If multiple categories need to be specified, use quotation marks and commas like `/* category: 'line, visualMap' */`
+ `since`: Optional. Semver version string. Recommended to add it to hint users the available echarts versions. For example, `/* since: 6.0.0 */`. Do not use `v6.0.0`, must follow Semver format.
+ `difficulty`: Optional. Number.
+ `theme`: Optional. String.
-+ `excludeFromGallery`: Optional. Boolean. Indicate that exclude this example from [example gallery page](https://echarts.apache.org/examples/en/index.html).
++ `noExplore`: Optional. Boolean. Indicate that exclude this example from [example exploration page](https://echarts.apache.org/examples/en/index.html).
+ `videoStart` and `videoEnd`: Optional. Number. Record a video to show the animation when genering screenshot. For example,
```js
/*
diff --git a/src/explore/Explore.vue b/src/explore/Explore.vue
index 2f9902b9..cb3c36e4 100644
--- a/src/explore/Explore.vue
+++ b/src/explore/Explore.vue
@@ -146,6 +146,9 @@ export default {
if (BLACK_MAP.hasOwnProperty(example.id)) {
continue;
}
+ if (example.noExplore) {
+ continue;
+ }
if (typeof example.category === 'string') {
example.category = [example.category];
}
diff --git a/tool/build-example.js b/tool/build-example.js
index 321ac327..362f506e 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -14,6 +14,7 @@ const { compareImage } = require('../common/compareImage');
const { runTasks } = require('../common/task');
const nStatic = require('node-static');
const shell = require('shelljs');
+const assert = require('assert');
function optionToJson(obj, prop) {
let json = JSON.stringify(
@@ -275,96 +276,113 @@ async function takeScreenshot(
let server; // Declare server at function scope
const examplesRoot = `${rootDir}public/examples`;
- const files = await globby(`js/${isGL ? 'gl/' : ''}*.js`, {
+ const filesPrimary = await globby(`js/${isGL ? 'gl/' : ''}*.js`, {
+ cwd: examplesRoot,
+ absolute: true
+ });
+ const filesInDocExampleFolder = isGL ? [] : await globby(`js/doc-example/*.js`, {
cwd: examplesRoot,
absolute: true
});
const exampleList = [];
+ const thumbTasks = [];
- let thumbTasks = [];
-
- for (let theme of themeList) {
- for (let fileName of files) {
- const basename = path.basename(fileName, '.js');
-
- // Remove mapbox temporary
- if (
- basename.indexOf('mapbox') >= 0 ||
- basename.indexOf('shanghai') >= 0 ||
- basename === 'lines3d-taxi-routes-of-cape-town' ||
- basename === 'lines3d-taxi-chengdu' ||
- basename === 'map3d-colorful-cities' ||
- // TODO Examples that can't work temporary.
- basename === 'bar3d-music-visualization'
- ) {
- continue;
- }
+ for (const theme of themeList) {
+ for (const fileAbsPath of filesPrimary) {
+ handleSingleFile(fileAbsPath, theme, false);
+ }
+ }
+ for (const fileAbsPath of filesInDocExampleFolder) {
+ handleSingleFile(fileAbsPath, null, true);
+ }
- const tsFile = `${examplesRoot}/ts/${isGL ? 'gl/' : ''}${basename}.ts`;
- const hasTs = fs.existsSync(tsFile);
+ function handleSingleFile(fileAbsPath, thumbTheme, noThumb) {
+ const relativePath = path.relative(path.join(examplesRoot, 'js'), fileAbsPath);
+ assert(relativePath !== '' && relativePath.indexOf('.') !== 0 && !path.isAbsolute(relativePath));
+ const exampleId = relativePath.replace(/\.js$/, '');
+
+ // Remove mapbox temporary
+ if (
+ exampleId.indexOf('mapbox') >= 0 ||
+ exampleId.indexOf('shanghai') >= 0 ||
+ exampleId === 'lines3d-taxi-routes-of-cape-town' ||
+ exampleId === 'lines3d-taxi-chengdu' ||
+ exampleId === 'map3d-colorful-cities' ||
+ // TODO Examples that can't work temporary.
+ exampleId === 'bar3d-music-visualization'
+ ) {
+ return;
+ }
- let fmResult;
- try {
- const code = fs.readFileSync(fileName, 'utf-8');
- fmResult = matter(code, {
- delimiters: ['/*', '*/']
- });
- } catch (e) {
- fmResult = {
- data: {}
- };
- }
+ const tsFile = path.normalize(`${examplesRoot}/ts/${isGL ? 'gl/' : ''}${exampleId}.ts`);
+ const hasTs = fs.existsSync(tsFile);
- if (fmResult.data.excludeFromGallery) {
- // `fmResult.data.excludeFromGallery` is boolean if writing `/* excludeFromGallery: true */` in code.
- continue;
- }
+ let fmResult;
+ try {
+ const code = fs.readFileSync(fileAbsPath, 'utf-8');
+ fmResult = matter(code, {
+ delimiters: ['/*', '*/']
+ });
+ } catch (e) {
+ fmResult = {
+ data: {}
+ };
+ }
- try {
- const difficulty =
- fmResult.data.difficulty != null ? fmResult.data.difficulty : 10;
- const category = (fmResult.data.category || '')
- .split(/,/g)
- .map((a) => a.trim())
- .filter((a) => !!a);
-
- if (!exampleList.find((item) => item.id === basename)) {
- // Avoid add multiple times when has multiple themes.
- exampleList.push({
- category: category,
- id: basename,
- ts: hasTs,
- tags: (fmResult.data.tags || '')
- .split(/,/g)
- .map((a) => a.trim())
- .filter((a) => !!a),
- theme: fmResult.data.theme,
- title: fmResult.data.title,
- titleCN: fmResult.data.titleCN,
- difficulty: +difficulty,
- since: fmResult.data.since,
- });
- }
- } catch (e) {
- throw new Error(e.toString());
- }
+ // `fmResult.data.noExplore` is boolean if writing `/* noExplore: true */` in code.
+ const noExplore = fmResult.data.noExplore;
- if (
- !matchPattern ||
- (matchPattern.some(function (pattern) {
- return minimatch(basename, pattern);
- }) &&
- screenshotBlackList.indexOf(basename) < 0)
- ) {
- thumbTasks.push({
- theme,
- fmResult,
- basename
+ try {
+ const difficulty =
+ fmResult.data.difficulty != null ? fmResult.data.difficulty : 10;
+ const category = (fmResult.data.category || '')
+ .split(/,/g)
+ .map((a) => a.trim())
+ .filter((a) => !!a);
+
+ if (!exampleList.find((item) => item.id === exampleId)) {
+ // Avoid add multiple times when has multiple themes.
+ exampleList.push({
+ category: category,
+ id: exampleId,
+ ts: hasTs,
+ tags: (fmResult.data.tags || '')
+ .split(/,/g)
+ .map((a) => a.trim())
+ .filter((a) => !!a),
+ noExplore: noExplore,
+ theme: fmResult.data.theme,
+ title: fmResult.data.title,
+ titleCN: fmResult.data.titleCN,
+ difficulty: +difficulty,
+ since: fmResult.data.since,
});
}
+ } catch (e) {
+ throw new Error(e.toString());
}
- }
+
+ if (
+ !noThumb
+ && !noExplore
+ && (
+ !matchPattern
+ || (
+ matchPattern.some(function (pattern) {
+ return minimatch(exampleId, pattern);
+ })
+ && screenshotBlackList.indexOf(exampleId) < 0
+ )
+ )
+ ) {
+ thumbTasks.push({
+ thumbTheme,
+ fmResult,
+ exampleId
+ });
+ }
+ } // End of handleSingleFile
exampleList.sort(function (a, b) {
if (a.difficulty === b.difficulty) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 06/10: Add example.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit 5299ddedb5a87b6633c258e5dce088b03388bc41
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 04:41:18 2025 +0800
Add example.
---
.../examples/ts/doc-example/geo-roam-indicator.js | 235 +++++++++++++++++++++
public/examples/ts/doc-example/grid-outerBounds.js | 188 +++++++++--------
2 files changed, 337 insertions(+), 86 deletions(-)
diff --git a/public/examples/ts/doc-example/geo-roam-indicator.js b/public/examples/ts/doc-example/geo-roam-indicator.js
new file mode 100644
index 00000000..57e93ca2
--- /dev/null
+++ b/public/examples/ts/doc-example/geo-roam-indicator.js
@@ -0,0 +1,235 @@
+/*
+title: geo roam indicator demo
+noExplore: true
+since: 6.0.0
+*/
+
+function updateChart() {
+ option = {
+ title: {
+ text: 'Drag or pinch to roam the map',
+ },
+ tooltip: {},
+ geo: {
+ id: 'my_geo',
+ map: 'iceland',
+ aspectScale: Math.cos(65 * Math.PI / 180),
+
+ preserveAspect: app.config.preserveAspect,
+ preserveAspectAlign: app.config.preserveAspectAlign,
+ preserveAspectVerticalAlign: app.config.preserveAspectVerticalAlign,
+ clip: app.config.clip,
+ roam: true,
+ // Note: if `clip: true; roamTrigger: 'global'`,
+ // roaming can only be triggered inside the clip area.
+ roamTrigger: app.config.roamTrigger,
+
+ // These props determine a rectangular area for the geo component:
+ left: app.config['geo.left'],
+ right: app.config['geo.right'],
+ top: app.config['geo.top'],
+ bottom: app.config['geo.bottom'],
+ },
+ };
+
+ myChart.setOption(option);
+
+ setTimeout(function () {
+ updateIndicators();
+ });
+}
+
+function initChart() {
+
+ myChart.on('georoam', function () {
+ updateIndicators();
+ });
+ myChart.on('resize', function () {
+ updateIndicators();
+ });
+
+ updateChart();
+}
+
+/**
+ * The rectangular indicators for tutorial purposes:
+ * - `geo_allocated_rect`:
+ * Determined by `geo.left`/`.right`/`.top`/`.bottom`/`.width`/`.height`/`.aspectScale`.
+ * - `geo_view_rect`:
+ * Determined by `geo_allocated_rect`
+ * and `geo.preserveAspect`/`.preserveAspectAlign`/`.preserveAspectVerticalAlign`.
+ * - `geo_content_bounding_rect`:
+ * Determined by `geo.map`/`.projection`/`.center`/`.zoom`.
+ */
+function updateIndicators() {
+ if (!_indicatorInfraRegistered) {
+ _indicatorInfraRegistered = true;
+ echarts.registerMap('geo_allocated_rect_indicator_fake_map', {
+ geoJSON: {
+ type: 'FeatureCollection',
+ features: [{
+ type: 'Feature',
+ geometry: {
+ type: 'Polygon',
+ coordinates: [[[0, 0], [0, 100], [100, 100], [100, 0]]]
+ },
+ properties: {
+ name: 'geo_allocated_rect (determined by geo.left/right/top/bottom)',
+ cp: [50, 98]
+ }
+ }]
+ }
+ });
+ }
+
+ var ignore = !app.config.showRectIndicators;
+ var indicatorRects = app.__internalAPI.retrieveViewCoordSysRects(myChart, {mainType: 'geo', id: 'my_geo'});
+
+ var colors = [
+ '#3B82F6',
+ '#10B981',
+ '#F59E0B'
+ ];
+
+ var indicatorsOption = {
+ // Tricky: Use another geo component just as an indicator for convenience.
+ geo: {
+ id: 'geo_allocated_rect_indicator',
+ map: 'geo_allocated_rect_indicator_fake_map',
+ aspectScale: 1,
+ roam: false,
+ zoom: 1,
+ silent: true,
+ itemStyle: {
+ borderColor: colors[0],
+ borderWidth: 1,
+ borderType: 'dashed',
+ color: 'transparent',
+ },
+ label: {
+ show: true,
+ padding: 2,
+ color: colors[0],
+ borderColor: '#fff',
+ lineWidth: 2,
+ },
+ z: -12,
+ show: !ignore,
+
+ left: app.config['geo.left'],
+ right: app.config['geo.right'],
+ top: app.config['geo.top'],
+ bottom: app.config['geo.bottom'],
+ },
+ graphic: {
+ elements: [{
+ id: 'geo_view_rect_indicator',
+ type: 'rect',
+ silent: true,
+ z: -9,
+ style: {
+ // fill: '#e0e0e0',
+ fill: 'none',
+ stroke: colors[1],
+ lineWidth: 1,
+ lineDash: 'dashed',
+ },
+ textContent: {
+ type: 'text',
+ style: {
+ text: 'geo_view_rect\n(determined by applying `preserveAspect` to geo_allocated_rect)',
+ fill: colors[1],
+ padding: 2,
+ stroke: '#fff',
+ lineWidth: 2,
+ fontSize: 12,
+ },
+ z: -8,
+ },
+ textConfig: {
+ position: 'insideTopLeft',
+ },
+ ignore: ignore,
+ shape: indicatorRects.viewRect,
+ }, {
+ id: 'geo_content_bounding_rect_indicator',
+ type: 'rect',
+ silent: true,
+ z: -6,
+ style: {
+ fill: 'none',
+ stroke: colors[2],
+ lineWidth: 1,
+ lineDash: 'dashed',
+ },
+ textContent: {
+ type: 'text',
+ style: {
+ text: 'geo_content_bounding_rect',
+ fill: colors[2],
+ padding: 2,
+ stroke: '#fff',
+ lineWidth: 2,
+ fontSize: 12,
+ },
+ z: -5,
+ },
+ textConfig: {
+ position: 'insideTop'
+ },
+ ignore: ignore,
+ shape: indicatorRects.contentBoundingRect,
+ }]
+ }
+ }; // End of indicatorsOption
+
+ myChart.setOption(indicatorsOption);
+}
+var _indicatorInfraRegistered = false;
+
+/**
+ * Note: The floating control panel are not relevant to echarts API,
+ * just for illustration purposes.
+ */
+function initFloatingControlPanelAndContext() {
+ app.config = {};
+
+ app.configParameters = {};
+ app.config.showRectIndicators = true;
+ app.configParameters.showRectIndicators = {options: [true, false]};
+ app.config.clip = true;
+ app.configParameters.clip = {options: [true, false]};
+ app.config.preserveAspect = true;
+ app.configParameters.preserveAspect = {options: [true, false, 'contain', 'cover']};
+ app.config.preserveAspectAlign = 'center';
+ app.configParameters.preserveAspectAlign = {options: ['center', 'left', 'right']};
+ app.config.preserveAspectVerticalAlign = 'middle';
+ app.configParameters.preserveAspectVerticalAlign = {options: ['middle', 'top', 'bottom']};
+ app.config.roamTrigger = 'selfRect';
+ app.configParameters.roamTrigger = {options: ['selfRect', 'global']};
+ app.config['geo.left'] = 100;
+ app.configParameters['geo.left'] = {min: 0, max: 500};
+ app.config['geo.right'] = 100;
+ app.configParameters['geo.right'] = {min: 0, max: 500};
+ app.config['geo.top'] = 100;
+ app.configParameters['geo.top'] = {min: 0, max: 500};
+ app.config['geo.bottom'] = 100;
+ app.configParameters['geo.bottom'] = {min: 0, max: 500};
+
+ app.config.onChange = function () {
+ updateChart();
+ };
+}
+
+initFloatingControlPanelAndContext();
+
+myChart.showLoading();
+$.get(ROOT_PATH + '/data/asset/geo/iceland.geo.json', function (geoJSON) {
+ myChart.hideLoading();
+
+
+ echarts.registerMap('iceland', geoJSON);
+
+ initChart();
+});
+
diff --git a/public/examples/ts/doc-example/grid-outerBounds.js b/public/examples/ts/doc-example/grid-outerBounds.js
index b7404fcc..20106b67 100644
--- a/public/examples/ts/doc-example/grid-outerBounds.js
+++ b/public/examples/ts/doc-example/grid-outerBounds.js
@@ -1,92 +1,18 @@
-app.config = {};
-app.configParameters = {};
-
-app.config.showRectIndicators = true;
-app.configParameters.showRectIndicators = {options: [false, true]};
-app.config.xAxisType = 'value';
-app.configParameters.xAxisType = {options: ['value', 'category', 'time', 'log']},
-app.config.yAxisType = 'value';
-app.configParameters.yAxisType = {options: ['value', 'category', 'time', 'log']};
-app.config.containLabel = false;
-app.configParameters.containLabel = {options: [false, true]};
-app.config.outerBoundsMode = 'auto';
-app.configParameters.outerBoundsMode = {options: ['auto', 'same', 'none']};
-app.config.chartDataLength = 'medium_data';
-app.configParameters.chartDataLength = {options: ['small_data', 'medium_data', 'big_data']};
-app.config.xAxisNameLocation = 'center';
-app.configParameters.xAxisNameLocation = {options: ['center', 'start', 'end']};
-app.config.yAxisNameLocation = 'center';
-app.configParameters.yAxisNameLocation = {options: ['end', 'center', 'start']};
-app.config.xAxisLabelRotate = 0;
-app.configParameters.xAxisLabelRotate = {options: [0, 30, 45, 60, 90]};
-app.config.yAxisLabelRotate = 0;
-app.configParameters.yAxisLabelRotate = {options: [0, 30, 45, 60, 90]};
-app.config.hideOverlap = false;
-app.configParameters.hideOverlap = {options: [true, false]};
-app.config.yAxisCount = 1;
-app.configParameters.yAxisCount = {options: [1, 2]};
-app.config['grid.left'] = 70;
-app.config['grid.right'] = 260;
-app.config['grid.top'] = 50;
-app.config['grid.bottom'] = 45;
-app.configParameters['grid.left'] = {min: 0, max: 500};
-app.configParameters['grid.right'] = {min: 0, max: 500};
-app.configParameters['grid.top'] = {min: 0, max: 500};
-app.configParameters['grid.bottom'] = {min: 0, max: 500};
-app.config['grid.outerBounds.left'] = 0;
-app.config['grid.outerBounds.right'] = 0;
-app.config['grid.outerBounds.top'] = 0;
-app.config['grid.outerBounds.bottom'] = 0;
-app.configParameters['grid.outerBounds.left'] = {min: 0, max: 500};
-app.configParameters['grid.outerBounds.right'] = {min: 0, max: 500};
-app.configParameters['grid.outerBounds.top'] = {min: 0, max: 500};
-app.configParameters['grid.outerBounds.bottom'] = {min: 0, max: 500};
-
-/**
- * Initail echarts option.
- */
-option = createOption();
-
-app.config.onChange = function () {
- chartSetOptionUpdate();
-};
-
-
-function calcOuterBoundsIndicatorShape() {
- // This implementation is an copy of echarts internal logic.
- var gridOuterBoundsParsed = {};
- var parsedOuterBoundsMode = app.config.outerBoundsMode;
- if (app.config.containLabel) {
- parsedOuterBoundsMode = 'same';
- }
- if (parsedOuterBoundsMode === 'none') {
- // 'none' effectively indicates outerBounds infinity.
- gridOuterBoundsParsed.left = -1000;
- gridOuterBoundsParsed.top = -1000;
- gridOuterBoundsParsed.right = -1000;
- gridOuterBoundsParsed.bottom = -1000;
- }
- else if (parsedOuterBoundsMode == 'same') {
- gridOuterBoundsParsed.left = app.config['grid.left'];
- gridOuterBoundsParsed.top = app.config['grid.top'];
- gridOuterBoundsParsed.right = app.config['grid.right'];
- gridOuterBoundsParsed.bottom = app.config['grid.bottom'];
- }
- else {
- gridOuterBoundsParsed = {
- left: app.config['grid.outerBounds.left'],
- top: app.config['grid.outerBounds.top'],
- right: app.config['grid.outerBounds.right'],
- bottom: app.config['grid.outerBounds.bottom']
- };
- }
- return gridOuterBoundsParsed;
-}
+/*
+title: grid outerBounds example
+noExplore: true
+since: 6.0.0
+*/
function makeAxisName({xy, idx}) {
return xy + 'Axis_' + idx + 'name';
}
+/**
+ * The rectangular indicators for tutorial purposes:
+ * - grid axis aligned rect (determined by `grid.left`/`.right`/`.top`/`.bottom`/`.width`/`.height`)
+ * - grid outer bounds rect (determined by `grid.outerBoundsMode` and `grid.outerBounds`).
+ */
function makeIndicatorOption() {
var gridOuterBoundsParsed = calcOuterBoundsIndicatorShape();
var ignore = !app.config.showRectIndicators;
@@ -104,7 +30,7 @@ function makeIndicatorOption() {
return [
{
type: 'rect',
- id: 'grid_box_indicator',
+ id: 'grid_axis_aligned_rect_indicator',
ignore,
shape: {
x: app.config['grid.left'],
@@ -335,10 +261,100 @@ function createOption() {
};
}
-function chartSetOptionUpdate(chartIdx) {
+function updateChart(chartIdx) {
var option = createOption();
myChart.setOption(
option,
{replaceMerge: ['series', 'xAxis', 'yAxis']}
);
}
+
+function calcOuterBoundsIndicatorShape() {
+ // This implementation is an copy of echarts internal logic.
+ var gridOuterBoundsParsed = {};
+ var parsedOuterBoundsMode = app.config.outerBoundsMode;
+ if (app.config.containLabel) {
+ parsedOuterBoundsMode = 'same';
+ }
+ if (parsedOuterBoundsMode === 'none') {
+ // 'none' effectively indicates outerBounds infinity.
+ gridOuterBoundsParsed.left = -1000;
+ gridOuterBoundsParsed.top = -1000;
+ gridOuterBoundsParsed.right = -1000;
+ gridOuterBoundsParsed.bottom = -1000;
+ }
+ else if (parsedOuterBoundsMode == 'same') {
+ gridOuterBoundsParsed.left = app.config['grid.left'];
+ gridOuterBoundsParsed.top = app.config['grid.top'];
+ gridOuterBoundsParsed.right = app.config['grid.right'];
+ gridOuterBoundsParsed.bottom = app.config['grid.bottom'];
+ }
+ else {
+ gridOuterBoundsParsed = {
+ left: app.config['grid.outerBounds.left'],
+ top: app.config['grid.outerBounds.top'],
+ right: app.config['grid.outerBounds.right'],
+ bottom: app.config['grid.outerBounds.bottom']
+ };
+ }
+ return gridOuterBoundsParsed;
+}
+
+/**
+ * Note: The floating control panel are not relevant to echarts API,
+ * just for illustration purposes.
+ */
+function initFloatingControlPanelAndContext() {
+ app.config = {};
+ app.configParameters = {};
+
+ app.config.showRectIndicators = true;
+ app.configParameters.showRectIndicators = {options: [false, true]};
+ app.config.xAxisType = 'value';
+ app.configParameters.xAxisType = {options: ['value', 'category', 'time', 'log']},
+ app.config.yAxisType = 'value';
+ app.configParameters.yAxisType = {options: ['value', 'category', 'time', 'log']};
+ app.config.containLabel = false;
+ app.configParameters.containLabel = {options: [false, true]};
+ app.config.outerBoundsMode = 'auto';
+ app.configParameters.outerBoundsMode = {options: ['auto', 'same', 'none']};
+ app.config.chartDataLength = 'medium_data';
+ app.configParameters.chartDataLength = {options: ['small_data', 'medium_data', 'big_data']};
+ app.config.xAxisNameLocation = 'center';
+ app.configParameters.xAxisNameLocation = {options: ['center', 'start', 'end']};
+ app.config.yAxisNameLocation = 'center';
+ app.configParameters.yAxisNameLocation = {options: ['end', 'center', 'start']};
+ app.config.xAxisLabelRotate = 0;
+ app.configParameters.xAxisLabelRotate = {options: [0, 30, 45, 60, 90]};
+ app.config.yAxisLabelRotate = 0;
+ app.configParameters.yAxisLabelRotate = {options: [0, 30, 45, 60, 90]};
+ app.config.hideOverlap = false;
+ app.configParameters.hideOverlap = {options: [true, false]};
+ app.config.yAxisCount = 1;
+ app.configParameters.yAxisCount = {options: [1, 2]};
+ app.config['grid.left'] = 70;
+ app.config['grid.right'] = 260;
+ app.config['grid.top'] = 50;
+ app.config['grid.bottom'] = 45;
+ app.configParameters['grid.left'] = {min: 0, max: 500};
+ app.configParameters['grid.right'] = {min: 0, max: 500};
+ app.configParameters['grid.top'] = {min: 0, max: 500};
+ app.configParameters['grid.bottom'] = {min: 0, max: 500};
+ app.config['grid.outerBounds.left'] = 0;
+ app.config['grid.outerBounds.right'] = 0;
+ app.config['grid.outerBounds.top'] = 0;
+ app.config['grid.outerBounds.bottom'] = 0;
+ app.configParameters['grid.outerBounds.left'] = {min: 0, max: 500};
+ app.configParameters['grid.outerBounds.right'] = {min: 0, max: 500};
+ app.configParameters['grid.outerBounds.top'] = {min: 0, max: 500};
+ app.configParameters['grid.outerBounds.bottom'] = {min: 0, max: 500};
+
+ app.config.onChange = function () {
+ updateChart();
+ };
+}
+
+
+initFloatingControlPanelAndContext();
+// Initialize echarts option.
+option = createOption();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 07/10: (1) Add since and noExplore to examples.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit afe44a9bcc94d0cf4c2582308a1684802801957e
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 05:38:45 2025 +0800
(1) Add since and noExplore to examples.
---
public/examples/ts/effectScatter-map.ts | 1 +
public/examples/ts/geo-choropleth-scatter.ts | 1 +
public/examples/ts/geo-graph.ts | 1 +
public/examples/ts/geo-lines.js | 1 +
public/examples/ts/geo-map-scatter.js | 1 +
public/examples/ts/heatmap-map.js | 1 +
public/examples/ts/map-bin.js | 1 +
public/examples/ts/map-iceland-pie.ts | 4 ++--
public/examples/ts/map-polygon.js | 1 +
public/examples/ts/matrix-cartesian-tiny.js | 2 +-
public/examples/ts/scatter-jitter.ts | 1 +
public/examples/ts/scatter-map-brush.ts | 1 +
public/examples/ts/scatter-map.js | 1 +
public/examples/ts/scatter-weibo.ts | 1 +
tool/build-example.js | 20 +++++++++++++-------
15 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/public/examples/ts/effectScatter-map.ts b/public/examples/ts/effectScatter-map.ts
index fad18600..c1fcc7f0 100644
--- a/public/examples/ts/effectScatter-map.ts
+++ b/public/examples/ts/effectScatter-map.ts
@@ -3,6 +3,7 @@ title: Air Quality
category: scatter
titleCN: 全国主要城市空气质量
difficulty: 2
+noExplore: true
*/
interface DataItem {
diff --git a/public/examples/ts/geo-choropleth-scatter.ts b/public/examples/ts/geo-choropleth-scatter.ts
index 6c407cbf..42aad273 100644
--- a/public/examples/ts/geo-choropleth-scatter.ts
+++ b/public/examples/ts/geo-choropleth-scatter.ts
@@ -2,6 +2,7 @@
title: Geo Choropleth and Scatter
category: map, scatter
titleCN: 地理坐标系上的等值区划图和散点图
+difficulty: 5
*/
function createChart() {
diff --git a/public/examples/ts/geo-graph.ts b/public/examples/ts/geo-graph.ts
index f5e5cd23..c4b8d905 100644
--- a/public/examples/ts/geo-graph.ts
+++ b/public/examples/ts/geo-graph.ts
@@ -2,6 +2,7 @@
title: Geo Graph
category: map, graph
titleCN: 地理坐标系上的关系图
+difficulty: 3
*/
function createChart() {
diff --git a/public/examples/ts/geo-lines.js b/public/examples/ts/geo-lines.js
index 11ff03a4..d3d7adff 100644
--- a/public/examples/ts/geo-lines.js
+++ b/public/examples/ts/geo-lines.js
@@ -2,6 +2,7 @@
title: Migration
category: map
titleCN: 模拟迁徙
+noExplore: true
*/
var geoCoordMap = {
diff --git a/public/examples/ts/geo-map-scatter.js b/public/examples/ts/geo-map-scatter.js
index a641d1f4..57c0298b 100644
--- a/public/examples/ts/geo-map-scatter.js
+++ b/public/examples/ts/geo-map-scatter.js
@@ -2,6 +2,7 @@
title: map and scatter share a geo
category: map
titleCN: map and scatter share a geo
+noExplore: true
*/
var data = [
diff --git a/public/examples/ts/heatmap-map.js b/public/examples/ts/heatmap-map.js
index f8f10088..66a6860d 100644
--- a/public/examples/ts/heatmap-map.js
+++ b/public/examples/ts/heatmap-map.js
@@ -2,6 +2,7 @@
title: Air Qulity
category: heatmap
titleCN: 全国主要城市空气质量
+noExplore: true
difficulty: 3
*/
diff --git a/public/examples/ts/map-bin.js b/public/examples/ts/map-bin.js
index 134dfd00..2bfe38be 100644
--- a/public/examples/ts/map-bin.js
+++ b/public/examples/ts/map-bin.js
@@ -3,6 +3,7 @@ title: Binning on Map
category: map
tags: bmap
titleCN: 在地图上显示分箱图
+noExplore: true
*/
var COLORS = ['#070093', '#1c3fbf', '#1482e5', '#70b4eb', '#b4e0f3', '#ffffff'];
diff --git a/public/examples/ts/map-iceland-pie.ts b/public/examples/ts/map-iceland-pie.ts
index 0d659832..a32fc97f 100644
--- a/public/examples/ts/map-iceland-pie.ts
+++ b/public/examples/ts/map-iceland-pie.ts
@@ -2,10 +2,10 @@
title: Pie Charts on GEO Map
category: map, pie
titleCN: 在地图上显示饼图
+since: 5.4.0
+difficulty: 5
*/
-// This example requires ECharts v5.4.0 or later
-
myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/geo/iceland.geo.json', function (geoJSON) {
diff --git a/public/examples/ts/map-polygon.js b/public/examples/ts/map-polygon.js
index b4e223b6..1f8d477d 100644
--- a/public/examples/ts/map-polygon.js
+++ b/public/examples/ts/map-polygon.js
@@ -3,6 +3,7 @@ title: Draw Polygon on Map
category: map
tags: bmap
titleCN: 在地图上绘制多边形
+noExplore: true
*/
var data = [
diff --git a/public/examples/ts/matrix-cartesian-tiny.js b/public/examples/ts/matrix-cartesian-tiny.js
index 0780319d..cc34da50 100644
--- a/public/examples/ts/matrix-cartesian-tiny.js
+++ b/public/examples/ts/matrix-cartesian-tiny.js
@@ -2,7 +2,7 @@
title: Tiny Charts in Matrix (Line Charts)
category: matrix
titleCN: 矩阵坐标系中的微型折线图
-difficulty: 2
+difficulty: 5
since: 6.0.0
*/
diff --git a/public/examples/ts/scatter-jitter.ts b/public/examples/ts/scatter-jitter.ts
index aa78170c..52020b8e 100644
--- a/public/examples/ts/scatter-jitter.ts
+++ b/public/examples/ts/scatter-jitter.ts
@@ -3,6 +3,7 @@ title: Scatter with Jittering
category: scatter
titleCN: 带抖动的散点图
difficulty: 3
+since: 6.0.0
*/
const grid = {
left: 80,
diff --git a/public/examples/ts/scatter-map-brush.ts b/public/examples/ts/scatter-map-brush.ts
index 2ad72eaa..1bd1afa4 100644
--- a/public/examples/ts/scatter-map-brush.ts
+++ b/public/examples/ts/scatter-map-brush.ts
@@ -2,6 +2,7 @@
title: Scatter Map Brush
category: scatter
titleCN: Scatter Map Brush
+noExplore: true
*/
interface DataItem {
diff --git a/public/examples/ts/scatter-map.js b/public/examples/ts/scatter-map.js
index 917f8bb7..7f3aa267 100644
--- a/public/examples/ts/scatter-map.js
+++ b/public/examples/ts/scatter-map.js
@@ -2,6 +2,7 @@
title: Air Quality
category: scatter
titleCN: 全国主要城市空气质量
+noExplore: true
*/
var geoCoordMap = {
diff --git a/public/examples/ts/scatter-weibo.ts b/public/examples/ts/scatter-weibo.ts
index 3b1ab1cb..c6715301 100644
--- a/public/examples/ts/scatter-weibo.ts
+++ b/public/examples/ts/scatter-weibo.ts
@@ -2,6 +2,7 @@
title: Sign in of weibo
category: scatter
titleCN: 微博签到数据点亮中国
+noExplore: true
*/
myChart.showLoading();
diff --git a/tool/build-example.js b/tool/build-example.js
index 362f506e..02e466d1 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -280,25 +280,27 @@ async function takeScreenshot(
cwd: examplesRoot,
absolute: true
});
+ const filesPrimaryBasePath = path.join(examplesRoot, `js${isGL ? '/gl' : ''}`);
const filesInDocExampleFolder = isGL ? [] : await globby(`js/doc-example/*.js`, {
cwd: examplesRoot,
absolute: true
});
+ const filesInDocExampleFolderBasePath = path.join(examplesRoot, 'js');
const exampleList = [];
const thumbTasks = [];
for (const theme of themeList) {
for (const fileAbsPath of filesPrimary) {
- handleSingleFile(fileAbsPath, theme, false);
+ handleSingleFile(fileAbsPath, filesPrimaryBasePath, theme, false);
}
}
for (const fileAbsPath of filesInDocExampleFolder) {
- handleSingleFile(fileAbsPath, null, true);
+ handleSingleFile(fileAbsPath, filesInDocExampleFolderBasePath, null, true);
}
- function handleSingleFile(fileAbsPath, thumbTheme, noThumb) {
- const relativePath = path.relative(path.join(examplesRoot, 'js'), fileAbsPath);
+ function handleSingleFile(fileAbsPath, fileAbsBasePath, thumbTheme, forceNoExplore) {
+ const relativePath = path.relative(fileAbsBasePath, fileAbsPath);
assert(relativePath !== '' && relativePath.indexOf('.') !== 0 && !path.isAbsolute(relativePath));
const exampleId = relativePath.replace(/\.js$/, '');
@@ -331,7 +333,7 @@ async function takeScreenshot(
}
// `fmResult.data.noExplore` is boolean if writing `/* noExplore: true */` in code.
- const noExplore = fmResult.data.noExplore;
+ const noExplore = forceNoExplore || fmResult.data.noExplore;
try {
const difficulty =
@@ -364,8 +366,7 @@ async function takeScreenshot(
}
if (
- !noThumb
- && !noExplore
+ !noExplore
&& (
!matchPattern
|| (
@@ -385,6 +386,11 @@ async function takeScreenshot(
} // End of handleSingleFile
exampleList.sort(function (a, b) {
+ const aNoExplore = a.noExplore ? 1 : 0;
+ const bNoExplore = b.noExplore ? 1 : 0;
+ if (aNoExplore !== bNoExplore) {
+ return aNoExplore - bNoExplore;
+ }
if (a.difficulty === b.difficulty) {
return a.id.localeCompare(b.id);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 09/10: Fix bug introduced by the previous commit.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit 452ad52768b963f19f9fbc4258356ae604273288
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 07:36:59 2025 +0800
Fix bug introduced by the previous commit.
---
tool/build-example.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tool/build-example.js b/tool/build-example.js
index 02e466d1..a1c85c5e 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -378,9 +378,9 @@ async function takeScreenshot(
)
) {
thumbTasks.push({
- thumbTheme,
+ theme: thumbTheme,
fmResult,
- exampleId
+ basename: exampleId
});
}
} // End of handleSingleFile
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 04/10: infra: Add version since in editor page, and tweak version since in gallery page.
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit 667970d8b953e30edb964aea76a8bcb2fffb8957
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 03:00:40 2025 +0800
infra: Add version since in editor page, and tweak version since in gallery page.
---
README.md | 2 +-
src/common/i18n.js | 4 +--
src/editor/Editor.vue | 75 ++++++++++++++++++++++++++++++---------------
src/explore/ExampleCard.vue | 15 ++++-----
4 files changed, 60 insertions(+), 36 deletions(-)
diff --git a/README.md b/README.md
index 07062d5b..0b3bef9b 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@ Metadata properties can be:
+ `title`: Optional. String.
+ `titleCN`: Optional. String.
+ `category`: Optional. String list. That is the main categories in [example gallery page](https://echarts.apache.org/examples/en/index.html). If multiple categories need to be specified, use quotation marks and commas like `/* category: 'line, visualMap' */`
-+ `since`: Optional. Semver version string. Recommended to add it to hint users the available echarts versions. For example, `/* since: 6.0.0 */`.
++ `since`: Optional. Semver version string. Recommended to add it to hint users the available echarts versions. For example, `/* since: 6.0.0 */`. Do not use `v6.0.0`, must follow Semver format.
+ `difficulty`: Optional. Number.
+ `theme`: Optional. String.
+ `excludeFromGallery`: Optional. Boolean. Indicate that exclude this example from [example gallery page](https://echarts.apache.org/examples/en/index.html).
diff --git a/src/common/i18n.js b/src/common/i18n.js
index ac3b635f..eb298fb3 100644
--- a/src/common/i18n.js
+++ b/src/common/i18n.js
@@ -9,7 +9,7 @@ export default {
infiniteLoopInEditor: 'Potential infinite loops exist in code!',
potentialRedirectionInEditor: 'Potential redirection exists in code!',
chartOK: 'Chart has been generated in ',
- bannerNew: 'Since',
+ bannerVersionRequire: 'Require ECharts',
darkMode: 'Dark Mode',
enableDecal: 'Decal Pattern',
@@ -140,7 +140,7 @@ export default {
infiniteLoopInEditor: '编辑器内容可能存在无限循环!',
potentialRedirectionInEditor: '编辑器内容可能存在重定向代码!',
chartOK: '图表已生成, ',
- bannerNew: '新增',
+ bannerVersionRequire: '依赖 ECharts',
darkMode: '深色模式',
enableDecal: '无障碍花纹',
diff --git a/src/editor/Editor.vue b/src/editor/Editor.vue
index 83f437cc..cc627b9d 100644
--- a/src/editor/Editor.vue
+++ b/src/editor/Editor.vue
@@ -10,31 +10,36 @@
<span slot="label">{{ $t('editor.tabEditor') }}</span>
<el-container>
<el-header id="editor-control-panel">
- <div class="languages">
- <el-tooltip
- :content="$t('editor.tooltip.jsMode')"
- placement="bottom"
- >
- <a
- :class="{ js: true, active: !shared.typeCheck }"
- @click="changeLang('js')"
- >JS</a
+ <div>
+ <div class="languages">
+ <el-tooltip
+ :content="$t('editor.tooltip.jsMode')"
+ placement="bottom"
>
- </el-tooltip>
- <el-tooltip
- :content="$t(`editor.tooltip.${hasTs ? 'tsMode' : 'noTs'}`)"
- placement="bottom"
- >
- <a
- @click="hasTs && changeLang('ts')"
- :class="{
- ts: true,
- active: shared.typeCheck,
- disabled: !hasTs
- }"
- >TS</a
+ <a
+ :class="{ js: true, active: !shared.typeCheck }"
+ @click="changeLang('js')"
+ >JS</a
+ >
+ </el-tooltip>
+ <el-tooltip
+ :content="$t(`editor.tooltip.${hasTs ? 'tsMode' : 'noTs'}`)"
+ placement="bottom"
>
- </el-tooltip>
+ <a
+ @click="hasTs && changeLang('ts')"
+ :class="{
+ ts: true,
+ active: shared.typeCheck,
+ disabled: !hasTs
+ }"
+ >TS</a
+ >
+ </el-tooltip>
+ </div>
+ <div class="example-version-since" v-if="hasVersionSince">
+ {{ versionSinceBanner }}
+ </div>
</div>
<div class="editor-controls">
<a
@@ -424,6 +429,7 @@ import {
import { collectDeps, buildExampleCode } from '../../common/buildCode';
import { gotoURL } from '../common/route';
import { mount } from '@lang/object-visualizer';
+import { compareVersions } from 'compare-versions';
import './object-visualizer.css';
import { getScriptURLs, URL_PARAMS } from '../common/config';
@@ -472,7 +478,16 @@ export default {
computed: {
hasTs() {
return this.exampleConfig && this.exampleConfig.ts;
- }
+ },
+
+ hasVersionSince() {
+ return this.exampleConfig && this.exampleConfig.since
+ && compareVersions(this.shared.echartsFullVersion, this.exampleConfig.since) >= 0;
+ },
+
+ versionSinceBanner() {
+ return this.$t('editor.bannerVersionRequire') + ' v' + this.exampleConfig.since + '+';
+ },
},
mounted() {
@@ -1047,6 +1062,18 @@ $handler-width: 15px;
}
}
+ .example-version-since {
+ display: inline-block;
+ padding: 1px 5px;
+ vertical-align: middle;
+ font-size: 10px;
+ // background: #fb628b;
+ background: #409eff;
+ color: #fff;
+ font-weight: bold;
+ border-radius: 2px;
+ }
+
.editor-controls {
.el-switch__label {
margin-top: -3px;
diff --git a/src/explore/ExampleCard.vue b/src/explore/ExampleCard.vue
index e8859f7b..4f129f36 100644
--- a/src/explore/ExampleCard.vue
+++ b/src/explore/ExampleCard.vue
@@ -8,8 +8,8 @@
</picture>
</a>
<div class="example-info">
- <div class="example-new" v-if="isNew">
- {{ newBanner }}
+ <div class="example-version-since" v-if="hasVersionSince">
+ {{ versionSinceBanner }}
</div>
<div>
<div class="example-title" :title="title">{{ title }}</div>
@@ -44,15 +44,13 @@ export default {
return this.example.title || '';
},
- isNew() {
+ hasVersionSince() {
return this.example.since
&& compareVersions(store.echartsFullVersion, this.example.since) >= 0;
},
- newBanner() {
- return store.locale === 'zh'
- ? (this.example.since + ' ' + this.$t('editor.bannerNew'))
- : (this.$t('editor.bannerNew') + ' ' + this.example.since);
+ versionSinceBanner() {
+ return 'v' + this.example.since + '+';
},
exampleTheme() {
@@ -145,13 +143,12 @@ export default {
padding-left: 10px;
}
- .example-new {
+ .example-version-since {
margin-top: 12px;
float: right;
padding: 1px 5px;
margin-left: 5px;
vertical-align: middle;
- border-radius: 3px;
font-size: 10px;
background: #fb628b;
color: #fff;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts-examples) 03/10: infra: Only remove the first JS comment block (treated as metadata).
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch v6-examples-supplement
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit eaff1c918ec6358c4456c822e7467d0ffbe96187
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Aug 7 02:11:40 2025 +0800
infra: Only remove the first JS comment block (treated as metadata).
---
README.md | 34 +++++++++++++++++++++++++---------
public/examples/tsconfig.json | 1 +
src/common/store.js | 5 +++--
3 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index e595ee69..07062d5b 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ npm run compile:example -- area-basic.ts
> npm i --force your/local/echarts
> ```
-If you want the example to be included in the [example gallery page](https://echarts.apache.org/examples/en/index.html), metadata must be provided in each example source code file, formatted as a JavaScript comment. For example:
+Metadata must be provided in each example source code file. The first JavaScript comment block is treated as metadata. For example:
```js
/*
title: Area Pieces
@@ -38,19 +38,22 @@ since: 6.0.0
*/
```
-Note: if you want an example to be excluded from the [example gallery page](https://echarts.apache.org/examples/en/index.html), you can either:
-- Add `/* ignore: true */` in its metadata (recommanded).
-- Move the example file to `public/examples/ts/doc-example/` folder (not recommanded, as its links in echarts-doc have to be modified accordingly).
-- Remove the metadata from the source code (not recommanded).
+Note:
+- The metadata, i.e., the first JavaScript comment block, will be removed when displaying the source code in editor page.
+- If you want the example to be included in the [example gallery page](https://echarts.apache.org/examples/en/index.html)
+ - metadata properies `title` and `category` must be provided.
+ - must no `excludeFromGallery: true`.
+ - The example should under `public/examples/ts/` folder directly, rather than in folder `public/examples/ts/doc-example/`.
+- **Do not modify the file path of existing examples**, unless you search and update all the links in `echarts-doc` correspondingly.
Metadata properties can be:
-+ `title`: Mandatory. String.
++ `title`: Optional. String.
+ `titleCN`: Optional. String.
-+ `category`: Mandatory. String list. That is the main categories in [example gallery page](https://echarts.apache.org/examples/en/index.html). If multiple categories need to be specified, use quotation marks and commas like `/* category: 'line, visualMap' */`
++ `category`: Optional. String list. That is the main categories in [example gallery page](https://echarts.apache.org/examples/en/index.html). If multiple categories need to be specified, use quotation marks and commas like `/* category: 'line, visualMap' */`
+ `since`: Optional. Semver version string. Recommended to add it to hint users the available echarts versions. For example, `/* since: 6.0.0 */`.
+ `difficulty`: Optional. Number.
+ `theme`: Optional. String.
-+ `ignore`: Optional. Boolean. Indicate that exclude this example from [example gallery page](https://echarts.apache.org/examples/en/index.html).
++ `excludeFromGallery`: Optional. Boolean. Indicate that exclude this example from [example gallery page](https://echarts.apache.org/examples/en/index.html).
+ `videoStart` and `videoEnd`: Optional. Number. Record a video to show the animation when genering screenshot. For example,
```js
/*
@@ -70,7 +73,7 @@ See "View and edit echarts-examples website" below.
### Some built-in features available in examples
-#### Import third-party library
+#### Import third-party library or data
For example:
@@ -82,6 +85,19 @@ $.when(
)
).done(function () {
// ...
+ // Set echarts option to the global variable `option`.
+ option = {/*...*/};
+ // The global variable `myChart` can be used there.
+ myChart.setOption(option);
+});
+
+$.get(ROOT_PATH + '/data/asset/geo/iceland.geo.json', function (geoJSON) {
+ echarts.registerMap('iceland', geoJSON);
+ // ...
+ // Set echarts option to the global variable `option`.
+ option = {/*...*/};
+ // The global variable `myChart` can be used there.
+ myChart.setOption(option);
});
```
diff --git a/public/examples/tsconfig.json b/public/examples/tsconfig.json
index 69003a58..15a7770a 100644
--- a/public/examples/tsconfig.json
+++ b/public/examples/tsconfig.json
@@ -6,6 +6,7 @@
"allowJs": true,
"checkJs": false,
"pretty": true,
+ "removeComments": false,
"rootDir": "./ts",
"outDir": "./js",
"baseUrl": "./"
diff --git a/src/common/store.js b/src/common/store.js
index ad503b85..c9088265 100644
--- a/src/common/store.js
+++ b/src/common/store.js
@@ -174,8 +174,9 @@ export function loadExampleCode() {
export function parseSourceCode(code) {
return (
code
- // remove front matter
- .replace(/\/\*[\w\W]*?\*\//, '')
+ .trim()
+ // remove the metadata: the first block of comments is treated as metadata
+ .replace(/^\/\*[\w\W]*?\*\//, '')
.trim()
// ts code needs add `export {}` to be a module. remove it.
// FIXME
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org