| commit | c2c0e5dafaf47028ea45de8f619079c941b1d0b2 | [log] [tgz] |
|---|---|---|
| author | 100pah <sushuang0322@gmail.com> | Wed Jul 30 19:31:46 2025 +0800 |
| committer | 100pah <sushuang0322@gmail.com> | Wed Jul 30 19:31:46 2025 +0800 |
| tree | a2660bcb50076340f4a697b368c9c54beb00fead | |
| parent | fdec014ca143d115992e3d74a41d597d0e196e18 [diff] | |
| parent | acf42d3dd7ccb691b0ade4e97f84ea4fc3547e5f [diff] |
Merge branch 'outerBounds' into dev
npm i --force
Add or edit example files in the public/examples/ts folder. (Do NOT add or edit files in the public/examples/js folder!)
An example file in public/examples/ts folder can be xxx.ts or xxx.js. After editing, you need to compile them to JavaScript using the following command:
npm run compile:example
Each example file should include the meta info at the top, formatted as a JS comment:
/* title: Area Pieces titleCN: 折线图区域高亮 category: 'line, visualMap' */
If you want to record a video to show the animation when genering screenshot. Use videoStart and videoEnd:
/* title: Bar Race titleCN: 动态排序柱状图 category: bar difficulty: 5 videoStart: 1000 videoEnd: 6000 */
Check the example in browser: See “View and edit echarts-examples website” below.
For example:
$.when( $.getScript(ROOT_PATH + '/data/asset/js/xxxx.js'), $.getScript( 'https://cdn.jsdelivr.net/npm/d3-contour@2.0.0/dist/d3-contour.js' ) ).done(function () { // ... });
Use this code to enable controller panel for a example:
app.config = { aNameForTheSelectionWidget: 'This is the initial value' aNameForTheRangeWidget: 45, aNameForTheButtonWidget: function () { // Do something on button click. }, onChange: function () { // Do something on SelectionWidget or RangeWidget changed. // Read the current value. console.log(app.config.aNameForTheRangeWidget) console.log(app.config.aNameForTheSelectionWidget) } }; app.configParameters = { // The keys below must exist in `app.config`. aNameForTheSelectionWidget: { options: [ 'This is the initial value', 'This is another value', 'This is the third value' 333, // value other than string is supported. false, // value other than string is supported. ] // // options can also be: // options: { /// // `text`: to display. // // `value`: write to `app.config` when option is switched. // text1: value1, // text2: value2, // text3: 333, // value other than string is supported. // text3: false, // value other than string is supported. // } }, aNameForTheRangeWidget: { min: -90, max: 90 } };
app.onresize = function () { // Do something. };
var width = myChart.getWidth(); var height = myChart.getHeight();
npm run dev
echarts-examples/config/config.local.js, including the content like:exports.SCRIPT_URLS = { // This is your own web server to visit the echarts dist files. localEChartsDir: 'http://localhost:8001/echarts', localEChartsGLDir: 'http://localhost:8001/echarts-gl', // Then the echarts will be fetched by URL // http://localhost:8001/echarts/dist/echarts.js // (if `local=1` exists in the entry URL) };
Note: The local URL is internally defined in
localEChartsDir&localEChartsGLDirinsrc/common/config.js
local=1 to the entry URL.http://127.0.0.1:3002/en/editor.html?c=line-simple&local=1Run all the examples to test package publishing and install, module importing, minimal bundling and DTS correctness.
Before run the tests. you need to update the examples list.
npm run build:examplelist
If puppeteer has not been installed:
npm i puppeteer -D
If you want to save the log:
exe_something > 1.log 2>&1
If you are testing a new version of echarts or zrender, which are not released in github yet, you need run e2e test with local dependent repos.
Make sure the dependent repos listed in dir attributes in echarts-examples/e2e/config.js existing. (If using npm run test:e2e:local or npm run test:e2e:esbuild:local, the local repo will be fetched from the dir attributes. Otherwise, download the remote repo from the git attributes.)
Make sure the local repos have release build, typically, npm run release has been performed.
Start e2e test:
# Notice: the commands below will execute `npm install` in these local directories. # run e2e using local dependent repos and webpack. npm run test:e2e:local > result.log 2>&1 # run e2e using local dependent repos and esbuild, which is much faster. npm run test:e2e:esbuild:local > result.log 2>&1
# Notice: the commands below will download the repos listed in `echarts-examples/e2e/config.js` to a temporary folder. # run e2e using remote dependent repos and webpack. npm run test:e2e > result.log 2>&1 # run e2e using remote dependent repos and esbuild, which is much faster. npm run test:e2e:esbuild > result.log 2>&1
The test result is in:
result.logecharts-examples/e2e/report.html, the file should be opened in your own local http server.Note: This can only be used when you run the whole e2e test at least once.
Skip specific stages.
node e2e/main.js --skip bundle
Specify matched tests.
node e2e/main.js --skip npm --tests bar3D*
npm run build:example # Node: If only build for default theme: node tool/build-example.js -t default
echarts-websitenpm run release # Note: the config of the dir of echarts-website is in # `echarts-examples/config/**`