@visactor/vchart-theme-demo-component 1.11.6-alpha.2 → 1.12.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.
@@ -0,0 +1,223 @@
1
+ export declare const businessFunnelSpec: {
2
+ id: string;
3
+ type: string;
4
+ seriesField: string;
5
+ height: number;
6
+ padding: {
7
+ top: number;
8
+ bottom: number;
9
+ left: number;
10
+ right: number;
11
+ };
12
+ data: ({
13
+ id: string;
14
+ values: {
15
+ x: string;
16
+ y: number;
17
+ percent: number;
18
+ average: number;
19
+ }[];
20
+ } | {
21
+ id: string;
22
+ values: {
23
+ x: string;
24
+ y0: number;
25
+ y1: number;
26
+ y: number;
27
+ percent: number;
28
+ }[];
29
+ })[];
30
+ series: ({
31
+ type: string;
32
+ id: string;
33
+ dataIndex: number;
34
+ xField: string;
35
+ yField: string;
36
+ barWidth: string;
37
+ extensionMark: {
38
+ type: string;
39
+ dataId: string;
40
+ style: {
41
+ x: (datum: any, ctx: any) => any;
42
+ y: number;
43
+ textAlign: string;
44
+ fontSize: number;
45
+ stroke: boolean;
46
+ text: (datum: any) => {
47
+ type: string;
48
+ text: ({
49
+ text: string;
50
+ fill: string;
51
+ textAlign: string;
52
+ fontWeight: string;
53
+ lineHeight: number;
54
+ } | {
55
+ text: string;
56
+ fill: string;
57
+ textAlign: string;
58
+ lineHeight: number;
59
+ fontWeight?: undefined;
60
+ })[];
61
+ };
62
+ };
63
+ }[];
64
+ bar?: undefined;
65
+ stack?: undefined;
66
+ tooltip?: undefined;
67
+ } | {
68
+ type: string;
69
+ id: string;
70
+ dataIndex: number;
71
+ xField: string;
72
+ yField: string;
73
+ bar: {
74
+ visible: boolean;
75
+ style?: undefined;
76
+ };
77
+ extensionMark: ({
78
+ type: string;
79
+ dataId: string;
80
+ dataKey: string;
81
+ style: {
82
+ points: (datum: any, ctx: any) => {
83
+ x: any;
84
+ y: any;
85
+ }[];
86
+ fill: string;
87
+ fillOpacity: number;
88
+ x?: undefined;
89
+ y?: undefined;
90
+ textAlign?: undefined;
91
+ fontSize?: undefined;
92
+ stroke?: undefined;
93
+ text?: undefined;
94
+ };
95
+ customShape?: undefined;
96
+ } | {
97
+ type: string;
98
+ dataId: string;
99
+ dataKey: string;
100
+ customShape: (data: any, attrs: any, path: any) => any;
101
+ style: {
102
+ points: (datum: any, ctx: any) => {
103
+ x: any;
104
+ y: any;
105
+ }[];
106
+ fill: string;
107
+ fillOpacity?: undefined;
108
+ x?: undefined;
109
+ y?: undefined;
110
+ textAlign?: undefined;
111
+ fontSize?: undefined;
112
+ stroke?: undefined;
113
+ text?: undefined;
114
+ };
115
+ } | {
116
+ type: string;
117
+ dataId: string;
118
+ dataKey: string;
119
+ style: {
120
+ x: (datum: any, ctx: any) => any;
121
+ y: number;
122
+ textAlign: string;
123
+ fontSize: number;
124
+ stroke: boolean;
125
+ text: (datum: any) => {
126
+ type: string;
127
+ text: ({
128
+ text: string;
129
+ fill: string;
130
+ textAlign: string;
131
+ fontWeight: string;
132
+ lineHeight: number;
133
+ } | {
134
+ text: string;
135
+ fill: string;
136
+ textAlign: string;
137
+ lineHeight: number;
138
+ fontWeight?: undefined;
139
+ })[];
140
+ };
141
+ points?: undefined;
142
+ fill?: undefined;
143
+ fillOpacity?: undefined;
144
+ };
145
+ customShape?: undefined;
146
+ })[];
147
+ barWidth?: undefined;
148
+ stack?: undefined;
149
+ tooltip?: undefined;
150
+ } | {
151
+ type: string;
152
+ stack: boolean;
153
+ id: string;
154
+ dataIndex: number;
155
+ xField: string;
156
+ yField: string;
157
+ barWidth: string;
158
+ bar: {
159
+ visible: boolean;
160
+ style: {
161
+ fill: string;
162
+ height: number;
163
+ };
164
+ };
165
+ tooltip: {
166
+ visible: boolean;
167
+ };
168
+ extensionMark?: undefined;
169
+ })[];
170
+ animation: boolean;
171
+ tooltip: {
172
+ mark: {
173
+ visible: boolean;
174
+ };
175
+ dimension: {
176
+ title: (data: any, params: any) => {
177
+ value: any;
178
+ };
179
+ content: (data: any, params: any) => ({
180
+ hasShape: boolean;
181
+ key: (datum: any) => any;
182
+ value: (datum: any) => any;
183
+ } | {
184
+ hasShape: boolean;
185
+ key: string;
186
+ value: (datum: any) => any;
187
+ })[];
188
+ };
189
+ };
190
+ axes: ({
191
+ orient: string;
192
+ seriesIndex: number[];
193
+ visible: boolean;
194
+ paddingInner?: undefined;
195
+ paddingOuter?: undefined;
196
+ domain?: undefined;
197
+ domainLine?: undefined;
198
+ tick?: undefined;
199
+ sampling?: undefined;
200
+ label?: undefined;
201
+ } | {
202
+ orient: string;
203
+ paddingInner: number;
204
+ paddingOuter: number;
205
+ domain: string[];
206
+ domainLine: {
207
+ visible: boolean;
208
+ };
209
+ tick: {
210
+ visible: boolean;
211
+ };
212
+ sampling: boolean;
213
+ label: {
214
+ style: {
215
+ fill: string;
216
+ };
217
+ autoLimit: boolean;
218
+ formatMethod: (label: any) => any;
219
+ };
220
+ seriesIndex?: undefined;
221
+ visible?: undefined;
222
+ })[];
223
+ };
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.businessFunnelSpec = void 0, exports.businessFunnelSpec = {
6
+ id: "businessFunnel",
7
+ type: "common",
8
+ seriesField: "color",
9
+ height: 300,
10
+ padding: {
11
+ top: 50,
12
+ bottom: 50,
13
+ left: 20,
14
+ right: 20
15
+ },
16
+ data: [ {
17
+ id: "main",
18
+ values: [ {
19
+ x: "大盘商品",
20
+ y: 11795e3,
21
+ percent: 100,
22
+ average: 1e6
23
+ }, {
24
+ x: "发生价格变化的商品",
25
+ y: 53e5,
26
+ percent: 4.52,
27
+ average: 1e6
28
+ }, {
29
+ x: "符合筛选条件的商品",
30
+ y: 174e3,
31
+ percent: .19,
32
+ average: 1e3
33
+ } ]
34
+ }, {
35
+ id: "transform",
36
+ values: [ {
37
+ x: "0-1",
38
+ y0: 11795e3,
39
+ y1: 53e5,
40
+ y: 6495e3,
41
+ percent: -95.48
42
+ }, {
43
+ x: "1-2",
44
+ y0: 53e5,
45
+ y1: 174e3,
46
+ y: 5126e3,
47
+ percent: -4.33
48
+ } ]
49
+ } ],
50
+ series: [ {
51
+ type: "bar",
52
+ id: "bar",
53
+ dataIndex: 0,
54
+ xField: "x",
55
+ yField: "y",
56
+ barWidth: "100%",
57
+ extensionMark: [ {
58
+ type: "text",
59
+ dataId: "main",
60
+ style: {
61
+ x: (datum, ctx) => ctx.valueToX(datum.x) + ctx.xBandwidth() / 2,
62
+ y: -40,
63
+ textAlign: "center",
64
+ fontSize: 12,
65
+ stroke: !1,
66
+ text: datum => ({
67
+ type: "rich",
68
+ text: [ {
69
+ text: `${datum.percent}%\n`,
70
+ fill: "black",
71
+ textAlign: "center",
72
+ fontWeight: "bold",
73
+ lineHeight: 20
74
+ }, {
75
+ text: `${datum.y}`,
76
+ fill: "grey",
77
+ textAlign: "center",
78
+ lineHeight: 20
79
+ } ]
80
+ })
81
+ }
82
+ } ]
83
+ }, {
84
+ type: "bar",
85
+ id: "transform",
86
+ dataIndex: 1,
87
+ xField: "x",
88
+ yField: "y",
89
+ bar: {
90
+ visible: !1
91
+ },
92
+ extensionMark: [ {
93
+ type: "polygon",
94
+ dataId: "transform",
95
+ dataKey: "x",
96
+ style: {
97
+ points: (datum, ctx) => {
98
+ const {valueToX: valueToX, valueToY: valueToY, xBandwidth: xBandwidth} = ctx;
99
+ return [ {
100
+ x: valueToX(datum.x),
101
+ y: valueToY(0) + 40
102
+ }, {
103
+ x: valueToX(datum.x) + xBandwidth(),
104
+ y: valueToY(0) + 40
105
+ }, {
106
+ x: valueToX(datum.x) + xBandwidth(),
107
+ y: -40
108
+ }, {
109
+ x: valueToX(datum.x),
110
+ y: -40
111
+ } ];
112
+ },
113
+ fill: "grey",
114
+ fillOpacity: .05
115
+ }
116
+ }, {
117
+ type: "polygon",
118
+ dataId: "transform",
119
+ dataKey: "x",
120
+ customShape: (data, attrs, path) => {
121
+ const points = attrs.points;
122
+ return path.moveTo(points[0].x, points[0].y), path.lineTo(points[1].x, points[1].y),
123
+ path.lineTo(points[2].x, points[2].y), path.bezierCurveTo((points[0].x + points[1].x) / 2, points[2].y, (points[0].x + points[1].x) / 2, points[3].y, points[3].x, points[3].y),
124
+ path.closePath(), path;
125
+ },
126
+ style: {
127
+ points: (datum, ctx) => {
128
+ const {valueToX: valueToX, valueToY: valueToY, xBandwidth: xBandwidth} = ctx;
129
+ return [ {
130
+ x: valueToX(datum.x),
131
+ y: valueToY(0)
132
+ }, {
133
+ x: valueToX(datum.x) + xBandwidth(),
134
+ y: valueToY(0)
135
+ }, {
136
+ x: valueToX(datum.x) + xBandwidth(),
137
+ y: valueToY(datum.y1)
138
+ }, {
139
+ x: valueToX(datum.x),
140
+ y: valueToY(datum.y0)
141
+ } ];
142
+ },
143
+ fill: "rgb(228, 232, 247)"
144
+ }
145
+ }, {
146
+ type: "text",
147
+ dataId: "transform",
148
+ dataKey: "x",
149
+ style: {
150
+ x: (datum, ctx) => ctx.valueToX(datum.x) + ctx.xBandwidth() / 2,
151
+ y: -40,
152
+ textAlign: "center",
153
+ fontSize: 12,
154
+ stroke: !1,
155
+ text: datum => ({
156
+ type: "rich",
157
+ text: [ {
158
+ text: `${datum.percent}%\n`,
159
+ fill: "green",
160
+ textAlign: "center",
161
+ fontWeight: "bold",
162
+ lineHeight: 20
163
+ }, {
164
+ text: `${datum.y}`,
165
+ fill: "grey",
166
+ textAlign: "center",
167
+ lineHeight: 20
168
+ } ]
169
+ })
170
+ }
171
+ } ]
172
+ }, {
173
+ type: "bar",
174
+ stack: !1,
175
+ id: "average",
176
+ dataIndex: 0,
177
+ xField: "x",
178
+ yField: "average",
179
+ barWidth: "100%",
180
+ bar: {
181
+ visible: !0,
182
+ style: {
183
+ fill: "orange",
184
+ height: 2
185
+ }
186
+ },
187
+ tooltip: {
188
+ visible: !1
189
+ }
190
+ } ],
191
+ animation: !1,
192
+ tooltip: {
193
+ mark: {
194
+ visible: !1
195
+ },
196
+ dimension: {
197
+ title: (data, params) => {
198
+ var _a, _b;
199
+ return {
200
+ value: (null === (_b = null === (_a = data[0]) || void 0 === _a ? void 0 : _a.value) || void 0 === _b ? void 0 : _b.includes("-")) ? "流失情况" : data[0].value
201
+ };
202
+ },
203
+ content: (data, params) => {
204
+ var _a, _b;
205
+ return (null === (_b = null === (_a = data[0]) || void 0 === _a ? void 0 : _a.value) || void 0 === _b ? void 0 : _b.includes("-")) ? [ {
206
+ hasShape: !1,
207
+ key: "流失量",
208
+ value: datum => datum.y
209
+ }, {
210
+ hasShape: !1,
211
+ key: "流失率",
212
+ value: datum => `${datum.percent}%`
213
+ } ] : [ {
214
+ hasShape: !1,
215
+ key: datum => datum.x,
216
+ value: datum => datum.y
217
+ }, {
218
+ hasShape: !1,
219
+ key: datum => `${datum.x}占比`,
220
+ value: datum => `${datum.percent}%`
221
+ }, {
222
+ hasShape: !1,
223
+ key: "average",
224
+ value: datum => datum.average
225
+ } ];
226
+ }
227
+ }
228
+ },
229
+ axes: [ {
230
+ orient: "left",
231
+ seriesIndex: [ 0, 1, 2 ],
232
+ visible: !1
233
+ }, {
234
+ orient: "bottom",
235
+ paddingInner: 0,
236
+ paddingOuter: 0,
237
+ domain: [ "大盘商品", "0-1", "发生价格变化的商品", "1-2", "符合筛选条件的商品" ],
238
+ domainLine: {
239
+ visible: !1
240
+ },
241
+ tick: {
242
+ visible: !1
243
+ },
244
+ sampling: !1,
245
+ label: {
246
+ style: {
247
+ fill: "black"
248
+ },
249
+ autoLimit: !0,
250
+ formatMethod: label => label.includes("-") ? {
251
+ type: "rich",
252
+ text: [ {
253
+ image: '<svg t="1722236631845" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9542" width="200" height="200"><path d="M779.8 240.9l225.9 225.9c25 25 25 65.5 0 90.5L779.8 783.1c-1.6 1.6-4.1 1.6-5.7 0l-62.2-62.2c-1.6-1.6-1.6-4.1 0-5.7l148.4-148.4c2.5-2.5 0.7-6.8-2.8-6.8H4c-2.2 0-4-1.8-4-4v-88c0-2.2 1.8-4 4-4h853.5c3.6 0 5.3-4.3 2.8-6.8L711.9 308.8c-1.6-1.6-1.6-4.1 0-5.7l62.2-62.2c1.6-1.6 4.1-1.6 5.7 0z" p-id="9543" fill="#707070"></path></svg>',
254
+ height: 14,
255
+ width: 10
256
+ } ]
257
+ } : label
258
+ }
259
+ } ]
260
+ };
261
+ //# sourceMappingURL=businessFunnel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/spec/businessFunnel.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,OAAO;IACpB,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,IAAI,EAAE;QACJ;YACE,EAAE,EAAE,MAAM;YACV,MAAM,EAAE;gBACN,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE;gBAC1D,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;gBAC/D,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;aAC5D;SACF;QACD;YACE,EAAE,EAAE,WAAW;YACf,MAAM,EAAE;gBACN,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE;gBACpE,EAAE,CAAC,EAAE,KAAK,EAAE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C,KAAU,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,GAAG,EAAE;oBACpG,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE;iBAC1E,CAAC;YACJ,CAAC;SACF;KACF;IACD,IAAI,EAAE;QACJ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE;QAC1D;YACE,MAAM,EAAE,QAAQ;YAChB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC;YACxD,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;YAC9B,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;YACxB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE;gBACL,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;gBACxB,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,CAAC,KAAU,EAAE,EAAE;oBAC3B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;wBACvB,OAAO;4BACL,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE;gCACJ;oCACE,KAAK,EAAE,oeAAoe;oCAC3e,MAAM,EAAE,EAAE;oCACV,KAAK,EAAE,EAAE;iCACV;6BACF;yBACF,CAAC;qBACH;oBACD,OAAO,KAAK,CAAC;gBACf,CAAC;aACF;SACF;KACF;CACF,CAAC","file":"businessFunnel.js","sourcesContent":["export const businessFunnelSpec = {\n id: 'businessFunnel',\n type: 'common',\n seriesField: 'color',\n height: 300,\n padding: { top: 50, bottom: 50, left: 20, right: 20 },\n data: [\n {\n id: 'main',\n values: [\n { x: '大盘商品', y: 11795000, percent: 100, average: 1000000 },\n { x: '发生价格变化的商品', y: 5300000, percent: 4.52, average: 1000000 },\n { x: '符合筛选条件的商品', y: 174000, percent: 0.19, average: 1000 }\n ]\n },\n {\n id: 'transform',\n values: [\n { x: '0-1', y0: 11795000, y1: 5300000, y: 6495000, percent: -95.48 },\n { x: '1-2', y0: 5300000, y1: 174000, y: 5126000, percent: -4.33 }\n ]\n }\n ],\n series: [\n {\n type: 'bar',\n id: 'bar',\n dataIndex: 0,\n xField: 'x',\n yField: 'y',\n barWidth: '100%',\n extensionMark: [\n {\n type: 'text',\n dataId: 'main',\n style: {\n x: (datum: any, ctx: any) => ctx.valueToX(datum.x) + ctx.xBandwidth() / 2,\n y: -40,\n textAlign: 'center',\n fontSize: 12,\n stroke: false,\n text: (datum: any) => {\n return {\n type: 'rich',\n text: [\n {\n text: `${datum.percent}%\\n`,\n fill: 'black',\n textAlign: 'center',\n fontWeight: 'bold',\n lineHeight: 20\n },\n { text: `${datum.y}`, fill: 'grey', textAlign: 'center', lineHeight: 20 }\n ]\n };\n }\n }\n }\n ]\n },\n {\n type: 'bar',\n id: 'transform',\n dataIndex: 1,\n xField: 'x',\n yField: 'y',\n bar: { visible: false },\n extensionMark: [\n {\n type: 'polygon',\n dataId: 'transform',\n dataKey: 'x',\n style: {\n points: (datum: any, ctx: any) => {\n const { valueToX, valueToY, xBandwidth } = ctx;\n return [\n { x: valueToX(datum.x), y: valueToY(0) + 40 },\n { x: valueToX(datum.x) + xBandwidth(), y: valueToY(0) + 40 },\n { x: valueToX(datum.x) + xBandwidth(), y: -40 },\n { x: valueToX(datum.x), y: -40 }\n ];\n },\n fill: 'grey',\n fillOpacity: 0.05\n }\n },\n {\n type: 'polygon',\n dataId: 'transform',\n dataKey: 'x',\n customShape: (data: any, attrs: any, path: any) => {\n const points = attrs.points;\n path.moveTo(points[0].x, points[0].y);\n path.lineTo(points[1].x, points[1].y);\n path.lineTo(points[2].x, points[2].y);\n path.bezierCurveTo(\n (points[0].x + points[1].x) / 2,\n points[2].y,\n (points[0].x + points[1].x) / 2,\n points[3].y,\n points[3].x,\n points[3].y\n );\n path.closePath();\n return path;\n },\n style: {\n points: (datum: any, ctx: any) => {\n const { valueToX, valueToY, xBandwidth } = ctx;\n return [\n { x: valueToX(datum.x), y: valueToY(0) },\n { x: valueToX(datum.x) + xBandwidth(), y: valueToY(0) },\n { x: valueToX(datum.x) + xBandwidth(), y: valueToY(datum.y1) },\n { x: valueToX(datum.x), y: valueToY(datum.y0) }\n ];\n },\n fill: 'rgb(228, 232, 247)'\n }\n },\n {\n type: 'text',\n dataId: 'transform',\n dataKey: 'x',\n style: {\n x: (datum: any, ctx: any) => ctx.valueToX(datum.x) + ctx.xBandwidth() / 2,\n y: -40,\n textAlign: 'center',\n fontSize: 12,\n stroke: false,\n text: (datum: any) => {\n return {\n type: 'rich',\n text: [\n {\n text: `${datum.percent}%\\n`,\n fill: 'green',\n textAlign: 'center',\n fontWeight: 'bold',\n lineHeight: 20\n },\n { text: `${datum.y}`, fill: 'grey', textAlign: 'center', lineHeight: 20 }\n ]\n };\n }\n }\n }\n ]\n },\n {\n type: 'bar',\n stack: false,\n id: 'average',\n dataIndex: 0,\n xField: 'x',\n yField: 'average',\n barWidth: '100%',\n bar: {\n visible: true,\n style: {\n fill: 'orange',\n height: 2\n }\n },\n tooltip: { visible: false }\n }\n ],\n animation: false,\n tooltip: {\n mark: { visible: false },\n dimension: {\n title: (data: any, params: any) => {\n return {\n value: data[0]?.value?.includes('-') ? '流失情况' : data[0].value\n };\n },\n content: (data: any, params: any) => {\n const isLose = data[0]?.value?.includes('-');\n if (isLose) {\n return [\n { hasShape: false, key: '流失量', value: (datum: any) => datum.y },\n { hasShape: false, key: '流失率', value: (datum: any) => `${datum.percent}%` }\n ];\n }\n return [\n { hasShape: false, key: (datum: any) => datum.x, value: (datum: any) => datum.y },\n { hasShape: false, key: (datum: any) => `${datum.x}占比`, value: (datum: any) => `${datum.percent}%` },\n { hasShape: false, key: `average`, value: (datum: any) => datum.average }\n ];\n }\n }\n },\n axes: [\n { orient: 'left', seriesIndex: [0, 1, 2], visible: false },\n {\n orient: 'bottom',\n paddingInner: 0,\n paddingOuter: 0,\n domain: ['大盘商品', '0-1', '发生价格变化的商品', '1-2', '符合筛选条件的商品'],\n domainLine: { visible: false },\n tick: { visible: false },\n sampling: false,\n label: {\n style: { fill: 'black' },\n autoLimit: true,\n formatMethod: (label: any) => {\n if (label.includes('-')) {\n return {\n type: 'rich',\n text: [\n {\n image: `<svg t=\"1722236631845\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"9542\" width=\"200\" height=\"200\"><path d=\"M779.8 240.9l225.9 225.9c25 25 25 65.5 0 90.5L779.8 783.1c-1.6 1.6-4.1 1.6-5.7 0l-62.2-62.2c-1.6-1.6-1.6-4.1 0-5.7l148.4-148.4c2.5-2.5 0.7-6.8-2.8-6.8H4c-2.2 0-4-1.8-4-4v-88c0-2.2 1.8-4 4-4h853.5c3.6 0 5.3-4.3 2.8-6.8L711.9 308.8c-1.6-1.6-1.6-4.1 0-5.7l62.2-62.2c1.6-1.6 4.1-1.6 5.7 0z\" p-id=\"9543\" fill=\"#707070\"></path></svg>`,\n height: 14,\n width: 10\n }\n ]\n };\n }\n return label;\n }\n }\n }\n ]\n};\n"]}
@@ -0,0 +1,48 @@
1
+ export declare const CombinationSpec: {
2
+ type: string;
3
+ seriesField: string;
4
+ data: {
5
+ id: string;
6
+ values: {
7
+ x: string;
8
+ type: string;
9
+ y: number;
10
+ }[];
11
+ }[];
12
+ series: ({
13
+ type: string;
14
+ dataIndex: number;
15
+ label: {
16
+ visible: boolean;
17
+ };
18
+ seriesField: string;
19
+ xField: string[];
20
+ yField: string;
21
+ stack?: undefined;
22
+ } | {
23
+ type: string;
24
+ dataIndex: number;
25
+ label: {
26
+ visible: boolean;
27
+ };
28
+ seriesField: string;
29
+ xField: string;
30
+ yField: string;
31
+ stack: boolean;
32
+ })[];
33
+ axes: ({
34
+ orient: string;
35
+ label?: undefined;
36
+ type?: undefined;
37
+ } | {
38
+ orient: string;
39
+ label: {
40
+ visible: boolean;
41
+ };
42
+ type: string;
43
+ })[];
44
+ legends: {
45
+ visible: boolean;
46
+ orient: string;
47
+ };
48
+ };
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.CombinationSpec = void 0, exports.CombinationSpec = {
6
+ type: "common",
7
+ seriesField: "color",
8
+ data: [ {
9
+ id: "id0",
10
+ values: [ {
11
+ x: "周一",
12
+ type: "早餐",
13
+ y: 15
14
+ }, {
15
+ x: "周一",
16
+ type: "午餐",
17
+ y: 25
18
+ }, {
19
+ x: "周二",
20
+ type: "早餐",
21
+ y: 12
22
+ }, {
23
+ x: "周二",
24
+ type: "午餐",
25
+ y: 30
26
+ }, {
27
+ x: "周三",
28
+ type: "早餐",
29
+ y: 15
30
+ }, {
31
+ x: "周三",
32
+ type: "午餐",
33
+ y: 24
34
+ }, {
35
+ x: "周四",
36
+ type: "早餐",
37
+ y: 10
38
+ }, {
39
+ x: "周四",
40
+ type: "午餐",
41
+ y: 25
42
+ }, {
43
+ x: "周五",
44
+ type: "早餐",
45
+ y: 13
46
+ }, {
47
+ x: "周五",
48
+ type: "午餐",
49
+ y: 20
50
+ }, {
51
+ x: "周六",
52
+ type: "早餐",
53
+ y: 10
54
+ }, {
55
+ x: "周六",
56
+ type: "午餐",
57
+ y: 22
58
+ }, {
59
+ x: "周日",
60
+ type: "早餐",
61
+ y: 12
62
+ }, {
63
+ x: "周日",
64
+ type: "午餐",
65
+ y: 19
66
+ } ]
67
+ }, {
68
+ id: "id1",
69
+ values: [ {
70
+ x: "周一",
71
+ type: "饮料",
72
+ y: 22
73
+ }, {
74
+ x: "周二",
75
+ type: "饮料",
76
+ y: 43
77
+ }, {
78
+ x: "周三",
79
+ type: "饮料",
80
+ y: 33
81
+ }, {
82
+ x: "周四",
83
+ type: "饮料",
84
+ y: 22
85
+ }, {
86
+ x: "周五",
87
+ type: "饮料",
88
+ y: 10
89
+ }, {
90
+ x: "周六",
91
+ type: "饮料",
92
+ y: 30
93
+ }, {
94
+ x: "周日",
95
+ type: "饮料",
96
+ y: 50
97
+ } ]
98
+ } ],
99
+ series: [ {
100
+ type: "bar",
101
+ dataIndex: 0,
102
+ label: {
103
+ visible: !0
104
+ },
105
+ seriesField: "type",
106
+ xField: [ "x", "type" ],
107
+ yField: "y"
108
+ }, {
109
+ type: "line",
110
+ dataIndex: 1,
111
+ label: {
112
+ visible: !0
113
+ },
114
+ seriesField: "type",
115
+ xField: "x",
116
+ yField: "y",
117
+ stack: !1
118
+ } ],
119
+ axes: [ {
120
+ orient: "left"
121
+ }, {
122
+ orient: "bottom",
123
+ label: {
124
+ visible: !0
125
+ },
126
+ type: "band"
127
+ } ],
128
+ legends: {
129
+ visible: !0,
130
+ orient: "bottom"
131
+ }
132
+ };
133
+ //# sourceMappingURL=combination.js.map