This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git
commit 421c83daa6658dc7080daedefb49ecb6d5e5b846 Author: Ovilia <[email protected]> AuthorDate: Sat Sep 14 16:10:18 2024 +0800 chore: add stage chart template --- custom-series/stage/dist/index.js | 39 ++++++++++++++++++++++ custom-series/stage/dist/index.min.js | 19 +++++++++++ custom-series/stage/dist/index.min.js.map | 1 + custom-series/stage/package-lock.json | 54 +++++++++++++++++++++++++++++++ custom-series/stage/package.json | 18 +++++++++++ custom-series/stage/rollup.config.js | 38 ++++++++++++++++++++++ custom-series/stage/src/index.ts | 44 +++++++++++++++++++++++++ custom-series/stage/test/index.html | 36 +++++++++++++++++++++ 8 files changed, 249 insertions(+) diff --git a/custom-series/stage/dist/index.js b/custom-series/stage/dist/index.js new file mode 100644 index 0000000..8691357 --- /dev/null +++ b/custom-series/stage/dist/index.js @@ -0,0 +1,39 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.stageCustomSeriesInstaller = factory()); +})(this, (function () { 'use strict'; + + var renderItem = function (params, api) { + return { + type: 'group', + children: [], + }; + }; + var index = { + install: function (registers) { + registers.registerCustomSeries('stage', renderItem); + }, + }; + + return index; + +})); diff --git a/custom-series/stage/dist/index.min.js b/custom-series/stage/dist/index.min.js new file mode 100644 index 0000000..72872b7 --- /dev/null +++ b/custom-series/stage/dist/index.min.js @@ -0,0 +1,19 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).stageCustomSeriesInstaller=t()}(this,(function(){"use strict";var e=function(e,t){return{type:"group",children:[]}};return{install:function(t){t.registerCustomSeries("stage",e)}}})); \ No newline at end of file diff --git a/custom-series/stage/dist/index.min.js.map b/custom-series/stage/dist/index.min.js.map new file mode 100644 index 0000000..d14b65f --- /dev/null +++ b/custom-series/stage/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"names":["global","factory","exports","module","define","amd","globalThis","self","stageCustomSeriesInstaller","this","renderItem","params","api","type","children","install","registers","registerCustomSeries"],"sources":["/Users/zhangwenli01/workspace/echarts/echarts-custom-series/custom-series/stage/dist/index.js"],"mappings":";;;;;;;;;;;;;;;;;;CAkBA,SAAWA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBA,OAAOD,QAAUD,IAC9D,mBAAXG,QAAyBA,OAAOC,IAAMD,OAAOH,IACnDD,EAA+B,oBAAfM,WAA6BA,WAAa [...] \ No newline at end of file diff --git a/custom-series/stage/package-lock.json b/custom-series/stage/package-lock.json new file mode 100644 index 0000000..b4ce48a --- /dev/null +++ b/custom-series/stage/package-lock.json @@ -0,0 +1,54 @@ +{ + "name": "echarts-stage", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "echarts-stage", + "version": "0.0.1", + "license": "Apache-2.0", + "dependencies": { + "echarts": "github:apache/echarts#v6" + }, + "devDependencies": { + "typescript": "^5.5.4" + } + }, + "node_modules/echarts": { + "version": "5.5.1", + "resolved": "git+ssh://[email protected]/apache/echarts.git#ce7c12287320aca047a9104cb0b42be5a366fbfc", + "license": "Apache-2.0", + "dependencies": { + "tslib": "2.3.0", + "zrender": "5.6.0" + } + }, + "node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/zrender": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz", + "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", + "dependencies": { + "tslib": "2.3.0" + } + } + } +} diff --git a/custom-series/stage/package.json b/custom-series/stage/package.json new file mode 100644 index 0000000..93a4888 --- /dev/null +++ b/custom-series/stage/package.json @@ -0,0 +1,18 @@ +{ + "name": "@echarts/custom-stage", + "version": "0.0.1-beta.1", + "description": "", + "main": "dist/index.js", + "scripts": { + "build": "tsc" + }, + "keywords": [], + "author": "", + "license": "Apache-2.0", + "dependencies": { + "echarts": "github:apache/echarts#v6" + }, + "devDependencies": { + "typescript": "^5.5.4" + } +} diff --git a/custom-series/stage/rollup.config.js b/custom-series/stage/rollup.config.js new file mode 100644 index 0000000..28dfbe5 --- /dev/null +++ b/custom-series/stage/rollup.config.js @@ -0,0 +1,38 @@ +module.exports = { + input: 'lib/index.js', + output: { + file: 'dist/index.js', + format: 'umd', + name: 'stageCustomSeriesInstaller', + extend: true, + globals: { + window: 'window', + }, + }, + plugins: [ + { + name: 'add-license', + renderChunk(code) { + return `/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +${code}`; + }, + }, + ], +}; diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts new file mode 100644 index 0000000..89c025c --- /dev/null +++ b/custom-series/stage/src/index.ts @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import echarts from 'echarts'; +import type { + CustomRootElementOption, + CustomSeriesRenderItem, +} from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; +import type { EChartsExtensionInstallRegisters } from 'echarts/src/extension.ts'; + +const renderItem = ( + params: echarts.CustomSeriesRenderItemParams, + api: echarts.CustomSeriesRenderItemAPI +) => { + return { + type: 'group', + children: [], + } as CustomRootElementOption; +}; + +export default { + install(registers: EChartsExtensionInstallRegisters) { + registers.registerCustomSeries( + 'stage', + renderItem as unknown as CustomSeriesRenderItem + ); + }, +}; diff --git a/custom-series/stage/test/index.html b/custom-series/stage/test/index.html new file mode 100644 index 0000000..6cba74b --- /dev/null +++ b/custom-series/stage/test/index.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Apache ECharts Custom Series Test</title> +</head> + +<body> + <div id="main" style="width: 1000px;height:400px;border:1px solid #ccc"></div> + + <script src="../node_modules/echarts/dist/echarts.js"></script> + <script src="../dist/index.js"></script> + <script> + echarts.use(window.stageCustomSeriesInstaller); + const chart = echarts.init(document.getElementById('main')); + + const data = [ + [new Date()] + ] + + option = { + series: { + type: 'custom', + renderItem: 'stage', + itemPayload: { + } + } + }; + + chart.setOption(option); + </script> +</body> + +</html> \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
