@antv/gpt-vis 0.0.6 → 0.2.0
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/LICENSE +21 -0
- package/README.md +92 -50
- package/README.zh-CN.md +138 -0
- package/dist/cjs/Area/index.d.ts +8 -2
- package/dist/cjs/Area/index.js +17 -16
- package/dist/cjs/Bar/index.d.ts +11 -0
- package/dist/cjs/Bar/index.js +65 -0
- package/dist/cjs/ChartCodeRender/Loading.d.ts +3 -0
- package/dist/cjs/ChartCodeRender/Loading.js +54 -0
- package/dist/cjs/ChartCodeRender/VisChart.d.ts +11 -0
- package/dist/cjs/ChartCodeRender/VisChart.js +84 -0
- package/dist/cjs/ChartCodeRender/index.d.ts +3 -4
- package/dist/cjs/ChartCodeRender/index.js +24 -68
- package/dist/cjs/ChartCodeRender/type.d.ts +9 -11
- package/dist/cjs/Column/index.d.ts +8 -2
- package/dist/cjs/Column/index.js +19 -27
- package/dist/cjs/ConfigProvider/context.d.ts +3 -0
- package/dist/cjs/ConfigProvider/context.js +41 -0
- package/dist/cjs/ConfigProvider/hooks/index.d.ts +1 -0
- package/dist/cjs/ConfigProvider/hooks/index.js +23 -0
- package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +13 -0
- package/dist/cjs/ConfigProvider/hooks/useConfig.js +108 -0
- package/dist/cjs/ConfigProvider/index.d.ts +2 -5
- package/dist/cjs/ConfigProvider/index.js +15 -9
- package/dist/cjs/DualAxes/index.d.ts +15 -0
- package/dist/cjs/DualAxes/index.js +71 -0
- package/dist/cjs/DualAxes/util.d.ts +9 -0
- package/dist/cjs/DualAxes/util.js +73 -0
- package/dist/cjs/FlowDiagram/index.d.ts +6 -0
- package/dist/cjs/FlowDiagram/index.js +100 -0
- package/dist/cjs/GPTVis/Lite.d.ts +10 -0
- package/dist/cjs/GPTVis/Lite.js +54 -0
- package/dist/cjs/GPTVis/index.d.ts +4 -8
- package/dist/cjs/GPTVis/index.js +4 -4
- package/dist/cjs/HeatMap/index.d.ts +7 -7
- package/dist/cjs/HeatMap/index.js +13 -26
- package/dist/cjs/Histogram/index.d.ts +10 -0
- package/dist/cjs/Histogram/index.js +51 -0
- package/dist/cjs/IndentedTree/index.d.ts +6 -0
- package/dist/cjs/IndentedTree/index.js +63 -0
- package/dist/cjs/Line/index.d.ts +8 -6
- package/dist/cjs/Line/index.js +15 -16
- package/dist/cjs/Map/data.json +305 -0
- package/dist/cjs/Map/index.d.ts +5 -0
- package/dist/cjs/Map/index.js +68 -0
- package/dist/cjs/MindMap/index.d.ts +6 -0
- package/dist/cjs/MindMap/index.js +64 -0
- package/dist/cjs/NetworkGraph/index.d.ts +6 -0
- package/dist/cjs/NetworkGraph/index.js +72 -0
- package/dist/cjs/OrganizationChart/index.d.ts +6 -0
- package/dist/cjs/OrganizationChart/index.js +93 -0
- package/dist/cjs/PathMap/index.d.ts +3 -9
- package/dist/cjs/PathMap/index.js +19 -109
- package/dist/cjs/Pie/index.d.ts +7 -5
- package/dist/cjs/Pie/index.js +17 -13
- package/dist/cjs/PinMap/index.d.ts +3 -9
- package/dist/cjs/PinMap/index.js +6 -85
- package/dist/cjs/Radar/index.d.ts +11 -0
- package/dist/cjs/Radar/index.js +84 -0
- package/dist/cjs/Scatter/index.d.ts +11 -0
- package/dist/cjs/Scatter/index.js +57 -0
- package/dist/cjs/Text/VisText.d.ts +4 -0
- package/dist/cjs/Text/VisText.js +74 -0
- package/dist/cjs/Text/config.d.ts +18 -0
- package/dist/cjs/Text/config.js +91 -0
- package/dist/cjs/Text/constants.d.ts +9 -0
- package/dist/cjs/Text/constants.js +37 -0
- package/dist/cjs/Text/custom-icons/index.d.ts +3 -0
- package/dist/cjs/Text/custom-icons/index.js +66 -0
- package/dist/cjs/Text/index.d.ts +3 -0
- package/dist/cjs/Text/index.js +42 -0
- package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +1 -0
- package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +65 -0
- package/dist/cjs/Text/mini-charts/hooks/index.d.ts +1 -0
- package/dist/cjs/Text/mini-charts/hooks/index.js +29 -0
- package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +5 -0
- package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +65 -0
- package/dist/cjs/Text/mini-charts/index.d.ts +2 -0
- package/dist/cjs/Text/mini-charts/index.js +25 -0
- package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +3 -0
- package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +63 -0
- package/dist/cjs/Text/mini-charts/line/index.d.ts +1 -0
- package/dist/cjs/Text/mini-charts/line/index.js +29 -0
- package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +4 -0
- package/dist/cjs/Text/mini-charts/line/scaleLinear.js +35 -0
- package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +6 -0
- package/dist/cjs/Text/mini-charts/line/useLineCompute.js +103 -0
- package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +1 -0
- package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +51 -0
- package/dist/cjs/Text/mini-charts/proportion/index.d.ts +3 -0
- package/dist/cjs/Text/mini-charts/proportion/index.js +72 -0
- package/dist/cjs/Text/types.d.ts +20 -0
- package/dist/cjs/Text/types.js +17 -0
- package/dist/cjs/Treemap/index.d.ts +11 -0
- package/dist/cjs/Treemap/index.js +73 -0
- package/dist/cjs/WordCloud/index.d.ts +4 -5
- package/dist/cjs/WordCloud/index.js +7 -15
- package/dist/cjs/constants/index.d.ts +1 -3
- package/dist/cjs/constants/index.js +4 -35
- package/dist/cjs/export.d.ts +28 -0
- package/dist/cjs/export.js +116 -0
- package/dist/cjs/index.d.ts +10 -11
- package/dist/cjs/index.js +9 -25
- package/dist/cjs/types/chart.d.ts +49 -14
- package/dist/cjs/types/chart.js +12 -0
- package/dist/cjs/types/config.d.ts +16 -0
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/index.js +0 -9
- package/dist/cjs/types/map.d.ts +242 -0
- package/dist/cjs/types/map.js +17 -0
- package/dist/cjs/utils/config.d.ts +5 -5
- package/dist/cjs/utils/config.js +41 -24
- package/dist/cjs/utils/graph.d.ts +18 -0
- package/dist/cjs/utils/graph.js +64 -0
- package/dist/cjs/utils/index.d.ts +1 -1
- package/dist/cjs/utils/index.js +3 -13
- package/dist/cjs/utils/map/context.d.ts +3 -0
- package/dist/cjs/utils/map/context.js +42 -0
- package/dist/cjs/utils/map/controls.d.ts +0 -0
- package/dist/cjs/utils/map/controls.js +0 -0
- package/dist/cjs/utils/map/index.d.ts +6 -0
- package/dist/cjs/utils/map/index.js +33 -0
- package/dist/cjs/utils/map/markers.d.ts +2 -0
- package/dist/cjs/utils/map/markers.js +88 -0
- package/dist/cjs/utils/map/polyline.d.ts +2 -0
- package/dist/cjs/utils/map/polyline.js +52 -0
- package/dist/cjs/utils/map/style.d.ts +45 -0
- package/dist/cjs/utils/map/style.js +112 -0
- package/dist/cjs/utils/map/util.d.ts +1 -0
- package/dist/cjs/utils/map/util.js +38 -0
- package/dist/cjs/utils/map/view.d.ts +3 -0
- package/dist/cjs/utils/map/view.js +93 -0
- package/dist/cjs/utils/plot.d.ts +4 -0
- package/dist/cjs/utils/plot.js +69 -0
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.js +25 -0
- package/dist/esm/Area/index.d.ts +8 -2
- package/dist/esm/Area/index.js +21 -27
- package/dist/esm/Bar/index.d.ts +11 -0
- package/dist/esm/Bar/index.js +35 -0
- package/dist/esm/ChartCodeRender/Loading.d.ts +3 -0
- package/dist/esm/ChartCodeRender/Loading.js +20 -0
- package/dist/esm/ChartCodeRender/VisChart.d.ts +11 -0
- package/dist/esm/ChartCodeRender/VisChart.js +65 -0
- package/dist/esm/ChartCodeRender/index.d.ts +3 -4
- package/dist/esm/ChartCodeRender/index.js +28 -84
- package/dist/esm/ChartCodeRender/type.d.ts +9 -11
- package/dist/esm/Column/index.d.ts +8 -2
- package/dist/esm/Column/index.js +22 -27
- package/dist/esm/ConfigProvider/context.d.ts +3 -0
- package/dist/esm/ConfigProvider/context.js +3 -0
- package/dist/esm/ConfigProvider/hooks/index.d.ts +1 -0
- package/dist/esm/ConfigProvider/hooks/index.js +1 -0
- package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +13 -0
- package/dist/esm/ConfigProvider/hooks/useConfig.js +57 -0
- package/dist/esm/ConfigProvider/index.d.ts +2 -5
- package/dist/esm/ConfigProvider/index.js +9 -9
- package/dist/esm/DualAxes/index.d.ts +15 -0
- package/dist/esm/DualAxes/index.js +44 -0
- package/dist/esm/DualAxes/util.d.ts +9 -0
- package/dist/esm/DualAxes/util.js +61 -0
- package/dist/esm/FlowDiagram/index.d.ts +6 -0
- package/dist/esm/FlowDiagram/index.js +75 -0
- package/dist/esm/GPTVis/Lite.d.ts +10 -0
- package/dist/esm/GPTVis/Lite.js +18 -0
- package/dist/esm/GPTVis/index.d.ts +4 -8
- package/dist/esm/GPTVis/index.js +5 -5
- package/dist/esm/HeatMap/index.d.ts +7 -7
- package/dist/esm/HeatMap/index.js +19 -27
- package/dist/esm/Histogram/index.d.ts +10 -0
- package/dist/esm/Histogram/index.js +25 -0
- package/dist/esm/IndentedTree/index.d.ts +6 -0
- package/dist/esm/IndentedTree/index.js +47 -0
- package/dist/esm/Line/index.d.ts +8 -6
- package/dist/esm/Line/index.js +17 -23
- package/dist/esm/Map/data.json +305 -0
- package/dist/esm/Map/index.d.ts +5 -0
- package/dist/esm/Map/index.js +60 -0
- package/dist/esm/MindMap/index.d.ts +6 -0
- package/dist/esm/MindMap/index.js +48 -0
- package/dist/esm/NetworkGraph/index.d.ts +6 -0
- package/dist/esm/NetworkGraph/index.js +57 -0
- package/dist/esm/OrganizationChart/index.d.ts +6 -0
- package/dist/esm/OrganizationChart/index.js +64 -0
- package/dist/esm/PathMap/index.d.ts +3 -9
- package/dist/esm/PathMap/index.js +32 -129
- package/dist/esm/Pie/index.d.ts +7 -5
- package/dist/esm/Pie/index.js +24 -20
- package/dist/esm/PinMap/index.d.ts +3 -9
- package/dist/esm/PinMap/index.js +18 -104
- package/dist/esm/Radar/index.d.ts +11 -0
- package/dist/esm/Radar/index.js +54 -0
- package/dist/esm/Scatter/index.d.ts +11 -0
- package/dist/esm/Scatter/index.js +30 -0
- package/dist/esm/Text/VisText.d.ts +4 -0
- package/dist/esm/Text/VisText.js +38 -0
- package/dist/esm/Text/config.d.ts +18 -0
- package/dist/esm/Text/config.js +79 -0
- package/dist/esm/Text/constants.d.ts +9 -0
- package/dist/esm/Text/constants.js +9 -0
- package/dist/esm/Text/custom-icons/index.d.ts +3 -0
- package/dist/esm/Text/custom-icons/index.js +37 -0
- package/dist/esm/Text/index.d.ts +3 -0
- package/dist/esm/Text/index.js +2 -0
- package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +1 -0
- package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +32 -0
- package/dist/esm/Text/mini-charts/hooks/index.d.ts +1 -0
- package/dist/esm/Text/mini-charts/hooks/index.js +1 -0
- package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +5 -0
- package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +31 -0
- package/dist/esm/Text/mini-charts/index.d.ts +2 -0
- package/dist/esm/Text/mini-charts/index.js +2 -0
- package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +3 -0
- package/dist/esm/Text/mini-charts/line/SingleLineChart.js +57 -0
- package/dist/esm/Text/mini-charts/line/index.d.ts +1 -0
- package/dist/esm/Text/mini-charts/line/index.js +1 -0
- package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +4 -0
- package/dist/esm/Text/mini-charts/line/scaleLinear.js +14 -0
- package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +6 -0
- package/dist/esm/Text/mini-charts/line/useLineCompute.js +106 -0
- package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +1 -0
- package/dist/esm/Text/mini-charts/proportion/getArcPath.js +19 -0
- package/dist/esm/Text/mini-charts/proportion/index.d.ts +3 -0
- package/dist/esm/Text/mini-charts/proportion/index.js +60 -0
- package/dist/esm/Text/types.d.ts +20 -0
- package/dist/esm/Text/types.js +1 -0
- package/dist/esm/Treemap/index.d.ts +11 -0
- package/dist/esm/Treemap/index.js +52 -0
- package/dist/esm/WordCloud/index.d.ts +4 -5
- package/dist/esm/WordCloud/index.js +8 -18
- package/dist/esm/constants/index.d.ts +1 -3
- package/dist/esm/constants/index.js +5 -14
- package/dist/esm/export.d.ts +28 -0
- package/dist/esm/export.js +33 -0
- package/dist/esm/index.d.ts +10 -11
- package/dist/esm/index.js +9 -9
- package/dist/esm/types/chart.d.ts +49 -14
- package/dist/esm/types/chart.js +12 -0
- package/dist/esm/types/config.d.ts +16 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/map.d.ts +242 -0
- package/dist/esm/types/map.js +1 -0
- package/dist/esm/utils/config.d.ts +5 -5
- package/dist/esm/utils/config.js +40 -18
- package/dist/esm/utils/graph.d.ts +18 -0
- package/dist/esm/utils/graph.js +49 -0
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/map/context.d.ts +3 -0
- package/dist/esm/utils/map/context.js +34 -0
- package/dist/esm/utils/map/controls.d.ts +0 -0
- package/dist/esm/utils/map/controls.js +0 -0
- package/dist/esm/utils/map/index.d.ts +6 -0
- package/dist/esm/utils/map/index.js +6 -0
- package/dist/esm/utils/map/markers.d.ts +2 -0
- package/dist/esm/utils/map/markers.js +64 -0
- package/dist/esm/utils/map/polyline.d.ts +2 -0
- package/dist/esm/utils/map/polyline.js +26 -0
- package/dist/esm/utils/map/style.d.ts +45 -0
- package/dist/esm/utils/map/style.js +76 -0
- package/dist/esm/utils/map/util.d.ts +1 -0
- package/dist/esm/utils/map/util.js +11 -0
- package/dist/esm/utils/map/view.d.ts +3 -0
- package/dist/esm/utils/map/view.js +81 -0
- package/dist/esm/utils/plot.d.ts +4 -0
- package/dist/esm/utils/plot.js +65 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.js +1 -0
- package/dist/umd/895.async.js +1 -0
- package/dist/umd/index.min.js +1 -0
- package/package.json +97 -58
|
@@ -32,117 +32,27 @@ __export(PathMap_exports, {
|
|
|
32
32
|
default: () => PathMap_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(PathMap_exports);
|
|
35
|
-
var import_larkmap = require("@antv/larkmap");
|
|
36
35
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
shape: "line",
|
|
41
|
-
size: 3,
|
|
42
|
-
color: "#6808fed1",
|
|
43
|
-
style: {
|
|
44
|
-
opacity: 1,
|
|
45
|
-
lineType: "solid",
|
|
46
|
-
stroke: "#6808FE",
|
|
47
|
-
strokeWidth: 1
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var makerLayerOptions = {
|
|
51
|
-
autoFit: false,
|
|
52
|
-
shape: "circle",
|
|
53
|
-
color: "#fff",
|
|
54
|
-
size: 4,
|
|
55
|
-
style: {
|
|
56
|
-
stroke: "#6808FE",
|
|
57
|
-
strokeWidth: 3
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var labelLayerOptions = {
|
|
61
|
-
autoFit: false,
|
|
62
|
-
field: "address",
|
|
63
|
-
style: {
|
|
64
|
-
fill: "#fff",
|
|
65
|
-
opacity: 1,
|
|
66
|
-
fontSize: 16,
|
|
67
|
-
fontWeight: "bold",
|
|
68
|
-
stroke: "#6808FE",
|
|
69
|
-
strokeWidth: 8,
|
|
70
|
-
textAllowOverlap: false,
|
|
71
|
-
padding: [5, 5],
|
|
72
|
-
textOffset: [0, 30]
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
function bbox(data) {
|
|
76
|
-
const bounds = [Infinity, Infinity, -Infinity, -Infinity];
|
|
77
|
-
data.forEach(({ coordinates }) => {
|
|
78
|
-
coordinates.forEach(([lng, lat]) => {
|
|
79
|
-
if (bounds[0] > lng) {
|
|
80
|
-
bounds[0] = lng;
|
|
81
|
-
}
|
|
82
|
-
if (bounds[1] > lat) {
|
|
83
|
-
bounds[1] = lat;
|
|
84
|
-
}
|
|
85
|
-
if (bounds[2] < lng) {
|
|
86
|
-
bounds[2] = lng;
|
|
87
|
-
}
|
|
88
|
-
if (bounds[3] < lat) {
|
|
89
|
-
bounds[3] = lat;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
return bounds;
|
|
94
|
-
}
|
|
36
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
37
|
+
var import_Map = __toESM(require("../Map"));
|
|
38
|
+
var import_map = require("../utils/map");
|
|
95
39
|
var PathMap = (props) => {
|
|
96
|
-
const {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
data
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
...mapConfigRest
|
|
103
|
-
} = props;
|
|
104
|
-
const [lineSource] = (0, import_react.useState)({
|
|
105
|
-
data,
|
|
106
|
-
parser: { type: "json", coordinates: "coordinates" }
|
|
107
|
-
});
|
|
108
|
-
const [dotSource] = (0, import_react.useState)(() => ({
|
|
109
|
-
data: data.map((item) => [
|
|
110
|
-
{ lngLat: item.coordinates[0], address: item == null ? void 0 : item.originName },
|
|
111
|
-
{
|
|
112
|
-
lngLat: item.coordinates[item.coordinates.length - 1],
|
|
113
|
-
address: item == null ? void 0 : item.destinationName
|
|
40
|
+
const { data = [], markerStyle = {}, pathStyle = {}, ...rest } = (0, import_hooks.useMapConfig)("PathMap", props);
|
|
41
|
+
const markerdata = (0, import_react.useMemo)(() => {
|
|
42
|
+
const markers = [];
|
|
43
|
+
data.forEach((item) => {
|
|
44
|
+
if (item.markers) {
|
|
45
|
+
markers.push(...item.markers);
|
|
114
46
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (scene.getType() === "amap") {
|
|
126
|
-
(_a = scene.map) == null ? void 0 : _a.setBounds(bounds, true, [60, 60, 60, 60]);
|
|
127
|
-
} else {
|
|
128
|
-
scene.fitBounds([
|
|
129
|
-
[bounds[0], bounds[1]],
|
|
130
|
-
[bounds[2], bounds[3]]
|
|
131
|
-
]);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
135
|
-
import_larkmap.LarkMap,
|
|
136
|
-
{
|
|
137
|
-
className,
|
|
138
|
-
style: { height: 300, ...style },
|
|
139
|
-
...mapConfig,
|
|
140
|
-
onSceneLoaded: onMapSceneLoaded
|
|
141
|
-
},
|
|
142
|
-
/* @__PURE__ */ import_react.default.createElement(import_larkmap.LineLayer, { ...lineLayerOptions, source: lineSource }),
|
|
143
|
-
/* @__PURE__ */ import_react.default.createElement(import_larkmap.PointLayer, { ...makerLayerOptions, source: dotSource }),
|
|
144
|
-
/* @__PURE__ */ import_react.default.createElement(import_larkmap.TextLayer, { ...labelLayerOptions, source: dotSource }),
|
|
145
|
-
children
|
|
146
|
-
));
|
|
47
|
+
});
|
|
48
|
+
return (0, import_map.formatMakerStyle)(markers, markerStyle);
|
|
49
|
+
}, [data, markerStyle]);
|
|
50
|
+
const linedata = (0, import_react.useMemo)(() => {
|
|
51
|
+
const lines = data.map((item) => {
|
|
52
|
+
return item.path;
|
|
53
|
+
});
|
|
54
|
+
return (0, import_map.formatPolylineStyle)(lines, pathStyle);
|
|
55
|
+
}, [data, pathStyle]);
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Map.default, { markers: markerdata, polyline: linedata, ...rest });
|
|
147
57
|
};
|
|
148
58
|
var PathMap_default = PathMap;
|
package/dist/cjs/Pie/index.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import type { PieConfig } from '@ant-design/plots';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
+
import type { BasePlotProps } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* PieDataItem is the type for each data item in the pie chart.
|
|
5
6
|
* It includes the name of the sector and its corresponding value.
|
|
6
|
-
* @param
|
|
7
|
+
* @param category The name of the sector.
|
|
7
8
|
* @param value The value of the sector.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
type PieDataItem = {
|
|
11
|
+
category: string;
|
|
11
12
|
value: number;
|
|
13
|
+
[key: string]: string | number;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* the props for the Pie
|
|
15
17
|
* @param data pie data
|
|
16
18
|
*/
|
|
17
|
-
export type PieProps =
|
|
19
|
+
export type PieProps = BasePlotProps<PieDataItem> & Partial<PieConfig>;
|
|
18
20
|
declare const Pie: (props: PieProps) => React.JSX.Element;
|
|
19
21
|
export default Pie;
|
package/dist/cjs/Pie/index.js
CHANGED
|
@@ -33,24 +33,25 @@ __export(Pie_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Pie_exports);
|
|
35
35
|
var import_plots = require("@ant-design/plots");
|
|
36
|
+
var import_lodash = require("lodash");
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
39
|
+
var defaultConfig = (props) => {
|
|
40
|
+
const { data = [], angleField = "value", colorField = "category" } = props;
|
|
41
|
+
const sumValue = (0, import_lodash.sumBy)(data, angleField);
|
|
42
|
+
return {
|
|
43
|
+
angleField,
|
|
44
|
+
colorField,
|
|
43
45
|
tooltip: (d) => {
|
|
44
46
|
return {
|
|
45
|
-
name: d
|
|
46
|
-
value: d
|
|
47
|
+
name: d[colorField],
|
|
48
|
+
value: d[angleField]
|
|
47
49
|
};
|
|
48
50
|
},
|
|
49
51
|
label: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
52
|
+
position: "outside",
|
|
53
|
+
// text: angleField,
|
|
54
|
+
text: (d) => `${d[colorField]}: ${(0, import_lodash.round)(d[angleField] / sumValue * 100, 1)}%`
|
|
54
55
|
},
|
|
55
56
|
legend: {
|
|
56
57
|
color: {
|
|
@@ -64,6 +65,9 @@ var Pie = (props) => {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
|
-
|
|
68
|
+
};
|
|
69
|
+
var Pie = (props) => {
|
|
70
|
+
const config = (0, import_hooks.usePlotConfig)("Pie", defaultConfig, props);
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_plots.Pie, { ...config });
|
|
68
72
|
};
|
|
69
73
|
var Pie_default = Pie;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
lng: number;
|
|
6
|
-
lat: number;
|
|
7
|
-
};
|
|
8
|
-
export interface PinMapProps extends BaseMapProps<GeoData> {
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
2
|
+
import type { MapProps } from '../Map';
|
|
3
|
+
import type { PinMap as PinMapType } from '../types/map';
|
|
4
|
+
export type PinMapProps = PinMapType & MapProps;
|
|
11
5
|
declare const PinMap: FC<PinMapProps>;
|
|
12
6
|
export default PinMap;
|
package/dist/cjs/PinMap/index.js
CHANGED
|
@@ -32,92 +32,13 @@ __export(PinMap_exports, {
|
|
|
32
32
|
default: () => PinMap_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(PinMap_exports);
|
|
35
|
-
var import_larkmap = require("@antv/larkmap");
|
|
36
35
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
autoFit: false,
|
|
41
|
-
shape: "marker",
|
|
42
|
-
size: 22,
|
|
43
|
-
style: {}
|
|
44
|
-
};
|
|
45
|
-
var labelLayerOptions = {
|
|
46
|
-
autoFit: false,
|
|
47
|
-
field: "address",
|
|
48
|
-
style: {
|
|
49
|
-
fill: "#fff",
|
|
50
|
-
opacity: 1,
|
|
51
|
-
fontSize: 16,
|
|
52
|
-
fontWeight: "bold",
|
|
53
|
-
stroke: "#6808FE",
|
|
54
|
-
strokeWidth: 8,
|
|
55
|
-
textAllowOverlap: false,
|
|
56
|
-
padding: [2, 2],
|
|
57
|
-
textOffset: [0, 50]
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
function bbox(data) {
|
|
61
|
-
const bounds = [Infinity, Infinity, -Infinity, -Infinity];
|
|
62
|
-
data.forEach(({ lng, lat }) => {
|
|
63
|
-
if (bounds[0] > lng) {
|
|
64
|
-
bounds[0] = lng;
|
|
65
|
-
}
|
|
66
|
-
if (bounds[1] > lat) {
|
|
67
|
-
bounds[1] = lat;
|
|
68
|
-
}
|
|
69
|
-
if (bounds[2] < lng) {
|
|
70
|
-
bounds[2] = lng;
|
|
71
|
-
}
|
|
72
|
-
if (bounds[3] < lat) {
|
|
73
|
-
bounds[3] = lat;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return bounds;
|
|
77
|
-
}
|
|
36
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
37
|
+
var import_Map = __toESM(require("../Map"));
|
|
38
|
+
var import_map = require("../utils/map");
|
|
78
39
|
var PinMap = (props) => {
|
|
79
|
-
const {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
onSceneLoaded,
|
|
83
|
-
children,
|
|
84
|
-
data = [],
|
|
85
|
-
...mapConfigRest
|
|
86
|
-
} = props;
|
|
87
|
-
const [loadedImages, setLoadedImages] = (0, import_react.useState)(false);
|
|
88
|
-
const [source] = (0, import_react.useState)({
|
|
89
|
-
data,
|
|
90
|
-
parser: { type: "json", x: "lng", y: "lat" }
|
|
91
|
-
});
|
|
92
|
-
const mapConfig = (0, import_utils.getMapConfig)(mapConfigRest);
|
|
93
|
-
const onMapSceneLoaded = (scene) => {
|
|
94
|
-
var _a;
|
|
95
|
-
onSceneLoaded == null ? void 0 : onSceneLoaded(scene);
|
|
96
|
-
scene.addImage("marker", SVG_URL).then(() => {
|
|
97
|
-
setLoadedImages(true);
|
|
98
|
-
});
|
|
99
|
-
if (!data.length)
|
|
100
|
-
return;
|
|
101
|
-
const bounds = bbox(data);
|
|
102
|
-
if (scene.getType() === "amap") {
|
|
103
|
-
(_a = scene.map) == null ? void 0 : _a.setBounds(bounds, true, [50, 50, 50, 50]);
|
|
104
|
-
} else {
|
|
105
|
-
scene.fitBounds([
|
|
106
|
-
[bounds[0], bounds[1]],
|
|
107
|
-
[bounds[2], bounds[3]]
|
|
108
|
-
]);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
112
|
-
import_larkmap.LarkMap,
|
|
113
|
-
{
|
|
114
|
-
className,
|
|
115
|
-
style: { height: 300, ...style },
|
|
116
|
-
...mapConfig,
|
|
117
|
-
onSceneLoaded: onMapSceneLoaded
|
|
118
|
-
},
|
|
119
|
-
loadedImages && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_larkmap.PointLayer, { ...makerLayerOptions, source }), /* @__PURE__ */ import_react.default.createElement(import_larkmap.TextLayer, { ...labelLayerOptions, source })),
|
|
120
|
-
children
|
|
121
|
-
));
|
|
40
|
+
const { data = [], markerStyle = {}, ...rest } = (0, import_hooks.useMapConfig)("PinMap", props);
|
|
41
|
+
const markerdata = (0, import_react.useMemo)(() => (0, import_map.formatMakerStyle)(data, markerStyle), [data, markerStyle]);
|
|
42
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Map.default, { markers: markerdata, includePoints: markerdata, ...rest });
|
|
122
43
|
};
|
|
123
44
|
var PinMap_default = PinMap;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RadarConfig } from '@ant-design/plots';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { BasePlotProps } from '../types';
|
|
4
|
+
export type RadarDataItem = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: number;
|
|
7
|
+
[key: string]: string | number;
|
|
8
|
+
};
|
|
9
|
+
export type RadarProps = BasePlotProps<RadarDataItem> & Partial<RadarConfig>;
|
|
10
|
+
declare const Radar: (props: RadarProps) => React.JSX.Element;
|
|
11
|
+
export default Radar;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Radar/index.tsx
|
|
30
|
+
var Radar_exports = {};
|
|
31
|
+
__export(Radar_exports, {
|
|
32
|
+
default: () => Radar_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Radar_exports);
|
|
35
|
+
var import_plots = require("@ant-design/plots");
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
39
|
+
var defaultConfig = (props) => {
|
|
40
|
+
const { data, xField = "name", yField = "value" } = props;
|
|
41
|
+
const hasGroupField = (0, import_lodash.get)(data, "[0].group") !== void 0;
|
|
42
|
+
return {
|
|
43
|
+
xField,
|
|
44
|
+
yField,
|
|
45
|
+
colorField: hasGroupField ? "group" : void 0,
|
|
46
|
+
area: {
|
|
47
|
+
style: {
|
|
48
|
+
fillOpacity: 0.5
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
scale: {
|
|
52
|
+
x: {
|
|
53
|
+
padding: 0.6,
|
|
54
|
+
align: 0
|
|
55
|
+
},
|
|
56
|
+
y: {
|
|
57
|
+
nice: true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
axis: {
|
|
61
|
+
x: {
|
|
62
|
+
title: false,
|
|
63
|
+
grid: true
|
|
64
|
+
},
|
|
65
|
+
y: {
|
|
66
|
+
zIndex: 1,
|
|
67
|
+
title: false,
|
|
68
|
+
gridConnect: "line",
|
|
69
|
+
gridLineWidth: 1
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
tooltip: (d) => {
|
|
73
|
+
return {
|
|
74
|
+
name: d[xField],
|
|
75
|
+
value: d[yField]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
var Radar = (props) => {
|
|
81
|
+
const config = (0, import_hooks.usePlotConfig)("Radar", defaultConfig, props);
|
|
82
|
+
return /* @__PURE__ */ import_react.default.createElement(import_plots.Radar, { ...config });
|
|
83
|
+
};
|
|
84
|
+
var Radar_default = Radar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScatterConfig } from '@ant-design/plots';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { BasePlotProps } from '../types';
|
|
4
|
+
type ScatterDataItem = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
[key: string]: string | number;
|
|
8
|
+
};
|
|
9
|
+
export type ScatterProps = BasePlotProps<ScatterDataItem> & Partial<ScatterConfig>;
|
|
10
|
+
declare const Scatter: (props: ScatterProps) => React.JSX.Element;
|
|
11
|
+
export default Scatter;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Scatter/index.tsx
|
|
30
|
+
var Scatter_exports = {};
|
|
31
|
+
__export(Scatter_exports, {
|
|
32
|
+
default: () => Scatter_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Scatter_exports);
|
|
35
|
+
var import_plots = require("@ant-design/plots");
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
39
|
+
var defaultConfig = (props) => {
|
|
40
|
+
const { data, xField = "x", yField = "y" } = props;
|
|
41
|
+
const axisXTitle = (0, import_lodash.get)(props, "axis.x.title");
|
|
42
|
+
const axisYTitle = (0, import_lodash.get)(props, "axis.y.title");
|
|
43
|
+
return {
|
|
44
|
+
data,
|
|
45
|
+
xField,
|
|
46
|
+
yField,
|
|
47
|
+
tooltip: [
|
|
48
|
+
{ channel: "x", name: axisXTitle || "x" },
|
|
49
|
+
{ channel: "y", name: axisYTitle || "y" }
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
var Scatter = (props) => {
|
|
54
|
+
const config = (0, import_hooks.usePlotConfig)("Scatter", defaultConfig, props);
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement(import_plots.Scatter, { ...config });
|
|
56
|
+
};
|
|
57
|
+
var Scatter_default = Scatter;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Text/VisText.tsx
|
|
30
|
+
var VisText_exports = {};
|
|
31
|
+
__export(VisText_exports, {
|
|
32
|
+
default: () => VisText_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(VisText_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
39
|
+
var import_config = require("./config");
|
|
40
|
+
var { Text } = import_antd.Typography;
|
|
41
|
+
function renderPrefixSuffix(symbol, staticsConfig, props) {
|
|
42
|
+
if (!symbol)
|
|
43
|
+
return null;
|
|
44
|
+
const Component = staticsConfig == null ? void 0 : staticsConfig[symbol];
|
|
45
|
+
if (Component)
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(Component, { ...props });
|
|
47
|
+
return symbol;
|
|
48
|
+
}
|
|
49
|
+
var VisText = (props) => {
|
|
50
|
+
const { children, className, style, type, origin } = props;
|
|
51
|
+
const textConfig = (0, import_hooks.useComponentGlobalConfig)("VisText");
|
|
52
|
+
const encoding = type ? textConfig == null ? void 0 : textConfig[type] : {};
|
|
53
|
+
const staticsConfig = textConfig == null ? void 0 : textConfig[import_config.STATICS_KEY];
|
|
54
|
+
return (
|
|
55
|
+
// TODO @羽熙 暂时简单处理 tooltip 直接显示 origin,后续可以根据 origin 类型分类处理
|
|
56
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: (0, import_lodash.toString)(origin) }, /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
+
Text,
|
|
58
|
+
{
|
|
59
|
+
className,
|
|
60
|
+
style: {
|
|
61
|
+
// antd Text 组件写死了 14px,在段落定义了 font-size 的情况下,显示很突兀,这里不设置,跟随上级容器字体大小改变。
|
|
62
|
+
// TODO @羽熙 之后看能否通过 antd ConfigProvider 统一配置
|
|
63
|
+
fontSize: "unset",
|
|
64
|
+
...style,
|
|
65
|
+
...(0, import_lodash.pick)(encoding, ["color", "backgroundColor", "fontWeight"])
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
renderPrefixSuffix(encoding == null ? void 0 : encoding.prefix, staticsConfig, props),
|
|
69
|
+
children,
|
|
70
|
+
renderPrefixSuffix(encoding == null ? void 0 : encoding.suffix, staticsConfig, props)
|
|
71
|
+
))
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
var VisText_default = VisText;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { VisTextProps } from './types';
|
|
3
|
+
declare const INNER_ENTITY_TYPES: readonly ["metric_name", "metric_value", "other_metric_value", "time_desc", "dim_value", "trend_desc", "delta_value", "ratio_value", "delta_value_pos", "delta_value_neg", "ratio_value_pos", "ratio_value_neg", "proportion", "contribute_ratio"];
|
|
4
|
+
export type InnerEntityType = (typeof INNER_ENTITY_TYPES)[number];
|
|
5
|
+
export type TextEntityType = InnerEntityType | string;
|
|
6
|
+
export type TextEncoding = Partial<Pick<CSSProperties, 'color' | 'backgroundColor' | 'fontWeight'> & {
|
|
7
|
+
/** 前缀 */
|
|
8
|
+
prefix: string;
|
|
9
|
+
/** 后缀 */
|
|
10
|
+
suffix: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const STATICS_KEY: "__statics";
|
|
13
|
+
/** 文本组件配置信息 */
|
|
14
|
+
export type TextConfig = Record<InnerEntityType & string, TextEncoding> & {
|
|
15
|
+
[STATICS_KEY]: Record<string, React.FC<VisTextProps>>;
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_VIS_TEXT_CONFIG: TextConfig;
|
|
18
|
+
export {};
|