@antv/g2 5.1.4 → 5.1.5-beta.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/dist/g2-lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/api/chart.d.ts +1 -0
- package/esm/api/library.d.ts +1 -0
- package/esm/api/utils.d.ts +1 -0
- package/esm/api/utils.js +25 -6
- package/esm/api/utils.js.map +1 -1
- package/esm/composition/repeatMatrix.js +4 -1
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/interaction/fisheye.js +3 -1
- package/esm/interaction/fisheye.js.map +1 -1
- package/esm/interaction/legendFilter.d.ts +1 -1
- package/esm/interaction/legendFilter.js +72 -31
- package/esm/interaction/legendFilter.js.map +1 -1
- package/esm/interaction/tooltip.d.ts +2 -2
- package/esm/interaction/tooltip.js +37 -20
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/lib/core.d.ts +1 -0
- package/esm/lib/core.js +2 -1
- package/esm/lib/core.js.map +1 -1
- package/esm/lib/std.d.ts +1 -0
- package/esm/runtime/plot.js +11 -4
- package/esm/runtime/plot.js.map +1 -1
- package/esm/shape/connector/connector.js +1 -1
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/theme/academy.js +30 -358
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/classic.js +4 -433
- package/esm/theme/classic.js.map +1 -1
- package/esm/theme/classicDark.js +3 -404
- package/esm/theme/classicDark.js.map +1 -1
- package/esm/theme/create.d.ts +437 -0
- package/esm/theme/create.js +421 -0
- package/esm/theme/create.js.map +1 -0
- package/esm/theme/dark.d.ts +3 -0
- package/esm/theme/dark.js +76 -0
- package/esm/theme/dark.js.map +1 -0
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/theme/index.js.map +1 -1
- package/esm/theme/light.js +52 -470
- package/esm/theme/light.js.map +1 -1
- package/lib/api/chart.d.ts +1 -0
- package/lib/api/library.d.ts +1 -0
- package/lib/api/utils.d.ts +1 -0
- package/lib/api/utils.js +26 -7
- package/lib/api/utils.js.map +1 -1
- package/lib/composition/repeatMatrix.js +4 -1
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/interaction/fisheye.js +3 -1
- package/lib/interaction/fisheye.js.map +1 -1
- package/lib/interaction/legendFilter.d.ts +1 -1
- package/lib/interaction/legendFilter.js +72 -31
- package/lib/interaction/legendFilter.js.map +1 -1
- package/lib/interaction/tooltip.d.ts +2 -2
- package/lib/interaction/tooltip.js +37 -20
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/lib/core.d.ts +1 -0
- package/lib/lib/core.js +1 -0
- package/lib/lib/core.js.map +1 -1
- package/lib/lib/std.d.ts +1 -0
- package/lib/runtime/plot.js +11 -4
- package/lib/runtime/plot.js.map +1 -1
- package/lib/shape/connector/connector.js +1 -1
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/theme/academy.js +30 -358
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/classic.js +4 -433
- package/lib/theme/classic.js.map +1 -1
- package/lib/theme/classicDark.js +3 -404
- package/lib/theme/classicDark.js.map +1 -1
- package/lib/theme/create.d.ts +437 -0
- package/lib/theme/create.js +425 -0
- package/lib/theme/create.js.map +1 -0
- package/lib/theme/dark.d.ts +3 -0
- package/lib/theme/dark.js +80 -0
- package/lib/theme/dark.js.map +1 -0
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +3 -1
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/light.js +52 -470
- package/lib/theme/light.js.map +1 -1
- package/package.json +1 -1
- package/src/api/utils.ts +22 -6
- package/src/composition/repeatMatrix.ts +11 -2
- package/src/interaction/fisheye.ts +3 -1
- package/src/interaction/legendFilter.ts +81 -48
- package/src/interaction/tooltip.ts +56 -32
- package/src/lib/core.ts +2 -1
- package/src/runtime/plot.ts +34 -7
- package/src/shape/connector/connector.ts +1 -1
- package/src/theme/academy.ts +74 -399
- package/src/theme/classic.ts +11 -438
- package/src/theme/classicDark.ts +10 -409
- package/src/theme/create.ts +439 -0
- package/src/theme/dark.ts +85 -0
- package/src/theme/index.ts +1 -0
- package/src/theme/light.ts +53 -473
package/esm/theme/light.js
CHANGED
|
@@ -1,477 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { deepMix } from '@antv/util';
|
|
2
|
+
import { create } from './create';
|
|
3
|
+
const defaults = create({
|
|
4
|
+
colorBlack: '#1D2129',
|
|
5
|
+
colorWhite: '#fff',
|
|
6
|
+
colorStroke: '#416180',
|
|
7
|
+
colorDefault: '#1783FF',
|
|
8
|
+
colorBackground: 'transparent',
|
|
9
|
+
category10: [
|
|
10
|
+
'#1783FF',
|
|
11
|
+
'#00C9C9',
|
|
12
|
+
'#F0884D',
|
|
13
|
+
'#D580FF',
|
|
14
|
+
'#7863FF',
|
|
15
|
+
'#60C42D',
|
|
16
|
+
'#BD8F24',
|
|
17
|
+
'#FF80CA',
|
|
18
|
+
'#2491B3',
|
|
19
|
+
'#17C76F',
|
|
20
|
+
],
|
|
21
|
+
category20: [
|
|
22
|
+
'#1783FF',
|
|
23
|
+
'#00C9C9',
|
|
24
|
+
'#F0884D',
|
|
25
|
+
'#D580FF',
|
|
26
|
+
'#7863FF',
|
|
27
|
+
'#60C42D',
|
|
28
|
+
'#BD8F24',
|
|
29
|
+
'#FF80CA',
|
|
30
|
+
'#2491B3',
|
|
31
|
+
'#17C76F',
|
|
32
|
+
'#AABA01',
|
|
33
|
+
'#BC7CFC',
|
|
34
|
+
'#237CBC',
|
|
35
|
+
'#2DE379',
|
|
36
|
+
'#CE8032',
|
|
37
|
+
'#FF7AF4',
|
|
38
|
+
'#545FD3',
|
|
39
|
+
'#AFE410',
|
|
40
|
+
'#D8C608',
|
|
41
|
+
'#FFA1E0',
|
|
42
|
+
],
|
|
43
|
+
padding1: 8,
|
|
44
|
+
padding2: 12,
|
|
45
|
+
padding3: 20,
|
|
46
|
+
alpha90: 0.9,
|
|
47
|
+
alpha65: 0.65,
|
|
48
|
+
alpha45: 0.45,
|
|
49
|
+
alpha25: 0.25,
|
|
50
|
+
alpha10: 0.1,
|
|
51
|
+
});
|
|
20
52
|
/**
|
|
21
53
|
* Default theme.
|
|
22
54
|
*/
|
|
23
55
|
export const Light = (options) => {
|
|
24
|
-
|
|
25
|
-
padding: 'auto',
|
|
26
|
-
margin: 16,
|
|
27
|
-
color: COLORS.DEFAULT,
|
|
28
|
-
size: 1,
|
|
29
|
-
category10: [
|
|
30
|
-
'#1783FF',
|
|
31
|
-
'#00C9C9',
|
|
32
|
-
'#F0884D',
|
|
33
|
-
'#D580FF',
|
|
34
|
-
'#7863FF',
|
|
35
|
-
'#60C42D',
|
|
36
|
-
'#BD8F24',
|
|
37
|
-
'#FF80CA',
|
|
38
|
-
'#2491B3',
|
|
39
|
-
'#17C76F',
|
|
40
|
-
],
|
|
41
|
-
category20: [
|
|
42
|
-
'#1783FF',
|
|
43
|
-
'#00C9C9',
|
|
44
|
-
'#F0884D',
|
|
45
|
-
'#D580FF',
|
|
46
|
-
'#7863FF',
|
|
47
|
-
'#60C42D',
|
|
48
|
-
'#BD8F24',
|
|
49
|
-
'#FF80CA',
|
|
50
|
-
'#2491B3',
|
|
51
|
-
'#17C76F',
|
|
52
|
-
'#AABA01',
|
|
53
|
-
'#BC7CFC',
|
|
54
|
-
'#237CBC',
|
|
55
|
-
'#2DE379',
|
|
56
|
-
'#CE8032',
|
|
57
|
-
'#FF7AF4',
|
|
58
|
-
'#545FD3',
|
|
59
|
-
'#AFE410',
|
|
60
|
-
'#D8C608',
|
|
61
|
-
'#FFA1E0',
|
|
62
|
-
],
|
|
63
|
-
enter: {
|
|
64
|
-
duration: 300,
|
|
65
|
-
fill: 'both',
|
|
66
|
-
delay: 0,
|
|
67
|
-
},
|
|
68
|
-
update: {
|
|
69
|
-
duration: 300,
|
|
70
|
-
fill: 'both',
|
|
71
|
-
delay: 0,
|
|
72
|
-
},
|
|
73
|
-
exit: {
|
|
74
|
-
duration: 300,
|
|
75
|
-
fill: 'both',
|
|
76
|
-
delay: 0,
|
|
77
|
-
},
|
|
78
|
-
view: {
|
|
79
|
-
viewFill: COLORS.BACKGROUND,
|
|
80
|
-
plotFill: 'transparent',
|
|
81
|
-
mainFill: 'transparent',
|
|
82
|
-
contentFill: 'transparent',
|
|
83
|
-
},
|
|
84
|
-
line: {
|
|
85
|
-
line: {
|
|
86
|
-
fill: '',
|
|
87
|
-
strokeOpacity: 1,
|
|
88
|
-
lineWidth: 1,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
point: {
|
|
92
|
-
point: {
|
|
93
|
-
r: 3,
|
|
94
|
-
fillOpacity: 0.95,
|
|
95
|
-
lineWidth: 0,
|
|
96
|
-
},
|
|
97
|
-
hollow: {
|
|
98
|
-
r: 3,
|
|
99
|
-
strokeOpacity: 0.95,
|
|
100
|
-
lineWidth: 1,
|
|
101
|
-
},
|
|
102
|
-
plus: {
|
|
103
|
-
r: 3,
|
|
104
|
-
strokeOpacity: 0.95,
|
|
105
|
-
lineWidth: 3,
|
|
106
|
-
},
|
|
107
|
-
diamond: {
|
|
108
|
-
r: 3,
|
|
109
|
-
strokeOpacity: 0.95,
|
|
110
|
-
lineWidth: 1,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
interval: {
|
|
114
|
-
rect: {
|
|
115
|
-
fillOpacity: 0.95,
|
|
116
|
-
},
|
|
117
|
-
hollow: {
|
|
118
|
-
fill: '',
|
|
119
|
-
strokeOpacity: 1,
|
|
120
|
-
lineWidth: 2,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
area: {
|
|
124
|
-
area: {
|
|
125
|
-
fillOpacity: 0.85,
|
|
126
|
-
lineWidth: 0,
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
polygon: {
|
|
130
|
-
polygon: {
|
|
131
|
-
fillOpacity: 0.95,
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
cell: {
|
|
135
|
-
cell: {
|
|
136
|
-
fillOpacity: 0.95,
|
|
137
|
-
},
|
|
138
|
-
hollow: {
|
|
139
|
-
fill: '',
|
|
140
|
-
strokeOpacity: 1,
|
|
141
|
-
lineWidth: 2,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
rect: {
|
|
145
|
-
rect: {
|
|
146
|
-
fillOpacity: 0.95,
|
|
147
|
-
},
|
|
148
|
-
hollow: {
|
|
149
|
-
fill: '',
|
|
150
|
-
strokeOpacity: 1,
|
|
151
|
-
lineWidth: 2,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
link: {
|
|
155
|
-
link: {
|
|
156
|
-
fill: '',
|
|
157
|
-
strokeOpacity: 1,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
vector: {
|
|
161
|
-
vector: {
|
|
162
|
-
fillOpacity: 1,
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
box: {
|
|
166
|
-
box: {
|
|
167
|
-
fillOpacity: 0.95,
|
|
168
|
-
stroke: COLORS.BLACK,
|
|
169
|
-
lineWidth: 1,
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
text: {
|
|
173
|
-
text: {
|
|
174
|
-
fill: '#1D2129',
|
|
175
|
-
fontSize: 12,
|
|
176
|
-
strokeWidth: 0,
|
|
177
|
-
connectorStroke: COLORS.STROKE,
|
|
178
|
-
connectorStrokeOpacity: 0.45,
|
|
179
|
-
connectorLineWidth: 1,
|
|
180
|
-
backgroundFill: COLORS.STROKE,
|
|
181
|
-
backgroundFillOpacity: 0.15,
|
|
182
|
-
backgroundPadding: [2, 4],
|
|
183
|
-
startMarkerSymbol: 'circle',
|
|
184
|
-
startMarkerSize: 4,
|
|
185
|
-
endMarkerSymbol: 'circle',
|
|
186
|
-
endMarkerSize: 4,
|
|
187
|
-
},
|
|
188
|
-
badge: {
|
|
189
|
-
fill: '#1D2129',
|
|
190
|
-
fillOpacity: 0.65,
|
|
191
|
-
strokeWidth: 0,
|
|
192
|
-
fontSize: 10,
|
|
193
|
-
textAlign: 'center',
|
|
194
|
-
textBaseline: 'middle',
|
|
195
|
-
markerFill: COLORS.STROKE,
|
|
196
|
-
markerFillOpacity: 0.25,
|
|
197
|
-
markerStrokeOpacity: 0,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
lineX: {
|
|
201
|
-
line: {
|
|
202
|
-
stroke: COLORS.STROKE,
|
|
203
|
-
strokeOpacity: 0.45,
|
|
204
|
-
lineWidth: 1,
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
lineY: {
|
|
208
|
-
line: {
|
|
209
|
-
stroke: COLORS.STROKE,
|
|
210
|
-
strokeOpacity: 0.45,
|
|
211
|
-
lineWidth: 1,
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
rangeX: {
|
|
215
|
-
range: {
|
|
216
|
-
fill: COLORS.STROKE,
|
|
217
|
-
fillOpacity: 0.15,
|
|
218
|
-
lineWidth: 0,
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
rangeY: {
|
|
222
|
-
range: {
|
|
223
|
-
fill: COLORS.STROKE,
|
|
224
|
-
fillOpacity: 0.15,
|
|
225
|
-
lineWidth: 0,
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
connector: {
|
|
229
|
-
connector: {
|
|
230
|
-
stroke: COLORS.STROKE,
|
|
231
|
-
strokeOpacity: 0.45,
|
|
232
|
-
lineWidth: 1,
|
|
233
|
-
connectLength1: 12,
|
|
234
|
-
endMarker: true,
|
|
235
|
-
endMarkerSize: 6,
|
|
236
|
-
endMarkerFill: COLORS.STROKE,
|
|
237
|
-
endMarkerFillOpacity: 0.95,
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
axis: {
|
|
241
|
-
arrow: false,
|
|
242
|
-
gridLineDash: [3, 4],
|
|
243
|
-
gridLineWidth: 0.5,
|
|
244
|
-
gridStroke: COLORS.BLACK,
|
|
245
|
-
gridStrokeOpacity: ALPHA[10],
|
|
246
|
-
labelAlign: 'horizontal',
|
|
247
|
-
labelFill: COLORS.BLACK,
|
|
248
|
-
labelOpacity: ALPHA[45],
|
|
249
|
-
labelFontSize: 12,
|
|
250
|
-
labelFontWeight: 'normal',
|
|
251
|
-
labelSpacing: PADDING[1],
|
|
252
|
-
line: false,
|
|
253
|
-
lineLineWidth: 0.5,
|
|
254
|
-
lineStroke: COLORS.BLACK,
|
|
255
|
-
lineStrokeOpacity: ALPHA[45],
|
|
256
|
-
tickLength: 4,
|
|
257
|
-
tickLineWidth: 1,
|
|
258
|
-
tickStroke: COLORS.BLACK,
|
|
259
|
-
tickOpacity: ALPHA[45],
|
|
260
|
-
titleFill: COLORS.BLACK,
|
|
261
|
-
titleOpacity: ALPHA[90],
|
|
262
|
-
titleFontSize: 12,
|
|
263
|
-
titleFontWeight: 'normal',
|
|
264
|
-
titleSpacing: 12,
|
|
265
|
-
titleTransformOrigin: 'center',
|
|
266
|
-
lineArrowOffset: 6,
|
|
267
|
-
lineArrowSize: 6,
|
|
268
|
-
},
|
|
269
|
-
axisTop: {
|
|
270
|
-
gridDirection: 'positive',
|
|
271
|
-
labelDirection: 'negative',
|
|
272
|
-
tickDirection: 'negative',
|
|
273
|
-
titlePosition: 'top',
|
|
274
|
-
labelAutoRotate: false,
|
|
275
|
-
titleSpacing: 12,
|
|
276
|
-
labelSpacing: 4,
|
|
277
|
-
titleTextBaseline: 'middle',
|
|
278
|
-
},
|
|
279
|
-
axisBottom: {
|
|
280
|
-
gridDirection: 'negative',
|
|
281
|
-
labelDirection: 'positive',
|
|
282
|
-
labelAutoRotate: false,
|
|
283
|
-
tickDirection: 'positive',
|
|
284
|
-
titlePosition: 'bottom',
|
|
285
|
-
titleSpacing: 12,
|
|
286
|
-
labelSpacing: 4,
|
|
287
|
-
titleTextBaseline: 'bottom',
|
|
288
|
-
},
|
|
289
|
-
axisLeft: {
|
|
290
|
-
gridDirection: 'positive',
|
|
291
|
-
labelAutoRotate: false,
|
|
292
|
-
labelDirection: 'negative',
|
|
293
|
-
labelSpacing: 4,
|
|
294
|
-
tickDirection: 'negative',
|
|
295
|
-
titlePosition: 'left',
|
|
296
|
-
titleSpacing: 12,
|
|
297
|
-
titleTextBaseline: 'middle',
|
|
298
|
-
titleDirection: 'vertical',
|
|
299
|
-
titleTransformOrigin: 'center',
|
|
300
|
-
},
|
|
301
|
-
axisRight: {
|
|
302
|
-
gridDirection: 'negative',
|
|
303
|
-
labelDirection: 'positive',
|
|
304
|
-
labelSpacing: 4,
|
|
305
|
-
tickDirection: 'positive',
|
|
306
|
-
titlePosition: 'right',
|
|
307
|
-
labelAutoRotate: false,
|
|
308
|
-
titleSpacing: 12,
|
|
309
|
-
titleTextBaseline: 'top',
|
|
310
|
-
titleDirection: 'vertical',
|
|
311
|
-
titleTransformOrigin: 'center',
|
|
312
|
-
},
|
|
313
|
-
axisLinear: {
|
|
314
|
-
girdClosed: true,
|
|
315
|
-
gridConnect: 'arc',
|
|
316
|
-
gridDirection: 'negative',
|
|
317
|
-
gridType: 'surround',
|
|
318
|
-
titlePosition: 'top',
|
|
319
|
-
titleSpacing: 0,
|
|
320
|
-
},
|
|
321
|
-
axisArc: {
|
|
322
|
-
title: false,
|
|
323
|
-
titlePosition: 'inner',
|
|
324
|
-
line: false,
|
|
325
|
-
tick: true,
|
|
326
|
-
labelSpacing: 4,
|
|
327
|
-
},
|
|
328
|
-
axisRadar: {
|
|
329
|
-
girdClosed: true,
|
|
330
|
-
gridStrokeOpacity: 0.3,
|
|
331
|
-
gridType: 'surround',
|
|
332
|
-
label: false,
|
|
333
|
-
tick: false,
|
|
334
|
-
titlePosition: 'start',
|
|
335
|
-
},
|
|
336
|
-
legendCategory: {
|
|
337
|
-
backgroundFill: 'transparent',
|
|
338
|
-
itemBackgroundFill: 'transparent',
|
|
339
|
-
itemLabelFill: COLORS.BLACK,
|
|
340
|
-
itemLabelFillOpacity: ALPHA[90],
|
|
341
|
-
itemLabelFontSize: 12,
|
|
342
|
-
itemLabelFontWeight: 'normal',
|
|
343
|
-
itemMarkerFillOpacity: 1,
|
|
344
|
-
itemMarkerSize: 8,
|
|
345
|
-
itemSpacing: [PADDING[1], PADDING[1]],
|
|
346
|
-
itemValueFill: COLORS.BLACK,
|
|
347
|
-
itemValueFillOpacity: 0.65,
|
|
348
|
-
itemValueFontSize: 12,
|
|
349
|
-
itemValueFontWeight: 'normal',
|
|
350
|
-
navButtonFill: COLORS.BLACK,
|
|
351
|
-
navButtonFillOpacity: 0.65,
|
|
352
|
-
navPageNumFill: COLORS.BLACK,
|
|
353
|
-
navPageNumFillOpacity: 0.45,
|
|
354
|
-
navPageNumFontSize: 12,
|
|
355
|
-
padding: 8,
|
|
356
|
-
title: false,
|
|
357
|
-
titleFill: COLORS.BLACK,
|
|
358
|
-
titleFillOpacity: 0.65,
|
|
359
|
-
titleFontSize: 12,
|
|
360
|
-
titleFontWeight: 'normal',
|
|
361
|
-
titleSpacing: 4,
|
|
362
|
-
tickStroke: COLORS.BLACK,
|
|
363
|
-
tickStrokeOpacity: 0.25,
|
|
364
|
-
rowPadding: PADDING[1],
|
|
365
|
-
colPadding: PADDING[2],
|
|
366
|
-
maxRows: 3,
|
|
367
|
-
maxCols: 3,
|
|
368
|
-
},
|
|
369
|
-
legendContinuous: {
|
|
370
|
-
handleHeight: 12,
|
|
371
|
-
handleLabelFill: COLORS.BLACK,
|
|
372
|
-
handleLabelFillOpacity: ALPHA[45],
|
|
373
|
-
handleLabelFontSize: 12,
|
|
374
|
-
handleLabelFontWeight: 'normal',
|
|
375
|
-
handleMarkerFill: COLORS.BLACK,
|
|
376
|
-
handleMarkerFillOpacity: 0.6,
|
|
377
|
-
handleMarkerLineWidth: 1,
|
|
378
|
-
handleMarkerStroke: COLORS.BLACK,
|
|
379
|
-
handleMarkerStrokeOpacity: 0.25,
|
|
380
|
-
handleWidth: 10,
|
|
381
|
-
labelFill: COLORS.BLACK,
|
|
382
|
-
labelFillOpacity: ALPHA[45],
|
|
383
|
-
labelFontSize: 12,
|
|
384
|
-
labelFontWeight: 'normal',
|
|
385
|
-
labelSpacing: 3,
|
|
386
|
-
tick: true,
|
|
387
|
-
tickLength: 12,
|
|
388
|
-
ribbonSize: 12,
|
|
389
|
-
ribbonFill: '#aaa',
|
|
390
|
-
handle: true,
|
|
391
|
-
handleLabel: false,
|
|
392
|
-
handleShape: 'slider',
|
|
393
|
-
handleIconSize: 12 / 1.8,
|
|
394
|
-
indicator: false,
|
|
395
|
-
titleFontSize: 12,
|
|
396
|
-
titleSpacing: 4,
|
|
397
|
-
titleFontWeight: 'normal',
|
|
398
|
-
titleFillOpacity: ALPHA[90],
|
|
399
|
-
tickStroke: COLORS.BLACK,
|
|
400
|
-
tickStrokeOpacity: ALPHA[45],
|
|
401
|
-
},
|
|
402
|
-
label: {
|
|
403
|
-
fill: COLORS.BLACK,
|
|
404
|
-
fillOpacity: 0.65,
|
|
405
|
-
fontSize: 12,
|
|
406
|
-
fontWeight: 'normal',
|
|
407
|
-
stroke: undefined,
|
|
408
|
-
offset: 12,
|
|
409
|
-
connectorStroke: COLORS.BLACK,
|
|
410
|
-
connectorStrokeOpacity: 0.45,
|
|
411
|
-
connectorLineWidth: 1,
|
|
412
|
-
connectorLength: 12,
|
|
413
|
-
connectorLength2: 8,
|
|
414
|
-
connectorDistance: 4,
|
|
415
|
-
},
|
|
416
|
-
innerLabel: {
|
|
417
|
-
fill: COLORS.WHITE,
|
|
418
|
-
fontSize: 12,
|
|
419
|
-
fillOpacity: 0.85,
|
|
420
|
-
fontWeight: 'normal',
|
|
421
|
-
stroke: undefined,
|
|
422
|
-
offset: 0,
|
|
423
|
-
},
|
|
424
|
-
htmlLabel: {
|
|
425
|
-
fontSize: 12,
|
|
426
|
-
opacity: 0.65,
|
|
427
|
-
color: COLORS.BLACK,
|
|
428
|
-
fontWeight: 'normal',
|
|
429
|
-
},
|
|
430
|
-
slider: {
|
|
431
|
-
trackSize: 16,
|
|
432
|
-
trackFill: COLORS.STROKE,
|
|
433
|
-
trackFillOpacity: 1,
|
|
434
|
-
selectionFill: COLORS.DEFAULT,
|
|
435
|
-
selectionFillOpacity: 0.15,
|
|
436
|
-
handleIconSize: 10,
|
|
437
|
-
handleIconFill: '#f7f7f7',
|
|
438
|
-
handleIconFillOpacity: 1,
|
|
439
|
-
handleIconStroke: COLORS.BLACK,
|
|
440
|
-
handleIconStrokeOpacity: 0.25,
|
|
441
|
-
handleIconLineWidth: 1,
|
|
442
|
-
handleIconRadius: 2,
|
|
443
|
-
handleLabelFill: COLORS.BLACK,
|
|
444
|
-
handleLabelFillOpacity: 0.45,
|
|
445
|
-
handleLabelFontSize: 12,
|
|
446
|
-
handleLabelFontWeight: 'normal',
|
|
447
|
-
},
|
|
448
|
-
scrollbar: {
|
|
449
|
-
padding: [0, 0, 0, 0],
|
|
450
|
-
trackSize: 6,
|
|
451
|
-
isRound: true,
|
|
452
|
-
slidable: true,
|
|
453
|
-
scrollable: true,
|
|
454
|
-
trackFill: '#e5e5e5',
|
|
455
|
-
trackFillOpacity: 0,
|
|
456
|
-
thumbFill: '#000',
|
|
457
|
-
thumbFillOpacity: 0.15,
|
|
458
|
-
thumbHighlightedFillOpacity: 0.2,
|
|
459
|
-
},
|
|
460
|
-
title: {
|
|
461
|
-
spacing: 8,
|
|
462
|
-
titleFill: COLORS.BLACK,
|
|
463
|
-
titleFillOpacity: ALPHA[90],
|
|
464
|
-
titleFontSize: 16,
|
|
465
|
-
titleFontWeight: 'bold',
|
|
466
|
-
titleTextBaseline: 'top',
|
|
467
|
-
subtitleFill: COLORS.BLACK,
|
|
468
|
-
subtitleFillOpacity: ALPHA[65],
|
|
469
|
-
subtitleFontSize: 12,
|
|
470
|
-
subtitleFontWeight: 'normal',
|
|
471
|
-
subtitleTextBaseline: 'top',
|
|
472
|
-
},
|
|
473
|
-
};
|
|
474
|
-
return Object.assign({}, defaultOptions, options);
|
|
56
|
+
return deepMix({}, defaults, options);
|
|
475
57
|
};
|
|
476
58
|
Light.props = {};
|
|
477
59
|
//# sourceMappingURL=light.js.map
|
package/esm/theme/light.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light.js","sourceRoot":"src/","sources":["theme/light.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"light.js","sourceRoot":"src/","sources":["theme/light.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,QAAQ,GAAG,MAAM,CAAC;IACtB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,aAAa;IAC9B,UAAU,EAAE;QACV,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;KACV;IACD,UAAU,EAAE;QACV,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;KACV;IACD,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,GAAG;CACb,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAqB,CAAC,OAAO,EAAE,EAAE;IACjD,OAAO,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
package/lib/api/chart.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ export declare const Chart: new (options?: RuntimeOptions) => API<G2Spec, {
|
|
|
102
102
|
readonly 'theme.classicDark': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
103
103
|
readonly 'theme.academy': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
104
104
|
readonly 'theme.light': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
105
|
+
readonly 'theme.dark': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
105
106
|
readonly 'component.axisX': import("../runtime").GuideComponentComponent<import("../component/axis").AxisOptions>;
|
|
106
107
|
readonly 'component.axisY': import("../runtime").GuideComponentComponent<import("../component/axis").AxisOptions>;
|
|
107
108
|
readonly 'component.legendCategory': import("../runtime").GuideComponentComponent<import("../component").LegendCategoryOptions>;
|
package/lib/api/library.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export declare const library: {
|
|
|
92
92
|
readonly 'theme.classicDark': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
93
93
|
readonly 'theme.academy': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
94
94
|
readonly 'theme.light': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
95
|
+
readonly 'theme.dark': import("../runtime").ThemeComponent<import("../runtime").G2Theme>;
|
|
95
96
|
readonly 'component.axisX': import("../runtime").GuideComponentComponent<import("../component/axis").AxisOptions>;
|
|
96
97
|
readonly 'component.axisY': import("../runtime").GuideComponentComponent<import("../component/axis").AxisOptions>;
|
|
97
98
|
readonly 'component.legendCategory': import("../runtime").GuideComponentComponent<import("../component").LegendCategoryOptions>;
|
package/lib/api/utils.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { G2ViewTree } from '../runtime';
|
|
|
2
2
|
import { Node } from './node';
|
|
3
3
|
export declare const VIEW_KEYS: string[];
|
|
4
4
|
export declare const REMOVE_FLAG = "__remove__";
|
|
5
|
+
export declare const CALLBACK_NODE = "__callback__";
|
|
5
6
|
export declare function normalizeContainer(container: string | HTMLElement): HTMLElement;
|
|
6
7
|
export declare function removeContainer(container: HTMLElement): void;
|
|
7
8
|
export declare function normalizeRoot(node: Node): Node<Record<string, any>, Record<string, any>, Record<string, any>>;
|
package/lib/api/utils.js
CHANGED
|
@@ -11,9 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.createEmptyPromise = exports.updateRoot = exports.optionsOf = exports.sizeOf = exports.valueOf = exports.normalizeRoot = exports.removeContainer = exports.normalizeContainer = exports.REMOVE_FLAG = exports.VIEW_KEYS = void 0;
|
|
14
|
+
exports.createEmptyPromise = exports.updateRoot = exports.optionsOf = exports.sizeOf = exports.valueOf = exports.normalizeRoot = exports.removeContainer = exports.normalizeContainer = exports.CALLBACK_NODE = exports.REMOVE_FLAG = exports.VIEW_KEYS = void 0;
|
|
15
15
|
const size_1 = require("../utils/size");
|
|
16
16
|
const helper_1 = require("../utils/helper");
|
|
17
|
+
const node_1 = require("./node");
|
|
17
18
|
// Keys can specified by new Chart({...}).
|
|
18
19
|
// Keys can bubble form mark-level options to view-level options.
|
|
19
20
|
exports.VIEW_KEYS = [
|
|
@@ -40,6 +41,7 @@ exports.VIEW_KEYS = [
|
|
|
40
41
|
'title',
|
|
41
42
|
];
|
|
42
43
|
exports.REMOVE_FLAG = '__remove__';
|
|
44
|
+
exports.CALLBACK_NODE = '__callback__';
|
|
43
45
|
function normalizeContainer(container) {
|
|
44
46
|
if (container === undefined) {
|
|
45
47
|
const container = document.createElement('div');
|
|
@@ -91,12 +93,17 @@ function optionsOf(node) {
|
|
|
91
93
|
const value = nodeValue.get(node);
|
|
92
94
|
const { children = [] } = node;
|
|
93
95
|
for (const child of children) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
if (child.type === exports.CALLBACK_NODE) {
|
|
97
|
+
value.children = child.value;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const childValue = valueOf(child);
|
|
101
|
+
const { children = [] } = value;
|
|
102
|
+
children.push(childValue);
|
|
103
|
+
discovered.push(child);
|
|
104
|
+
nodeValue.set(child, childValue);
|
|
105
|
+
value.children = children;
|
|
106
|
+
}
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
return nodeValue.get(root);
|
|
@@ -135,6 +142,12 @@ function typeCtor(type, mark, composition) {
|
|
|
135
142
|
}
|
|
136
143
|
// Create node from options.
|
|
137
144
|
function createNode(options, mark, composition) {
|
|
145
|
+
if (typeof options === 'function') {
|
|
146
|
+
const node = new node_1.Node();
|
|
147
|
+
node.value = options;
|
|
148
|
+
node.type = exports.CALLBACK_NODE;
|
|
149
|
+
return node;
|
|
150
|
+
}
|
|
138
151
|
const { type, children } = options, value = __rest(options, ["type", "children"]);
|
|
139
152
|
const Ctor = typeCtor(type, mark, composition);
|
|
140
153
|
const node = new Ctor();
|
|
@@ -172,6 +185,9 @@ function appendNode(parent, newOptions, mark, composition) {
|
|
|
172
185
|
discovered.push([node, child]);
|
|
173
186
|
}
|
|
174
187
|
}
|
|
188
|
+
else if (typeof children === 'function') {
|
|
189
|
+
discovered.push([node, children]);
|
|
190
|
+
}
|
|
175
191
|
}
|
|
176
192
|
}
|
|
177
193
|
// Update node tree from options.
|
|
@@ -201,6 +217,9 @@ function updateRoot(node, options, definedType, mark, composition) {
|
|
|
201
217
|
discovered.push([oldNode, oldChild, newChild]);
|
|
202
218
|
}
|
|
203
219
|
}
|
|
220
|
+
else if (typeof newChildren === 'function') {
|
|
221
|
+
discovered.push([oldNode, null, newChildren]);
|
|
222
|
+
}
|
|
204
223
|
}
|
|
205
224
|
}
|
|
206
225
|
}
|