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 <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
