├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── proposal.md
├── .gitignore
├── LICENSE
├── README.md
├── README_zh.md
├── core
└── datart.d.ts
├── dist
├── datart-3d-map.iife.js
├── datart-amap.iife.js
├── datart-antd-react.iife.js
├── datart-antv-box.iife.js
├── datart-antv-sankey.iife.js
├── datart-antvg2.iife.js
├── datart-babylon.iife.js
├── datart-bmap.iife.js
├── datart-chartjs.iife.js
├── datart-clustering.iife.js
├── datart-jquery.iife.js
├── datart-lottie.iife.js
├── datart-luckysheet.iife.js
├── datart-pivot.iife.js
├── datart-scroll.iife.js
├── datart-sovit-sample.iife.js
├── datart-thingjs-sample.iife.js
├── datart-threejs-bingdundun.iife.js
├── datart-threejs-industry.iife.js
├── datart-threejs-webgl.iife.js
├── datart-time.iife.js
├── datart-uml.iife.js
├── datart-vue-carousel.iife.js
├── datart-vuejs.iife.js
└── datart-zrender.iife.js
├── docs
└── CONTRIBUTING.md
├── index.d.ts
├── legacy-custom-chart-plugins
├── demo-custom-line-chart.js
└── demo-d3js-scatter-chart.js
├── package.json
├── plugins
├── datart-3d-map
│ ├── README.md
│ ├── config.js
│ ├── experiment-3d-map-chart.png
│ ├── experiment-3d-map-chart.ts
│ ├── gaode-map-logo.svg
│ ├── geo-china-city-map.json
│ ├── geo-china-map.json
│ ├── index.js
│ └── sample.json
├── datart-amap
│ ├── README.md
│ ├── config.js
│ ├── experiment-amap-chart.ts
│ ├── gaode-map-logo.svg
│ ├── geo-china-city-map.json
│ ├── geo-china-map.json
│ └── index.js
├── datart-antd-react
│ ├── README.md
│ ├── antd-react-table-plugin-chart.png
│ ├── experiment-antd-react-chart.js
│ └── index.js
├── datart-antv-box
│ ├── README.md
│ ├── experiment-antv-box.js
│ ├── experiment-antv-box.png
│ └── index.js
├── datart-antv-sankey
│ ├── README.md
│ ├── experiment-antv-sankey.js
│ ├── experiment-antv-sankey.png
│ └── index.js
├── datart-antvg2
│ ├── README.md
│ ├── experiment-antvg2-chart.js
│ ├── experiment-antvg2-chart.png
│ └── index.js
├── datart-babylon
│ ├── README.md
│ ├── babylon-js-demo.png
│ ├── babylon-js-logo.svg
│ ├── experiment-babylon.ts
│ └── index.js
├── datart-bmap
│ ├── baidu-map-logo.svg
│ ├── experiment-bmap-chart.js
│ └── index.js
├── datart-chartjs
│ ├── README.md
│ ├── chartjs-logo.svg
│ ├── experiment-chartjs-sample.png
│ ├── experiment-chartjs.js
│ └── index.js
├── datart-clustering
│ ├── README.md
│ ├── experiment-cluster-chart.png
│ ├── experiment-clustering-chart.js
│ ├── icon.svg
│ ├── index.js
│ └── sample.js
├── datart-jquery
│ ├── README.md
│ ├── experiment-jquery-chart.js
│ ├── icons8-jquery.svg
│ ├── index.js
│ └── jquery-vertical.svg
├── datart-lottie
│ ├── README.md
│ ├── data.json
│ ├── experiment-lottie-chart.js
│ ├── index.js
│ ├── lottie-icon.svg
│ └── lottie-record.gif
├── datart-luckysheet
│ ├── README.md
│ ├── config.js
│ ├── experiment-luckysheet-demo.png
│ ├── experiment-luckysheet.ts
│ ├── index.js
│ └── luckysheet-logo.svg
├── datart-pivot
│ ├── README.md
│ ├── experiment-pivot-chart.js
│ └── index.js
├── datart-scroll
│ ├── README.md
│ ├── experiment-scroll-chart.js
│ ├── index.js
│ ├── scroll-table-chart.png
│ └── scroll-table.svg
├── datart-sovit-sample
│ ├── README.md
│ ├── config.js
│ ├── experiment-sovit-sample.ts
│ ├── index.js
│ └── sovit-logo.svg
├── datart-thingjs-sample
│ ├── README.md
│ ├── config.js
│ ├── experiment-thingjs-sample.ts
│ ├── index.js
│ └── thingjs-logo.svg
├── datart-threejs-bingdundun
│ ├── README.md
│ ├── bigndundun.png
│ ├── bingdundun.glb
│ ├── experiment-threejs-bingdundun.js
│ ├── index.js
│ └── threejs-icon.svg
├── datart-threejs-industry
│ ├── README.md
│ ├── callada.gif
│ ├── experiment-threejs-industry.js
│ ├── index.js
│ ├── sample.js
│ └── threejs-icon.svg
├── datart-threejs-webgl
│ ├── README.md
│ ├── callada.gif
│ ├── experiment-threejs-webgl.js
│ ├── index.js
│ └── threejs-icon.svg
├── datart-time
│ ├── README.md
│ ├── experiment-time-chart.js
│ ├── index.js
│ ├── time-series-chart.png
│ └── time.svg
├── datart-uml
│ ├── README.md
│ ├── experiment-mermaid-uml-chart.js
│ ├── experiment-uml-chart.png
│ ├── icon.svg
│ └── index.js
├── datart-vue-carousel
│ ├── demo-vue-carousel.js
│ ├── images
│ │ ├── 1.jpeg
│ │ ├── 2.jpeg
│ │ ├── 3.jpeg
│ │ ├── 4.jpeg
│ │ └── 5.jpeg
│ ├── index.js
│ ├── vue-carousel-csv.xlsx
│ ├── vue-carousel.gif
│ └── vue-carousel.svg
├── datart-vuejs
│ ├── README.md
│ ├── experiment-vue-dynamic-chart.js
│ ├── index.js
│ ├── vuejs-chart.png
│ └── vuejs.svg
└── datart-zrender
│ ├── README.md
│ ├── experiment-zrender-chart.js
│ ├── experiment-zrender-chart.png
│ ├── index.js
│ └── zrender-logo.png
├── rollup.config.js
└── tsconfig.json
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/proposal.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Proposal :clap:
3 | about: Add New Proposal
4 | title: '[Proposal]
'
5 | labels: Proposal, Need Review
6 | assignees: ''
7 |
8 | ---
9 |
10 |
13 |
14 | ### Current Behavior:
15 |
16 |
17 | ### Expected Behavior:
18 |
19 |
20 | ### Steps To Reproduce:
21 |
28 |
29 | ### Solution
30 |
31 | ### Anything else:
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 | package-lock.json
8 | yarn.lock
9 |
10 | # testing
11 | /coverage
12 |
13 | # production
14 | /build
15 | /share
16 | *.zip
17 | # misc
18 | .DS_Store
19 | **/.DS_Store
20 | .datart-cli
21 | .env.local
22 | .env.development.local
23 | .env.test.local
24 | .env.production.local
25 | .vscode
26 | .idea
27 | stats.json
28 |
29 | npm-debug.log*
30 | yarn-debug.log*
31 | yarn-error.log*
32 |
33 | # vscode
34 | .vscode
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # datart-extension-charts
2 |
3 | > An extension repository to host datart plugin charts which is in **experiment state not officially**🤝.
4 |
5 | 🖖 Welcome PRs or Issues, please don't be worry about any questions 👏.
6 |
7 | ## By Consumer
8 |
9 | 1. Copy `plugins` from `dist` folder, eg. `datart-amap.iife.js` file.
10 | 2. Paste to your datart backend server folder of `custom-chart-plugins`
11 | 3. Login datart, and select a your custom plugin chart.
12 |
13 | ## By Developer
14 |
15 | > With this project, you can make yourself plugin chart and bundle with CLI.
16 |
17 | ### 1. Cook plugin chart as IIFE type (Recommended)
18 |
19 | > IIFE also called Immediately Invoked Function Expression[^1], a programming language idiom which produces a lexical scope using function scoping.
20 |
21 | 1. Create a folder prefixed with `datart-`, such as `datart-hello-world`.
22 | 2. Create a plugin chart with **Javascript** or **Typescript** file
23 | 3. Plugin chart should be export an object with datart lifecycles[^2], such as `onMount`、`onUpdated` and etc.
24 | 4. Run `npm run build` and then check `dist` folder with file `datart-hello-world.iife.js`.
25 | __NOTE: Plugin folder should be prefix as `datart-*` which could be automatic load when run `build`__
26 |
27 | ### 2. Cook plugin chart as an React Component
28 |
29 | **Please take a look plugins folder**
30 |
31 | ## Sample
32 |
33 |
34 |
Antv/G2
35 |

36 |
37 |
38 |
BabylonJS
39 |

40 |
41 |
42 |
ChartJS
43 |

44 |
45 |
46 |
ThreeJS-BingDunDun
47 |

48 |
49 |
50 |
ThreeJS-WebGL
51 |

52 |
53 |
54 |
ECharts-Time
55 |

56 |
57 |
58 |
Mermaid-UML
59 |

60 |
61 |
62 |
VueJS
63 |

64 |
65 |
66 |
ZRender
67 |

68 |
69 |
70 |
71 |
72 | ## More Posts
73 | - [x] Plugin Chart Helper API document: https://running-elephant.github.io/datart-docs/api/
74 | - [x] How to Make a Plugin Chart: https://running-elephant.github.io/datart-docs/docs/chart_plugin.html
75 | - [x] How to Make Chart Config: https://juejin.cn/post/7040683275446124574
76 | - [x] Vue Carousel Plugin Chart:https://mp.weixin.qq.com/s/a4DVf-5LHVQAknmKKE6DJA
77 | - [x] JQuery Plugin Chart:https://mp.weixin.qq.com/s/9hBNSla86Fzouy0WdXqSQQ
78 | - [x] Hand by hand develop a plugin chart: https://mp.weixin.qq.com/s/nYMAaiT97NPkm71FpW8LSw
79 |
80 |
81 | [^1]: https://en.wikipedia.org/wiki/Immediately_invoked_function_expression
82 |
83 | [^2]: https://running-elephant.github.io/datart-docs/docs/chart_plugin.html
--------------------------------------------------------------------------------
/README_zh.md:
--------------------------------------------------------------------------------
1 | # datart-extension-charts
2 |
3 | > 这里是 Datart 插件图表仓库,当前的图表是**实验阶段**,请勿用于生产环境。
4 |
5 |
6 | 🖖 欢迎提 Pull Rquest 以及 Issue,请不要担心问题过于直白或者初级,任何反馈均是贡献 👏.
7 |
8 | ## 如果你是一位使用者
9 |
10 | 1. 从`dist`文件夹中拷贝出你所需要的插件图表,如`datart-amap.iife.js`这个给予高德地图的插件图表
11 | 2. 将拷贝出的插件图表粘贴到你的datart服务端的`custom-chart-plugins`目录下
12 | 3. 登陆 datart 系统,然后选择你所导入的插件图表
13 |
14 | ## 如果你是一位开发者
15 |
16 | > 当前的仓库提供了基于命令行的工具,提升开发效率。
17 |
18 | ### 1. 制作 IIFE 类型的插件图表 (推荐)
19 |
20 | > 立即调用函数表达式(英文:immediately-invoked function expression,缩写:IIFE)[1],是一种利用JavaScript函数生成新作用域的编程方法。
21 |
22 | 1. 创建一个以`datart-`开头的文件夹,如`datart-hello-world`文件夹
23 | 2. 创建一个 **Javascript** or **Typescript** 文件
24 | 3. 导出一个包含 datart 生命周期的函数对象,生命周期[^2]例如`onMount`、`onUpdated`等.
25 | 4. 运行`npm run build` 命令,并且查看`dist`文件夹新生成的`datart-hello-world.iife.js`文件
26 |
27 | __注意:插件图表文件夹的名称必须以`datart-`开头,这样当运行build命令时可自动打包文件__
28 |
29 | ### 2. 制作 React 类型的插件图表
30 |
31 | **请查看`plugins`文件夹📁下面的图表示例**
32 |
33 | ## Sample
34 |
35 |
36 |
Antv/G2
37 |

38 |
39 |
40 |
BabylonJS
41 |

42 |
43 |
44 |
ChartJS
45 |

46 |
47 |
48 |
ThreeJS-BingDunDun
49 |

50 |
51 |
52 |
ThreeJS-WebGL
53 |

54 |
55 |
56 |
ECharts-Time
57 |

58 |
59 |
60 |
Mermaid-UML
61 |

62 |
63 |
64 |
VueJS
65 |

66 |
67 |
68 |
ZRender
69 |

70 |
71 |
72 |
73 |
74 | ## 更多文章链接
75 | - [x] Plugin Chart Helper API document: https://running-elephant.github.io/datart-docs/api/
76 | - [x] How to Make a Plugin Chart: https://running-elephant.github.io/datart-docs/docs/chart_plugin.html
77 | - [x] How to Make Chart Config: https://juejin.cn/post/7040683275446124574
78 | - [x] Vue 跑马灯插件示例: https://mp.weixin.qq.com/s/a4DVf-5LHVQAknmKKE6DJA
79 | - [x] JQuery 图表插件:https://mp.weixin.qq.com/s/9hBNSla86Fzouy0WdXqSQQ
80 | - [x] 手把手教你开发出优秀的图表插件作品: https://mp.weixin.qq.com/s/nYMAaiT97NPkm71FpW8LSw
81 |
82 |
83 | [^1]: https://zh.wikipedia.org/wiki/%E7%AB%8B%E5%8D%B3%E8%B0%83%E7%94%A8%E5%87%BD%E6%95%B0%E8%A1%A8%E8%BE%BE%E5%BC%8F
84 |
85 | [^2]: https://running-elephant.github.io/datart-docs/docs/chart_plugin.html
--------------------------------------------------------------------------------
/core/datart.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | export interface IChartLifecycle {
20 | /**
21 | * Mount event with params `option` and `context`
22 | *
23 | * @abstract
24 | * @param {*} options
25 | * @param {*} [context]
26 | * @memberof DatartChartBase
27 | */
28 | onMount(options, context?): void;
29 |
30 | /**
31 | * Update event with params `option` and `context`
32 | *
33 | * @abstract
34 | * @param {*} options
35 | * @param {*} [context]
36 | * @memberof DatartChartBase
37 | */
38 | onUpdated(options, context?): void;
39 |
40 | /**
41 | * UnMount event with params `option` and `context`
42 | *
43 | * @abstract
44 | * @param {*} options
45 | * @param {*} [context]
46 | * @memberof DatartChartBase
47 | */
48 | onUnMount(options, context?): void;
49 |
50 | /**
51 | * Resize event with params `option` and `context`
52 | *
53 | * @abstract
54 | * @param {*} options
55 | * @param {*} [context]
56 | * @memberof DatartChartBase
57 | */
58 | onResize(options, context?): void;
59 | }
60 |
61 | export interface IChart extends IChartLifecycle {
62 | meta: any;
63 | config?: any;
64 | dataset?: any;
65 | dependency: string[];
66 | isISOContainer: boolean | string;
67 | useIFrame?: boolean;
68 |
69 | set state(state: any);
70 | get state();
71 |
72 | getDependencies(): string[];
73 |
74 | init(config: any);
75 | registerMouseEvents(events: Array);
76 | isMatchRequirement(targetConfig?: any): boolean;
77 | }
78 |
--------------------------------------------------------------------------------
/dist/datart-antd-react.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";function e({dHelper:e}){return{config:{datas:[],styles:[{label:"code.title",key:"code",comType:"group",rows:[{label:"code.area",key:"area",comType:"text",options:{}}]},{label:"watermark.title",key:"watermark",comType:"group",rows:[{label:"watermark.area",key:"area",comType:"text",options:{}}]}],settings:[],i18ns:[{lang:"zh-CN",translation:{code:{title:"代码设置",area:"编辑区"},watermark:{title:"水印设置",area:"编辑区"}}},{lang:"en",translation:{code:{title:"Code Setting",area:"Editor Block"},watermark:{title:"Watermark Setting",area:"Editor Block"}}}]},_containerId:null,isISOContainer:"experiment-antd-react-chart",dependency:["https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js","https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js","https://cdnjs.cloudflare.com/ajax/libs/antd/4.24.1/antd.min.js","https://cdnjs.cloudflare.com/ajax/libs/antd/4.24.1/antd.min.css"],meta:{id:"experiment-antd-react-chart",name:"[Experiment] Ant Design React",icon:"chart"},_ReactDom:null,_React:null,onMount(e,t){this._containerId=e.containerId;if("React"in t.window&&"ReactDOM"in t.window){this._ReactDOM=t.window.ReactDOM;this._React=t.window.React;const a=this._ReactDOM.createRoot(t.document.getElementById(e.containerId));a.render(this.buildComponent(t.window))}},onUpdated(e,t){e.config.styles},onUnMount(){},onResize(e,t){},buildComponent({antd:e}){const t=this._React.createElement;const a=[{key:"1",name:"Mike",age:32,address:"10 Downing Street"},{key:"2",name:"John",age:42,address:"10 Downing Street"}];const n=[{title:"Name",dataIndex:"name",key:"name"},{title:"Age",dataIndex:"age",key:"age"},{title:"Address",dataIndex:"address",key:"address"}];return t("div",null,[t("h1",null,"Hello World!"),t(e.Table,{dataSource:a,columns:n},null)])}}}return e})();
2 |
--------------------------------------------------------------------------------
/dist/datart-antv-box.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";const e="@global@";function t({dHelper:t}){const a=[{x:"Oceania",low:1,q1:9,median:16,q3:22,high:24},{x:"East Europe",low:1,q1:5,median:8,q3:12,high:16},{x:"Australia",low:1,q1:8,median:12,q3:19,high:26},{x:"South America",low:2,q1:8,median:12,q3:21,high:28},{x:"North Africa",low:1,q1:8,median:14,q3:18,high:24},{x:"North America",low:3,q1:10,median:17,q3:28,high:30},{x:"West Europe",low:1,q1:7,median:10,q3:17,high:22},{x:"West Africa",low:1,q1:6,median:8,q3:13,high:16}];return{config:{datas:[{label:`${e}.box.dimension`,key:"dimension",type:"group",required:true,limit:[1,1]},{label:`${e}.box.min`,key:"min",type:"aggregate",required:true,limit:[1,1]},{label:`${e}.box.q1`,key:"q1",type:"aggregate",required:true,limit:[1,1]},{label:`${e}.box.median`,key:"median",type:"aggregate",required:true,limit:[1,1]},{label:`${e}.box.q3`,key:"q3",type:"aggregate",required:true,limit:[1,1]},{label:`${e}.box.max`,key:"max",type:"aggregate",required:true,limit:[1,1]}],styles:[{label:"boxStyle.title",key:"boxStyle",comType:"group",rows:[{label:"boxStyle.fill",key:"fill",default:"#1890FF",comType:"fontColor"},{label:"boxStyle.stroke",key:"stroke",default:"#545454",comType:"fontColor"},{label:"boxStyle.fillOpacity",key:"fillOpacity",default:.3,comType:"inputNumber"}]},{label:"theme.title",key:"theme",comType:"group",rows:[{label:"theme.current",key:"current",comType:"select",default:"default",options:{translateItemLabel:false,items:[{label:"默认",value:"default"},{label:"黑暗主题",value:"dark"}]}}]}],i18ns:[{lang:"zh",translation:{box:{dimension:"维度",min:"最小值",q1:"第一分位",median:"中位数",q3:"第三分位",max:"最大位"},theme:{title:"主题设置",current:"当前主题"},boxStyle:{title:"箱线图样式设置",fill:"图形的填充色",stroke:"图形的描边",fillOpacity:"填充透明度"}}},{lang:"en",translation:{theme:{title:"Theme Style",current:"Current"}}}]},isISOContainer:"antv-g2plot",dependency:["https://cdnjs.cloudflare.com/ajax/libs/g2plot/2.4.23/g2plot.min.js"],meta:{id:"experiment-antv-box",name:"[Experiment] AntV Box Chart",icon:"chart",requirements:[{group:1,aggregate:5}]},_chart:null,onMount(e,t){if(void 0===e.containerId||!t.document)return;const{Box:i}=t.window.G2Plot;if(!i)return;this._chart=new i(e.containerId,{autoFit:true,data:a,xField:"x",yField:["low","q1","median","q3","high"],boxStyle:{stroke:"#545454",fill:"#1890FF",fillOpacity:.3},animation:false});this._chart.render()},onUpdated(e,t){if(!this._chart)return;if(!this.isMatchRequirement(e.config))return;const a=this.getOptions(e.dataset,e.config,e.drillOption,e.selectedItems);this._chart.update(a)},onUnMount(){if(!this._chart)return;this._chart.destroy()},onResize(e,t){if(!this._chart)return;if(!t.width||!t.height)return;this._chart.changeSize(t.width,t.height)},getOptions(e,a,i,l){const r=a.styles||[];const o=a.datas||[];const n=o.filter((e=>"dimension"===e.key)).flatMap((e=>e.rows||[])).map((e=>e.colName)).findLast((e=>e));const s=o.filter((e=>"min"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const m=o.filter((e=>"q1"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const c=o.filter((e=>"median"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const d=o.filter((e=>"q3"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const g=o.filter((e=>"max"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const h=t.transformToObjectArray(e.rows,e.columns);const[u,f,y]=t.getStyles(r,["boxStyle"],["fill","stroke","fillOpacity"]);const[p]=t.getStyles(r,["theme"],["current"]);return{data:h,xField:n,yField:[s,m,c,d,g],theme:p,boxStyle:{stroke:f,fill:u,fillOpacity:y},animation:false}}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-antv-sankey.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";const e="@global@";function t({dHelper:t}){const a=[{source:"首次打开",target:"首页 UV",value:160},{source:"结果页",target:"首页 UV",value:40},{source:"验证页",target:"首页 UV",value:10},{source:"我的",target:"首页 UV",value:10},{source:"朋友",target:"首页 UV",value:8},{source:"其他来源",target:"首页 UV",value:27},{source:"首页 UV",target:"理财",value:30},{source:"首页 UV",target:"扫一扫",value:40},{source:"首页 UV",target:"服务",value:35},{source:"首页 UV",target:"蚂蚁森林",value:25},{source:"首页 UV",target:"跳失",value:10},{source:"首页 UV",target:"借呗",value:30},{source:"首页 UV",target:"花呗",value:40},{source:"首页 UV",target:"其他流向",value:45}];return{config:{datas:[{label:`${e}.sankey.source`,key:"source",type:"group",required:true,limit:[1,1]},{label:`${e}.sankey.target`,key:"target",type:"group",required:true,limit:[1,1]},{label:`${e}.sankey.metrics`,key:"metrics",type:"aggregate",required:true,limit:[1,1]}],styles:[{label:"geometry.title",key:"geometry",comType:"group",rows:[{label:"geometry.nodeWidthRatio",key:"nodeWidthRatio",default:.008,max:1,min:.001,comType:"inputNumber"},{label:"geometry.nodeWidthPadding",key:"nodeWidthPadding",default:.01,max:1,min:.01,comType:"inputNumber"},{label:"geometry.nodeAlign.title",key:"nodeAlign",comType:"select",default:"justify",options:{translateItemLabel:true,items:[{label:"@global@.geometry.nodeAlign.left",value:"left"},{label:"@global@.geometry.nodeAlign.right",value:"right"},{label:"@global@.geometry.nodeAlign.center",value:"center"},{label:"@global@.geometry.nodeAlign.justify",value:"justify"}]}}]},{label:"theme.title",key:"theme",comType:"group",rows:[{label:"theme.current",key:"current",comType:"select",default:"default",options:{translateItemLabel:false,items:[{label:"默认",value:"default"},{label:"黑暗主题",value:"dark"}]}}]}],i18ns:[{lang:"zh",translation:{sankey:{source:"来源",target:"目标",metrics:"指标"},theme:{title:"主题设置",current:"当前主题"},geometry:{title:"几何样式设置",nodeWidthRatio:"节点的宽度配置",nodeWidthPadding:"节点的之间垂直方向的间距",nodeAlign:{title:"对齐方式",left:"左对齐",right:"右对齐",center:"居中",justify:"两端对齐"}}}},{lang:"en",translation:{sankey:{source:"Source",target:"Target",metrics:"Metric"},theme:{title:"Theme Style",current:"Current"},geometry:{title:"Geometry Style",nodeWidthRatio:"Node Width Ratio",nodeWidthPadding:"Node Width Padding",nodeAlign:{title:"Align Type",left:"left",right:"right",center:"center",justify:"justify"}}}}]},isISOContainer:"antv-g2plot",dependency:["https://cdnjs.cloudflare.com/ajax/libs/g2plot/2.4.23/g2plot.min.js"],meta:{id:"experiment-antv-sankey",name:"[Experiment] AntV Sankey Chart",icon:"chart",requirements:[{group:0,aggregate:3}]},_chart:null,onMount(e,t){if(void 0===e.containerId||!t.document)return;const{Sankey:r}=t.window.G2Plot;if(!r)return;this._chart=new r(e.containerId,{data:a,sourceField:"source",targetField:"target",weightField:"value",nodeWidthRatio:.008,nodePaddingRatio:.03});this._chart.render()},onUpdated(e,t){if(!this._chart)return;const a=this.getOptions(e.dataset,e.config,e.drillOption,e.selectedItems);this._chart.update(a)},onUnMount(){if(!this._chart)return;this._chart.destroy()},onResize(e,t){if(!this._chart)return;if(!t.width||!t.height)return;this._chart.changeSize(t.width,t.height)},getOptions(e,a,r,o){const i=a.styles||[];const l=a.datas||[];const n=l.filter((e=>"metrics"===e.key)).flatMap((e=>e.rows||[])).map((e=>`${e.aggregate}(${e.colName})`)).findLast((e=>e));const s=l.filter((e=>"source"===e.key)).flatMap((e=>e.rows||[])).map((e=>e.colName||"source")).findLast((e=>e));const d=l.filter((e=>"target"===e.key)).flatMap((e=>e.rows||[])).map((e=>e.colName||"target")).findLast((e=>e));const u=t.transformToObjectArray(e.rows,e.columns);const[g,c,m]=t.getStyles(i,["geometry"],["nodeWidthRatio","nodeWidthPadding","nodeAlign"]);const[h]=t.getStyles(i,["theme"],["current"]);return{data:u,sourceField:s,targetField:d,weightField:n,nodeWidthRatio:g,nodePaddingRatio:c,nodeAlign:m,theme:h,nodeDraggable:true,rawFields:["path"],tooltip:{fields:["path","value"],formatter:({path:e,value:t})=>({name:e,value:t})}}}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-antvg2.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";function e({dHelper:e}){const n=[{Year:2016,"Number of incidents":"13,488",Deaths:"34,676",Injuries:"39,851"},{Year:2015,"Number of incidents":"14,852",Deaths:"38,464",Injuries:"43,960"},{Year:2014,"Number of incidents":"16,860",Deaths:"43,566",Injuries:"41,061"},{Year:2013,"Number of incidents":"11,996",Deaths:"22,234",Injuries:"37,666"},{Year:2012,"Number of incidents":"8,500",Deaths:"15,436",Injuries:"25,486"},{Year:2011,"Number of incidents":"5,071",Deaths:"8,228",Injuries:"14,652"},{Year:2010,"Number of incidents":"4,822",Deaths:"7,727",Injuries:"15,860"},{Year:2009,"Number of incidents":"4,719",Deaths:"9,271",Injuries:"19,128"},{Year:2008,"Number of incidents":"4,803",Deaths:"9,135",Injuries:"18,984"},{Year:2007,"Number of incidents":"3,241",Deaths:"12,858",Injuries:"22,453"},{Year:2006,"Number of incidents":"2,749",Deaths:"9,362",Injuries:"15,551"},{Year:2005,"Number of incidents":"2,009",Deaths:"6,313",Injuries:"12,769"},{Year:2004,"Number of incidents":"1,162",Deaths:"5,718",Injuries:"11,817"},{Year:2003,"Number of incidents":"1,262",Deaths:"3,278",Injuries:"7,091"},{Year:2002,"Number of incidents":"1,332",Deaths:"4,799",Injuries:"7,103"},{Year:2001,"Number of incidents":"1,907",Deaths:"7,743",Injuries:"21,151"},{Year:2e3,"Number of incidents":"1,813",Deaths:"4,402",Injuries:"5,869"},{Year:1999,"Number of incidents":"1,395",Deaths:"3,388",Injuries:"5,341"},{Year:1998,"Number of incidents":933,Deaths:"4,688",Injuries:"8,183"},{Year:1997,"Number of incidents":"3,200",Deaths:"10,928",Injuries:"9,174"},{Year:1996,"Number of incidents":"3,056",Deaths:"6,965",Injuries:"10,781"},{Year:1995,"Number of incidents":"3,081",Deaths:"6,094",Injuries:"14,288"},{Year:1994,"Number of incidents":"3,458",Deaths:"7,691",Injuries:"7,573"},{Year:1993,"Number of incidents":747,Deaths:"2,669",Injuries:"5,600"},{Year:1992,"Number of incidents":"5,073",Deaths:"9,745",Injuries:"9,927"},{Year:1991,"Number of incidents":"4,683",Deaths:"8,429",Injuries:"7,591"},{Year:1990,"Number of incidents":"3,887",Deaths:"7,148",Injuries:"6,128"},{Year:1989,"Number of incidents":"4,323",Deaths:"8,136",Injuries:"5,512"},{Year:1988,"Number of incidents":"3,720",Deaths:"7,189",Injuries:"6,860"},{Year:1987,"Number of incidents":"3,184",Deaths:"6,476",Injuries:"5,769"},{Year:1986,"Number of incidents":"2,860",Deaths:"4,976",Injuries:"5,814"},{Year:1985,"Number of incidents":"2,915",Deaths:"7,094",Injuries:"5,130"},{Year:1984,"Number of incidents":"3,495",Deaths:"10,450",Injuries:"5,291"},{Year:1983,"Number of incidents":"2,870",Deaths:"9,444",Injuries:"4,047"},{Year:1982,"Number of incidents":"2,545",Deaths:"5,135",Injuries:"3,342"},{Year:1981,"Number of incidents":"2,585",Deaths:"4,851",Injuries:"3,337"},{Year:1980,"Number of incidents":"2,662",Deaths:"4,391",Injuries:"3,645"},{Year:1979,"Number of incidents":"2,661",Deaths:"2,100",Injuries:"2,502"},{Year:1978,"Number of incidents":"1,526",Deaths:"1,459",Injuries:"1,600"},{Year:1977,"Number of incidents":"1,319",Deaths:456,Injuries:518},{Year:1976,"Number of incidents":923,Deaths:672,Injuries:755},{Year:1975,"Number of incidents":740,Deaths:617,Injuries:617},{Year:1974,"Number of incidents":580,Deaths:542,Injuries:763},{Year:1973,"Number of incidents":473,Deaths:370,Injuries:495},{Year:1972,"Number of incidents":496,Deaths:566,Injuries:408},{Year:1971,"Number of incidents":470,Deaths:173,Injuries:82},{Year:1970,"Number of incidents":651,Deaths:171,Injuries:192}];return{config:{datas:[{label:"dimension",key:"dimension",actions:["sortable","alias"]},{label:"metrics",key:"metrics",rows:[],actions:["format","aggregate"]}],styles:[{label:"label",key:"label",comType:"group",rows:[{label:"showLabel",key:"showLabel",default:false,comType:"checkbox"},{label:"showLabelBySwitch",key:"showLabelBySwitch",default:true,comType:"switch",watcher:{deps:["showLabel"],action:e=>({comType:e.showLabel?"checkbox":"switch",disabled:e.showLabel})}},{label:"showDataColumns",key:"dataColumns",comType:"select",options:[{getItems:e=>{const n=(e||[]).filter((e=>["metrics","dimension"].includes(e.key)));const t=n.reduce(((e,n)=>e.concat(n.rows||[])),[]);return t.map((e=>({key:e.uid,value:e.uid,label:e.label||e.aggregate?`${e.aggregate}(${e.colName})`:e.colName})))}}]},{label:"font",key:"font",comType:"font"}]}],i18ns:[{lang:"zh",translation:{label:"标签",showLabel:"显示标签",showLabelBySwitch:"显示标签2",showLabelByInput:"显示标签3",showLabelWithSelect:"显示标签4",fontFamily:"字体",fontSize:"字体大小",fontColor:"字体颜色",rotateLabel:"旋转标签",showDataColumns:"选择数据列",legend:{label:"图例",showLabel:"图例-显示标签",showLabel2:"图例-显示标签2"}}},{lang:"en",translation:{label:"Label",showLabel:"Show Label",showLabelBySwitch:"Show Lable Switch",showLabelWithInput:"Show Label Input",showLabelWithSelect:"Show Label Select"}}]},isISOContainer:"experiment-antvg2-chart",dependency:["https://cdnjs.cloudflare.com/ajax/libs/antv-g2/4.1.34/g2.min.js","https://cdn.jsdelivr.net/npm/@antv/data-set@0.11.8/build/data-set.min.js"],meta:{id:"experiment-antvg2-chart",name:"[Experiment] AntV G2 Chart",icon:"chart",requirements:[{group:null,aggregate:null}]},onMount(e,t){if(void 0===e.containerId||!t.document)return;const{Chart:s}=t.window.G2;if(!s)return;const a=new t.window.Dataset;const i=new s({container:e.containerId,autoFit:true,height:500,syncViewPadding:true});i.scale({Deaths:{sync:true,nice:true},death:{sync:true,nice:true}});const r=a.createView().source(n);r.transform({type:"map",callback:e=>{if("string"===typeof e.Deaths)e.Deaths=e.Deaths.replace(",","");e.Deaths=parseInt(e.Deaths,10);e.death=e.Deaths;e.year=e.Year;return e}});const o=i.createView();o.data(r.rows);o.axis("Year",{subTickLine:{count:3,length:3},tickLine:{length:6}});o.axis("Deaths",{label:{formatter:e=>e.replace(/(\d)(?=(?:\d{3})+$)/g,"$1,")}});o.line().position("Year*Deaths");const u=a.createView().source(r.rows);u.transform({type:"regression",method:"polynomial",fields:["year","death"],bandwidth:.1,as:["year","death"]});const c=i.createView();c.axis(false);c.data(u.rows);c.line().position("year*death").style({stroke:"#969696",lineDash:[3,3]}).tooltip(false);o.annotation().text({content:"趋势线",position:["1970",2500],style:{fill:"#8c8c8c",fontSize:14,fontWeight:300},offsetY:-70});i.render()},onUpdated(e,n){},onUnMount(){},onResize(e,n){}}}return e})();
2 |
--------------------------------------------------------------------------------
/dist/datart-chartjs.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var t='\n\n';function e({dHelper:e}){const n={labels:["Red","Blue","Yellow","Green","Purple","Orange"],datasets:[{label:"# of Votes",data:[12,19,3,5,2,3],backgroundColor:["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],borderColor:["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],borderWidth:1}]};return{config:{datas:[{label:"dimension",key:"dimension",actions:["sortable","alias"]},{label:"metrics",key:"metrics",rows:[],actions:["format","aggregate"]}],styles:[],settings:[],i18ns:[{lang:"zh-CN",translation:{chartName:"ChartJS"}},{lang:"en-US",translation:{chartName:"ChartJS"}}]},isISOContainer:"experiment-chartjs-chart",dependency:["https://cdn.jsdelivr.net/npm/chart.js@2.8.0"],meta:{id:"experiment-chartjs-chart",name:"chartName",icon:t,requirements:[{group:null,aggregate:null}]},onMount(t,e){if(void 0===t.containerId||!e.document)return;const{Chart:a}=e.window.Chart;if(!a)return;const r=e.document.createElement("canvas");r.id="chartjs-canvas-container";e.document.getElementById(t.containerId).appendChild(r);var o=e.document.getElementById("chartjs-canvas-container").getContext("2d");new a(o,{type:"bar",data:n,options:{scales:{yAxes:[{ticks:{beginAtZero:true}}]}}})},onUpdated(t,e){},onUnMount(){},onResize(t,e){}}}return e})();
2 |
--------------------------------------------------------------------------------
/dist/datart-clustering.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var t='';var e=[[3.275154,2.957587],[-3.344465,2.603513],[.355083,-3.376585],[1.852435,3.547351],[-2.078973,2.552013],[-.993756,-.884433],[2.682252,4.007573],[-3.087776,2.878713],[-1.565978,-1.256985],[2.441611,.444826],[-.659487,3.111284],[-.459601,-2.618005],[2.17768,2.387793],[-2.920969,2.917485],[-.028814,-4.168078],[3.625746,2.119041],[-3.912363,1.325108],[-.551694,-2.814223],[2.855808,3.483301],[-3.594448,2.856651],[.421993,-2.372646],[1.650821,3.407572],[-2.082902,3.384412],[-.718809,-2.492514],[4.513623,3.841029],[-4.822011,4.607049],[-.656297,-1.449872],[1.919901,4.439368],[-3.287749,3.918836],[-1.576936,-2.977622],[3.598143,1.97597],[-3.977329,4.900932],[-1.79108,-2.184517],[3.914654,3.559303],[-1.910108,4.166946],[-1.226597,-3.317889],[1.148946,3.345138],[-2.113864,3.548172],[.845762,-3.589788],[2.629062,3.535831],[-1.640717,2.990517],[-1.881012,-2.485405],[4.606999,3.510312],[-4.366462,4.023316],[.765015,-3.00127],[3.121904,2.173988],[-4.025139,4.65231],[-.559558,-3.840539],[4.376754,4.863579],[-1.874308,4.032237],[-.089337,-3.026809],[3.997787,2.518662],[-3.082978,2.884822],[.845235,-3.454465],[1.327224,3.358778],[-2.889949,3.596178],[-.966018,-2.839827],[2.960769,3.079555],[-3.275518,1.577068],[.639276,-3.41284]];const s="@global@";function i({dHelper:i}){return{config:{datas:[{label:`${s}.xAxis`,key:"xAxis",type:"mixed",required:true,limit:[1,1]},{label:`${s}.yAxis`,key:"yAxis",type:"mixed",required:true,limit:[1,1]}],settings:[{label:"cluster.title",key:"cluster",comType:"group",rows:[{label:"cluster.clusterCount",key:"clusterCount",default:5,comType:"inputNumber",options:{min:2}}]}],i18ns:[{lang:"zh-CN",translation:{xAxis:"X 轴",yAxis:"Y 轴",cluster:{title:"统计分析",clusterCount:"K值"}}},{lang:"en",translation:{xAxis:"X Axis",yAxis:"Y Axis",cluster:{title:"Clustering",clusterCount:"K Value"}}}]},dependency:["https://fastly.jsdelivr.net/npm/echarts@5.4.1/dist/echarts.min.js","https://fastly.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js"],meta:{id:"clustering-chart",name:"[Experiment] 统计聚类图表",icon:t,requirements:[{group:null,aggregate:null}]},onMount(t,e){if(void 0===t.containerId||!e.document)return;if("echarts"in e.window&&"ecStat"in e.window){const s=e.window.echarts;this.chart=s.init(e.document.getElementById(t.containerId),"default");const i=e.window.ecStat;s.registerTransform(i.transform.clustering)}},onUpdated(t){if(!t.dataset||!t.dataset.columns||!t.config)return;if(!this.isMatchRequirement(t.config)){this.chart?.clear();return}const e=this.getOptions(t.dataset,t.config);this.chart?.setOption(Object.assign({},e),true)},onUnMount(){this.chart?.dispose()},onResize(t,e){this.chart?.resize(e)},getOptions(t,s){const n=s.settings||[];s.datas||[];const a=t.rows?.map((t=>t?.map((t=>+t))));const[r]=i.getStyles(n,["cluster"],["clusterCount"]);var c=r||2;var l=2;var o=["#37A2DA","#e06343","#37a354","#b55dba","#b5bd48","#8378EA","#96BFFF"];var u=[];for(var d=0;d`);this.tableBox=this.jQuery(`#${this.containerId}-scroll-table`).dataTable(r);this.chart.marquee(a)}},onUpdated(e){if(!e.dataset||!e.dataset.columns||!e.config)return;if(!this.isMatchRequirement(e.config))return;this.chart.marquee("destroy");this.tableBox.fnClearTable();this.tableBox.fnDestroy();this.jQuery(`#${this.containerId}-scroll-table`).empty();const{marqueeOptions:t,dataTableOptions:a}=this.getMarqueeOptions(e.dataset,e.config);this.jQuery(`#${this.containerId}-scroll-table`).dataTable(Object.assign(a,{destroy:true}));this.jQuery(`#${this.containerId}-scroll-table thead`).remove();this.jQuery(`#${this.containerId}-scroll-table`).css({border:"none"});this.chart.marquee(t)},onUnMount(){this.tableBox.fnClearTable();this.tableBox.fnDestroy();this.jQuery(`#${this.containerId}-scroll-table`).empty();this.chart.marquee("destroy")},onResize(e,t){const{marqueeOptions:a}=this.getMarqueeOptions(e.dataset,e.config);this.chart.width(t.width+"px");this.chart.marquee("destroy");this.chart.marquee(a)},getMarqueeOptions(e,a){const r=a.styles;const i=a.datas||[];const s=i.filter((e=>"mixed"===e.key)).flatMap((e=>e.rows||[]));const l=t.transformToDataSet(e.rows,e.columns,i);const[n,o,u,d,c,h,p]=t.getStyles(r,["marquee"],["delayBeforeStart","direction","duration","gap","pauseOnHover","duplicated","startVisible"]);return{marqueeOptions:{delayBeforeStart:n||0,direction:o,duration:u||0,gap:d||0,pauseOnHover:c,duplicated:h,startVisible:p,pauseOnCycle:u||0},dataTableOptions:{data:l.map((e=>{const a={};s.forEach((r=>{a[t.getColumnRenderName(r)]=t.toFormattedValue(e.getCell(r),r.format)}));return a})),columns:s.map((e=>({data:t.getColumnRenderName(e)}))),cellBorder:true,autoWidth:true,paging:false,searching:false,ordering:false,info:false}}}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-sovit-sample.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";const e={datas:[{label:"dimension",key:"dimension",required:true,type:"group",maxFieldCount:1},{label:"metrics",key:"metrics",required:true,type:"aggregate",maxFieldCount:1,actions:{NUMERIC:["aggregate","alias","format","colorRange"],STRING:["aggregate","alias","format","colorRange"]}},{label:"filter",key:"filter",type:"filter",allowSameField:true},{label:"size",key:"size",type:"size",maxFieldCount:1}],styles:[{label:"map.title",key:"map",comType:"group",rows:[{label:"map.level",key:"level",comType:"select",default:"china",options:{items:[{label:"中国-省级地图",value:"china"},{label:"中国-地市级地图",value:"china-city"}]}},{label:"map.theme",key:"theme",comType:"select",default:"light",options:{items:[{label:"明亮",value:"light"},{label:"黑暗",value:"dark"}]}},{label:"map.cycleRatio",key:"cycleRatio",comType:"slider",default:1,options:{items:[1,2,4,8]}}]},{label:"label.title",key:"label",comType:"group",rows:[{label:"label.showLabel",key:"showLabel",default:true,comType:"checkbox"},{label:"label.position",key:"position",comType:"select",default:"top",options:{items:[{label:"上",value:"top"},{label:"左",value:"left"},{label:"右",value:"right"},{label:"下",value:"bottom"},{label:"内",value:"inside"},{label:"内左",value:"insideLeft"},{label:"内右",value:"insideRight"},{label:"内上",value:"insideTop"},{label:"内下",value:"insideBottom"},{label:"内左上",value:"insideTopLeft"},{label:"内左下",value:"insideBottomLeft"},{label:"内右上",value:"insideTopRight"},{label:"内右下",value:"insideBottomRight"}]}},{label:"font",key:"font",comType:"font",default:{fontFamily:"PingFang SC",fontSize:"12",fontWeight:"normal",fontStyle:"normal",color:"black"}}]},{label:"viz.palette.style.visualMap.title",key:"visualMap",comType:"group",rows:[{label:"viz.palette.style.visualMap.show",key:"show",default:true,comType:"checkbox"},{label:"viz.palette.style.visualMap.orient",key:"orient",comType:"select",default:"vertical",options:{items:[{label:"竖直",value:"vertical"},{label:"水平",value:"horizontal"}]}},{label:"viz.palette.style.visualMap.align",key:"align",comType:"select",default:"auto",options:{items:[{label:"自动",value:"auto"},{label:"右",value:"right"},{label:"上",value:"top"},{label:"下",value:"bottom"},{label:"左",value:"left"}]}},{label:"viz.palette.style.visualMap.itemWidth",key:"itemWidth",default:20,comType:"inputNumber"},{label:"viz.palette.style.visualMap.itemHeight",key:"itemHeight",default:140,comType:"inputNumber"},{label:"font",key:"font",comType:"font",default:{fontFamily:"PingFang SC",fontSize:"12",fontWeight:"normal",fontStyle:"normal",color:"black"}}]}],i18ns:[{lang:"zh-CN",translation:{chartName:"数维3D示例",common:{showAxis:"显示坐标轴",inverseAxis:"反转坐标轴",lineStyle:"线条样式",borderType:"边框线条类型",borderWidth:"边框线条宽度",borderColor:"边框线条颜色",backgroundColor:"背景颜色",showLabel:"显示标签",unitFont:"刻度字体",rotate:"旋转角度",position:"位置",showInterval:"显示刻度",interval:"刻度间隔",showTitleAndUnit:"显示标题和刻度",nameLocation:"标题位置",nameRotate:"标题旋转",nameGap:"标题与轴线距离",min:"最小值",max:"最大值"},label:{title:"标签",showLabel:"显示标签",position:"位置"},map:{title:"地图设置",level:"默认地图等级",enableZoom:"开启缩放",theme:"主题",cycleRatio:"气泡大像素比"},background:{title:"背景设置"}}},{lang:"en-US",translation:{chartName:"Sovit 3D Sample",common:{showAxis:"Show Axis",inverseAxis:"Inverse Axis",lineStyle:"Line Style",borderType:"Border Type",borderWidth:"Border Width",borderColor:"Border Color",backgroundColor:"Background Color",showLabel:"Show Label",unitFont:"Unit Font",rotate:"Rotate",position:"Position",showInterval:"Show Interval",interval:"Interval",showTitleAndUnit:"Show Title and Unit",nameLocation:"Name Location",nameRotate:"Name Rotate",nameGap:"Name Gap",min:"Min",max:"Max"},label:{title:"Label",showLabel:"Show Label",position:"Postion"},map:{title:"Setting",level:"Level",enableZoom:"Enable Zoom",theme:"Theme",cycleRatio:"Cycle Ratio"},background:{title:"Background Setting"}}}]};var t='\n\n';function a(a){var l=a.dHelper;return{isISOContainer:"sovit-sample",chart:null,config:e,dependency:["https://admin.sovitjs.com/static/sovitjs/jquery-ui.css","https://admin.sovitjs.com/static/sovitjs/SovitChartPaser.min.js"],meta:{id:"experiment-sovit-smaple",name:"chartName",icon:t,requirements:[{group:1,aggregate:[1,2]}]},onMount:function(e,t){if(void 0===e.containerId||!t.document)return;if("SovitChartPaser"in t.window){var a=t.window.SovitChartPaser;var l=new a.SceneMain({apiurl:"https://admin.sovitjs.com/restapi",publishType:1});l.initChart(e.containerId,{pageId:"3221068859372994564"},(function(e,t,a){console.log("comId, eventType, reData ---\x3e ",e,t,a)}))}},onUpdated:function(e,t){var a,l,o;if(!e.dataset||!e.dataset.columns||!e.config)return;if(!this.isMatchRequirement(e.config)){null===(a=this.chart)||void 0===a?void 0:a.clear();return}null===(l=this.chart)||void 0===l?void 0:l.clear();var i=this.getOptions(e.dataset,e.config);null===(o=this.chart)||void 0===o?void 0:o.setOption(Object.assign({},i),true)},onUnMount:function(){var e;null===(e=this.chart)||void 0===e?void 0:e.dispose()},onResize:function(e,t){var a;null===(a=this.chart)||void 0===a?void 0:a.resize(t)},getOptions:function(e,t){var a=t.styles;var o=t.datas||[];o.filter((function(e){return"group"===e.type})).flatMap((function(e){return e.rows||[]}));o.filter((function(e){return"aggregate"===e.type})).flatMap((function(e){return e.rows||[]}));o.filter((function(e){return"size"===e.type})).flatMap((function(e){return e.rows||[]}));l.transformToDataSet(e.rows,e.columns,o);l.getValue(a,["map","theme"]);return null}}}return a})();
2 |
--------------------------------------------------------------------------------
/dist/datart-threejs-bingdundun.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var e='\n';function t({dHelper:t}){return{config:{datas:[{label:"dimension",key:"dimension",required:true,type:"group"},{label:"metrics",key:"metrics",required:true,type:"aggregate"},{label:"filter",key:"filter",type:"filter",allowSameField:true},{label:"colorize",key:"color",type:"color"}],styles:[{label:"label.title",key:"label",comType:"group",rows:[{label:"label.text",key:"text",default:"datart",comType:"input"},{label:"label.fontLeft",key:"fontL",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#0ff"}},{label:"label.fontRight",key:"fontR",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#f0f"}}]}],i18ns:[{lang:"zh-CN",translation:{label:{title:"标签",text:"文本",fontLeft:"主字体",fontRight:"副字体"}}}]},isISOContainer:"experiment-threejs-bingdundun",dependency:["https://unpkg.com/three@0.131.3/build/three.min.js","https://unpkg.com/three@0.131.3/examples/js/libs/stats.min.js","https://unpkg.com/three@0.131.3/examples/js/loaders/GLTFLoader.js","https://unpkg.com/three@0.131.3/examples/js/controls/OrbitControls.js"],meta:{id:"experiment-threejs-bingdundun",name:"[Experiment] 冰墩墩",icon:e,requirements:[{group:null,aggregate:null}]},container:null,stats:null,clock:null,controls:null,camera:null,scene:null,renderer:null,mixer:null,mesh:null,meshes:[],window:null,loadingProcessTimeout:null,onMount(e,t){if(void 0===e.containerId||!t.document)return;const{THREE:n}=t.window;if(!n)return;this.window=t.window;this.container=t.document.getElementById(e.containerId);this.camera=new n.PerspectiveCamera(25,t.window.innerWidth/t.window.innerHeight,1,1e3);this.camera.position.set(0,30,100);this.scene=new n.Scene;this.clock=new n.Clock;const i=new n.LoadingManager;const r=new n.GLTFLoader(i);const s=e=>{e.scene.traverse((e=>{if(e.isMesh){this.meshes.push(e);if("皮肤"===e.name){e.material.metalness=.3;e.material.roughness=.8}if("外壳"===e.name){e.material.transparent=true;e.material.opacity=.4;e.material.metalness=.4;e.material.roughness=0;e.material.refractionRatio=1.6;e.castShadow=true;e.material.envMapIntensity=1}if("围脖"===e.name){e.material.transparent=true;e.material.opacity=.6;e.material.metalness=.4;e.material.roughness=.6}}}));e.scene.rotation.y=Math.PI/24;e.scene.position.set(0,0,0);e.scene.scale.set(16,16,16);this.scene.fog=new n.Fog(16777215,10,100);this.scene.add(e.scene)};r.load("https://unpkg.com/datart-extension-charts@0.0.1/plugins/datart-threejs-bingdundun/bingdundun.glb",s)},onUpdated(e,t){if(!e.dataset||!e.dataset.columns||!e.config)return;if(!this.isMatchRequirement(e.config)){this.chart.clear();return}const{THREE:n,Stats:i}=t.window;const r=new n.GridHelper(10,20,8947848,4473924);this.scene.add(r);const s=new n.AmbientLight(16777215,.2);this.scene.add(s);const a=new n.PointLight(16777215,.8);this.scene.add(this.camera);this.camera.add(a);this.renderer=new n.WebGLRenderer({antialias:true});this.renderer.outputEncoding=n.sRGBEncoding;this.renderer.shadowMap.enabled=true;this.renderer.setPixelRatio(window.devicePixelRatio);this.renderer.setSize(t.window.innerWidth,t.window.innerHeight);this.container.appendChild(this.renderer.domElement);this.controls=new n.OrbitControls(this.camera,this.renderer.domElement);this.controls.screenSpacePanning=true;this.controls.minDistance=5;this.controls.maxDistance=40;this.controls.target.set(0,2,0);this.controls.update();this.stats=new i;this.container.appendChild(this.stats.dom);this.animate(t.window)},onUnMount(){},onResize(e,t){this.camera.aspect=t.window.innerWidth/t.window.innerHeight;this.camera.updateProjectionMatrix();this.renderer.setSize(t.window.innerWidth,t.window.innerHeight)},animate(){this.window.requestAnimationFrame(this.animate.bind(this));this.render();this.stats.update()},render(){const e=this.clock.getDelta();if(!!this.mixer)this.mixer.update(e);this.renderer.render(this.scene,this.camera)}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-threejs-webgl.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var e='\n';function t({dHelper:t}){return{config:{datas:[{label:"dimension",key:"dimension",required:true,type:"group"},{label:"metrics",key:"metrics",required:true,type:"aggregate"},{label:"filter",key:"filter",type:"filter",allowSameField:true},{label:"colorize",key:"color",type:"color"}],styles:[{label:"label.title",key:"label",comType:"group",rows:[{label:"label.text",key:"text",default:"datart",comType:"input"},{label:"label.fontLeft",key:"fontL",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#0ff"}},{label:"label.fontRight",key:"fontR",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#f0f"}}]}],i18ns:[{lang:"zh-CN",translation:{label:{title:"标签",text:"文本",fontLeft:"主字体",fontRight:"副字体"}}}]},isISOContainer:"experiment-threejs-chart",dependency:["https://unpkg.com/three@0.131.3/build/three.min.js","https://unpkg.com/three@0.131.3/examples/js/libs/stats.min.js","https://unpkg.com/three@0.131.3/examples/js/loaders/ColladaLoader.js","https://unpkg.com/three@0.131.3/examples/js/controls/OrbitControls.js"],meta:{id:"experiment-threejs-chart",name:"[Experiment] ThreeJS",icon:e,requirements:[{group:null,aggregate:null}]},container:null,stats:null,clock:null,controls:null,camera:null,scene:null,renderer:null,mixer:null,mesh:null,window:null,onMount(e,t){if(void 0===e.containerId||!t.document)return;const{THREE:n}=t.window;if(!n)return;this.window=t.window;this.container=t.document.getElementById(e.containerId);this.camera=new n.PerspectiveCamera(25,t.window.innerWidth/t.window.innerHeight,1,1e3);this.camera.position.set(15,10,-15);this.scene=new n.Scene;this.clock=new n.Clock;const i=new n.ColladaLoader;const r=e=>{const t=e.scene;const i=t.animations;t.traverse((function(e){if(e.isSkinnedMesh)e.frustumCulled=false}));this.mixer=new n.AnimationMixer(t);this.mixer.clipAction(i[0]).play();this.scene.add(t)};i.load("https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/models/collada/stormtrooper/stormtrooper.dae",r)},onUpdated(e,t){if(!e.dataset||!e.dataset.columns||!e.config)return;if(!this.isMatchRequirement(e.config)){this.chart.clear();return}const{THREE:n,Stats:i}=t.window;const r=new n.GridHelper(10,20,8947848,4473924);this.scene.add(r);const o=new n.AmbientLight(16777215,.2);this.scene.add(o);const s=new n.PointLight(16777215,.8);this.scene.add(this.camera);this.camera.add(s);this.renderer=new n.WebGLRenderer({antialias:true});this.renderer.outputEncoding=n.sRGBEncoding;this.renderer.setPixelRatio(window.devicePixelRatio);this.renderer.setSize(t.window.innerWidth,t.window.innerHeight);this.container.appendChild(this.renderer.domElement);this.controls=new n.OrbitControls(this.camera,this.renderer.domElement);this.controls.screenSpacePanning=true;this.controls.minDistance=5;this.controls.maxDistance=40;this.controls.target.set(0,2,0);this.controls.update();this.stats=new i;this.container.appendChild(this.stats.dom);this.animate(t.window)},onUnMount(){},onResize(e,t){this.camera.aspect=t.window.innerWidth/t.window.innerHeight;this.camera.updateProjectionMatrix();this.renderer.setSize(t.window.innerWidth,t.window.innerHeight)},animate(){this.window.requestAnimationFrame(this.animate.bind(this));this.render();this.stats.update()},render(){const e=this.clock.getDelta();if(!!this.mixer)this.mixer.update(e);this.renderer.render(this.scene,this.camera)}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-uml.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var e='';function t({dHelper:t}){const n={code:`%%{config: { 'fontFamily': 'Menlo', 'fontSize': 12, 'fontWeight': 400} }%%\n %%{init: { 'logLevel': 'debug', 'theme': '' } }%%\n \n sequenceDiagram\n participant A as 项目主入口\n participant C as 图表管理器\n participant V as 可视化模块\n participant S as 后端服务\n \n A->>C: 初始化 Chart Manager\n C->>S: 请求插件图表路径集合\n S--\x3e>C: 返回插件图表路径集合\n Note right of S: 服务端将从'custom-chart-plugins'文件夹读取自定义组件\n loop 插件集合\n C->>S: 下载插件图表\n S--\x3e>C: 返回插件图表路文件\n C--\x3e>C: 检查及加载插件图表文件\n end\n C->>C: 加载默认图表集合\n C--\x3e>A: 完成图表初始化\n A->>V: 切换到可视化模块开始制作自定义图表\n V->>S: 保存制作完成的图表\n `,watermark:`Powered by Datart`};return{config:{datas:[],styles:[{label:"code.title",key:"code",comType:"group",rows:[{label:"code.area",key:"area",comType:"text",options:{}}]},{label:"watermark.title",key:"watermark",comType:"group",rows:[{label:"watermark.area",key:"area",comType:"text",options:{}}]}],settings:[],i18ns:[{lang:"zh-CN",translation:{code:{title:"代码设置",area:"编辑区"},watermark:{title:"水印设置",area:"编辑区"}}},{lang:"en",translation:{code:{title:"Code Setting",area:"Editor Block"},watermark:{title:"Watermark Setting",area:"Editor Block"}}}]},isISOContainer:"experiment-mermaid-uml-chart",dependency:["https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.13.3/mermaid.min.js"],meta:{id:"experiment-mermaid-uml-chart",name:"[Experiment] Mermaid UML",icon:e,requirements:[{group:null,aggregate:null}]},_containerId:null,onMount(e,t){this._containerId=e.containerId;if("mermaid"in t.window){this.chart=t.window.mermaid.mermaidAPI;this.chart.initialize({startOnLoad:false})}},onUpdated(e,a){const r=e.config.styles;const i=t.getValue(r,["code","area"])||n.code;const o=t.getValue(r,["watermark","area"])||n.watermark;var s=a.document.getElementById(this._containerId);if(this.chart&&s){this.chart.render("theGraph",i,(function(e){s.style.position="relative";s.style.overflow="hidden";s.style.margin="20px";s.innerHTML=e}));this.addWatermark(s,o,a)}},onUnMount(){},onResize(e,t){},addWatermark(e,t,n){if(!t)return;const a=n.document.createElement("div");a.style.position="absolute";a.style.left="-50%";a.style.top="-50%";a.style.width="200%";a.style.height="200%";a.style.color="#f1f1f1";a.style["line-height"]="90px";a.style["z-index"]=1;a.style["font-size"]="18px";a.style["-webkit-transform"]="rotate(-45deg)";a.style["-webkit-transform"]="rotate(-45deg)";a.innerHTML=`\n ${Array(Math.ceil(1/t.length*2e3)).fill(`${t}`).join(Array(20).fill(" ").join(" "))}
\n `;e.appendChild(a)}}}return t})();
2 |
--------------------------------------------------------------------------------
/dist/datart-vue-carousel.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var t='';function e({dHelper:e}){return{config:{datas:[{label:"dimension",key:"dimension",type:"group"},{label:"filter",key:"filter",type:"filter",allowSameField:true}],styles:[{label:"carousel.title",key:"carousel",comType:"group",rows:[{label:"carousel.interval",key:"interval",comType:"inputNumber",default:3e3,options:{min:0,step:1}}]}],settings:[{label:"viz.palette.setting.paging.title",key:"paging",comType:"group",rows:[{label:"viz.palette.setting.paging.pageSize",key:"pageSize",default:1e3,comType:"inputNumber",options:{needRefresh:true,step:1,min:0}}]}],i18ns:[{lang:"zh-CN",translation:{chartName:"[Experiment] 用户自定义Vue跑马灯",carousel:{title:"跑马灯",interval:"切换间隔(毫秒)"}}},{lang:"en-US",translation:{chartName:"[Experiment] Vue Carousel",carousel:{title:"Carousel",interval:"Interval(MS)"}}}]},isISOContainer:"demo-customize-line-chart",dependency:["https://cdn.jsdelivr.net/npm/vue@2.6.14"],meta:{id:"demo-vue-carousel",name:"chartName",icon:t,requirements:[{group:1}]},chartId:"vueCarousel",onMount(t,e){if("Vue"in e.window){e.document.getElementById(t.containerId).innerHTML=``;const i=e.window.Vue;this.chart=new i({el:`#${this.chartId}`,template:this.getTemplate(),data:{nowIndex:0,list:[],btnStyle:{display:"inline-block",margin:"0 20px",width:"10px",height:"10px",border:"1px solid #000",borderRadius:"50%"},actionBtnStyle:{display:"inline-block",margin:"0 20px",width:"10px",height:"10px",border:"1px solid #000",borderRadius:"50%",background:"#000"},setTime:3e3,timer:null},methods:{onClickBtn(t){this.nowIndex=t;this.initInterval()},initInterval(t=this.setTime){if(this.timer)clearInterval(this.timer);if(t)this.timer=setInterval((()=>{this.nowIndex+=1;if(this.nowIndex>=this.list.length)this.nowIndex=0}),t)},getImage(t){return t}},watch:{setTime:function(t){this.initInterval(t)},list:{handler:function(t){if(t.length){this.nowIndex=0;this.initInterval()}},deep:true}},mounted:function(){if(this.list.length)this.initInterval()}})}},onUpdated(t){if(!t.dataset||!t.dataset.columns||!t.config)return;const i=t.config.datas||[];const n=i.filter((t=>"group"===t.type)).flatMap((t=>t.rows||[]));const a=t.config.styles||[];const s=e.transformToDataSet(t.dataset.rows,t.dataset.columns,i);const[l]=e.getStyles(a,["carousel"],["interval"]);this.chart.$data.list=s.map((t=>t.getCell(n[0])));this.chart.$data.setTime=void 0!==l?l:3e3},onUnMount(){if(this.chart.$data.timer)clearInterval(this.chart.$data.timer);this.chart=null},onResize(){},getTemplate(){return`\n \n
\n
![]()
\n
\n
\n
\n `}}}return e})();
2 |
--------------------------------------------------------------------------------
/dist/datart-vuejs.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";var n='';function e({dHelper:e}){const t=()=>`\n \`\`\`js\n import Chart from 'app/pages/ChartWorkbenchPage/models/Chart';\n import { getStyleValueByGroup } from 'app/utils/chart';\n import Config from './config';\n\n class VueJSChart extends Chart {\n constructor() {\n super('vue-chart', 'DEMO - VueJS Chart', 'star');\n }\n \n isISOContainer = 'vue-chart-container';\n config = Config;\n dependency = [\n 'https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js',\n 'https://cdn.jsdelivr.net/npm/vue-markdown@2.2.4/dist/vue-markdown.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css',\n ];\n chart: any = null;\n nodeId = 'vue';\n \n onMount(options, context): void {\n const node = context.document.createElement('div');\n node.setAttribute('id', this.nodeId);\n context.document.getElementById(options.containerId).appendChild(node);\n \n const Vue = context.window.Vue;\n Vue.use(context.window.VueMarkdown);\n this.chart = new Vue({\n el: \`#\${this.nodeId}\`,\n data: { vue: 'Hello', person: { name: 'Stephen' }, content: getCode() },\n template: this.getTemplate(),\n methods: {\n greet: function (event) {\n alert('Hello My Friends ~ this.me');\n },\n },\n });\n }\n \n onUpdated(options, context): void {\n if (!this.isMatchRequirement(options.config)) {\n return;\n }\n\n const name = this.getInfo(options?.config?.styles);\n this.chart.$set(this.chart.person, 'name', name);\n }\n \n onUnMount(): void {}\n \n private getInfo(styleConfigs) {\n const name = getStyleValueByGroup(styleConfigs, 'label', 'name');\n return name;\n }\n \n private getTemplate() {\n return \`\n \n
\n \n {{ vue }} {{ person.name }} ,
\n Welcome to VueJS Chart Demo ~
\n \n \n \n {{content}}\n \n \n \n
\n \`;\n }\n }\n \`\`\`\n `;return{config:{styles:[{label:"label",key:"label",comType:"group",rows:[{label:"name",key:"name",default:"Friends",comType:"input"},{label:"font",key:"font",comType:"font",default:{fontFamily:"PingFang SC",fontSize:"24",fontWeight:"normal",fontStyle:"normal",color:"yellow"}}]}],i18ns:[{lang:"zh-CN",translation:{label:"标签",name:"你的姓名"}},{lang:"en-US",translation:{label:"Label",name:"Your Name"}}]},isISOContainer:"experiment-vue-dynamic-chart",dependency:["https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js","https://cdn.jsdelivr.net/npm/vue-markdown@2.2.4/dist/vue-markdown.js","https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css"],meta:{id:"experiment-vue-dynamic-chart",name:"[Experiment] VUEJS Chart",icon:n,requirements:[{group:null,aggregate:null}]},onMount(n,e){const o=e.document.createElement("div");o.setAttribute("id",this.nodeId);e.document.getElementById(n.containerId).appendChild(o);const a=e.window.Vue;a.use(e.window.VueMarkdown);this.chart=new a({el:`#${this.nodeId}`,data:{vue:"Hello",person:{name:"Stephen"},content:t()},template:this.getTemplate(),methods:{greet:function(n){alert("Hello My Friends ~ this.me")}}})},onUpdated(n,e){if(!this.isMatchRequirement(n.config))return;const t=this.getInfo(n?.config?.styles);this.chart.$set(this.chart.person,"name",t)},onUnMount(){},onResize(n,e){},getInfo(n){const t=e.getValue(n,["label","name"]);return t},getTemplate(){return`\n \n
\n \n {{ vue }} {{ person.name }} ,
\n Welcome to VueJS Chart Demo ~
\n \n \n \n {{content}}\n \n \n \n
\n `}}}return e})();
2 |
--------------------------------------------------------------------------------
/dist/datart-zrender.iife.js:
--------------------------------------------------------------------------------
1 | (function(){"use strict";function t({dHelper:t}){return{config:{datas:[{label:"dimension",key:"dimension",required:true,type:"group"},{label:"metrics",key:"metrics",required:true,type:"aggregate"},{label:"filter",key:"filter",type:"filter",allowSameField:true},{label:"colorize",key:"color",type:"color"}],styles:[{label:"label.title",key:"label",comType:"group",rows:[{label:"label.text",key:"text",default:"datart",comType:"input"},{label:"label.fontLeft",key:"fontL",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#0ff"}},{label:"label.fontRight",key:"fontR",comType:"font",default:{fontFamily:"Lato",fontSize:200,fontWeight:"bolder",fontStyle:"normal",color:"#f0f"}}]}],i18ns:[{lang:"zh-CN",translation:{label:{title:"标签",text:"文本",fontLeft:"主字体",fontRight:"副字体"}}}]},isISOContainer:"experiment-zrender-chart",dependency:["https://ecomfe.github.io/zrender-doc/public/lib/js/zrender.min.js"],meta:{id:"experiment-zrender-chart",name:"[Experiment] ZRender Chart",icon:"chart",requirements:[{group:null,aggregate:null}]},onMount(t,e){if(void 0===t.containerId||!e.document)return;const{zrender:n}=e.window;if(!n)return;this.chart=n.init(e.document.getElementById(t.containerId));this.mouseEvents.forEach((t=>{this.chart.on(t.name,t.callback)}))},onUpdated(t,e){if(!t.dataset||!t.dataset.columns||!t.config)return;if(!this.isMatchRequirement(t.config)){this.chart.clear();return}this.draw(e,t.config.styles)},onUnMount(){this.chart&&this.chart.dispose()},onResize(t,e){this.draw(e,t?.config?.styles)},draw(t,e){const{text:n,fontL:i,fontR:o}=this.getText(e);const{zrender:r}=t.window;const a=this.chart;var l=t.width||a.getWidth();var f=t.height||a.getHeight();a.clear();a.resize({width:l,height:f});var h=new r.Rect({style:{fill:"#333"},shape:{width:l,height:f}});a.add(h);var d=new r.Text({style:{text:n,textAlign:"center",textVerticalAlign:"middle",fontSize:i.fontSize,fontFamily:i.fontFamily,fontWeight:i.fontWight,textFill:i.color,blend:"lighten"},position:[l/2+5,f/2]});a.add(d);var s=new r.Text({style:{text:n,textAlign:"center",textVerticalAlign:"middle",fontSize:o.fontSize,fontFamily:o.fontFamily,fontWeight:o.fontWight,textFill:o.color,blend:"lighten"},position:[l/2,f/2]});a.add(s);var c=[];for(var m=0;m<16;++m){var g=new r.Rect({shape:{x:l*(Math.random()-.3),y:f*Math.random(),width:l*(Math.random()+.3),height:8*Math.random()},style:{fill:["#ff0","#f0f","#0ff","#00f"][Math.floor(4*Math.random())],blend:"lighten",opacity:0}});a.add(g);c.push(g)}if(this.timerId)t.window.clearInterval(this.timerId);this.timerId=setInterval((function(){if(Math.random()>.2){s.attr("position",[l/2+50*Math.random(),f/2]);for(var t=0;t c.type === "group")
172 | .flatMap((config) => config.rows || []);
173 |
174 | // 获取指标类型配置信息
175 | const aggregateConfigs = dataConfigs
176 | .filter((c) => c.type === "aggregate")
177 | .flatMap((config) => config.rows || []);
178 |
179 | // 数据转换,根据Datart提供了Helper转换工具
180 | const objDataColumns = dHelper.transformToObjectArray(
181 | dataset.rows,
182 | dataset.columns
183 | );
184 | const data = objDataColumns.map((dc) => {
185 | return {
186 | x: dc[dHelper.getValueByColumnKey(aggregateConfigs[0])],
187 | y: dc[dHelper.getValueByColumnKey(aggregateConfigs[1])],
188 | };
189 | });
190 |
191 | var xMinValue = Math.min(...data.map((o) => o.x));
192 | var xMaxValue = Math.max(...data.map((o) => o.y));
193 |
194 | var yMinValue = Math.min(...data.map((o) => o.y));
195 | var yMaxValue = Math.max(...data.map((o) => o.y));
196 |
197 | // 获取用户配置
198 | const color = dHelper.getStyleValueByGroup(
199 | styleConfigs,
200 | "scatter",
201 | "color"
202 | );
203 |
204 | return {
205 | style: {
206 | color,
207 | },
208 | data: data.map((d) => {
209 | return {
210 | x: ((d.x || xMinValue - xMinValue) * 100) / (xMaxValue - xMinValue),
211 | y: ((d.y || yMinValue - yMinValue) * 100) / (yMaxValue - yMinValue),
212 | };
213 | }),
214 | };
215 | },
216 |
217 | onUnMount() {},
218 | };
219 | }
220 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "datart-extension-charts",
3 | "version": "0.0.1",
4 | "description": "Datart Extension Charts",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/Cuiyansong/datart-extension-charts-fork.git"
8 | },
9 | "author": "Stephen Cui",
10 | "license": "Apache-2.0",
11 | "bugs": {
12 | "url": "https://github.com/Cuiyansong/datart-extension-charts-fork/issues"
13 | },
14 | "homepage": "https://github.com/Cuiyansong/datart-extension-charts-fork#readme",
15 | "scripts": {
16 | "build": "rollup -c",
17 | "build:watch": "rollup -c -w"
18 | },
19 | "devDependencies": {
20 | "@rollup/plugin-json": "^4.1.0",
21 | "@rollup/plugin-node-resolve": "^13.3.0",
22 | "@rollup/plugin-typescript": "^8.3.0",
23 | "commitizen": "^4.2.4",
24 | "cz-conventional-changelog": "3.3.0",
25 | "rollup": "^2.60.2",
26 | "rollup-plugin-progress": "^1.1.2",
27 | "rollup-plugin-svg": "^2.0.0",
28 | "rollup-plugin-terser": "^7.0.2",
29 | "tslib": "^2.3.1",
30 | "typescript": "^4.2.2"
31 | },
32 | "config": {
33 | "commitizen": {
34 | "path": "./node_modules/cz-conventional-changelog"
35 | }
36 | },
37 | "dependencies": {
38 | "three": "^0.135.0",
39 | "three-mesh-bvh": "^0.5.22",
40 | "web-ifc-three": "^0.0.121"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/plugins/datart-3d-map/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 3D地图 插件图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | ## 使用说明
7 | 
8 |
9 | ### 数据区域配置
10 |
11 | - 维度: 地理信息数据字段
12 | - 指标: 根据指标决定【视觉映射】颜色深浅
13 | - 大小: 根据指标决定气泡大小,并且可以在样式配置区域更改相对半径值
14 | - 过滤: 过滤不需要的数据,可以是维度条件,也可以是指标条件
15 |
16 | ### 样式区域配置
17 | - 可切换`省级`和`地市级`,对应`维度`区域的地区设置,**目前可能没有那么完善,基于内置的区域名称和维度值名称匹配**
18 |
19 |
--------------------------------------------------------------------------------
/plugins/datart-3d-map/experiment-3d-map-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-3d-map/experiment-3d-map-chart.png
--------------------------------------------------------------------------------
/plugins/datart-3d-map/gaode-map-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-3d-map/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { mapChart } from "./experiment-3d-map-chart";
20 |
21 | export default mapChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-amap/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 高德地图 插件图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | __Note: 请将文件`experiment-amap-chart.js`中的高德地图Key换成自己注册的使用, 该Key仅仅作为临时样例使用。__
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | - 维度: 地理信息数据字段
13 | - 指标: 根据指标决定【视觉映射】颜色深浅
14 | - 大小: 根据指标决定气泡大小,并且可以在样式配置区域更改相对半径值
15 | - 过滤: 过滤不需要的数据,可以是维度条件,也可以是指标条件
16 |
17 | ### 样式区域配置
18 | - 可切换`省级`和`地市级`,对应`维度`区域的地区设置,**目前可能没有那么完善,基于内置的区域名称和维度值名称匹配**
19 |
20 |
--------------------------------------------------------------------------------
/plugins/datart-amap/gaode-map-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-amap/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { GaodeMapChart } from "./experiment-amap-chart";
20 |
21 | export default GaodeMapChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-antd-react/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 基于Ant Design React组件的图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | ## 使用说明
7 |
8 | 
--------------------------------------------------------------------------------
/plugins/datart-antd-react/antd-react-table-plugin-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-antd-react/antd-react-table-plugin-chart.png
--------------------------------------------------------------------------------
/plugins/datart-antd-react/experiment-antd-react-chart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | export function AntDesignChart({ dHelper }) {
20 | const icon =
21 | "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI+CiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8+CiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8+CiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8+CiAgPC9nPgo8L3N2Zz4K";
22 |
23 | return {
24 | config: {
25 | datas: [],
26 | styles: [
27 | {
28 | label: "code.title",
29 | key: "code",
30 | comType: "group",
31 | rows: [
32 | {
33 | label: "code.area",
34 | key: "area",
35 | comType: "text",
36 | options: {},
37 | },
38 | ],
39 | },
40 | {
41 | label: "watermark.title",
42 | key: "watermark",
43 | comType: "group",
44 | rows: [
45 | {
46 | label: "watermark.area",
47 | key: "area",
48 | comType: "text",
49 | options: {},
50 | },
51 | ],
52 | },
53 | ],
54 | settings: [],
55 | i18ns: [
56 | {
57 | lang: "zh-CN",
58 | translation: {
59 | code: {
60 | title: "代码设置",
61 | area: "编辑区",
62 | },
63 | watermark: {
64 | title: "水印设置",
65 | area: "编辑区",
66 | },
67 | },
68 | },
69 | {
70 | lang: "en",
71 | translation: {
72 | code: {
73 | title: "Code Setting",
74 | area: "Editor Block",
75 | },
76 | watermark: {
77 | title: "Watermark Setting",
78 | area: "Editor Block",
79 | },
80 | },
81 | },
82 | ],
83 | },
84 | _containerId: null,
85 | isISOContainer: "experiment-antd-react-chart",
86 | dependency: [
87 | "https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js",
88 | "https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js",
89 | "https://cdnjs.cloudflare.com/ajax/libs/antd/4.24.1/antd.min.js",
90 | "https://cdnjs.cloudflare.com/ajax/libs/antd/4.24.1/antd.min.css",
91 | ],
92 | meta: {
93 | id: "experiment-antd-react-chart",
94 | name: "[Experiment] Ant Design React",
95 | icon: "chart",
96 | },
97 | _ReactDom: null,
98 | _React: null,
99 |
100 | onMount(options, context) {
101 | this._containerId = options.containerId;
102 | if ("React" in context.window && "ReactDOM" in context.window) {
103 | this._ReactDOM = context.window.ReactDOM;
104 | this._React = context.window.React;
105 | const root = this._ReactDOM.createRoot(
106 | context.document.getElementById(options.containerId)
107 | );
108 | root.render(this.buildComponent(context.window));
109 | }
110 | },
111 |
112 | onUpdated(options, context) {
113 | const styles = options.config.styles;
114 | },
115 |
116 | onUnMount() {
117 | // this.chart && this.chart.dispose();
118 | },
119 |
120 | onResize(opt, context) {
121 | // this.chart && this.chart.resize(context);
122 | },
123 |
124 | buildComponent({ antd }) {
125 | const e = this._React.createElement;
126 | const dataSource = [
127 | {
128 | key: "1",
129 | name: "Mike",
130 | age: 32,
131 | address: "10 Downing Street",
132 | },
133 | {
134 | key: "2",
135 | name: "John",
136 | age: 42,
137 | address: "10 Downing Street",
138 | },
139 | ];
140 | const columns = [
141 | {
142 | title: "Name",
143 | dataIndex: "name",
144 | key: "name",
145 | },
146 | {
147 | title: "Age",
148 | dataIndex: "age",
149 | key: "age",
150 | },
151 | {
152 | title: "Address",
153 | dataIndex: "address",
154 | key: "address",
155 | },
156 | ];
157 | return e("div", null, [
158 | e('h1', null, 'Hello World!'),
159 | e(antd.Table, { dataSource, columns }, null),
160 | ]);
161 | },
162 | };
163 | }
164 |
--------------------------------------------------------------------------------
/plugins/datart-antd-react/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { AntDesignChart } from "./experiment-antd-react-chart";
20 |
21 | export default AntDesignChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-antv-box/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Antv G2Plot Box Chart
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ### 参考属性
9 | https://g2plot.antv.antgroup.com/api/plots/box
10 |
11 |
--------------------------------------------------------------------------------
/plugins/datart-antv-box/experiment-antv-box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-antv-box/experiment-antv-box.png
--------------------------------------------------------------------------------
/plugins/datart-antv-box/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { AntVBox } from "./experiment-antv-box";
20 |
21 | export default AntVBox;
22 |
--------------------------------------------------------------------------------
/plugins/datart-antv-sankey/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Antv G2Plot Sankey Chart
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ### 参考属性
9 | https://charts.ant.design/zh/examples/relation-plots/sankey#draggable
10 |
--------------------------------------------------------------------------------
/plugins/datart-antv-sankey/experiment-antv-sankey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-antv-sankey/experiment-antv-sankey.png
--------------------------------------------------------------------------------
/plugins/datart-antv-sankey/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { AntVSankey } from "./experiment-antv-sankey";
20 |
21 | export default AntVSankey;
22 |
--------------------------------------------------------------------------------
/plugins/datart-antvg2/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] AntV GG
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/plugins/datart-antvg2/experiment-antvg2-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-antvg2/experiment-antvg2-chart.png
--------------------------------------------------------------------------------
/plugins/datart-antvg2/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { AntVG2Chart } from "./experiment-antvg2-chart";
20 |
21 | export default AntVG2Chart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-babylon/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] BabylonJS Demo
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/plugins/datart-babylon/babylon-js-demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-babylon/babylon-js-demo.png
--------------------------------------------------------------------------------
/plugins/datart-babylon/babylon-js-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-babylon/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { BabylonJSDemo } from "./experiment-babylon";
20 |
21 | export default BabylonJSDemo;
22 |
--------------------------------------------------------------------------------
/plugins/datart-bmap/baidu-map-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-bmap/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { BMap } from "./experiment-bmap-chart";
20 |
21 | export default BMap;
22 |
--------------------------------------------------------------------------------
/plugins/datart-chartjs/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] ChartJS
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 | [ChartJS](https://www.chartjs.org/) official site.
10 |
11 | ### 数据区域配置
12 |
13 | ### 样式区域配置
14 |
15 |
16 |
--------------------------------------------------------------------------------
/plugins/datart-chartjs/chartjs-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/plugins/datart-chartjs/experiment-chartjs-sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-chartjs/experiment-chartjs-sample.png
--------------------------------------------------------------------------------
/plugins/datart-chartjs/experiment-chartjs.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import ChartJSIcon from "./chartjs-logo.svg";
20 |
21 | export function ChartJS({ dHelper }) {
22 | const mockData = {
23 | labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
24 | datasets: [
25 | {
26 | label: "# of Votes",
27 | data: [12, 19, 3, 5, 2, 3],
28 | backgroundColor: [
29 | "rgba(255, 99, 132, 0.2)",
30 | "rgba(54, 162, 235, 0.2)",
31 | "rgba(255, 206, 86, 0.2)",
32 | "rgba(75, 192, 192, 0.2)",
33 | "rgba(153, 102, 255, 0.2)",
34 | "rgba(255, 159, 64, 0.2)",
35 | ],
36 | borderColor: [
37 | "rgba(255, 99, 132, 1)",
38 | "rgba(54, 162, 235, 1)",
39 | "rgba(255, 206, 86, 1)",
40 | "rgba(75, 192, 192, 1)",
41 | "rgba(153, 102, 255, 1)",
42 | "rgba(255, 159, 64, 1)",
43 | ],
44 | borderWidth: 1,
45 | },
46 | ],
47 | };
48 |
49 | return {
50 | config: {
51 | datas: [
52 | {
53 | label: "dimension",
54 | key: "dimension",
55 | actions: ["sortable", "alias"],
56 | },
57 | {
58 | label: "metrics",
59 | key: "metrics",
60 | rows: [],
61 | actions: ["format", "aggregate"],
62 | },
63 | ],
64 | styles: [],
65 | settings: [],
66 | i18ns: [
67 | {
68 | lang: "zh-CN",
69 | translation: {
70 | chartName: "ChartJS",
71 | },
72 | },
73 | {
74 | lang: "en-US",
75 | translation: {
76 | chartName: "ChartJS",
77 | },
78 | },
79 | ],
80 | },
81 | isISOContainer: "experiment-chartjs-chart",
82 | dependency: ["https://cdn.jsdelivr.net/npm/chart.js@2.8.0"],
83 | meta: {
84 | id: "experiment-chartjs-chart",
85 | name: "chartName",
86 | icon: ChartJSIcon,
87 | requirements: [
88 | {
89 | group: null,
90 | aggregate: null,
91 | },
92 | ],
93 | },
94 |
95 | onMount(options, context) {
96 | if (options.containerId === undefined || !context.document) {
97 | return;
98 | }
99 | const { Chart } = context.window.Chart;
100 | if (!Chart) {
101 | return;
102 | }
103 |
104 | const node = context.document.createElement("canvas");
105 | node.id = "chartjs-canvas-container";
106 | context.document.getElementById(options.containerId).appendChild(node);
107 |
108 | var ctx = context.document
109 | .getElementById("chartjs-canvas-container")
110 | .getContext("2d");
111 | var myChart = new Chart(ctx, {
112 | type: "bar",
113 | data: mockData,
114 | options: {
115 | scales: {
116 | yAxes: [
117 | {
118 | ticks: {
119 | beginAtZero: true,
120 | },
121 | },
122 | ],
123 | },
124 | },
125 | });
126 | },
127 |
128 | onUpdated(props, context) {},
129 |
130 | onUnMount() {},
131 |
132 | onResize(opt, context) {},
133 | };
134 | }
135 |
--------------------------------------------------------------------------------
/plugins/datart-chartjs/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ChartJS } from "./experiment-chartjs";
20 |
21 | export default ChartJS;
22 |
--------------------------------------------------------------------------------
/plugins/datart-clustering/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] EChart 统计聚类图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/plugins/datart-clustering/experiment-cluster-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-clustering/experiment-cluster-chart.png
--------------------------------------------------------------------------------
/plugins/datart-clustering/experiment-clustering-chart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import Icon from "./icon.svg";
20 | import SampleData from "./sample";
21 |
22 | const DATART_TRANSLATE_HOLDER = "@global@";
23 |
24 | export function ClusteringChart({ dHelper }) {
25 | return {
26 | config: {
27 | datas: [
28 | {
29 | label: `${DATART_TRANSLATE_HOLDER}.xAxis`,
30 | key: "xAxis",
31 | type: "mixed",
32 | required: true,
33 | limit: [1, 1],
34 | },
35 | {
36 | label: `${DATART_TRANSLATE_HOLDER}.yAxis`,
37 | key: "yAxis",
38 | type: "mixed",
39 | required: true,
40 | limit: [1, 1],
41 | },
42 | ],
43 | settings: [
44 | {
45 | label: "cluster.title",
46 | key: "cluster",
47 | comType: "group",
48 | rows: [
49 | {
50 | label: "cluster.clusterCount",
51 | key: "clusterCount",
52 | default: 5,
53 | comType: "inputNumber",
54 | options: {
55 | min: 2,
56 | },
57 | },
58 | ],
59 | },
60 | ],
61 | i18ns: [
62 | {
63 | lang: "zh-CN",
64 | translation: {
65 | xAxis: "X 轴",
66 | yAxis: "Y 轴",
67 | cluster: {
68 | title: "统计分析",
69 | clusterCount: "K值",
70 | },
71 | },
72 | },
73 | {
74 | lang: "en",
75 | translation: {
76 | xAxis: "X Axis",
77 | yAxis: "Y Axis",
78 | cluster: {
79 | title: "Clustering",
80 | clusterCount: "K Value",
81 | },
82 | },
83 | },
84 | ],
85 | },
86 | dependency: [
87 | "https://fastly.jsdelivr.net/npm/echarts@5.4.1/dist/echarts.min.js",
88 | "https://fastly.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js",
89 | ],
90 | meta: {
91 | id: "clustering-chart",
92 | name: "[Experiment] 统计聚类图表",
93 | icon: Icon,
94 | requirements: [
95 | {
96 | group: null,
97 | aggregate: null,
98 | },
99 | ],
100 | },
101 |
102 | onMount(options, context) {
103 | if (options.containerId === undefined || !context.document) {
104 | return;
105 | }
106 |
107 | if ("echarts" in context.window && "ecStat" in context.window) {
108 | const echarts = context.window.echarts;
109 | this.chart = echarts.init(
110 | context.document.getElementById(options.containerId),
111 | "default"
112 | );
113 | const ecStat = context.window.ecStat;
114 | echarts.registerTransform(ecStat.transform.clustering);
115 | }
116 | },
117 |
118 | onUpdated(props) {
119 | if (!props.dataset || !props.dataset.columns || !props.config) {
120 | return;
121 | }
122 | if (!this.isMatchRequirement(props.config)) {
123 | this.chart?.clear();
124 | return;
125 | }
126 | const newOptions = this.getOptions(props.dataset, props.config);
127 | this.chart?.setOption(Object.assign({}, newOptions), true);
128 | },
129 |
130 | onUnMount() {
131 | this.chart?.dispose();
132 | },
133 |
134 | onResize(opt, context) {
135 | this.chart?.resize(context);
136 | },
137 |
138 | getOptions(dataset, config) {
139 | const settingsConfigs = config.settings || [];
140 | const dataConfigs = config.datas || [];
141 | const data = dataset.rows?.map((row) => {
142 | return row?.map((col) => +col);
143 | });
144 | const [clusterCount] = dHelper.getStyles(
145 | settingsConfigs,
146 | ["cluster"],
147 | ["clusterCount"]
148 | );
149 | var CLUSTER_COUNT = clusterCount || 2;
150 | var DIENSIION_CLUSTER_INDEX = 2;
151 | var COLOR_ALL = [
152 | "#37A2DA",
153 | "#e06343",
154 | "#37a354",
155 | "#b55dba",
156 | "#b5bd48",
157 | "#8378EA",
158 | "#96BFFF",
159 | ];
160 | var pieces = [];
161 | for (var i = 0; i < clusterCount; i++) {
162 | pieces.push({
163 | value: i,
164 | label: "cluster " + i,
165 | color: COLOR_ALL[i],
166 | });
167 | }
168 | const option = {
169 | dataset: [
170 | {
171 | source: data || SampleData,
172 | },
173 | {
174 | transform: {
175 | type: "ecStat:clustering",
176 | // print: true,
177 | config: {
178 | clusterCount: CLUSTER_COUNT,
179 | outputType: "single",
180 | outputClusterIndexDimension: DIENSIION_CLUSTER_INDEX,
181 | },
182 | },
183 | },
184 | ],
185 | tooltip: {
186 | position: "top",
187 | },
188 | visualMap: {
189 | type: "piecewise",
190 | top: "middle",
191 | min: 0,
192 | max: CLUSTER_COUNT,
193 | left: 10,
194 | splitNumber: CLUSTER_COUNT,
195 | dimension: DIENSIION_CLUSTER_INDEX,
196 | pieces: pieces,
197 | },
198 | grid: {
199 | left: 150,
200 | },
201 | xAxis: {},
202 | yAxis: {},
203 | series: {
204 | type: "scatter",
205 | encode: { tooltip: [0, 1] },
206 | symbolSize: 15,
207 | itemStyle: {
208 | borderColor: "#555",
209 | },
210 | datasetIndex: 1,
211 | },
212 | };
213 | return option;
214 | },
215 | };
216 | }
217 |
--------------------------------------------------------------------------------
/plugins/datart-clustering/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-clustering/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ClusteringChart } from "./experiment-clustering-chart";
20 |
21 | export default ClusteringChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-clustering/sample.js:
--------------------------------------------------------------------------------
1 | export default [
2 | [3.275154, 2.957587],
3 | [-3.344465, 2.603513],
4 | [0.355083, -3.376585],
5 | [1.852435, 3.547351],
6 | [-2.078973, 2.552013],
7 | [-0.993756, -0.884433],
8 | [2.682252, 4.007573],
9 | [-3.087776, 2.878713],
10 | [-1.565978, -1.256985],
11 | [2.441611, 0.444826],
12 | [-0.659487, 3.111284],
13 | [-0.459601, -2.618005],
14 | [2.17768, 2.387793],
15 | [-2.920969, 2.917485],
16 | [-0.028814, -4.168078],
17 | [3.625746, 2.119041],
18 | [-3.912363, 1.325108],
19 | [-0.551694, -2.814223],
20 | [2.855808, 3.483301],
21 | [-3.594448, 2.856651],
22 | [0.421993, -2.372646],
23 | [1.650821, 3.407572],
24 | [-2.082902, 3.384412],
25 | [-0.718809, -2.492514],
26 | [4.513623, 3.841029],
27 | [-4.822011, 4.607049],
28 | [-0.656297, -1.449872],
29 | [1.919901, 4.439368],
30 | [-3.287749, 3.918836],
31 | [-1.576936, -2.977622],
32 | [3.598143, 1.97597],
33 | [-3.977329, 4.900932],
34 | [-1.79108, -2.184517],
35 | [3.914654, 3.559303],
36 | [-1.910108, 4.166946],
37 | [-1.226597, -3.317889],
38 | [1.148946, 3.345138],
39 | [-2.113864, 3.548172],
40 | [0.845762, -3.589788],
41 | [2.629062, 3.535831],
42 | [-1.640717, 2.990517],
43 | [-1.881012, -2.485405],
44 | [4.606999, 3.510312],
45 | [-4.366462, 4.023316],
46 | [0.765015, -3.00127],
47 | [3.121904, 2.173988],
48 | [-4.025139, 4.65231],
49 | [-0.559558, -3.840539],
50 | [4.376754, 4.863579],
51 | [-1.874308, 4.032237],
52 | [-0.089337, -3.026809],
53 | [3.997787, 2.518662],
54 | [-3.082978, 2.884822],
55 | [0.845235, -3.454465],
56 | [1.327224, 3.358778],
57 | [-2.889949, 3.596178],
58 | [-0.966018, -2.839827],
59 | [2.960769, 3.079555],
60 | [-3.275518, 1.577068],
61 | [0.639276, -3.41284],
62 | ];
63 |
--------------------------------------------------------------------------------
/plugins/datart-jquery/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 基于VUEJS的图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | ### 样式区域配置
13 |
--------------------------------------------------------------------------------
/plugins/datart-jquery/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { JQueryEasyUIChart } from "./experiment-jquery-chart";
20 |
21 | export default JQueryEasyUIChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-jquery/jquery-vertical.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-lottie/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Lottie Animation Chart
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ## 资源
11 |
12 | https://lottiefiles.com/web-player
13 |
14 | https://lottiefiles.com/featured
--------------------------------------------------------------------------------
/plugins/datart-lottie/experiment-lottie-chart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import Icon from "./lottie-icon.svg";
20 | import Data from './data.json';
21 |
22 | export function LottieChart({}) {
23 | return {
24 | config: {
25 | datas: [
26 | {
27 | label: "dimension",
28 | key: "dimension",
29 | required: true,
30 | type: "group",
31 | },
32 | {
33 | label: "metrics",
34 | key: "metrics",
35 | required: true,
36 | type: "aggregate",
37 | },
38 | ],
39 | styles: [
40 | {
41 | label: "label.title",
42 | key: "label",
43 | comType: "group",
44 | rows: [
45 | {
46 | label: "label.text",
47 | key: "text",
48 | default: "datart",
49 | comType: "input",
50 | },
51 | {
52 | label: "label.fontLeft",
53 | key: "fontL",
54 | comType: "font",
55 | default: {
56 | fontFamily: "Lato",
57 | fontSize: 200,
58 | fontWeight: "bolder",
59 | fontStyle: "normal",
60 | color: "#0ff",
61 | },
62 | },
63 | {
64 | label: "label.fontRight",
65 | key: "fontR",
66 | comType: "font",
67 | default: {
68 | fontFamily: "Lato",
69 | fontSize: 200,
70 | fontWeight: "bolder",
71 | fontStyle: "normal",
72 | color: "#f0f",
73 | },
74 | },
75 | ],
76 | },
77 | ],
78 | i18ns: [
79 | {
80 | lang: "zh-CN",
81 | translation: {
82 | label: {
83 | title: "标签",
84 | text: "文本",
85 | fontLeft: "主字体",
86 | fontRight: "副字体",
87 | },
88 | },
89 | },
90 | ],
91 | },
92 | isISOContainer: "experiment-lottie-chart",
93 | dependency: [
94 | "https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js",
95 | ],
96 | meta: {
97 | id: "experiment-lottie-chart",
98 | name: "[Experiment] Lottie Chart",
99 | icon: Icon,
100 | requirements: [
101 | {
102 | group: null,
103 | aggregate: null,
104 | },
105 | ],
106 | },
107 |
108 | onMount(options, context) {
109 | if (options.containerId === undefined || !context.document) {
110 | return;
111 | }
112 |
113 | const { bodymovin } = context.window;
114 | if (!bodymovin) {
115 | return;
116 | }
117 |
118 | var animation = bodymovin.loadAnimation({
119 | container: context.document.getElementById(options.containerId),
120 | animType: "svg",
121 | loop: true,
122 | animationData: Data,
123 | // path: 'https://labs.nearpod.com/bodymovin/demo/markus/halloween/markus.json';
124 | });
125 | },
126 |
127 | onUpdated(props, context) {},
128 |
129 | onUnMount() {},
130 | };
131 | }
132 |
--------------------------------------------------------------------------------
/plugins/datart-lottie/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { LottieChart } from "./experiment-lottie-chart";
20 |
21 | export default LottieChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-lottie/lottie-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
18 |
--------------------------------------------------------------------------------
/plugins/datart-lottie/lottie-record.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-lottie/lottie-record.gif
--------------------------------------------------------------------------------
/plugins/datart-luckysheet/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 基于LuckySheet的图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | 请参考官方文档: https://mengshukeji.github.io/LuckysheetDocs/guide/#steps-for-usage
11 |
12 | ### 数据区域配置
13 |
14 | ### 样式区域配置
15 |
--------------------------------------------------------------------------------
/plugins/datart-luckysheet/experiment-luckysheet-demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-luckysheet/experiment-luckysheet-demo.png
--------------------------------------------------------------------------------
/plugins/datart-luckysheet/experiment-luckysheet.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import config from "./config";
20 | import icon from "./luckysheet-logo.svg";
21 | import { IChart } from "../../core/datart";
22 |
23 | /**
24 | * @summary LuckySheet
25 | * Document Link: https://mengshukeji.github.io/LuckysheetDocs/guide/#steps-for-usage
26 | * @param {*} { dHelper }, Datart Helper Utils
27 | * @return {*} void
28 | */
29 | export function LuckySheetChart({ dHelper }): IChart & any {
30 | return {
31 | isISOContainer: "luckysheet-chart",
32 | chart: null,
33 | config,
34 | dependency: [
35 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/css/pluginsCss.css",
36 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/plugins.css",
37 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/css/luckysheet.css",
38 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/assets/iconfont/iconfont.css",
39 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/js/plugin.js",
40 | "https://cdn.jsdelivr.net/npm/luckysheet/dist/luckysheet.umd.js",
41 | ],
42 | geoMap: null,
43 | meta: {
44 | id: "experiment-luckysheet-chart",
45 | name: "chartName",
46 | icon: icon,
47 | requirements: [
48 | {
49 | group: 0,
50 | aggregate: 0,
51 | },
52 | ],
53 | },
54 |
55 | onMount(options, context) {
56 | if (options.containerId === undefined || !context.document) {
57 | return;
58 | }
59 | if (context.window.luckysheet) {
60 | context.window.luckysheet.create({
61 | container: options.containerId,
62 | });
63 | }
64 |
65 | // this.chart = context.window.echarts.init(
66 | // context.document.getElementById(options.containerId),
67 | // "default"
68 | // );
69 | // this._mouseEvents?.forEach((event) => {
70 | // this.chart.on(event.name, event.callback);
71 | // });
72 | },
73 |
74 | onUpdated(props, context) {
75 | if (!props.dataset || !props.dataset.columns || !props.config) {
76 | return;
77 | }
78 | if (!this.isMatchRequirement(props.config)) {
79 | // this.chart?.clear();
80 | return;
81 | }
82 | },
83 |
84 | onUnMount() {
85 | // this.chart?.dispose();
86 | },
87 |
88 | onResize(opt, context) {
89 | // this.chart?.resize(context);
90 | },
91 | };
92 | }
93 |
--------------------------------------------------------------------------------
/plugins/datart-luckysheet/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { LuckySheetChart } from "./experiment-luckysheet";
20 |
21 | export default LuckySheetChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-luckysheet/luckysheet-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
35 |
--------------------------------------------------------------------------------
/plugins/datart-pivot/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 阿里AntV S2 透视表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | ## 使用说明
7 |
8 | ### 数据区域配置
9 |
10 | - 维度: 地理信息数据字段
11 | - 指标: 根据指标决定【视觉映射】颜色深浅
12 | - 大小: 根据指标决定气泡大小,并且可以在样式配置区域更改相对半径值
13 | - 过滤: 过滤不需要的数据,可以是维度条件,也可以是指标条件
14 |
15 | ### 样式区域配置
16 | - 可切换`省级`和`地市级`,对应`维度`区域的地区设置,**目前可能没有那么完善,基于内置的区域名称和维度值名称匹配**
17 |
18 |
--------------------------------------------------------------------------------
/plugins/datart-pivot/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { PivotTableChart } from "./experiment-pivot-chart";
20 |
21 | export default PivotTableChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-scroll/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 滚动图表
2 |
3 | - [x] datart version: **1.0.0-beta.1**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 | None
12 | ### 样式区域配置
13 | - 可设置`开始延迟`、`运动方向`、`持续时间`、`间隔`、`悬停时暂停`、`是否连续`、`是否起点显示`
14 |
--------------------------------------------------------------------------------
/plugins/datart-scroll/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ScrollChart } from "./experiment-scroll-chart";
20 |
21 | export default ScrollChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-scroll/scroll-table-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-scroll/scroll-table-chart.png
--------------------------------------------------------------------------------
/plugins/datart-scroll/scroll-table.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-sovit-sample/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 数维3D场景集成示例
2 |
3 | - [x] datart version: **1.0.0-beta.1**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
--------------------------------------------------------------------------------
/plugins/datart-sovit-sample/experiment-sovit-sample.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import config from "./config";
20 | import icon from "./sovit-logo.svg";
21 | import { IChart } from "../../core/datart";
22 |
23 | /**
24 | * @summary
25 | * Integrate with amap echart extions, more detail please check https://www.sovitjs.com/document-new-api-zzmefu.html
26 | * @param {*} { dHelper }, Datart Helper Utils
27 | * @return {*} void
28 | */
29 | export function SovitChart({ dHelper }): IChart & any {
30 | return {
31 | isISOContainer: "sovit-sample",
32 | chart: null,
33 | config,
34 | dependency: [
35 | "https://admin.sovitjs.com/static/sovitjs/jquery-ui.css",
36 | "https://admin.sovitjs.com/static/sovitjs/SovitChartPaser.min.js",
37 | ],
38 | meta: {
39 | id: "experiment-sovit-smaple",
40 | name: "chartName",
41 | icon: icon,
42 | requirements: [
43 | {
44 | group: 1,
45 | aggregate: [1, 2],
46 | },
47 | ],
48 | },
49 |
50 | onMount(options, context) {
51 | if (options.containerId === undefined || !context.document) {
52 | return;
53 | }
54 |
55 | if ("SovitChartPaser" in context.window) {
56 | const SovitChartPaser = context.window.SovitChartPaser;
57 | const sceneChartMain = new SovitChartPaser.SceneMain({
58 | apiurl: "https://admin.sovitjs.com/restapi",
59 | publishType: 1, //1为在线引用组件
60 | });
61 |
62 | sceneChartMain.initChart(
63 | options.containerId,
64 | {
65 | pageId: '3221068859372994564',
66 | },
67 | function (comId, eventType, reData) {
68 | console.log(
69 | `comId, eventType, reData ---> `,
70 | comId,
71 | eventType,
72 | reData
73 | );
74 | }
75 | );
76 | }
77 | },
78 |
79 | onUpdated(props, context) {
80 | if (!props.dataset || !props.dataset.columns || !props.config) {
81 | return;
82 | }
83 | if (!this.isMatchRequirement(props.config)) {
84 | this.chart?.clear();
85 | return;
86 | }
87 |
88 | // Node: especially clear before map dispose
89 | this.chart?.clear();
90 | const newOptions = this.getOptions(props.dataset, props.config);
91 | this.chart?.setOption(Object.assign({}, newOptions), true);
92 | },
93 |
94 | onUnMount() {
95 | this.chart?.dispose();
96 | },
97 |
98 | onResize(opt, context) {
99 | this.chart?.resize(context);
100 | },
101 |
102 | getOptions(dataset, config) {
103 | const styleConfigs = config.styles;
104 | const dataConfigs = config.datas || [];
105 | const groupConfigs = dataConfigs
106 | .filter((c) => c.type === "group")
107 | .flatMap((config) => config.rows || []);
108 | const aggregateConfigs = dataConfigs
109 | .filter((c) => c.type === "aggregate")
110 | .flatMap((config) => config.rows || []);
111 | const sizeConfigs = dataConfigs
112 | .filter((c) => c.type === "size")
113 | .flatMap((config) => config.rows || []);
114 |
115 | const chartDataSet = dHelper.transformToDataSet(
116 | dataset.rows,
117 | dataset.columns,
118 | dataConfigs
119 | );
120 | const theme = dHelper.getValue(styleConfigs, ["map", "theme"]);
121 | return null;
122 | },
123 | };
124 | }
125 |
--------------------------------------------------------------------------------
/plugins/datart-sovit-sample/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { SovitChart } from "./experiment-sovit-sample";
20 |
21 | export default SovitChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-sovit-sample/sovit-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
26 |
--------------------------------------------------------------------------------
/plugins/datart-thingjs-sample/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Thing JS 3D场景示例
2 |
3 | - [x] datart version: **1.0.0-beta.1**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
--------------------------------------------------------------------------------
/plugins/datart-thingjs-sample/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ThingChart } from "./experiment-thingjs-sample";
20 |
21 | export default ThingChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-thingjs-sample/thingjs-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
26 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-bingdundun/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Three.js BingDunDun Sample
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | ### 样式区域配置
13 |
14 |
15 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-bingdundun/bigndundun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-threejs-bingdundun/bigndundun.png
--------------------------------------------------------------------------------
/plugins/datart-threejs-bingdundun/bingdundun.glb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-threejs-bingdundun/bingdundun.glb
--------------------------------------------------------------------------------
/plugins/datart-threejs-bingdundun/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { BingDunDun } from "./experiment-threejs-bingdundun";
20 |
21 | export default BingDunDun;
22 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-bingdundun/threejs-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-industry/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Three.js Industry Sample
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 | https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_ifc.html
--------------------------------------------------------------------------------
/plugins/datart-threejs-industry/callada.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-threejs-industry/callada.gif
--------------------------------------------------------------------------------
/plugins/datart-threejs-industry/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ThreeJSWebGLIndustry } from "./experiment-threejs-industry";
20 |
21 | export default ThreeJSWebGLIndustry;
22 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-industry/sample.js:
--------------------------------------------------------------------------------
1 | const mockData = [
2 | {
3 | Year: 2016,
4 | "Number of incidents": "13,488",
5 | Deaths: "34,676",
6 | Injuries: "39,851",
7 | },
8 | {
9 | Year: 2015,
10 | "Number of incidents": "14,852",
11 | Deaths: "38,464",
12 | Injuries: "43,960",
13 | },
14 | {
15 | Year: 2014,
16 | "Number of incidents": "16,860",
17 | Deaths: "43,566",
18 | Injuries: "41,061",
19 | },
20 | {
21 | Year: 2013,
22 | "Number of incidents": "11,996",
23 | Deaths: "22,234",
24 | Injuries: "37,666",
25 | },
26 | {
27 | Year: 2012,
28 | "Number of incidents": "8,500",
29 | Deaths: "15,436",
30 | Injuries: "25,486",
31 | },
32 | {
33 | Year: 2011,
34 | "Number of incidents": "5,071",
35 | Deaths: "8,228",
36 | Injuries: "14,652",
37 | },
38 | {
39 | Year: 2010,
40 | "Number of incidents": "4,822",
41 | Deaths: "7,727",
42 | Injuries: "15,860",
43 | },
44 | {
45 | Year: 2009,
46 | "Number of incidents": "4,719",
47 | Deaths: "9,271",
48 | Injuries: "19,128",
49 | },
50 | {
51 | Year: 2008,
52 | "Number of incidents": "4,803",
53 | Deaths: "9,135",
54 | Injuries: "18,984",
55 | },
56 | {
57 | Year: 2007,
58 | "Number of incidents": "3,241",
59 | Deaths: "12,858",
60 | Injuries: "22,453",
61 | },
62 | {
63 | Year: 2006,
64 | "Number of incidents": "2,749",
65 | Deaths: "9,362",
66 | Injuries: "15,551",
67 | },
68 | {
69 | Year: 2005,
70 | "Number of incidents": "2,009",
71 | Deaths: "6,313",
72 | Injuries: "12,769",
73 | },
74 | {
75 | Year: 2004,
76 | "Number of incidents": "1,162",
77 | Deaths: "5,718",
78 | Injuries: "11,817",
79 | },
80 | {
81 | Year: 2003,
82 | "Number of incidents": "1,262",
83 | Deaths: "3,278",
84 | Injuries: "7,091",
85 | },
86 | {
87 | Year: 2002,
88 | "Number of incidents": "1,332",
89 | Deaths: "4,799",
90 | Injuries: "7,103",
91 | },
92 | {
93 | Year: 2001,
94 | "Number of incidents": "1,907",
95 | Deaths: "7,743",
96 | Injuries: "21,151",
97 | },
98 | {
99 | Year: 2000,
100 | "Number of incidents": "1,813",
101 | Deaths: "4,402",
102 | Injuries: "5,869",
103 | },
104 | {
105 | Year: 1999,
106 | "Number of incidents": "1,395",
107 | Deaths: "3,388",
108 | Injuries: "5,341",
109 | },
110 | {
111 | Year: 1998,
112 | "Number of incidents": 933,
113 | Deaths: "4,688",
114 | Injuries: "8,183",
115 | },
116 | {
117 | Year: 1997,
118 | "Number of incidents": "3,200",
119 | Deaths: "10,928",
120 | Injuries: "9,174",
121 | },
122 | {
123 | Year: 1996,
124 | "Number of incidents": "3,056",
125 | Deaths: "6,965",
126 | Injuries: "10,781",
127 | },
128 | {
129 | Year: 1995,
130 | "Number of incidents": "3,081",
131 | Deaths: "6,094",
132 | Injuries: "14,288",
133 | },
134 | {
135 | Year: 1994,
136 | "Number of incidents": "3,458",
137 | Deaths: "7,691",
138 | Injuries: "7,573",
139 | },
140 | {
141 | Year: 1993,
142 | "Number of incidents": 747,
143 | Deaths: "2,669",
144 | Injuries: "5,600",
145 | },
146 | {
147 | Year: 1992,
148 | "Number of incidents": "5,073",
149 | Deaths: "9,745",
150 | Injuries: "9,927",
151 | },
152 | {
153 | Year: 1991,
154 | "Number of incidents": "4,683",
155 | Deaths: "8,429",
156 | Injuries: "7,591",
157 | },
158 | {
159 | Year: 1990,
160 | "Number of incidents": "3,887",
161 | Deaths: "7,148",
162 | Injuries: "6,128",
163 | },
164 | {
165 | Year: 1989,
166 | "Number of incidents": "4,323",
167 | Deaths: "8,136",
168 | Injuries: "5,512",
169 | },
170 | {
171 | Year: 1988,
172 | "Number of incidents": "3,720",
173 | Deaths: "7,189",
174 | Injuries: "6,860",
175 | },
176 | {
177 | Year: 1987,
178 | "Number of incidents": "3,184",
179 | Deaths: "6,476",
180 | Injuries: "5,769",
181 | },
182 | {
183 | Year: 1986,
184 | "Number of incidents": "2,860",
185 | Deaths: "4,976",
186 | Injuries: "5,814",
187 | },
188 | {
189 | Year: 1985,
190 | "Number of incidents": "2,915",
191 | Deaths: "7,094",
192 | Injuries: "5,130",
193 | },
194 | {
195 | Year: 1984,
196 | "Number of incidents": "3,495",
197 | Deaths: "10,450",
198 | Injuries: "5,291",
199 | },
200 | {
201 | Year: 1983,
202 | "Number of incidents": "2,870",
203 | Deaths: "9,444",
204 | Injuries: "4,047",
205 | },
206 | {
207 | Year: 1982,
208 | "Number of incidents": "2,545",
209 | Deaths: "5,135",
210 | Injuries: "3,342",
211 | },
212 | {
213 | Year: 1981,
214 | "Number of incidents": "2,585",
215 | Deaths: "4,851",
216 | Injuries: "3,337",
217 | },
218 | {
219 | Year: 1980,
220 | "Number of incidents": "2,662",
221 | Deaths: "4,391",
222 | Injuries: "3,645",
223 | },
224 | {
225 | Year: 1979,
226 | "Number of incidents": "2,661",
227 | Deaths: "2,100",
228 | Injuries: "2,502",
229 | },
230 | {
231 | Year: 1978,
232 | "Number of incidents": "1,526",
233 | Deaths: "1,459",
234 | Injuries: "1,600",
235 | },
236 | {
237 | Year: 1977,
238 | "Number of incidents": "1,319",
239 | Deaths: 456,
240 | Injuries: 518,
241 | },
242 | {
243 | Year: 1976,
244 | "Number of incidents": 923,
245 | Deaths: 672,
246 | Injuries: 755,
247 | },
248 | {
249 | Year: 1975,
250 | "Number of incidents": 740,
251 | Deaths: 617,
252 | Injuries: 617,
253 | },
254 | {
255 | Year: 1974,
256 | "Number of incidents": 580,
257 | Deaths: 542,
258 | Injuries: 763,
259 | },
260 | {
261 | Year: 1973,
262 | "Number of incidents": 473,
263 | Deaths: 370,
264 | Injuries: 495,
265 | },
266 | {
267 | Year: 1972,
268 | "Number of incidents": 496,
269 | Deaths: 566,
270 | Injuries: 408,
271 | },
272 | {
273 | Year: 1971,
274 | "Number of incidents": 470,
275 | Deaths: 173,
276 | Injuries: 82,
277 | },
278 | {
279 | Year: 1970,
280 | "Number of incidents": 651,
281 | Deaths: 171,
282 | Injuries: 192,
283 | },
284 | ];
285 |
286 | export default mockData;
287 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-industry/threejs-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-webgl/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] Three.js Sample
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | ### 样式区域配置
13 |
14 |
15 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-webgl/callada.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-threejs-webgl/callada.gif
--------------------------------------------------------------------------------
/plugins/datart-threejs-webgl/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ThreeJSWebGL } from "./experiment-threejs-webgl";
20 |
21 | export default ThreeJSWebGL;
22 |
--------------------------------------------------------------------------------
/plugins/datart-threejs-webgl/threejs-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/plugins/datart-time/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] EChart 人均寿命演变图
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 | None
12 | ### 样式区域配置
13 | None
14 |
--------------------------------------------------------------------------------
/plugins/datart-time/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { LifeExpectancyChart } from "./experiment-time-chart";
20 |
21 | export default LifeExpectancyChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-time/time-series-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-time/time-series-chart.png
--------------------------------------------------------------------------------
/plugins/datart-time/time.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-uml/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 基于Mermaid的UML图
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | 关于UML图插件的API使用,请参考Mermaid[官方文档和示例](https://mermaid-js.github.io/mermaid/#/)
11 |
12 | ### 数据区域配置
13 |
14 | ### 样式区域配置
15 | - 代码设置:直接以Text文本的形式编辑数据,后期可以使用Monaco Code作为数据编辑器,目前是纯文本框。
16 | - 水印设置:增加水印
17 |
18 |
--------------------------------------------------------------------------------
/plugins/datart-uml/experiment-mermaid-uml-chart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import icon from "./icon.svg";
20 |
21 | export function MermaidUMLChart({ dHelper }) {
22 | const mockData = {
23 | code: `%%{config: { 'fontFamily': 'Menlo', 'fontSize': 12, 'fontWeight': 400} }%%
24 | %%{init: { 'logLevel': 'debug', 'theme': '' } }%%
25 |
26 | sequenceDiagram
27 | participant A as 项目主入口
28 | participant C as 图表管理器
29 | participant V as 可视化模块
30 | participant S as 后端服务
31 |
32 | A->>C: 初始化 Chart Manager
33 | C->>S: 请求插件图表路径集合
34 | S-->>C: 返回插件图表路径集合
35 | Note right of S: 服务端将从'custom-chart-plugins'文件夹读取自定义组件
36 | loop 插件集合
37 | C->>S: 下载插件图表
38 | S-->>C: 返回插件图表路文件
39 | C-->>C: 检查及加载插件图表文件
40 | end
41 | C->>C: 加载默认图表集合
42 | C-->>A: 完成图表初始化
43 | A->>V: 切换到可视化模块开始制作自定义图表
44 | V->>S: 保存制作完成的图表
45 | `,
46 | watermark: `Powered by Datart`,
47 | };
48 |
49 | return {
50 | config: {
51 | datas: [],
52 | styles: [
53 | {
54 | label: "code.title",
55 | key: "code",
56 | comType: "group",
57 | rows: [
58 | {
59 | label: "code.area",
60 | key: "area",
61 | comType: "text",
62 | options: {},
63 | },
64 | ],
65 | },
66 | {
67 | label: "watermark.title",
68 | key: "watermark",
69 | comType: "group",
70 | rows: [
71 | {
72 | label: "watermark.area",
73 | key: "area",
74 | comType: "text",
75 | options: {},
76 | },
77 | ],
78 | },
79 | ],
80 | settings: [],
81 | i18ns: [
82 | {
83 | lang: "zh-CN",
84 | translation: {
85 | code: {
86 | title: "代码设置",
87 | area: "编辑区",
88 | },
89 | watermark: {
90 | title: "水印设置",
91 | area: "编辑区",
92 | },
93 | },
94 | },
95 | {
96 | lang: "en",
97 | translation: {
98 | code: {
99 | title: "Code Setting",
100 | area: "Editor Block",
101 | },
102 | watermark: {
103 | title: "Watermark Setting",
104 | area: "Editor Block",
105 | },
106 | },
107 | },
108 | ],
109 | },
110 | isISOContainer: "experiment-mermaid-uml-chart",
111 | dependency: [
112 | "https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.13.3/mermaid.min.js",
113 | ],
114 | meta: {
115 | id: "experiment-mermaid-uml-chart",
116 | name: "[Experiment] Mermaid UML",
117 | icon: icon,
118 | requirements: [
119 | {
120 | group: null,
121 | aggregate: null,
122 | },
123 | ],
124 | },
125 | _containerId: null,
126 |
127 | onMount(options, context) {
128 | this._containerId = options.containerId;
129 | if ("mermaid" in context.window) {
130 | this.chart = context.window.mermaid.mermaidAPI;
131 | this.chart.initialize({
132 | startOnLoad: false,
133 | });
134 | }
135 | },
136 |
137 | onUpdated(options, context) {
138 | const styles = options.config.styles;
139 | const code =
140 | dHelper.getValue(styles, ["code", "area"]) || mockData.code;
141 | const watermark =
142 | dHelper.getValue(styles, ["watermark", "area"]) ||
143 | mockData.watermark;
144 | var outputDiv = context.document.getElementById(this._containerId);
145 |
146 | if (this.chart && outputDiv) {
147 | this.chart.render("theGraph", code, function (svgCode) {
148 | outputDiv.style.position = "relative";
149 | outputDiv.style.overflow = "hidden";
150 | outputDiv.style.margin = "20px";
151 | outputDiv.innerHTML = svgCode;
152 | });
153 | this.addWatermark(outputDiv, watermark, context);
154 | }
155 | },
156 |
157 | onUnMount() {
158 | // this.chart && this.chart.dispose();
159 | },
160 |
161 | onResize(opt, context) {
162 | // this.chart && this.chart.resize(context);
163 | },
164 |
165 | addWatermark(targetEle, watermark, context) {
166 | if (!watermark) {
167 | return;
168 | }
169 | const watermarkDiv = context.document.createElement("div");
170 | watermarkDiv.style.position = "absolute";
171 | watermarkDiv.style.left = "-50%";
172 | watermarkDiv.style.top = "-50%";
173 | watermarkDiv.style.width = "200%";
174 | watermarkDiv.style.height = "200%";
175 | watermarkDiv.style.color = "#f1f1f1";
176 | watermarkDiv.style["line-height"] = "90px";
177 | watermarkDiv.style["z-index"] = 1;
178 | watermarkDiv.style["font-size"] = "18px";
179 | watermarkDiv.style["-webkit-transform"] = "rotate(-45deg)";
180 | watermarkDiv.style["-webkit-transform"] = "rotate(-45deg)";
181 | watermarkDiv.innerHTML = `
182 | ${Array(Math.ceil((1 / watermark.length) * 2000))
183 | .fill(`${watermark}`)
184 | .join(Array(20).fill(" ").join(" "))}
185 | `;
186 | targetEle.appendChild(watermarkDiv);
187 | },
188 | };
189 | }
190 |
--------------------------------------------------------------------------------
/plugins/datart-uml/experiment-uml-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-uml/experiment-uml-chart.png
--------------------------------------------------------------------------------
/plugins/datart-uml/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-uml/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { MermaidUMLChart } from "./experiment-mermaid-uml-chart";
20 |
21 | export default MermaidUMLChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/demo-vue-carousel.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import svgIcon from "./vue-carousel.svg";
20 |
21 | export function DemoVueCarousel({ dHelper }) {
22 | return {
23 | config: {
24 | datas: [
25 | {
26 | label: "dimension",
27 | key: "dimension",
28 | type: "group",
29 | },
30 | {
31 | label: "filter",
32 | key: "filter",
33 | type: "filter",
34 | allowSameField: true,
35 | },
36 | ],
37 | styles: [
38 | {
39 | label: "carousel.title",
40 | key: "carousel",
41 | comType: "group",
42 | rows: [
43 | {
44 | label: "carousel.interval",
45 | key: "interval",
46 | comType: "inputNumber",
47 | default: 3000,
48 | options: {
49 | min: 0,
50 | step: 1,
51 | },
52 | },
53 | ],
54 | },
55 | ],
56 | settings: [
57 | {
58 | label: "viz.palette.setting.paging.title",
59 | key: "paging",
60 | comType: "group",
61 | rows: [
62 | {
63 | label: "viz.palette.setting.paging.pageSize",
64 | key: "pageSize",
65 | default: 1000,
66 | comType: "inputNumber",
67 | options: {
68 | needRefresh: true,
69 | step: 1,
70 | min: 0,
71 | },
72 | },
73 | ],
74 | },
75 | ],
76 | i18ns: [
77 | {
78 | lang: "zh-CN",
79 | translation: {
80 | chartName: "[Experiment] 用户自定义Vue跑马灯",
81 | carousel: {
82 | title: "跑马灯",
83 | interval: "切换间隔(毫秒)",
84 | },
85 | },
86 | },
87 | {
88 | lang: "en-US",
89 | translation: {
90 | chartName: "[Experiment] Vue Carousel",
91 | carousel: {
92 | title: "Carousel",
93 | interval: "Interval(MS)",
94 | },
95 | },
96 | },
97 | ],
98 | },
99 | isISOContainer: "demo-customize-line-chart",
100 | dependency: ["https://cdn.jsdelivr.net/npm/vue@2.6.14"],
101 | meta: {
102 | id: "demo-vue-carousel",
103 | name: "chartName",
104 | icon: svgIcon,
105 | requirements: [
106 | {
107 | group: 1,
108 | },
109 | ],
110 | },
111 | chartId: "vueCarousel",
112 |
113 | onMount(options, context) {
114 | if ("Vue" in context.window) {
115 | context.document.getElementById(
116 | options.containerId
117 | ).innerHTML = ``;
118 | const Vue = context.window.Vue;
119 | this.chart = new Vue({
120 | el: `#${this.chartId}`,
121 | template: this.getTemplate(),
122 | data: {
123 | nowIndex: 0,
124 | list: [],
125 | btnStyle: {
126 | display: "inline-block",
127 | margin: "0 20px",
128 | width: "10px",
129 | height: "10px",
130 | border: "1px solid #000",
131 | borderRadius: "50%",
132 | },
133 | actionBtnStyle: {
134 | display: "inline-block",
135 | margin: "0 20px",
136 | width: "10px",
137 | height: "10px",
138 | border: "1px solid #000",
139 | borderRadius: "50%",
140 | background: "#000",
141 | },
142 | setTime: 3000,
143 | timer: null,
144 | },
145 | methods: {
146 | onClickBtn(index) {
147 | this.nowIndex = index;
148 | this.initInterval();
149 | },
150 | initInterval(time = this.setTime) {
151 | if (this.timer) {
152 | clearInterval(this.timer);
153 | }
154 | if (time) {
155 | this.timer = setInterval(() => {
156 | this.nowIndex += 1;
157 | if (this.nowIndex >= this.list.length) {
158 | this.nowIndex = 0;
159 | }
160 | }, time);
161 | }
162 | },
163 | getImage(path) {
164 | return path;
165 | },
166 | },
167 | watch: {
168 | setTime: function (val) {
169 | this.initInterval(val);
170 | },
171 | list: {
172 | handler: function (list) {
173 | if (list.length) {
174 | this.nowIndex = 0;
175 | this.initInterval();
176 | }
177 | },
178 | deep: true,
179 | },
180 | },
181 | mounted: function () {
182 | if (this.list.length) {
183 | this.initInterval();
184 | }
185 | },
186 | });
187 | }
188 | },
189 |
190 | onUpdated(props) {
191 | if (!props.dataset || !props.dataset.columns || !props.config) {
192 | return;
193 | }
194 | const dataConfigs = props.config.datas || [];
195 | const groupConfigs = dataConfigs
196 | .filter((c) => c.type === "group")
197 | .flatMap((config) => config.rows || []);
198 | const styleConfigs = props.config.styles || [];
199 | const chartDataSet = dHelper.transformToDataSet(
200 | props.dataset.rows,
201 | props.dataset.columns,
202 | dataConfigs
203 | );
204 |
205 | const [interval] = dHelper.getStyles(
206 | styleConfigs,
207 | ["carousel"],
208 | ["interval"]
209 | );
210 | this.chart.$data.list = chartDataSet.map((row) =>
211 | row.getCell(groupConfigs[0])
212 | );
213 | this.chart.$data.setTime = interval !== void 0 ? interval : 3000;
214 | },
215 |
216 | onUnMount() {
217 | if (this.chart.$data.timer) {
218 | clearInterval(this.chart.$data.timer);
219 | }
220 | this.chart = null;
221 | },
222 |
223 | onResize() {},
224 |
225 | getTemplate() {
226 | return `
227 |
228 |
234 |
![]()
235 |
236 |
245 |
246 | `;
247 | },
248 | };
249 | }
250 |
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/images/1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/images/1.jpeg
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/images/2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/images/2.jpeg
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/images/3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/images/3.jpeg
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/images/4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/images/4.jpeg
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/images/5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/images/5.jpeg
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { DemoVueCarousel } from "./demo-vue-carousel.js";
20 |
21 | export default DemoVueCarousel;
22 |
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/vue-carousel-csv.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/vue-carousel-csv.xlsx
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/vue-carousel.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vue-carousel/vue-carousel.gif
--------------------------------------------------------------------------------
/plugins/datart-vue-carousel/vue-carousel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-vuejs/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] 基于VUEJS的图表
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | ### 样式区域配置
13 |
--------------------------------------------------------------------------------
/plugins/datart-vuejs/experiment-vue-dynamic-chart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import VueJSIcon from "./vuejs.svg";
20 |
21 | export function VueDynamicChart({ dHelper }) {
22 | const getCode = () => {
23 | return `
24 | \`\`\`js
25 | import Chart from 'app/pages/ChartWorkbenchPage/models/Chart';
26 | import { getStyleValueByGroup } from 'app/utils/chart';
27 | import Config from './config';
28 |
29 | class VueJSChart extends Chart {
30 | constructor() {
31 | super('vue-chart', 'DEMO - VueJS Chart', 'star');
32 | }
33 |
34 | isISOContainer = 'vue-chart-container';
35 | config = Config;
36 | dependency = [
37 | 'https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js',
38 | 'https://cdn.jsdelivr.net/npm/vue-markdown@2.2.4/dist/vue-markdown.js',
39 | 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css',
40 | ];
41 | chart: any = null;
42 | nodeId = 'vue';
43 |
44 | onMount(options, context): void {
45 | const node = context.document.createElement('div');
46 | node.setAttribute('id', this.nodeId);
47 | context.document.getElementById(options.containerId).appendChild(node);
48 |
49 | const Vue = context.window.Vue;
50 | Vue.use(context.window.VueMarkdown);
51 | this.chart = new Vue({
52 | el: \`#\${this.nodeId}\`,
53 | data: { vue: 'Hello', person: { name: 'Stephen' }, content: getCode() },
54 | template: this.getTemplate(),
55 | methods: {
56 | greet: function (event) {
57 | alert('Hello My Friends ~ this.me');
58 | },
59 | },
60 | });
61 | }
62 |
63 | onUpdated(options, context): void {
64 | if (!this.isMatchRequirement(options.config)) {
65 | return;
66 | }
67 |
68 | const name = this.getInfo(options?.config?.styles);
69 | this.chart.$set(this.chart.person, 'name', name);
70 | }
71 |
72 | onUnMount(): void {}
73 |
74 | private getInfo(styleConfigs) {
75 | const name = getStyleValueByGroup(styleConfigs, 'label', 'name');
76 | return name;
77 | }
78 |
79 | private getTemplate() {
80 | return \`
81 |
82 |
83 |
84 | {{ vue }} {{ person.name }} ,
85 | Welcome to VueJS Chart Demo ~
86 |
87 |
88 |
89 | {{content}}
90 |
91 |
92 |
93 |
94 | \`;
95 | }
96 | }
97 | \`\`\`
98 | `;
99 | };
100 |
101 | return {
102 | config: {
103 | styles: [
104 | {
105 | label: "label",
106 | key: "label",
107 | comType: "group",
108 | rows: [
109 | {
110 | label: "name",
111 | key: "name",
112 | default: "Friends",
113 | comType: "input",
114 | },
115 | {
116 | label: "font",
117 | key: "font",
118 | comType: "font",
119 | default: {
120 | fontFamily: "PingFang SC",
121 | fontSize: "24",
122 | fontWeight: "normal",
123 | fontStyle: "normal",
124 | color: "yellow",
125 | },
126 | },
127 | ],
128 | },
129 | ],
130 | i18ns: [
131 | {
132 | lang: "zh-CN",
133 | translation: {
134 | label: "标签",
135 | name: "你的姓名",
136 | },
137 | },
138 | {
139 | lang: "en-US",
140 | translation: {
141 | label: "Label",
142 | name: "Your Name",
143 | },
144 | },
145 | ],
146 | },
147 | isISOContainer: "experiment-vue-dynamic-chart",
148 | dependency: [
149 | "https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js",
150 | "https://cdn.jsdelivr.net/npm/vue-markdown@2.2.4/dist/vue-markdown.js",
151 | "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css",
152 | ],
153 | meta: {
154 | id: "experiment-vue-dynamic-chart",
155 | name: "[Experiment] VUEJS Chart",
156 | icon: VueJSIcon,
157 | requirements: [
158 | {
159 | group: null,
160 | aggregate: null,
161 | },
162 | ],
163 | },
164 |
165 | onMount(options, context) {
166 | const node = context.document.createElement("div");
167 | node.setAttribute("id", this.nodeId);
168 | context.document.getElementById(options.containerId).appendChild(node);
169 |
170 | const Vue = context.window.Vue;
171 | Vue.use(context.window.VueMarkdown);
172 | this.chart = new Vue({
173 | el: `#${this.nodeId}`,
174 | data: { vue: "Hello", person: { name: "Stephen" }, content: getCode() },
175 | template: this.getTemplate(),
176 | methods: {
177 | greet: function (event) {
178 | alert("Hello My Friends ~ this.me");
179 | },
180 | },
181 | });
182 | },
183 |
184 | onUpdated(options, context) {
185 | if (!this.isMatchRequirement(options.config)) {
186 | return;
187 | }
188 |
189 | const name = this.getInfo(options?.config?.styles);
190 | this.chart.$set(this.chart.person, "name", name);
191 | },
192 |
193 | onUnMount() {
194 | // this.chart && this.chart.dispose();
195 | },
196 |
197 | onResize(opt, context) {
198 | // this.chart && this.chart.resize(context);
199 | },
200 |
201 | getInfo(styleConfigs) {
202 | const name = dHelper.getValue(styleConfigs, ["label", "name"]);
203 | return name;
204 | },
205 |
206 | getTemplate() {
207 | return `
208 |
209 |
210 |
211 | {{ vue }} {{ person.name }} ,
212 | Welcome to VueJS Chart Demo ~
213 |
214 |
215 |
216 | {{content}}
217 |
218 |
219 |
220 |
221 | `;
222 | },
223 | };
224 | }
225 |
--------------------------------------------------------------------------------
/plugins/datart-vuejs/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { VueDynamicChart } from "./experiment-vue-dynamic-chart";
20 |
21 | export default VueDynamicChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-vuejs/vuejs-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-vuejs/vuejs-chart.png
--------------------------------------------------------------------------------
/plugins/datart-vuejs/vuejs.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/datart-zrender/README.md:
--------------------------------------------------------------------------------
1 | ## [Experimental] ZRender Chart
2 |
3 | - [x] datart version: **1.0.0**
4 | - [x] status: **experimental**
5 |
6 | 
7 |
8 | ## 使用说明
9 |
10 | ### 数据区域配置
11 |
12 | ### 样式区域配置
13 |
14 |
15 |
--------------------------------------------------------------------------------
/plugins/datart-zrender/experiment-zrender-chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-zrender/experiment-zrender-chart.png
--------------------------------------------------------------------------------
/plugins/datart-zrender/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Datart
3 | *
4 | * Copyright 2021
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | import { ZRenderChart } from "./experiment-zrender-chart";
20 |
21 | export default ZRenderChart;
22 |
--------------------------------------------------------------------------------
/plugins/datart-zrender/zrender-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/running-elephant/datart-extension-charts/71c8619a32982b3b0397798143d0c3f2d332cbaa/plugins/datart-zrender/zrender-logo.png
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import json from "@rollup/plugin-json";
2 | import { terser } from "rollup-plugin-terser";
3 | import svg from "rollup-plugin-svg";
4 | import progress from "rollup-plugin-progress";
5 | import typescript from "@rollup/plugin-typescript";
6 | import { nodeResolve } from '@rollup/plugin-node-resolve';
7 |
8 | const fs = require("fs");
9 |
10 | const pluginFolders = (assetFileNames) => {
11 | const dir = fs.readdirSync(`./plugins`);
12 | if (assetFileNames) {
13 | return dir.filter((f) => f.match(assetFileNames));
14 | }
15 | return dir.filter((f) => f.match(/^datart*/));
16 | };
17 |
18 | export default (commandLineArgs) => {
19 | const assetFileNames = commandLineArgs?.assetFileNames;
20 | const plugins = pluginFolders(assetFileNames);
21 | const config = (plugins || []).map((name) => {
22 | return {
23 | input: `plugins/${name}/index.js`,
24 | output: {
25 | file: `dist/${name}.iife.js`,
26 | format: "iife",
27 | },
28 | plugins: [
29 | nodeResolve(),
30 | progress({
31 | clearLine: false,
32 | }),
33 | json(),
34 | svg({ base64: false }),
35 | terser({
36 | compress: {
37 | defaults: false,
38 | },
39 | }),
40 | typescript(),
41 | ],
42 | watch: {
43 | include: "plugins/**",
44 | exclude: "node_modules/**",
45 | },
46 | };
47 | });
48 | return config;
49 | };
50 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "noImplicitAny": false,
4 | "target": "es5",
5 | "lib": ["es5", "es6", "dom"],
6 | "module": "esnext",
7 | "removeComments": true,
8 | "preserveConstEnums": true,
9 | "esModuleInterop": true,
10 | "moduleResolution": "node",
11 | "isolatedModules": true,
12 | "noEmit": true,
13 | "strict": true,
14 | "skipLibCheck": true,
15 | "resolveJsonModule": true
16 | },
17 | "include": ["plugins/**/*", "index.d.ts"],
18 | "exclude": ["node_modules", "**/*.spec.ts"]
19 | }
20 |
--------------------------------------------------------------------------------