@nocobase/plugin-data-visualization 1.9.0-beta.9 → 2.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/client/33f0f13fb9c8b63c.js +10 -0
  2. package/dist/client/ai/tools/index.d.ts +10 -0
  3. package/dist/client/{4abed7583f4c3c67.js → b73d4b7728feb594.js} +2 -2
  4. package/dist/client/d5982ab2df5b1822.js +10 -0
  5. package/dist/client/e5eee84a69b5014e.js +10 -0
  6. package/dist/client/flow/components/CodeEditor.d.ts +22 -0
  7. package/dist/client/flow/models/Chart.d.ts +16 -0
  8. package/dist/client/flow/models/ChartBlockModel.d.ts +62 -0
  9. package/dist/client/flow/models/ChartOptionsBuilder.d.ts +14 -0
  10. package/dist/client/flow/models/ChartOptionsBuilder.service.d.ts +48 -0
  11. package/dist/client/flow/models/ChartOptionsEditor.d.ts +16 -0
  12. package/dist/client/flow/models/ChartOptionsPanel.d.ts +10 -0
  13. package/dist/client/flow/models/ConfigPanel.d.ts +10 -0
  14. package/dist/client/flow/models/ECharts.d.ts +20 -0
  15. package/dist/client/flow/models/EventsEditor.d.ts +11 -0
  16. package/dist/client/flow/models/EventsPanel.d.ts +10 -0
  17. package/dist/client/flow/models/FormItemLite.d.ts +13 -0
  18. package/dist/client/flow/models/QueryBuilder.d.ts +16 -0
  19. package/dist/client/flow/models/QueryBuilder.service.d.ts +19 -0
  20. package/dist/client/flow/models/QueryPanel.d.ts +10 -0
  21. package/dist/client/flow/models/ResultPanel.d.ts +10 -0
  22. package/dist/client/flow/models/SQLEditor.d.ts +10 -0
  23. package/dist/client/flow/models/config-store.d.ts +20 -0
  24. package/dist/client/flow/resources/ChartResource.d.ts +35 -0
  25. package/dist/client/flow/utils.d.ts +35 -0
  26. package/dist/client/index.js +1 -1
  27. package/dist/client/{locale/index.d.ts → locale.d.ts} +4 -2
  28. package/dist/client/utils.d.ts +1 -0
  29. package/dist/externalVersion.js +15 -12
  30. package/dist/locale/en-US.json +12 -0
  31. package/dist/locale/zh-CN.json +13 -1
  32. package/dist/node_modules/koa-compose/package.json +1 -1
  33. package/dist/node_modules/moment-timezone/package.json +1 -1
  34. package/dist/server/ai/tools/build-chart-block.d.ts +10 -0
  35. package/dist/server/ai/tools/build-chart-block.js +67 -0
  36. package/dist/server/plugin.js +3 -0
  37. package/dist/server/query-parser/query-parser.js +1 -1
  38. package/package.json +18 -10
@@ -6,6 +6,8 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const NAMESPACE = "data-visualization";
9
+ export declare const namespace: string;
10
+ export declare function useT(): any;
11
+ export declare function tStr(key: string): string;
10
12
  export declare function lang(key: string): string;
11
- export declare function useChartsTranslation(): import("react-i18next").UseTranslationResponse<("data-visualization" | "client")[], undefined>;
13
+ export declare function useChartsTranslation(): import("react-i18next").UseTranslationResponse<string[], undefined>;
@@ -152,3 +152,4 @@ export declare const removeUnparsableFilter: (filter: any) => any;
152
152
  export declare const getValuesByPath: (values: any, path: string) => any;
153
153
  export declare const getFormulaComponent: (type: string) => string;
154
154
  export declare const getFormulaInterface: (type: string) => string;
155
+ export declare const isEmptyFilterObject: (filter: any) => boolean;
@@ -8,24 +8,27 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.9.0-beta.9",
12
- "@formily/react": "2.3.0",
11
+ "@nocobase/client": "2.0.0-alpha.10",
12
+ "@formily/react": "2.3.7",
13
+ "@nocobase/plugin-ai": "2.0.0-alpha.10",
14
+ "@nocobase/flow-engine": "2.0.0-alpha.10",
15
+ "react-i18next": "11.18.6",
13
16
  "dayjs": "1.11.13",
14
- "@formily/shared": "2.3.2",
17
+ "@formily/shared": "2.3.7",
15
18
  "lodash": "4.17.21",
16
- "@nocobase/cache": "1.9.0-beta.9",
17
- "@nocobase/server": "1.9.0-beta.9",
18
- "@nocobase/test": "1.9.0-beta.9",
19
- "@nocobase/utils": "1.9.0-beta.9",
19
+ "@nocobase/cache": "2.0.0-alpha.10",
20
+ "@nocobase/server": "2.0.0-alpha.10",
21
+ "@nocobase/test": "2.0.0-alpha.10",
22
+ "@nocobase/utils": "2.0.0-alpha.10",
20
23
  "react": "18.2.0",
21
24
  "@emotion/css": "11.13.0",
22
25
  "@ant-design/icons": "5.6.1",
23
26
  "ahooks": "3.7.8",
24
27
  "antd": "5.24.2",
25
28
  "@formily/antd-v5": "1.2.3",
26
- "@formily/core": "2.3.0",
27
- "react-i18next": "11.18.6",
28
- "@nocobase/actions": "1.9.0-beta.9",
29
- "@nocobase/database": "1.9.0-beta.9",
30
- "sequelize": "6.35.2"
29
+ "@formily/core": "2.3.7",
30
+ "@nocobase/actions": "2.0.0-alpha.10",
31
+ "@nocobase/database": "2.0.0-alpha.10",
32
+ "sequelize": "6.35.2",
33
+ "@formily/reactive": "2.3.7"
31
34
  };
@@ -1,4 +1,5 @@
1
1
  {
2
+ "Chart settings": "Chart settings",
2
3
  "Edit": "Edit",
3
4
  "Delete": "Delete",
4
5
  "Cancel": "Cancel",
@@ -15,9 +16,13 @@
15
16
  "Transform": "Transform",
16
17
  "Chart type": "Chart type",
17
18
  "JSON config": "JSON config",
19
+ "Query builder": "Query builder",
20
+ "Data query": "Data query",
18
21
  "Query": "Query",
19
22
  "Data": "Data",
20
23
  "Run query": "Run query",
24
+ "View data": "View data",
25
+ "Hide data": "Hide data",
21
26
  "Measures": "Measures",
22
27
  "Dimensions": "Dimensions",
23
28
  "Filter": "Filter",
@@ -27,9 +32,11 @@
27
32
  "Enable cache": "Enable cache",
28
33
  "TTL (second)": "TTL (second)",
29
34
  "Field": "Field",
35
+ "Select Field": "Select Field",
30
36
  "Aggregation": "Aggregation",
31
37
  "Alias": "Alias",
32
38
  "Format": "Format",
39
+ "Chart options": "Chart options",
33
40
  "The first 10 records of the query result:": "The first 10 records of the query result:",
34
41
  "Please run query to retrive data.": "Please run query to retrive data.",
35
42
  "Type": "Type",
@@ -53,6 +60,7 @@
53
60
  "Percent": "Percent",
54
61
  "Exponential": "Exponential",
55
62
  "Abbreviation": "Abbreviation",
63
+ "Events": "Events",
56
64
  "Please configure and run query": "Please configure and run query",
57
65
  "Please configure chart": "Please configure chart",
58
66
  "Are you sure to cancel?": "Are you sure to cancel?",
@@ -92,6 +100,10 @@
92
100
  "Size": "Size",
93
101
  "Width": "Width",
94
102
  "Height": "Height",
103
+ "Smooth": "Smooth",
104
+ "Legend": "Legend",
105
+ "Tooltip": "Tooltip",
106
+ "Label": "Label",
95
107
  "Aspect ratio": "Aspect ratio",
96
108
  "Fixed height": "Fixed height",
97
109
  "Show background": "Show background",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "Chart settings": "图表设置",
2
3
  "Edit": "编辑",
3
4
  "Delete": "删除",
4
5
  "Cancel": "取消",
@@ -15,9 +16,13 @@
15
16
  "Transform": "数据转换",
16
17
  "Chart type": "图表类型",
17
18
  "JSON config": "JSON 配置",
19
+ "Query builder": "查询构建器",
20
+ "Data query": "数据查询",
18
21
  "Query": "查询",
19
22
  "Data": "数据",
20
- "Run query": "执行查询",
23
+ "Run query": "运行查询",
24
+ "View data": "查看数据",
25
+ "Hide data": "收起数据",
21
26
  "Measures": "度量",
22
27
  "Dimensions": "维度",
23
28
  "Filter": "过滤",
@@ -27,9 +32,11 @@
27
32
  "Enable cache": "启用缓存",
28
33
  "TTL (second)": "缓存时间 (秒)",
29
34
  "Field": "字段",
35
+ "Select Field": "选择字段",
30
36
  "Aggregation": "聚合",
31
37
  "Alias": "别名",
32
38
  "Format": "格式",
39
+ "Chart options": "图表选项",
33
40
  "The first 10 records of the query result:": "查询结果的前 10 条记录:",
34
41
  "Please run query to retrive data.": "请执行查询来获取数据。",
35
42
  "Type": "类型",
@@ -53,6 +60,7 @@
53
60
  "Percent": "百分比",
54
61
  "Exponential": "科学记数法",
55
62
  "Abbreviation": "缩写",
63
+ "Events": "事件",
56
64
  "Please configure and run query": "请配置并执行数据查询",
57
65
  "Please configure chart": "请配置图表",
58
66
  "Are you sure to cancel?": "确定要取消吗?",
@@ -93,6 +101,10 @@
93
101
  "Size": "尺寸",
94
102
  "Width": "宽",
95
103
  "Height": "高",
104
+ "Smooth": "平滑(Smooth)",
105
+ "Legend": "图例(Legend)",
106
+ "Tooltip": "提示框(Tooltip)",
107
+ "Label": "标签(Label)",
96
108
  "Aspect ratio": "宽高比",
97
109
  "Fixed height": "固定高度",
98
110
  "Show background": "显示背景",
@@ -1 +1 @@
1
- {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2025-09-30T05:20:46.778Z"}
1
+ {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2025-10-15T15:09:23.463Z"}
@@ -1 +1 @@
1
- {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-09-30T05:20:47.474Z"}
1
+ {"name":"moment-timezone","version":"0.5.43","description":"Parse and display moments in any timezone.","homepage":"http://momentjs.com/timezone/","author":"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","keywords":["moment","date","time","timezone","olson","iana","zone","tz"],"main":"./index.js","typings":"./index.d.ts","engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment-timezone.git"},"bugs":{"url":"https://github.com/moment/moment-timezone/issues"},"license":"MIT","dependencies":{"moment":"^2.29.4"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-clean":"^2.0.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-nodeunit":"^4.0.0","grunt-contrib-uglify":"^5.2.2","grunt-exec":"^3.0.0","typescript":"^3.5.1"},"jspm":{"main":"builds/moment-timezone-with-data","shim":{"moment-timezone":{"deps":["moment"]}}},"scripts":{"test":"grunt"},"_lastModified":"2025-10-15T15:09:24.414Z"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ToolOptions } from '@nocobase/plugin-ai';
10
+ export declare const buildChartBlock: ToolOptions;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var build_chart_block_exports = {};
28
+ __export(build_chart_block_exports, {
29
+ buildChartBlock: () => buildChartBlock
30
+ });
31
+ module.exports = __toCommonJS(build_chart_block_exports);
32
+ const buildChartBlock = {
33
+ name: "buildChartBlock",
34
+ title: '{{t("Build chart blocks")}}',
35
+ description: '{{t("Helper to build chart blocks")}}',
36
+ execution: "frontend",
37
+ schema: {
38
+ type: "object",
39
+ properties: {
40
+ title: {
41
+ type: "string"
42
+ },
43
+ description: {
44
+ type: "string"
45
+ },
46
+ sql: {
47
+ type: "string"
48
+ },
49
+ echartsOption: {
50
+ type: "object",
51
+ additionalProperties: true
52
+ }
53
+ },
54
+ required: ["sql", "echartsOption"],
55
+ additionalProperties: false
56
+ },
57
+ invoke: async () => {
58
+ return {
59
+ status: "success",
60
+ content: "I have built the chart block successfully."
61
+ };
62
+ }
63
+ };
64
+ // Annotate the CommonJS export names for ESM import in node:
65
+ 0 && (module.exports = {
66
+ buildChartBlock
67
+ });
@@ -53,6 +53,9 @@ class PluginDataVisualizationServer extends import_server.Plugin {
53
53
  // millseconds
54
54
  max: 1e3
55
55
  });
56
+ const ai = this.app.pm.get("ai");
57
+ if (ai) {
58
+ }
56
59
  }
57
60
  async install(options) {
58
61
  }
@@ -120,7 +120,7 @@ class QueryParser {
120
120
  const order = this.parseOrders(ctx, orders, hasAgg);
121
121
  const queryParams = {
122
122
  where,
123
- attributes: [...measureAttributes, ...dimensionAttributes],
123
+ attributes: [...dimensionAttributes, ...measureAttributes],
124
124
  include,
125
125
  group,
126
126
  order,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "1.9.0-beta.9",
3
+ "version": "2.0.0-alpha.10",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.zh-CN": "数据可视化",
6
6
  "description": "Provides data visualization feature, including chart block and chart filter block, support line charts, area charts, bar charts and more than a dozen kinds of charts, you can also extend more chart types.",
@@ -11,6 +11,12 @@
11
11
  "devDependencies": {
12
12
  "@ant-design/icons": "5.x",
13
13
  "@ant-design/plots": "^2.1.4",
14
+ "@codemirror/lang-javascript": "^6.0.1",
15
+ "@codemirror/lang-sql": "^6.9.1",
16
+ "@codemirror/lint": "^6.8.3",
17
+ "@codemirror/state": "^6.0.1",
18
+ "@codemirror/theme-one-dark": "^6.0.1",
19
+ "@codemirror/view": "^6.37.2",
14
20
  "@emotion/css": "^11.7.1",
15
21
  "@formily/antd-v5": "1.x",
16
22
  "@formily/core": "2.x",
@@ -18,6 +24,7 @@
18
24
  "@formily/shared": "2.x",
19
25
  "antd": "5.x",
20
26
  "classnames": "^2.3.1",
27
+ "echarts": "^6.0.0",
21
28
  "koa-compose": "^4.1.0",
22
29
  "lodash": "^4.17.21",
23
30
  "react": "^18.2.0",
@@ -25,16 +32,17 @@
25
32
  "react-i18next": "^11.15.1"
26
33
  },
27
34
  "peerDependencies": {
28
- "@nocobase/actions": "1.x",
29
- "@nocobase/cache": "1.x",
30
- "@nocobase/client": "1.x",
31
- "@nocobase/database": "1.x",
32
- "@nocobase/plugin-data-source-main": "1.x",
33
- "@nocobase/server": "1.x",
34
- "@nocobase/test": "1.x",
35
- "@nocobase/utils": "1.x"
35
+ "@nocobase/actions": "2.x",
36
+ "@nocobase/cache": "2.x",
37
+ "@nocobase/client": "2.x",
38
+ "@nocobase/database": "2.x",
39
+ "@nocobase/plugin-ai": "2.x",
40
+ "@nocobase/plugin-data-source-main": "2.x",
41
+ "@nocobase/server": "2.x",
42
+ "@nocobase/test": "2.x",
43
+ "@nocobase/utils": "2.x"
36
44
  },
37
- "gitHead": "b44464f1d1bbc96022d0f622e0a2f1d7e8d7142f",
45
+ "gitHead": "6422cfb6fa6c8450de2efa3294fd29a28b228990",
38
46
  "keywords": [
39
47
  "Blocks"
40
48
  ]