lowcoder-map-component 0.1.1
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/README.md +37 -0
- package/icons/demo-icon.svg +10 -0
- package/icons/hills.svg +17 -0
- package/index.css +27 -0
- package/index.html +35 -0
- package/index.tsx +20 -0
- package/loader.mjs +11 -0
- package/package.json +175 -0
- package/src/README.md +35 -0
- package/src/components/ChartPropertyView.tsx +961 -0
- package/src/components/SeriesComp.tsx +368 -0
- package/src/components/TabPropertyView.tsx +127 -0
- package/src/comps/Barcharts/comp.tsx +338 -0
- package/src/comps/Barcharts/constants.tsx +77 -0
- package/src/comps/Linecharts/comp.tsx +350 -0
- package/src/comps/Linecharts/constants.tsx +53 -0
- package/src/comps/Linechartsv2/comp.tsx +350 -0
- package/src/comps/Linechartsv2/constants.tsx +68 -0
- package/src/comps/Mapcharts/comp.tsx +381 -0
- package/src/comps/Mapcharts/constants.tsx +312 -0
- package/src/comps/Mapchartsv2/comp.tsx +393 -0
- package/src/comps/Mapchartsv2/constants.tsx +340 -0
- package/src/comps/MixedLineBarCharts/comp.tsx +353 -0
- package/src/comps/MixedLineBarCharts/constants.tsx +60 -0
- package/src/comps/MultiLineCharts/comp.tsx +362 -0
- package/src/comps/MultiLineCharts/constants.tsx +96 -0
- package/src/comps/PercentageCharts/comp.tsx +359 -0
- package/src/comps/PercentageCharts/constants.tsx +98 -0
- package/src/comps/Piecharts/comp.tsx +334 -0
- package/src/comps/Piecharts/constants.tsx +48 -0
- package/src/comps/Tablecharts/comp.tsx +429 -0
- package/src/comps/Tablecharts/constants.tsx +97 -0
- package/src/comps/Totalcharts/comp.tsx +463 -0
- package/src/comps/Totalcharts/constants.tsx +66 -0
- package/src/comps/TwoLineCharts/comp.tsx +350 -0
- package/src/comps/TwoLineCharts/constants.tsx +82 -0
- package/src/comps/mapComponent/comp.tsx +338 -0
- package/src/comps/mapComponent/constants.tsx +2149 -0
- package/src/comps/tab/comp.tsx +283 -0
- package/src/comps/tab/constants.tsx +79 -0
- package/src/configs/barChartConfig.tsx +153 -0
- package/src/configs/baseConfig.tsx +66 -0
- package/src/configs/candleStickChartConfig.tsx +35 -0
- package/src/configs/cartesianAxisConfig.tsx +314 -0
- package/src/configs/chartUrls.tsx +9 -0
- package/src/configs/echartConfig.tsx +260 -0
- package/src/configs/echartsLabelConfig.tsx +47 -0
- package/src/configs/echartsLegendConfig.tsx +29 -0
- package/src/configs/echartsTitleConfig.tsx +49 -0
- package/src/configs/echartsTitleVerticalConfig.tsx +50 -0
- package/src/configs/funnelChartConfig.tsx +35 -0
- package/src/configs/gaugeChartConfig.tsx +31 -0
- package/src/configs/graphChartConfig.tsx +31 -0
- package/src/configs/heatmapChartConfig.tsx +31 -0
- package/src/configs/legendConfig.tsx +55 -0
- package/src/configs/lineChartConfig.tsx +246 -0
- package/src/configs/lineChartConfigv2.tsx +246 -0
- package/src/configs/mapChartConfig.tsx +106 -0
- package/src/configs/mapChartConfigv2.tsx +106 -0
- package/src/configs/mixedChartConfig.tsx +21 -0
- package/src/configs/pieChartConfig.tsx +156 -0
- package/src/configs/radarChartConfig.tsx +31 -0
- package/src/configs/sankeyChartConfig.tsx +35 -0
- package/src/configs/scatterChartConfig.tsx +152 -0
- package/src/configs/sunburstChartConfig.tsx +31 -0
- package/src/configs/tabConfig.tsx +0 -0
- package/src/configs/tableChartConfig.tsx +81 -0
- package/src/configs/themeriverChartConfig.tsx +31 -0
- package/src/configs/totalChartConfig.tsx +670 -0
- package/src/configs/treeChartConfig.tsx +31 -0
- package/src/configs/treemapChartConfig.tsx +31 -0
- package/src/controls/AnimationsControls.tsx +3 -0
- package/src/controls/AutoHeightControl.tsx +2 -0
- package/src/controls/AxisControls.tsx +146 -0
- package/src/controls/AxisVisibilityControl.tsx +14 -0
- package/src/controls/ChartTypeControl.tsx +15 -0
- package/src/controls/ColorScaleControl.tsx +221 -0
- package/src/controls/ColumnControl.tsx +204 -0
- package/src/controls/ConfigControl.tsx +37 -0
- package/src/controls/DirectionControls.tsx +20 -0
- package/src/controls/IconControl.tsx +88 -0
- package/src/controls/LegendControl.tsx +8 -0
- package/src/controls/RowLimitControl.tsx +91 -0
- package/src/controls/StyleControls.tsx +22 -0
- package/src/controls/TimeControls.tsx +41 -0
- package/src/controls/TrendlineControl.tsx +89 -0
- package/src/controls/UIEventControl.tsx +21 -0
- package/src/controls/index.ts +16 -0
- package/src/controls/radioControl.tsx +88 -0
- package/src/exposing/index.ts +3 -0
- package/src/exposing/setPoint.ts +19 -0
- package/src/geo/vn.geo.json +369897 -0
- package/src/geo/world.geo.json +32127 -0
- package/src/i18n/comps/index.tsx +39 -0
- package/src/i18n/comps/locales/en.ts +558 -0
- package/src/i18n/comps/locales/enObj.tsx +7186 -0
- package/src/i18n/comps/locales/index.ts +7 -0
- package/src/i18n/comps/locales/pt.ts +37 -0
- package/src/i18n/comps/locales/ptObj.tsx +40 -0
- package/src/i18n/comps/locales/types.tsx +622 -0
- package/src/i18n/comps/locales/zh.ts +3 -0
- package/src/i18n/comps/locales/zhObj.tsx +4 -0
- package/src/index.ts +31 -0
- package/src/types/global.d.ts +9 -0
- package/src/types/lowcoder-sdk.d.ts +578 -0
- package/src/utils/chartStyle.util.ts +121 -0
- package/src/utils/columnExtractor.util.ts +41 -0
- package/src/utils/dataTransform.util.ts +37 -0
- package/src/utils/deepEqual.util.ts +29 -0
- package/src/utils/echarts.util.tsx +822 -0
- package/src/utils/getDataKey.util.ts +115 -0
- package/src/utils/getLinearRegression.util.ts +46 -0
- package/src/utils/googleMaps.util.ts +28 -0
- package/src/utils/isEmpty.util.ts +10 -0
- package/src/utils/move.util.ts +6 -0
- package/src/utils/selection.util.ts +73 -0
- package/src/utils/style.util.ts +315 -0
- package/src/utils/time.util.ts +221 -0
- package/src/utils/timeFormatter.util.ts +104 -0
- package/src/utils/timeProcessing.util.ts +38 -0
- package/src/utils/trendline.util.ts +342 -0
- package/tsconfig.json +25 -0
- package/vite.config.js +19 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { trans } from "@/i18n/comps";
|
|
2
|
+
import { ScatterSeriesOption } from "echarts";
|
|
3
|
+
import {
|
|
4
|
+
BoolControl,
|
|
5
|
+
ColorControl,
|
|
6
|
+
MultiCompBuilder,
|
|
7
|
+
NumberControl,
|
|
8
|
+
StringControl,
|
|
9
|
+
dropdownControl,
|
|
10
|
+
showLabelPropertyView,
|
|
11
|
+
withDefault,
|
|
12
|
+
} from "lowcoder-sdk";
|
|
13
|
+
|
|
14
|
+
const ScatterShapeOptions = [
|
|
15
|
+
{
|
|
16
|
+
label: trans("chart.circle"),
|
|
17
|
+
value: "circle",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: trans("chart.rect"),
|
|
21
|
+
value: "rect",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: trans("chart.triangle"),
|
|
25
|
+
value: "triangle",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: trans("chart.diamond"),
|
|
29
|
+
value: "diamond",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: trans("chart.pin"),
|
|
33
|
+
value: "pin",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: trans("chart.arrow"),
|
|
37
|
+
value: "arrow",
|
|
38
|
+
},
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
41
|
+
export const ScatterChartConfig = (function () {
|
|
42
|
+
return new MultiCompBuilder(
|
|
43
|
+
{
|
|
44
|
+
showLabel: BoolControl,
|
|
45
|
+
labelIndex: withDefault(NumberControl, 2),
|
|
46
|
+
shape: dropdownControl(ScatterShapeOptions, "circle"),
|
|
47
|
+
singleAxis: BoolControl,
|
|
48
|
+
boundaryGap: withDefault(BoolControl, true),
|
|
49
|
+
visualMap: BoolControl,
|
|
50
|
+
visualMapMin: NumberControl,
|
|
51
|
+
visualMapMax: NumberControl,
|
|
52
|
+
visualMapDimension: NumberControl,
|
|
53
|
+
visualMapColorMin: ColorControl,
|
|
54
|
+
visualMapColorMax: ColorControl,
|
|
55
|
+
polar: BoolControl,
|
|
56
|
+
heatmap: BoolControl,
|
|
57
|
+
heatmapMonth: withDefault(StringControl, "2021-09"),
|
|
58
|
+
},
|
|
59
|
+
(props): ScatterSeriesOption => {
|
|
60
|
+
return {
|
|
61
|
+
type: "scatter",
|
|
62
|
+
symbol: props.shape,
|
|
63
|
+
label: {
|
|
64
|
+
show: props.showLabel,
|
|
65
|
+
position: "right",
|
|
66
|
+
formatter: function (param) {
|
|
67
|
+
return param?.data?.[props?.labelIndex];
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
labelLayout: function () {
|
|
71
|
+
return {
|
|
72
|
+
x: "88%",
|
|
73
|
+
moveOverlap: "shiftY",
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
labelLine: {
|
|
77
|
+
show: true,
|
|
78
|
+
length2: 5,
|
|
79
|
+
lineStyle: {
|
|
80
|
+
color: "#bbb",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
singleAxis: props.singleAxis,
|
|
84
|
+
boundaryGap: props.boundaryGap,
|
|
85
|
+
visualMapData: {
|
|
86
|
+
visualMap: props.visualMap,
|
|
87
|
+
visualMapMin: props.visualMapMin,
|
|
88
|
+
visualMapMax: props.visualMapMax,
|
|
89
|
+
visualMapDimension: props.visualMapDimension,
|
|
90
|
+
visualMapColorMin: props.visualMapColorMin,
|
|
91
|
+
visualMapColorMax: props.visualMapColorMax,
|
|
92
|
+
},
|
|
93
|
+
polar: props.polar,
|
|
94
|
+
heatmap: props.heatmap,
|
|
95
|
+
heatmapMonth: props.heatmapMonth,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
.setPropertyViewFn((children) => (
|
|
100
|
+
<>
|
|
101
|
+
{showLabelPropertyView(children)}
|
|
102
|
+
{children.showLabel.getView() &&
|
|
103
|
+
children.labelIndex.propertyView({
|
|
104
|
+
label: trans("scatterChart.labelIndex"),
|
|
105
|
+
})}
|
|
106
|
+
{children.boundaryGap.propertyView({
|
|
107
|
+
label: trans("scatterChart.boundaryGap"),
|
|
108
|
+
})}
|
|
109
|
+
{children.shape.propertyView({
|
|
110
|
+
label: trans("chart.scatterShape"),
|
|
111
|
+
})}
|
|
112
|
+
{children.singleAxis.propertyView({
|
|
113
|
+
label: trans("scatterChart.singleAxis"),
|
|
114
|
+
})}
|
|
115
|
+
{children.visualMap.propertyView({
|
|
116
|
+
label: trans("scatterChart.visualMap"),
|
|
117
|
+
})}
|
|
118
|
+
{children.visualMap.getView() &&
|
|
119
|
+
children.visualMapMin.propertyView({
|
|
120
|
+
label: trans("scatterChart.visualMapMin"),
|
|
121
|
+
})}
|
|
122
|
+
{children.visualMap.getView() &&
|
|
123
|
+
children.visualMapMax.propertyView({
|
|
124
|
+
label: trans("scatterChart.visualMapMax"),
|
|
125
|
+
})}
|
|
126
|
+
{children.visualMap.getView() &&
|
|
127
|
+
children.visualMapDimension.propertyView({
|
|
128
|
+
label: trans("scatterChart.visualMapDimension"),
|
|
129
|
+
})}
|
|
130
|
+
{children.visualMap.getView() &&
|
|
131
|
+
children.visualMapColorMin.propertyView({
|
|
132
|
+
label: trans("scatterChart.visualMapColorMin"),
|
|
133
|
+
})}
|
|
134
|
+
{children.visualMap.getView() &&
|
|
135
|
+
children.visualMapColorMax.propertyView({
|
|
136
|
+
label: trans("scatterChart.visualMapColorMax"),
|
|
137
|
+
})}
|
|
138
|
+
{children.visualMap.getView() &&
|
|
139
|
+
children.heatmap.propertyView({
|
|
140
|
+
label: trans("scatterChart.heatmap"),
|
|
141
|
+
})}
|
|
142
|
+
{children.visualMap.getView() &&
|
|
143
|
+
children.heatmapMonth.propertyView({
|
|
144
|
+
label: trans("scatterChart.heatmapMonth"),
|
|
145
|
+
})}
|
|
146
|
+
{children.polar.propertyView({
|
|
147
|
+
label: trans("scatterChart.polar"),
|
|
148
|
+
})}
|
|
149
|
+
</>
|
|
150
|
+
))
|
|
151
|
+
.build();
|
|
152
|
+
})();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { trans } from "@/i18n/comps";
|
|
2
|
+
import { SunburstSeriesOption } from "echarts";
|
|
3
|
+
import {
|
|
4
|
+
BoolControl,
|
|
5
|
+
MultiCompBuilder,
|
|
6
|
+
showLabelPropertyView,
|
|
7
|
+
} from "lowcoder-sdk";
|
|
8
|
+
|
|
9
|
+
export const SunburstChartConfig = (function () {
|
|
10
|
+
return new MultiCompBuilder(
|
|
11
|
+
{
|
|
12
|
+
showLabel: BoolControl,
|
|
13
|
+
},
|
|
14
|
+
(_): SunburstSeriesOption => {
|
|
15
|
+
const config: SunburstSeriesOption = {
|
|
16
|
+
type: "sunburst",
|
|
17
|
+
};
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
.setPropertyViewFn((children) => (
|
|
22
|
+
<>
|
|
23
|
+
{showLabelPropertyView(children)}
|
|
24
|
+
{children.type.propertyView({
|
|
25
|
+
label: trans("sunburstChart.sunburstType"),
|
|
26
|
+
radioButton: true,
|
|
27
|
+
})}
|
|
28
|
+
</>
|
|
29
|
+
))
|
|
30
|
+
.build();
|
|
31
|
+
})();
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { TableStyle } from "@/controls";
|
|
2
|
+
import { trans } from "@/i18n/comps";
|
|
3
|
+
import { Flex } from "antd";
|
|
4
|
+
import {
|
|
5
|
+
BoolControl,
|
|
6
|
+
EchartDefaultChartStyle,
|
|
7
|
+
EchartDefaultTextStyle,
|
|
8
|
+
MultiCompBuilder,
|
|
9
|
+
StringControl,
|
|
10
|
+
styleControl,
|
|
11
|
+
withDefault,
|
|
12
|
+
} from "lowcoder-sdk";
|
|
13
|
+
|
|
14
|
+
export const CompStyles = [
|
|
15
|
+
{
|
|
16
|
+
name: "backgroundColor",
|
|
17
|
+
label: trans("style.backgroundColor"),
|
|
18
|
+
backgroundColor: "backgroundColor",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "shadowColor",
|
|
22
|
+
label: trans("style.shadowColor"),
|
|
23
|
+
shadowColor: "shadowColor",
|
|
24
|
+
},
|
|
25
|
+
{ name: "textSize", label: trans("style.fontSize"), fontSize: "fontSize" },
|
|
26
|
+
{
|
|
27
|
+
name: "borderColor",
|
|
28
|
+
label: trans("style.borderColor"),
|
|
29
|
+
borderColor: "borderColor",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "radius",
|
|
33
|
+
label: trans("style.borderStyle"),
|
|
34
|
+
borderStyle: "borderStyle",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "radius",
|
|
38
|
+
label: trans("style.borderRadius"),
|
|
39
|
+
borderRadius: "borderRadius",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "borderWidth",
|
|
43
|
+
label: trans("style.borderWidth"),
|
|
44
|
+
borderWidth: "borderWidth",
|
|
45
|
+
},
|
|
46
|
+
] as const;
|
|
47
|
+
|
|
48
|
+
export const TableChartConfig = (function () {
|
|
49
|
+
return new MultiCompBuilder(
|
|
50
|
+
{
|
|
51
|
+
data: withDefault(BoolControl, true),
|
|
52
|
+
dataStyle: styleControl(EchartDefaultChartStyle, "dataStyle"),
|
|
53
|
+
title: StringControl,
|
|
54
|
+
titleStyle: styleControl(CompStyles, "subStyle"),
|
|
55
|
+
headerStyle: styleControl(TableStyle, "headerStyle"),
|
|
56
|
+
rowStyle: styleControl(TableStyle, "rowStyle"),
|
|
57
|
+
chartStyle: styleControl(EchartDefaultTextStyle, "chartStyle"),
|
|
58
|
+
},
|
|
59
|
+
(props) => {
|
|
60
|
+
return {
|
|
61
|
+
...props,
|
|
62
|
+
type: "table",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
.setPropertyViewFn((children) => (
|
|
67
|
+
<>
|
|
68
|
+
{children.dataStyle?.getPropertyView()}
|
|
69
|
+
|
|
70
|
+
<Flex gap={5} vertical>
|
|
71
|
+
<div className="sub-title">Header</div>
|
|
72
|
+
{children.headerStyle.getPropertyView()}
|
|
73
|
+
<div className="sub-title">Row</div>
|
|
74
|
+
{children.rowStyle.getPropertyView()}
|
|
75
|
+
<div className="sub-title">Chart style</div>
|
|
76
|
+
{children.chartStyle.getPropertyView()}
|
|
77
|
+
</Flex>
|
|
78
|
+
</>
|
|
79
|
+
))
|
|
80
|
+
.build();
|
|
81
|
+
})();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { trans } from "@/i18n/comps";
|
|
2
|
+
import { ThemeRiverSeriesOption } from "echarts";
|
|
3
|
+
import {
|
|
4
|
+
BoolControl,
|
|
5
|
+
MultiCompBuilder,
|
|
6
|
+
showLabelPropertyView,
|
|
7
|
+
} from "lowcoder-sdk";
|
|
8
|
+
|
|
9
|
+
export const ThemeriverChartConfig = (function () {
|
|
10
|
+
return new MultiCompBuilder(
|
|
11
|
+
{
|
|
12
|
+
showLabel: BoolControl,
|
|
13
|
+
},
|
|
14
|
+
(_): ThemeRiverSeriesOption => {
|
|
15
|
+
const config: ThemeRiverSeriesOption = {
|
|
16
|
+
type: "themeRiver",
|
|
17
|
+
};
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
.setPropertyViewFn((children) => (
|
|
22
|
+
<>
|
|
23
|
+
{showLabelPropertyView(children)}
|
|
24
|
+
{children.type.propertyView({
|
|
25
|
+
label: trans("themeriverChart.themeriverType"),
|
|
26
|
+
radioButton: true,
|
|
27
|
+
})}
|
|
28
|
+
</>
|
|
29
|
+
))
|
|
30
|
+
.build();
|
|
31
|
+
})();
|