@nocobase/plugin-charts 0.11.1-alpha.5 → 0.12.0-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.
- package/client.d.ts +2 -3
- package/client.js +1 -1
- package/{lib → dist}/client/index.d.ts +1 -0
- package/dist/client/index.js +3234 -0
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/locale/en-US.js +26 -0
- package/{src/locale/es-ES.ts → dist/locale/es-ES.js} +22 -18
- package/dist/locale/fr-FR.js +5 -0
- package/dist/locale/ja-JP.js +5 -0
- package/dist/locale/pt-BR.js +26 -0
- package/dist/locale/ru-RU.js +5 -0
- package/dist/locale/tr-TR.js +5 -0
- package/dist/locale/zh-CN.js +65 -0
- package/dist/node_modules/json5/dist/index.js +1737 -0
- package/dist/node_modules/json5/dist/index.min.js +1 -0
- package/dist/node_modules/json5/lib/cli.js +152 -0
- package/dist/node_modules/json5/lib/index.d.ts +4 -0
- package/dist/node_modules/json5/lib/index.js +1 -0
- package/dist/node_modules/json5/lib/parse.d.ts +15 -0
- package/dist/node_modules/json5/lib/parse.js +1114 -0
- package/dist/node_modules/json5/lib/register.js +13 -0
- package/dist/node_modules/json5/lib/require.js +4 -0
- package/dist/node_modules/json5/lib/stringify.d.ts +89 -0
- package/dist/node_modules/json5/lib/stringify.js +261 -0
- package/dist/node_modules/json5/lib/unicode.d.ts +3 -0
- package/dist/node_modules/json5/lib/unicode.js +4 -0
- package/dist/node_modules/json5/lib/util.d.ts +5 -0
- package/dist/node_modules/json5/lib/util.js +35 -0
- package/dist/node_modules/json5/package.json +1 -0
- package/dist/server/actions/chartsQueries.js +57 -0
- package/dist/server/actions/index.js +2 -0
- package/dist/server/collections/chartsQueries.js +30 -0
- package/dist/server/index.js +11 -0
- package/dist/server/plugin.js +66 -0
- package/dist/server/query.js +39 -0
- package/dist/server/shared/index.js +5 -0
- package/package.json +17 -28
- package/server.d.ts +2 -3
- package/server.js +1 -1
- package/lib/client/ChartBlockEngine.js +0 -146
- package/lib/client/ChartBlockEngineDesigner.js +0 -293
- package/lib/client/ChartBlockInitializer.js +0 -263
- package/lib/client/ChartQueryBlockInitializer.js +0 -191
- package/lib/client/ChartQueryMetadataProvider.js +0 -91
- package/lib/client/DataSetPreviewTable.js +0 -113
- package/lib/client/Icons.js +0 -210
- package/lib/client/chartRenderComponents/index.js +0 -20
- package/lib/client/hooks/index.js +0 -38
- package/lib/client/index.js +0 -143
- package/lib/client/locale/index.js +0 -37
- package/lib/client/select/CustomSelect.js +0 -148
- package/lib/client/select/ReadPretty.js +0 -77
- package/lib/client/select/index.js +0 -27
- package/lib/client/select/shared.js +0 -66
- package/lib/client/settings/AddNewQuery.js +0 -270
- package/lib/client/settings/ConfigureFields.js +0 -39
- package/lib/client/settings/QueriesTable.js +0 -77
- package/lib/client/settings/queryTypes.js +0 -77
- package/lib/client/settings/schemas/chartsQueries.js +0 -353
- package/lib/client/templates/AreaTemplate.js +0 -81
- package/lib/client/templates/BarTemplate.js +0 -98
- package/lib/client/templates/ColumnTemplate.js +0 -98
- package/lib/client/templates/FunnelTemplate.js +0 -82
- package/lib/client/templates/LineTemplate.js +0 -89
- package/lib/client/templates/PieTemplate.js +0 -87
- package/lib/client/templates/RadarTemplate.js +0 -88
- package/lib/client/templates/ScatterTemplate.js +0 -107
- package/lib/client/templates/TableTemplate.js +0 -54
- package/lib/client/templates/index.js +0 -25
- package/lib/client/utils.js +0 -50
- package/lib/index.js +0 -13
- package/lib/locale/en-US.js +0 -29
- package/lib/locale/es-ES.js +0 -59
- package/lib/locale/fr-FR.js +0 -8
- package/lib/locale/ja-JP.js +0 -8
- package/lib/locale/pt-BR.js +0 -29
- package/lib/locale/ru-RU.js +0 -8
- package/lib/locale/tr-TR.js +0 -8
- package/lib/locale/zh-CN.js +0 -68
- package/lib/server/actions/chartsQueries.js +0 -89
- package/lib/server/actions/index.js +0 -1
- package/lib/server/collections/chartsQueries.js +0 -33
- package/lib/server/index.js +0 -13
- package/lib/server/plugin.js +0 -106
- package/lib/server/query.js +0 -71
- package/lib/server/shared/index.js +0 -8
- package/src/client/ChartBlockEngine.tsx +0 -121
- package/src/client/ChartBlockEngineDesigner.tsx +0 -248
- package/src/client/ChartBlockInitializer.tsx +0 -223
- package/src/client/ChartQueryBlockInitializer.tsx +0 -156
- package/src/client/ChartQueryMetadataProvider.tsx +0 -64
- package/src/client/DataSetPreviewTable.tsx +0 -71
- package/src/client/Icons.tsx +0 -99
- package/src/client/chartRenderComponents/index.ts +0 -7
- package/src/client/hooks/index.ts +0 -19
- package/src/client/index.tsx +0 -115
- package/src/client/locale/index.ts +0 -18
- package/src/client/select/CustomSelect.tsx +0 -126
- package/src/client/select/ReadPretty.tsx +0 -39
- package/src/client/select/index.md +0 -31
- package/src/client/select/index.ts +0 -2
- package/src/client/select/shared.ts +0 -37
- package/src/client/settings/AddNewQuery.tsx +0 -176
- package/src/client/settings/ConfigureFields.tsx +0 -18
- package/src/client/settings/QueriesTable.tsx +0 -26
- package/src/client/settings/queryTypes.ts +0 -65
- package/src/client/settings/schemas/chartsQueries.ts +0 -319
- package/src/client/templates/AreaTemplate.tsx +0 -64
- package/src/client/templates/BarTemplate.tsx +0 -80
- package/src/client/templates/ColumnTemplate.tsx +0 -81
- package/src/client/templates/FunnelTemplate.tsx +0 -65
- package/src/client/templates/LineTemplate.tsx +0 -72
- package/src/client/templates/PieTemplate.tsx +0 -68
- package/src/client/templates/RadarTemplate.tsx +0 -71
- package/src/client/templates/ScatterTemplate.tsx +0 -90
- package/src/client/templates/TableTemplate.tsx +0 -48
- package/src/client/templates/index.ts +0 -21
- package/src/client/utils.ts +0 -39
- package/src/index.ts +0 -1
- package/src/locale/en-US.ts +0 -23
- package/src/locale/fr-FR.ts +0 -1
- package/src/locale/ja-JP.ts +0 -1
- package/src/locale/pt-BR.ts +0 -23
- package/src/locale/ru-RU.ts +0 -1
- package/src/locale/tr-TR.ts +0 -1
- package/src/locale/zh-CN.ts +0 -64
- package/src/server/actions/chartsQueries.ts +0 -49
- package/src/server/actions/index.ts +0 -0
- package/src/server/collections/.gitkeep +0 -0
- package/src/server/collections/chartsQueries.ts +0 -26
- package/src/server/index.ts +0 -1
- package/src/server/plugin.ts +0 -61
- package/src/server/query.ts +0 -39
- package/src/server/shared/index.ts +0 -2
- /package/{lib → dist}/client/ChartBlockEngine.d.ts +0 -0
- /package/{lib → dist}/client/ChartBlockEngineDesigner.d.ts +0 -0
- /package/{lib → dist}/client/ChartBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/ChartQueryBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/ChartQueryMetadataProvider.d.ts +0 -0
- /package/{lib → dist}/client/DataSetPreviewTable.d.ts +0 -0
- /package/{lib → dist}/client/Icons.d.ts +0 -0
- /package/{lib → dist}/client/chartRenderComponents/index.d.ts +0 -0
- /package/{lib → dist}/client/hooks/index.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/select/CustomSelect.d.ts +0 -0
- /package/{lib → dist}/client/select/ReadPretty.d.ts +0 -0
- /package/{lib → dist}/client/select/index.d.ts +0 -0
- /package/{lib → dist}/client/select/shared.d.ts +0 -0
- /package/{lib → dist}/client/settings/AddNewQuery.d.ts +0 -0
- /package/{lib → dist}/client/settings/ConfigureFields.d.ts +0 -0
- /package/{lib → dist}/client/settings/QueriesTable.d.ts +0 -0
- /package/{lib → dist}/client/settings/queryTypes.d.ts +0 -0
- /package/{lib → dist}/client/settings/schemas/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/client/templates/AreaTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/BarTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/ColumnTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/FunnelTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/LineTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/PieTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/RadarTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/ScatterTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/TableTemplate.d.ts +0 -0
- /package/{lib → dist}/client/templates/index.d.ts +0 -0
- /package/{lib → dist}/client/utils.d.ts +0 -0
- /package/{lib → dist}/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/locale/es-ES.d.ts +0 -0
- /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
- /package/{lib → dist}/locale/ru-RU.d.ts +0 -0
- /package/{lib → dist}/locale/tr-TR.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/actions/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/server/actions/index.d.ts +0 -0
- /package/{lib → dist}/server/collections/chartsQueries.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
- /package/{lib → dist}/server/plugin.d.ts +0 -0
- /package/{lib → dist}/server/query.d.ts +0 -0
- /package/{lib → dist}/server/shared/index.d.ts +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.funnelTemplate = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const chartConfig = {
|
|
16
|
-
xField: '{{dimension}}',
|
|
17
|
-
yField: '{{metric}}',
|
|
18
|
-
seriesField: '{{category}}',
|
|
19
|
-
legend: false
|
|
20
|
-
};
|
|
21
|
-
const funnelTemplate = {
|
|
22
|
-
description: '1 「Unordered Noun」 field, 1 「Numeric」 field',
|
|
23
|
-
type: 'Funnel',
|
|
24
|
-
title: 'Funnel',
|
|
25
|
-
iconId: 'icon-funnel',
|
|
26
|
-
group: 1,
|
|
27
|
-
renderComponent: 'G2Plot',
|
|
28
|
-
defaultChartOptions: chartConfig,
|
|
29
|
-
configurableProperties: {
|
|
30
|
-
type: 'void',
|
|
31
|
-
properties: {
|
|
32
|
-
dimension: {
|
|
33
|
-
required: true,
|
|
34
|
-
type: 'string',
|
|
35
|
-
title: '{{t("Sector label / Dimensional",{ns:"charts"})}}',
|
|
36
|
-
'x-decorator': 'FormItem',
|
|
37
|
-
'x-component': 'Select',
|
|
38
|
-
enum: '{{dataSource}}'
|
|
39
|
-
},
|
|
40
|
-
metric: {
|
|
41
|
-
required: true,
|
|
42
|
-
type: 'string',
|
|
43
|
-
title: '{{t("Funnel Layer Width/Metrics",{ns:"charts"})}}',
|
|
44
|
-
'x-decorator': 'FormItem',
|
|
45
|
-
'x-component': 'Select',
|
|
46
|
-
enum: '{{dataSource}}'
|
|
47
|
-
},
|
|
48
|
-
category: {
|
|
49
|
-
type: 'string',
|
|
50
|
-
title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
|
|
51
|
-
'x-decorator': 'FormItem',
|
|
52
|
-
'x-component': 'Select',
|
|
53
|
-
enum: '{{dataSource}}'
|
|
54
|
-
},
|
|
55
|
-
jsonConfig: {
|
|
56
|
-
type: 'void',
|
|
57
|
-
'x-component': 'div',
|
|
58
|
-
properties: {
|
|
59
|
-
template: {
|
|
60
|
-
required: true,
|
|
61
|
-
title: '{{t("JSON config",{ns:"charts"})}}',
|
|
62
|
-
type: 'string',
|
|
63
|
-
default: _json().default.stringify(chartConfig, null, 2),
|
|
64
|
-
'x-decorator': 'FormItem',
|
|
65
|
-
'x-component': 'Input.TextArea',
|
|
66
|
-
'x-component-props': {
|
|
67
|
-
autoSize: {
|
|
68
|
-
minRows: 8,
|
|
69
|
-
maxRows: 16
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
description: '{{jsonConfigDesc("Funnel | G2Plot","https://g2plot.antv.antgroup.com/api/plots/funnel")}}',
|
|
73
|
-
'x-validator': {
|
|
74
|
-
json5: true
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
exports.funnelTemplate = funnelTemplate;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.lineTemplate = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const chartConfig = {
|
|
16
|
-
yField: '{{metric}}',
|
|
17
|
-
xField: '{{dimension}}',
|
|
18
|
-
seriesField: '{{category}}',
|
|
19
|
-
xAxis: {
|
|
20
|
-
//type: 'time',
|
|
21
|
-
},
|
|
22
|
-
yAxis: {
|
|
23
|
-
// label: {
|
|
24
|
-
// formatter: '{{(v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`)}}',
|
|
25
|
-
// },
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const lineTemplate = {
|
|
29
|
-
description: '1 「Time」 or 「Order Noun」 field, 1 「Value」 field',
|
|
30
|
-
type: 'Line',
|
|
31
|
-
title: 'Line',
|
|
32
|
-
iconId: 'icon-line',
|
|
33
|
-
group: 2,
|
|
34
|
-
renderComponent: 'G2Plot',
|
|
35
|
-
defaultChartOptions: chartConfig,
|
|
36
|
-
configurableProperties: {
|
|
37
|
-
type: 'void',
|
|
38
|
-
properties: {
|
|
39
|
-
dimension: {
|
|
40
|
-
required: true,
|
|
41
|
-
type: 'string',
|
|
42
|
-
title: '{{t("Category axis / Dimension",{ns:"charts"})}}',
|
|
43
|
-
'x-decorator': 'FormItem',
|
|
44
|
-
'x-component': 'Select',
|
|
45
|
-
enum: '{{dataSource}}'
|
|
46
|
-
},
|
|
47
|
-
metric: {
|
|
48
|
-
required: true,
|
|
49
|
-
type: 'string',
|
|
50
|
-
title: '{{t("Value axis / Metrics",{ns:"charts"})}}',
|
|
51
|
-
'x-decorator': 'FormItem',
|
|
52
|
-
'x-component': 'Select',
|
|
53
|
-
enum: '{{dataSource}}'
|
|
54
|
-
},
|
|
55
|
-
category: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
|
|
58
|
-
'x-decorator': 'FormItem',
|
|
59
|
-
'x-component': 'Select',
|
|
60
|
-
enum: '{{dataSource}}'
|
|
61
|
-
},
|
|
62
|
-
jsonConfig: {
|
|
63
|
-
type: 'void',
|
|
64
|
-
'x-component': 'div',
|
|
65
|
-
properties: {
|
|
66
|
-
template: {
|
|
67
|
-
required: true,
|
|
68
|
-
title: '{{t("JSON config",{ns:"charts"})}}',
|
|
69
|
-
type: 'string',
|
|
70
|
-
default: _json().default.stringify(chartConfig, null, 2),
|
|
71
|
-
'x-decorator': 'FormItem',
|
|
72
|
-
'x-component': 'Input.TextArea',
|
|
73
|
-
'x-component-props': {
|
|
74
|
-
autoSize: {
|
|
75
|
-
minRows: 8,
|
|
76
|
-
maxRows: 16
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
description: '{{jsonConfigDesc("Line | G2Plot","https://g2plot.antv.antgroup.com/api/plots/line")}}',
|
|
80
|
-
'x-validator': {
|
|
81
|
-
json5: true
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
exports.lineTemplate = lineTemplate;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pieTemplate = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const chartConfig = {
|
|
16
|
-
appendPadding: 10,
|
|
17
|
-
angleField: '{{metric}}',
|
|
18
|
-
colorField: '{{dimension}}',
|
|
19
|
-
radius: 0.9,
|
|
20
|
-
label: {
|
|
21
|
-
type: 'inner',
|
|
22
|
-
offset: '-30%',
|
|
23
|
-
content: '{{({percent}) => `${(percent * 100).toFixed(0)}%`}}',
|
|
24
|
-
style: {
|
|
25
|
-
fontSize: 14,
|
|
26
|
-
textAlign: 'center'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
interactions: [{
|
|
30
|
-
type: 'element-active'
|
|
31
|
-
}]
|
|
32
|
-
};
|
|
33
|
-
const pieTemplate = {
|
|
34
|
-
description: '1 「Time」 or 「Order Noun」 field, 1 「Value」 field',
|
|
35
|
-
title: 'Pie',
|
|
36
|
-
type: 'Pie',
|
|
37
|
-
iconId: 'icon-pie',
|
|
38
|
-
group: 2,
|
|
39
|
-
renderComponent: 'G2Plot',
|
|
40
|
-
defaultChartOptions: chartConfig,
|
|
41
|
-
configurableProperties: {
|
|
42
|
-
type: 'void',
|
|
43
|
-
properties: {
|
|
44
|
-
dimension: {
|
|
45
|
-
required: true,
|
|
46
|
-
type: 'string',
|
|
47
|
-
title: '{{t("Sector label / Dimensional",{ns:"charts"})}}',
|
|
48
|
-
'x-decorator': 'FormItem',
|
|
49
|
-
'x-component': 'Select',
|
|
50
|
-
enum: '{{dataSource}}'
|
|
51
|
-
},
|
|
52
|
-
metric: {
|
|
53
|
-
required: true,
|
|
54
|
-
type: 'string',
|
|
55
|
-
title: '{{t("Sector Angle / Metric",{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("Pie | G2Plot","https://g2plot.antv.antgroup.com/api/plots/pie")}}',
|
|
78
|
-
'x-validator': {
|
|
79
|
-
json5: true
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
exports.pieTemplate = pieTemplate;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.radarTemplate = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const chartConfig = {
|
|
16
|
-
xField: '{{dimension}}',
|
|
17
|
-
yField: '{{metric}}',
|
|
18
|
-
appendPadding: [0, 10, 0, 10],
|
|
19
|
-
xAxis: {
|
|
20
|
-
tickLine: null
|
|
21
|
-
},
|
|
22
|
-
yAxis: {
|
|
23
|
-
label: false,
|
|
24
|
-
grid: {
|
|
25
|
-
alternateColor: 'rgba(0, 0, 0, 0.04)'
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
// 开启辅助点
|
|
29
|
-
point: {
|
|
30
|
-
size: 2
|
|
31
|
-
},
|
|
32
|
-
area: {}
|
|
33
|
-
};
|
|
34
|
-
const radarTemplate = {
|
|
35
|
-
description: '1~ 2 「Unordered Noun」 fields, 1 「Numeric」 field',
|
|
36
|
-
type: 'Radar',
|
|
37
|
-
title: 'Radar',
|
|
38
|
-
iconId: 'icon-radar',
|
|
39
|
-
group: 1,
|
|
40
|
-
renderComponent: 'G2Plot',
|
|
41
|
-
defaultChartOptions: chartConfig,
|
|
42
|
-
configurableProperties: {
|
|
43
|
-
type: 'void',
|
|
44
|
-
properties: {
|
|
45
|
-
dimension: {
|
|
46
|
-
required: true,
|
|
47
|
-
type: 'string',
|
|
48
|
-
title: '{{t("Branch Tags/Dimensions",{ns:"charts"})}}',
|
|
49
|
-
'x-decorator': 'FormItem',
|
|
50
|
-
'x-component': 'Select',
|
|
51
|
-
enum: '{{dataSource}}'
|
|
52
|
-
},
|
|
53
|
-
metric: {
|
|
54
|
-
required: true,
|
|
55
|
-
type: 'string',
|
|
56
|
-
title: '{{t("Branch Length/Metrics",{ns:"charts"})}}',
|
|
57
|
-
'x-decorator': 'FormItem',
|
|
58
|
-
'x-component': 'Select',
|
|
59
|
-
enum: '{{dataSource}}'
|
|
60
|
-
},
|
|
61
|
-
jsonConfig: {
|
|
62
|
-
type: 'void',
|
|
63
|
-
'x-component': 'div',
|
|
64
|
-
properties: {
|
|
65
|
-
template: {
|
|
66
|
-
required: true,
|
|
67
|
-
title: '{{t("JSON config",{ns:"charts"})}}',
|
|
68
|
-
type: 'string',
|
|
69
|
-
default: _json().default.stringify(chartConfig, null, 2),
|
|
70
|
-
'x-decorator': 'FormItem',
|
|
71
|
-
'x-component': 'Input.TextArea',
|
|
72
|
-
'x-component-props': {
|
|
73
|
-
autoSize: {
|
|
74
|
-
minRows: 8,
|
|
75
|
-
maxRows: 16
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
description: '{{jsonConfigDesc("Radar | G2Plot","https://g2plot.antv.antgroup.com/api/plots/radar")}}',
|
|
79
|
-
'x-validator': {
|
|
80
|
-
json5: true
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
exports.radarTemplate = radarTemplate;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.scatterTemplate = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const chartConfig = {
|
|
16
|
-
appendPadding: 10,
|
|
17
|
-
xField: '{{metric}}',
|
|
18
|
-
yField: '{{dimension}}',
|
|
19
|
-
colorField: '{{category}}',
|
|
20
|
-
shape: 'circle',
|
|
21
|
-
size: 4,
|
|
22
|
-
yAxis: {
|
|
23
|
-
nice: true,
|
|
24
|
-
line: {
|
|
25
|
-
style: {
|
|
26
|
-
stroke: '#aaa'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
xAxis: {
|
|
31
|
-
min: -100,
|
|
32
|
-
grid: {
|
|
33
|
-
line: {
|
|
34
|
-
style: {
|
|
35
|
-
stroke: '#eee'
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
line: {
|
|
40
|
-
style: {
|
|
41
|
-
stroke: '#aaa'
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const scatterTemplate = {
|
|
47
|
-
description: '1 「Numeric」 field, 0~ 1 「Unordered Noun」 field',
|
|
48
|
-
type: 'Scatter',
|
|
49
|
-
title: 'Scatter',
|
|
50
|
-
iconId: 'icon-scatter',
|
|
51
|
-
group: 2,
|
|
52
|
-
renderComponent: 'G2Plot',
|
|
53
|
-
defaultChartOptions: chartConfig,
|
|
54
|
-
configurableProperties: {
|
|
55
|
-
type: 'void',
|
|
56
|
-
properties: {
|
|
57
|
-
dimension: {
|
|
58
|
-
required: true,
|
|
59
|
-
type: 'string',
|
|
60
|
-
title: '{{t("Category axis / Dimension",{ns:"charts"})}}',
|
|
61
|
-
'x-decorator': 'FormItem',
|
|
62
|
-
'x-component': 'Select',
|
|
63
|
-
enum: '{{dataSource}}'
|
|
64
|
-
},
|
|
65
|
-
metric: {
|
|
66
|
-
required: true,
|
|
67
|
-
type: 'string',
|
|
68
|
-
title: '{{t("Value axis / Metrics",{ns:"charts"})}}',
|
|
69
|
-
'x-decorator': 'FormItem',
|
|
70
|
-
'x-component': 'Select',
|
|
71
|
-
enum: '{{dataSource}}'
|
|
72
|
-
},
|
|
73
|
-
category: {
|
|
74
|
-
type: 'string',
|
|
75
|
-
title: '{{t("Color legend / Dimensional",{ns:"charts"})}}',
|
|
76
|
-
'x-decorator': 'FormItem',
|
|
77
|
-
'x-component': 'Select',
|
|
78
|
-
enum: '{{dataSource}}'
|
|
79
|
-
},
|
|
80
|
-
jsonConfig: {
|
|
81
|
-
type: 'void',
|
|
82
|
-
'x-component': 'div',
|
|
83
|
-
properties: {
|
|
84
|
-
template: {
|
|
85
|
-
required: true,
|
|
86
|
-
title: '{{t("JSON config",{ns:"charts"})}}',
|
|
87
|
-
type: 'string',
|
|
88
|
-
default: _json().default.stringify(chartConfig, null, 2),
|
|
89
|
-
'x-decorator': 'FormItem',
|
|
90
|
-
'x-component': 'Input.TextArea',
|
|
91
|
-
'x-component-props': {
|
|
92
|
-
autoSize: {
|
|
93
|
-
minRows: 8,
|
|
94
|
-
maxRows: 16
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
description: '{{jsonConfigDesc("Scatter | G2Plot","https://g2plot.antv.antgroup.com/api/plots/scatter")}}',
|
|
98
|
-
'x-validator': {
|
|
99
|
-
json5: true
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
exports.scatterTemplate = scatterTemplate;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tableTemplate = void 0;
|
|
7
|
-
const validateJSON = {
|
|
8
|
-
validator: `{{(value, rule)=> {
|
|
9
|
-
if (!value) {
|
|
10
|
-
return '';
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const val = JSON5.parse(value);
|
|
14
|
-
if(!isNaN(val)) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
} catch(error) {
|
|
19
|
-
console.error(error);
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}}}`,
|
|
23
|
-
message: '{{t("Invalid JSON format",{ ns: "charts" })}}'
|
|
24
|
-
};
|
|
25
|
-
const chartConfig = {
|
|
26
|
-
appendPadding: 10,
|
|
27
|
-
angleField: '{{metric}}',
|
|
28
|
-
colorField: '{{dimension}}',
|
|
29
|
-
radius: 0.9,
|
|
30
|
-
label: {
|
|
31
|
-
type: 'inner',
|
|
32
|
-
offset: '-30%',
|
|
33
|
-
content: '{{({percent}) => `${(percent * 100).toFixed(0)}%`}}',
|
|
34
|
-
style: {
|
|
35
|
-
fontSize: 14,
|
|
36
|
-
textAlign: 'center'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
interactions: [{
|
|
40
|
-
type: 'element-active'
|
|
41
|
-
}]
|
|
42
|
-
};
|
|
43
|
-
const tableTemplate = {
|
|
44
|
-
title: '表格展示',
|
|
45
|
-
type: 'DataSetPreviewTable',
|
|
46
|
-
group: 2,
|
|
47
|
-
renderComponent: 'DataSetPreviewTable',
|
|
48
|
-
defaultChartOptions: chartConfig,
|
|
49
|
-
configurableProperties: {
|
|
50
|
-
type: 'void',
|
|
51
|
-
properties: {}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
exports.tableTemplate = tableTemplate;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.templates = void 0;
|
|
7
|
-
var _PieTemplate = require("./PieTemplate");
|
|
8
|
-
var _BarTemplate = require("./BarTemplate");
|
|
9
|
-
var _ColumnTemplate = require("./ColumnTemplate");
|
|
10
|
-
var _LineTemplate = require("./LineTemplate");
|
|
11
|
-
var _AreaTemplate = require("./AreaTemplate");
|
|
12
|
-
var _ScatterTemplate = require("./ScatterTemplate");
|
|
13
|
-
var _RadarTemplate = require("./RadarTemplate");
|
|
14
|
-
var _FunnelTemplate = require("./FunnelTemplate");
|
|
15
|
-
const templates = new Map();
|
|
16
|
-
exports.templates = templates;
|
|
17
|
-
templates.set('Pie', _PieTemplate.pieTemplate);
|
|
18
|
-
templates.set('Line', _LineTemplate.lineTemplate);
|
|
19
|
-
templates.set('Area', _AreaTemplate.areaTemplate);
|
|
20
|
-
templates.set('Bar', _BarTemplate.barTemplate);
|
|
21
|
-
templates.set('Column', _ColumnTemplate.columnTemplate);
|
|
22
|
-
templates.set('Scatter', _ScatterTemplate.scatterTemplate);
|
|
23
|
-
templates.set('Radar', _RadarTemplate.radarTemplate);
|
|
24
|
-
templates.set('Funnel', _FunnelTemplate.funnelTemplate);
|
|
25
|
-
// templates.set('DataSetPreviewTable', tableTemplate);
|
package/lib/client/utils.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.validateArray = exports.parseDataSetString = void 0;
|
|
7
|
-
function _json() {
|
|
8
|
-
const data = _interopRequireDefault(require("json5"));
|
|
9
|
-
_json = function _json() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _shared() {
|
|
15
|
-
const data = require("@formily/shared");
|
|
16
|
-
_shared = function _shared() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
const validateArray = value => {
|
|
23
|
-
try {
|
|
24
|
-
value = _json().default.parse(value);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
return 'Please input validate dataset';
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(value)) {
|
|
29
|
-
if (value.every(item => {
|
|
30
|
-
return typeof item === 'object' && Object.keys(item).length > 1;
|
|
31
|
-
})) return true;
|
|
32
|
-
}
|
|
33
|
-
return 'Please input validate dataset';
|
|
34
|
-
};
|
|
35
|
-
exports.validateArray = validateArray;
|
|
36
|
-
const parseDataSetString = str => {
|
|
37
|
-
const dataSetDataArray = _json().default.parse(str);
|
|
38
|
-
if (Array.isArray(dataSetDataArray)) {
|
|
39
|
-
if (dataSetDataArray.every(item => {
|
|
40
|
-
return typeof item === 'object' && Object.keys(item).length > 1;
|
|
41
|
-
})) dataSetDataArray.map(item => {
|
|
42
|
-
if (!(item !== null && item !== void 0 && item.id)) {
|
|
43
|
-
item.id = (0, _shared().uid)();
|
|
44
|
-
}
|
|
45
|
-
return item;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return dataSetDataArray;
|
|
49
|
-
};
|
|
50
|
-
exports.parseDataSetString = parseDataSetString;
|
package/lib/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _server.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _server = _interopRequireDefault(require("./server"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/locale/en-US.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
Edit: 'Edit',
|
|
9
|
-
Delete: 'Delete',
|
|
10
|
-
Cancel: 'Cancel',
|
|
11
|
-
Submit: 'Submit',
|
|
12
|
-
Actions: 'Actions',
|
|
13
|
-
Title: 'Title',
|
|
14
|
-
Enable: 'Enable',
|
|
15
|
-
'SAML manager': 'SAML manager',
|
|
16
|
-
'SAML Providers': 'SAML Providers',
|
|
17
|
-
'Redirect url': 'Redirect url',
|
|
18
|
-
'SP entity id': 'SP entity id',
|
|
19
|
-
'Add provider': 'Add',
|
|
20
|
-
'Edit provider': 'Edit',
|
|
21
|
-
'Client id': 'Client id',
|
|
22
|
-
'Entity id or issuer': 'Entity id or issuer',
|
|
23
|
-
'Login Url': 'Login Url',
|
|
24
|
-
'Public cert': 'Public cert',
|
|
25
|
-
'Delete provider': 'Delete',
|
|
26
|
-
'Are you sure you want to delete it?': 'Are you sure you want to delete it?',
|
|
27
|
-
'Sign in button name, which will be displayed on the sign in page': 'Sign in button name, which will be displayed on the sign in page'
|
|
28
|
-
};
|
|
29
|
-
exports.default = _default;
|
package/lib/locale/es-ES.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
"Edit": "Editar",
|
|
9
|
-
"Delete": "Borrar",
|
|
10
|
-
"Cancel": "Cancelar",
|
|
11
|
-
"Submit": "Enviar",
|
|
12
|
-
"Actions": "Acciones",
|
|
13
|
-
"Title": "Título",
|
|
14
|
-
"Enable": "Activar",
|
|
15
|
-
"Chart": "Chart",
|
|
16
|
-
"Charts": "Charts",
|
|
17
|
-
"Queries": "Consultas",
|
|
18
|
-
"Select chart query": "Seleccionar consulta de chart",
|
|
19
|
-
"Select query data": "Seleccionar datos de consulta",
|
|
20
|
-
"Type": "Tipo",
|
|
21
|
-
"Chart type": "Tipo de chart",
|
|
22
|
-
"Chart title": "Título del chart",
|
|
23
|
-
"Basic charts": "Basic charts",
|
|
24
|
-
"More charts": "Más charts",
|
|
25
|
-
"Chart config": "Chart config",
|
|
26
|
-
"Add query": "Añadir consulta",
|
|
27
|
-
"Edit query": "Editar consulta",
|
|
28
|
-
"Invalid JSON format,must be an object array.": "Formato JSON no válido, debe ser una matriz de objetos.",
|
|
29
|
-
"Area": "Área",
|
|
30
|
-
"Bar": "Barra",
|
|
31
|
-
"Column": "Columna",
|
|
32
|
-
"Funnel": "Embudo",
|
|
33
|
-
"Line": "Línea",
|
|
34
|
-
"Pie": "Tarta",
|
|
35
|
-
"Radar": "Radar",
|
|
36
|
-
"Scatter": "Dispersión",
|
|
37
|
-
"Edit chart block": "Editar bloque de chart",
|
|
38
|
-
"Chart preview": "Vista previa de charts",
|
|
39
|
-
"Delete queries": "Eliminar consultas",
|
|
40
|
-
"Delete query": "Eliminar consulta",
|
|
41
|
-
"Add chart query": "Añadir consulta de chart",
|
|
42
|
-
"Add SQL query": "Añadir consulta SQL",
|
|
43
|
-
"Add JSON query": "Añadir consulta JSON",
|
|
44
|
-
"Data preview": "Vista previa de datos",
|
|
45
|
-
"Category axis / Dimension": "Eje de categorías / Dimensión",
|
|
46
|
-
"Value axis / Metrics": "Eje de valor / Métrica",
|
|
47
|
-
"JSON config": "JSON config",
|
|
48
|
-
"Create chart block": "Crear bloque de charts",
|
|
49
|
-
"Invalid JSON format": "Formato JSON no válido",
|
|
50
|
-
"Json config references": "Referencias JSON config",
|
|
51
|
-
"Sector Angle / Metric": "Sector Angle / Metric",
|
|
52
|
-
"Sector label / Dimensional": "Etiqueta de sector / Dimensional",
|
|
53
|
-
"Color legend / Dimensional": "Leyenda de color / Dimensional",
|
|
54
|
-
"Funnel Layer Width/Metrics": "Anchura de la capa del embudo / Métrica",
|
|
55
|
-
"Branch Tags/Dimensions": "Etiquetas de rama / Dimensión",
|
|
56
|
-
"Branch Length/Metrics": "Longitud de rama / Métrica",
|
|
57
|
-
"Please check the chart config": "Please check the chart config"
|
|
58
|
-
};
|
|
59
|
-
exports.default = _default;
|