@nocobase/plugin-charts 0.9.1-alpha.2

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 (139) hide show
  1. package/client.d.ts +4 -0
  2. package/client.js +30 -0
  3. package/lib/client/ChartBlockEngine.d.ts +27 -0
  4. package/lib/client/ChartBlockEngine.js +201 -0
  5. package/lib/client/ChartBlockEngineDesigner.d.ts +3 -0
  6. package/lib/client/ChartBlockEngineDesigner.js +348 -0
  7. package/lib/client/ChartBlockInitializer.d.ts +3 -0
  8. package/lib/client/ChartBlockInitializer.js +324 -0
  9. package/lib/client/ChartQueryBlockInitializer.d.ts +9 -0
  10. package/lib/client/ChartQueryBlockInitializer.js +230 -0
  11. package/lib/client/ChartQueryMetadataProvider.d.ts +10 -0
  12. package/lib/client/ChartQueryMetadataProvider.js +118 -0
  13. package/lib/client/DataSetPreviewTable.d.ts +5 -0
  14. package/lib/client/DataSetPreviewTable.js +127 -0
  15. package/lib/client/Icons.d.ts +1 -0
  16. package/lib/client/Icons.js +226 -0
  17. package/lib/client/chartRenderComponents/index.d.ts +2 -0
  18. package/lib/client/chartRenderComponents/index.js +26 -0
  19. package/lib/client/hooks/index.d.ts +4 -0
  20. package/lib/client/hooks/index.js +52 -0
  21. package/lib/client/index.d.ts +4 -0
  22. package/lib/client/index.js +161 -0
  23. package/lib/client/locale/en-US.d.ts +23 -0
  24. package/lib/client/locale/en-US.js +29 -0
  25. package/lib/client/locale/index.d.ts +3 -0
  26. package/lib/client/locale/index.js +46 -0
  27. package/lib/client/locale/ja-JP.d.ts +2 -0
  28. package/lib/client/locale/ja-JP.js +8 -0
  29. package/lib/client/locale/ru-RU.d.ts +2 -0
  30. package/lib/client/locale/ru-RU.js +8 -0
  31. package/lib/client/locale/tr-TR.d.ts +2 -0
  32. package/lib/client/locale/tr-TR.js +8 -0
  33. package/lib/client/locale/zh-CN.d.ts +61 -0
  34. package/lib/client/locale/zh-CN.js +67 -0
  35. package/lib/client/select/CustomSelect.d.ts +11 -0
  36. package/lib/client/select/CustomSelect.js +193 -0
  37. package/lib/client/select/ReadPretty.d.ts +2 -0
  38. package/lib/client/select/ReadPretty.js +102 -0
  39. package/lib/client/select/index.d.ts +2 -0
  40. package/lib/client/select/index.js +31 -0
  41. package/lib/client/select/shared.d.ts +7 -0
  42. package/lib/client/select/shared.js +86 -0
  43. package/lib/client/settings/AddNewQuery.d.ts +2 -0
  44. package/lib/client/settings/AddNewQuery.js +321 -0
  45. package/lib/client/settings/ConfigureFields.d.ts +1 -0
  46. package/lib/client/settings/ConfigureFields.js +51 -0
  47. package/lib/client/settings/QueriesTable.d.ts +1 -0
  48. package/lib/client/settings/QueriesTable.js +108 -0
  49. package/lib/client/settings/queryTypes.d.ts +5 -0
  50. package/lib/client/settings/queryTypes.js +85 -0
  51. package/lib/client/settings/schemas/chartsQueries.d.ts +8 -0
  52. package/lib/client/settings/schemas/chartsQueries.js +378 -0
  53. package/lib/client/templates/AreaTemplate.d.ts +65 -0
  54. package/lib/client/templates/AreaTemplate.js +86 -0
  55. package/lib/client/templates/BarTemplate.d.ts +80 -0
  56. package/lib/client/templates/BarTemplate.js +103 -0
  57. package/lib/client/templates/ColumnTemplate.d.ts +80 -0
  58. package/lib/client/templates/ColumnTemplate.js +103 -0
  59. package/lib/client/templates/FunnelTemplate.d.ts +66 -0
  60. package/lib/client/templates/FunnelTemplate.js +87 -0
  61. package/lib/client/templates/LineTemplate.d.ts +67 -0
  62. package/lib/client/templates/LineTemplate.js +92 -0
  63. package/lib/client/templates/PieTemplate.d.ts +71 -0
  64. package/lib/client/templates/PieTemplate.js +92 -0
  65. package/lib/client/templates/RadarTemplate.d.ts +71 -0
  66. package/lib/client/templates/RadarTemplate.js +93 -0
  67. package/lib/client/templates/ScatterTemplate.d.ts +91 -0
  68. package/lib/client/templates/ScatterTemplate.js +112 -0
  69. package/lib/client/templates/TableTemplate.d.ts +28 -0
  70. package/lib/client/templates/TableTemplate.js +54 -0
  71. package/lib/client/templates/index.d.ts +1 -0
  72. package/lib/client/templates/index.js +33 -0
  73. package/lib/client/utils.d.ts +3 -0
  74. package/lib/client/utils.js +66 -0
  75. package/lib/index.d.ts +1 -0
  76. package/lib/index.js +15 -0
  77. package/lib/server/actions/chartsQueries.d.ts +3 -0
  78. package/lib/server/actions/chartsQueries.js +104 -0
  79. package/lib/server/actions/index.d.ts +1 -0
  80. package/lib/server/actions/index.js +1 -0
  81. package/lib/server/collections/chartsQueries.d.ts +2 -0
  82. package/lib/server/collections/chartsQueries.js +36 -0
  83. package/lib/server/index.d.ts +1 -0
  84. package/lib/server/index.js +15 -0
  85. package/lib/server/plugin.d.ts +14 -0
  86. package/lib/server/plugin.js +142 -0
  87. package/lib/server/query.d.ts +12 -0
  88. package/lib/server/query.js +91 -0
  89. package/lib/server/shared/index.d.ts +2 -0
  90. package/lib/server/shared/index.js +8 -0
  91. package/package.json +14 -0
  92. package/server.d.ts +4 -0
  93. package/server.js +30 -0
  94. package/src/client/ChartBlockEngine.tsx +120 -0
  95. package/src/client/ChartBlockEngineDesigner.tsx +238 -0
  96. package/src/client/ChartBlockInitializer.tsx +216 -0
  97. package/src/client/ChartQueryBlockInitializer.tsx +136 -0
  98. package/src/client/ChartQueryMetadataProvider.tsx +62 -0
  99. package/src/client/DataSetPreviewTable.tsx +73 -0
  100. package/src/client/Icons.tsx +99 -0
  101. package/src/client/chartRenderComponents/index.ts +7 -0
  102. package/src/client/hooks/index.ts +19 -0
  103. package/src/client/index.tsx +101 -0
  104. package/src/client/locale/en-US.ts +23 -0
  105. package/src/client/locale/index.ts +18 -0
  106. package/src/client/locale/ja-JP.ts +1 -0
  107. package/src/client/locale/ru-RU.ts +1 -0
  108. package/src/client/locale/tr-TR.ts +1 -0
  109. package/src/client/locale/zh-CN.ts +63 -0
  110. package/src/client/select/CustomSelect.tsx +127 -0
  111. package/src/client/select/ReadPretty.tsx +36 -0
  112. package/src/client/select/index.md +38 -0
  113. package/src/client/select/index.ts +2 -0
  114. package/src/client/select/shared.ts +36 -0
  115. package/src/client/settings/AddNewQuery.tsx +161 -0
  116. package/src/client/settings/ConfigureFields.tsx +18 -0
  117. package/src/client/settings/QueriesTable.tsx +26 -0
  118. package/src/client/settings/queryTypes.ts +64 -0
  119. package/src/client/settings/schemas/chartsQueries.ts +319 -0
  120. package/src/client/templates/AreaTemplate.tsx +64 -0
  121. package/src/client/templates/BarTemplate.tsx +80 -0
  122. package/src/client/templates/ColumnTemplate.tsx +81 -0
  123. package/src/client/templates/FunnelTemplate.tsx +65 -0
  124. package/src/client/templates/LineTemplate.tsx +72 -0
  125. package/src/client/templates/PieTemplate.tsx +68 -0
  126. package/src/client/templates/RadarTemplate.tsx +71 -0
  127. package/src/client/templates/ScatterTemplate.tsx +90 -0
  128. package/src/client/templates/TableTemplate.tsx +48 -0
  129. package/src/client/templates/index.ts +21 -0
  130. package/src/client/utils.ts +39 -0
  131. package/src/index.ts +1 -0
  132. package/src/server/actions/chartsQueries.ts +44 -0
  133. package/src/server/actions/index.ts +0 -0
  134. package/src/server/collections/.gitkeep +0 -0
  135. package/src/server/collections/chartsQueries.ts +24 -0
  136. package/src/server/index.ts +1 -0
  137. package/src/server/plugin.ts +61 -0
  138. package/src/server/query.ts +39 -0
  139. package/src/server/shared/index.ts +2 -0
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.areaTemplate = void 0;
7
+
8
+ function _json() {
9
+ const data = _interopRequireDefault(require("json5"));
10
+
11
+ _json = function _json() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const chartConfig = {
21
+ yField: '{{metric}}',
22
+ xField: '{{dimension}}',
23
+ seriesField: '{{category}}'
24
+ };
25
+ const areaTemplate = {
26
+ description: '1 「time」or 「Ordered Noun」 field,1 「Numerical」 field,1 「Unordered Noun」 field (optional)',
27
+ type: 'Area',
28
+ title: 'Area',
29
+ iconId: 'icon-area',
30
+ group: 2,
31
+ renderComponent: 'G2Plot',
32
+ defaultChartOptions: chartConfig,
33
+ configurableProperties: {
34
+ type: 'void',
35
+ properties: {
36
+ dimension: {
37
+ required: true,
38
+ type: 'string',
39
+ title: '{{t("Category axis / Dimension",{ns:"charts"})}}',
40
+ 'x-decorator': 'FormItem',
41
+ 'x-component': 'Select',
42
+ enum: '{{dataSource}}'
43
+ },
44
+ metric: {
45
+ required: true,
46
+ type: 'string',
47
+ title: '{{t("Value axis / Metrics",{ns:"charts"})}}',
48
+ 'x-decorator': 'FormItem',
49
+ 'x-component': 'Select',
50
+ enum: '{{dataSource}}'
51
+ },
52
+ category: {
53
+ type: 'string',
54
+ title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
55
+ 'x-decorator': 'FormItem',
56
+ 'x-component': 'Select',
57
+ enum: '{{dataSource}}'
58
+ },
59
+ jsonConfig: {
60
+ type: 'void',
61
+ 'x-component': 'div',
62
+ properties: {
63
+ template: {
64
+ required: true,
65
+ title: '{{t("JSON config",{ns:"charts"})}}',
66
+ type: 'string',
67
+ default: _json().default.stringify(chartConfig, null, 2),
68
+ 'x-decorator': 'FormItem',
69
+ 'x-component': 'Input.TextArea',
70
+ 'x-component-props': {
71
+ autoSize: {
72
+ minRows: 8,
73
+ maxRows: 16
74
+ }
75
+ },
76
+ description: '{{jsonConfigDesc("Area | G2Plot","https://g2plot.antv.antgroup.com/api/plots/area")}}',
77
+ 'x-validator': {
78
+ json5: true
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ };
86
+ exports.areaTemplate = areaTemplate;
@@ -0,0 +1,80 @@
1
+ export declare const barTemplate: {
2
+ description: string;
3
+ type: string;
4
+ title: string;
5
+ iconId: string;
6
+ group: number;
7
+ renderComponent: string;
8
+ defaultChartOptions: {
9
+ appendPadding: number;
10
+ isGroup: boolean;
11
+ yField: string;
12
+ xField: string;
13
+ seriesField: string;
14
+ label: {
15
+ position: string;
16
+ style: {
17
+ fill: string;
18
+ opacity: number;
19
+ };
20
+ };
21
+ xAxis: {
22
+ label: {
23
+ autoHide: boolean;
24
+ autoRotate: boolean;
25
+ };
26
+ };
27
+ };
28
+ configurableProperties: {
29
+ type: string;
30
+ properties: {
31
+ dimension: {
32
+ required: boolean;
33
+ type: string;
34
+ title: string;
35
+ 'x-decorator': string;
36
+ 'x-component': string;
37
+ enum: string;
38
+ };
39
+ metric: {
40
+ required: boolean;
41
+ type: string;
42
+ title: string;
43
+ 'x-decorator': string;
44
+ 'x-component': string;
45
+ enum: string;
46
+ };
47
+ category: {
48
+ type: string;
49
+ title: string;
50
+ 'x-decorator': string;
51
+ 'x-component': string;
52
+ enum: string;
53
+ };
54
+ jsonConfig: {
55
+ type: string;
56
+ 'x-component': string;
57
+ properties: {
58
+ template: {
59
+ required: boolean;
60
+ title: string;
61
+ type: string;
62
+ default: string;
63
+ 'x-decorator': string;
64
+ 'x-component': string;
65
+ 'x-component-props': {
66
+ autoSize: {
67
+ minRows: number;
68
+ maxRows: number;
69
+ };
70
+ };
71
+ description: string;
72
+ 'x-validator': {
73
+ json5: boolean;
74
+ };
75
+ };
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.barTemplate = void 0;
7
+
8
+ function _json() {
9
+ const data = _interopRequireDefault(require("json5"));
10
+
11
+ _json = function _json() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const chartConfig = {
21
+ appendPadding: 10,
22
+ isGroup: true,
23
+ yField: '{{dimension}}',
24
+ xField: '{{metric}}',
25
+ seriesField: '{{category}}',
26
+ label: {
27
+ // 可手动配置 label 数据标签位置
28
+ position: 'middle',
29
+ // 配置样式
30
+ style: {
31
+ fill: '#FFFFFF',
32
+ opacity: 0.6
33
+ }
34
+ },
35
+ xAxis: {
36
+ label: {
37
+ autoHide: true,
38
+ autoRotate: false
39
+ }
40
+ }
41
+ };
42
+ const barTemplate = {
43
+ description: '1 「time」 or 「ordered noun」 field, 1 「value」 field, 0~ 1 「unordered noun」',
44
+ type: 'Bar',
45
+ title: 'Bar',
46
+ iconId: 'icon-bar',
47
+ group: 2,
48
+ renderComponent: 'G2Plot',
49
+ defaultChartOptions: chartConfig,
50
+ configurableProperties: {
51
+ type: 'void',
52
+ properties: {
53
+ dimension: {
54
+ required: true,
55
+ type: 'string',
56
+ title: '{{t("Category axis / Dimension",{ns:"charts"})}}',
57
+ 'x-decorator': 'FormItem',
58
+ 'x-component': 'Select',
59
+ enum: '{{dataSource}}'
60
+ },
61
+ metric: {
62
+ required: true,
63
+ type: 'string',
64
+ title: '{{t("Value axis / Metrics",{ns:"charts"})}}',
65
+ 'x-decorator': 'FormItem',
66
+ 'x-component': 'Select',
67
+ enum: '{{dataSource}}'
68
+ },
69
+ category: {
70
+ type: 'string',
71
+ title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
72
+ 'x-decorator': 'FormItem',
73
+ 'x-component': 'Select',
74
+ enum: '{{dataSource}}'
75
+ },
76
+ jsonConfig: {
77
+ type: 'void',
78
+ 'x-component': 'div',
79
+ properties: {
80
+ template: {
81
+ required: true,
82
+ title: '{{t("JSON config",{ns:"charts"})}}',
83
+ type: 'string',
84
+ default: _json().default.stringify(chartConfig, null, 2),
85
+ 'x-decorator': 'FormItem',
86
+ 'x-component': 'Input.TextArea',
87
+ 'x-component-props': {
88
+ autoSize: {
89
+ minRows: 8,
90
+ maxRows: 16
91
+ }
92
+ },
93
+ description: '{{jsonConfigDesc("Bar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/bar")}}',
94
+ 'x-validator': {
95
+ json5: true
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ };
103
+ exports.barTemplate = barTemplate;
@@ -0,0 +1,80 @@
1
+ export declare const columnTemplate: {
2
+ description: string;
3
+ type: string;
4
+ title: string;
5
+ iconId: string;
6
+ group: number;
7
+ renderComponent: string;
8
+ defaultChartOptions: {
9
+ appendPadding: number;
10
+ isGroup: boolean;
11
+ yField: string;
12
+ xField: string;
13
+ seriesField: string;
14
+ label: {
15
+ position: string;
16
+ style: {
17
+ fill: string;
18
+ opacity: number;
19
+ };
20
+ };
21
+ xAxis: {
22
+ label: {
23
+ autoHide: boolean;
24
+ autoRotate: boolean;
25
+ };
26
+ };
27
+ };
28
+ configurableProperties: {
29
+ type: string;
30
+ properties: {
31
+ dimension: {
32
+ required: boolean;
33
+ type: string;
34
+ title: string;
35
+ 'x-decorator': string;
36
+ 'x-component': string;
37
+ enum: string;
38
+ };
39
+ metric: {
40
+ required: boolean;
41
+ type: string;
42
+ title: string;
43
+ 'x-decorator': string;
44
+ 'x-component': string;
45
+ enum: string;
46
+ };
47
+ category: {
48
+ type: string;
49
+ title: string;
50
+ 'x-decorator': string;
51
+ 'x-component': string;
52
+ enum: string;
53
+ };
54
+ jsonConfig: {
55
+ type: string;
56
+ 'x-component': string;
57
+ properties: {
58
+ template: {
59
+ required: boolean;
60
+ title: string;
61
+ type: string;
62
+ default: string;
63
+ 'x-decorator': string;
64
+ 'x-component': string;
65
+ 'x-component-props': {
66
+ autoSize: {
67
+ minRows: number;
68
+ maxRows: number;
69
+ };
70
+ };
71
+ description: string;
72
+ 'x-validator': {
73
+ json5: boolean;
74
+ };
75
+ };
76
+ };
77
+ };
78
+ };
79
+ };
80
+ };
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.columnTemplate = void 0;
7
+
8
+ function _json() {
9
+ const data = _interopRequireDefault(require("json5"));
10
+
11
+ _json = function _json() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const chartConfig = {
21
+ appendPadding: 10,
22
+ isGroup: true,
23
+ yField: '{{metric}}',
24
+ xField: '{{dimension}}',
25
+ seriesField: '{{category}}',
26
+ label: {
27
+ // 可手动配置 label 数据标签位置
28
+ position: 'middle',
29
+ // 配置样式
30
+ style: {
31
+ fill: '#FFFFFF',
32
+ opacity: 0.6
33
+ }
34
+ },
35
+ xAxis: {
36
+ label: {
37
+ autoHide: true,
38
+ autoRotate: false
39
+ }
40
+ }
41
+ };
42
+ const columnTemplate = {
43
+ description: '1 「time」 or 「ordered noun」 field, 1 「value」 field, 0 to 1 「unordered noun」',
44
+ type: 'Column',
45
+ title: 'Column',
46
+ iconId: 'icon-column',
47
+ group: 2,
48
+ renderComponent: 'G2Plot',
49
+ defaultChartOptions: chartConfig,
50
+ configurableProperties: {
51
+ type: 'void',
52
+ properties: {
53
+ dimension: {
54
+ required: true,
55
+ type: 'string',
56
+ title: '{{t("Category axis / Dimension",{ns:"charts"})}}',
57
+ 'x-decorator': 'FormItem',
58
+ 'x-component': 'Select',
59
+ enum: '{{dataSource}}'
60
+ },
61
+ metric: {
62
+ required: true,
63
+ type: 'string',
64
+ title: '{{t("Value axis / Metrics",{ns:"charts"})}}',
65
+ 'x-decorator': 'FormItem',
66
+ 'x-component': 'Select',
67
+ enum: '{{dataSource}}'
68
+ },
69
+ category: {
70
+ type: 'string',
71
+ title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
72
+ 'x-decorator': 'FormItem',
73
+ 'x-component': 'Select',
74
+ enum: '{{dataSource}}'
75
+ },
76
+ jsonConfig: {
77
+ type: 'void',
78
+ 'x-component': 'div',
79
+ properties: {
80
+ template: {
81
+ required: true,
82
+ title: '{{t("JSON config",{ns:"charts"})}}',
83
+ type: 'string',
84
+ default: _json().default.stringify(chartConfig, null, 2),
85
+ 'x-decorator': 'FormItem',
86
+ 'x-component': 'Input.TextArea',
87
+ 'x-component-props': {
88
+ autoSize: {
89
+ minRows: 8,
90
+ maxRows: 16
91
+ }
92
+ },
93
+ description: '{{jsonConfigDesc("Column | G2Plot","https://g2plot.antv.antgroup.com/api/plots/column")}}',
94
+ 'x-validator': {
95
+ json5: true
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ };
103
+ exports.columnTemplate = columnTemplate;
@@ -0,0 +1,66 @@
1
+ export declare const funnelTemplate: {
2
+ description: string;
3
+ type: string;
4
+ title: string;
5
+ iconId: string;
6
+ group: number;
7
+ renderComponent: string;
8
+ defaultChartOptions: {
9
+ xField: string;
10
+ yField: string;
11
+ seriesField: string;
12
+ legend: boolean;
13
+ };
14
+ configurableProperties: {
15
+ type: string;
16
+ properties: {
17
+ dimension: {
18
+ required: boolean;
19
+ type: string;
20
+ title: string;
21
+ 'x-decorator': string;
22
+ 'x-component': string;
23
+ enum: string;
24
+ };
25
+ metric: {
26
+ required: boolean;
27
+ type: string;
28
+ title: string;
29
+ 'x-decorator': string;
30
+ 'x-component': string;
31
+ enum: string;
32
+ };
33
+ category: {
34
+ type: string;
35
+ title: string;
36
+ 'x-decorator': string;
37
+ 'x-component': string;
38
+ enum: string;
39
+ };
40
+ jsonConfig: {
41
+ type: string;
42
+ 'x-component': string;
43
+ properties: {
44
+ template: {
45
+ required: boolean;
46
+ title: string;
47
+ type: string;
48
+ default: string;
49
+ 'x-decorator': string;
50
+ 'x-component': string;
51
+ 'x-component-props': {
52
+ autoSize: {
53
+ minRows: number;
54
+ maxRows: number;
55
+ };
56
+ };
57
+ description: string;
58
+ 'x-validator': {
59
+ json5: boolean;
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.funnelTemplate = void 0;
7
+
8
+ function _json() {
9
+ const data = _interopRequireDefault(require("json5"));
10
+
11
+ _json = function _json() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const chartConfig = {
21
+ xField: '{{dimension}}',
22
+ yField: '{{metric}}',
23
+ seriesField: '{{category}}',
24
+ legend: false
25
+ };
26
+ const funnelTemplate = {
27
+ description: '1 「Unordered Noun」 field, 1 「Numeric」 field',
28
+ type: 'Funnel',
29
+ title: 'Funnel',
30
+ iconId: 'icon-funnel',
31
+ group: 1,
32
+ renderComponent: 'G2Plot',
33
+ defaultChartOptions: chartConfig,
34
+ configurableProperties: {
35
+ type: 'void',
36
+ properties: {
37
+ dimension: {
38
+ required: true,
39
+ type: 'string',
40
+ title: '{{t("Sector label / Dimensional",{ns:"charts"})}}',
41
+ 'x-decorator': 'FormItem',
42
+ 'x-component': 'Select',
43
+ enum: '{{dataSource}}'
44
+ },
45
+ metric: {
46
+ required: true,
47
+ type: 'string',
48
+ title: '{{t("Funnel Layer Width/Metrics",{ns:"charts"})}}',
49
+ 'x-decorator': 'FormItem',
50
+ 'x-component': 'Select',
51
+ enum: '{{dataSource}}'
52
+ },
53
+ category: {
54
+ type: 'string',
55
+ title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
56
+ 'x-decorator': 'FormItem',
57
+ 'x-component': 'Select',
58
+ enum: '{{dataSource}}'
59
+ },
60
+ jsonConfig: {
61
+ type: 'void',
62
+ 'x-component': 'div',
63
+ properties: {
64
+ template: {
65
+ required: true,
66
+ title: '{{t("JSON config",{ns:"charts"})}}',
67
+ type: 'string',
68
+ default: _json().default.stringify(chartConfig, null, 2),
69
+ 'x-decorator': 'FormItem',
70
+ 'x-component': 'Input.TextArea',
71
+ 'x-component-props': {
72
+ autoSize: {
73
+ minRows: 8,
74
+ maxRows: 16
75
+ }
76
+ },
77
+ description: '{{jsonConfigDesc("Funnel | G2Plot","https://g2plot.antv.antgroup.com/api/plots/funnel")}}',
78
+ 'x-validator': {
79
+ json5: true
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ };
87
+ exports.funnelTemplate = funnelTemplate;
@@ -0,0 +1,67 @@
1
+ export declare const lineTemplate: {
2
+ description: string;
3
+ type: string;
4
+ title: string;
5
+ iconId: string;
6
+ group: number;
7
+ renderComponent: string;
8
+ defaultChartOptions: {
9
+ yField: string;
10
+ xField: string;
11
+ seriesField: string;
12
+ xAxis: {};
13
+ yAxis: {};
14
+ };
15
+ configurableProperties: {
16
+ type: string;
17
+ properties: {
18
+ dimension: {
19
+ required: boolean;
20
+ type: string;
21
+ title: string;
22
+ 'x-decorator': string;
23
+ 'x-component': string;
24
+ enum: string;
25
+ };
26
+ metric: {
27
+ required: boolean;
28
+ type: string;
29
+ title: string;
30
+ 'x-decorator': string;
31
+ 'x-component': string;
32
+ enum: string;
33
+ };
34
+ category: {
35
+ type: string;
36
+ title: string;
37
+ 'x-decorator': string;
38
+ 'x-component': string;
39
+ enum: string;
40
+ };
41
+ jsonConfig: {
42
+ type: string;
43
+ 'x-component': string;
44
+ properties: {
45
+ template: {
46
+ required: boolean;
47
+ title: string;
48
+ type: string;
49
+ default: string;
50
+ 'x-decorator': string;
51
+ 'x-component': string;
52
+ 'x-component-props': {
53
+ autoSize: {
54
+ minRows: number;
55
+ maxRows: number;
56
+ };
57
+ };
58
+ description: string;
59
+ 'x-validator': {
60
+ json5: boolean;
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };