@antv/g2 5.0.0-beta.1 → 5.0.0-beta.3
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 +2 -2
- package/dist/g2.min.js +2 -2
- package/esm/animation/morphing.js +10 -8
- package/esm/animation/morphing.js.map +1 -1
- package/esm/api/chart.js +2 -5
- package/esm/api/chart.js.map +1 -1
- package/esm/component/axis.d.ts +1 -2
- package/esm/component/axis.js +81 -198
- package/esm/component/axis.js.map +1 -1
- package/esm/component/legendCategory.d.ts +0 -1
- package/esm/component/legendCategory.js +36 -49
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.js +29 -19
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/utils.d.ts +1 -0
- package/esm/component/utils.js +3 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetRect.js +2 -4
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/composition/repeatMatrix.js +2 -2
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/interaction/action/service/legendItemSelection.js.map +1 -1
- package/esm/interaction/action/transformer/setItemState.js.map +1 -1
- package/esm/mark/cell.js +1 -1
- package/esm/shape/area/curve.js +2 -9
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/interval/color.js +2 -2
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/line/curve.js +23 -12
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/line/line.js +6 -2
- package/esm/shape/line/line.js.map +1 -1
- package/esm/shape/line/smooth.js +6 -2
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/shape/text/advance.js +2 -2
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/utils.d.ts +1 -0
- package/esm/shape/utils.js +8 -1
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/geometry.d.ts +1 -1
- package/esm/spec/transform.d.ts +10 -2
- package/esm/stdlib/index.js +2 -2
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/dark.js +78 -65
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +84 -74
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/groupN.js +2 -0
- package/esm/transform/groupN.js.map +1 -1
- package/esm/transform/index.d.ts +8 -6
- package/esm/transform/index.js +4 -3
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/sample.d.ts +8 -0
- package/esm/transform/sample.js +48 -0
- package/esm/transform/sample.js.map +1 -0
- package/esm/transform/{Select.d.ts → select.d.ts} +0 -0
- package/esm/transform/{Select.js → select.js} +1 -1
- package/esm/transform/{Select.js.map → select.js.map} +1 -1
- package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/esm/transform/{SelectX.js → selectX.js} +2 -2
- package/esm/transform/{SelectX.js.map → selectX.js.map} +1 -1
- package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/esm/transform/{SelectY.js → selectY.js} +2 -2
- package/esm/transform/{SelectY.js.map → selectY.js.map} +1 -1
- package/esm/transform/sort.d.ts +1 -1
- package/esm/transform/sort.js +39 -21
- package/esm/transform/sort.js.map +1 -1
- package/lib/animation/morphing.js +10 -8
- package/lib/animation/morphing.js.map +1 -1
- package/lib/api/chart.js +2 -5
- package/lib/api/chart.js.map +1 -1
- package/lib/component/axis.d.ts +1 -2
- package/lib/component/axis.js +80 -197
- package/lib/component/axis.js.map +1 -1
- package/lib/component/legendCategory.d.ts +0 -1
- package/lib/component/legendCategory.js +36 -49
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.js +29 -19
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/utils.d.ts +1 -0
- package/lib/component/utils.js +5 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetRect.js +2 -4
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/composition/repeatMatrix.js +2 -2
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/interaction/action/service/legendItemSelection.js.map +1 -1
- package/lib/interaction/action/transformer/setItemState.js.map +1 -1
- package/lib/mark/cell.js +1 -1
- package/lib/shape/area/curve.js +2 -9
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/interval/color.js +2 -2
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/line/curve.js +21 -10
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/line/line.js +5 -1
- package/lib/shape/line/line.js.map +1 -1
- package/lib/shape/line/smooth.js +5 -1
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/shape/text/advance.js +2 -2
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/utils.d.ts +1 -0
- package/lib/shape/utils.js +9 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/geometry.d.ts +1 -1
- package/lib/spec/transform.d.ts +10 -2
- package/lib/stdlib/index.js +1 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/dark.js +78 -65
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +84 -74
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/groupN.js +2 -0
- package/lib/transform/groupN.js.map +1 -1
- package/lib/transform/index.d.ts +8 -6
- package/lib/transform/index.js +9 -7
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/sample.d.ts +8 -0
- package/lib/transform/sample.js +52 -0
- package/lib/transform/sample.js.map +1 -0
- package/lib/transform/{Select.d.ts → select.d.ts} +0 -0
- package/lib/transform/{Select.js → select.js} +1 -1
- package/lib/transform/{Select.js.map → select.js.map} +1 -1
- package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/lib/transform/{SelectX.js → selectX.js} +3 -3
- package/lib/transform/{SelectX.js.map → selectX.js.map} +1 -1
- package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/lib/transform/{SelectY.js → selectY.js} +3 -3
- package/lib/transform/{SelectY.js.map → selectY.js.map} +1 -1
- package/lib/transform/sort.d.ts +1 -1
- package/lib/transform/sort.js +38 -20
- package/lib/transform/sort.js.map +1 -1
- package/package.json +3 -3
- package/src/animation/morphing.ts +12 -8
- package/src/api/chart.ts +2 -5
- package/src/component/axis.ts +233 -310
- package/src/component/legendCategory.ts +52 -68
- package/src/component/legendContinuous.ts +24 -25
- package/src/component/utils.ts +4 -0
- package/src/composition/facetRect.ts +2 -4
- package/src/composition/repeatMatrix.ts +2 -2
- package/src/interaction/action/service/legendItemSelection.ts +1 -2
- package/src/interaction/action/transformer/setItemState.ts +2 -3
- package/src/mark/cell.ts +1 -1
- package/src/shape/area/curve.ts +7 -9
- package/src/shape/interval/color.ts +7 -7
- package/src/shape/line/curve.ts +27 -12
- package/src/shape/line/line.ts +6 -2
- package/src/shape/line/smooth.ts +11 -2
- package/src/shape/text/advance.ts +2 -2
- package/src/shape/utils.ts +8 -1
- package/src/spec/geometry.ts +1 -7
- package/src/spec/transform.ts +10 -1
- package/src/stdlib/index.ts +2 -0
- package/src/theme/dark.ts +78 -66
- package/src/theme/light.ts +84 -75
- package/src/transform/groupN.ts +2 -0
- package/src/transform/index.ts +8 -6
- package/src/transform/sample.ts +44 -0
- package/src/transform/selectX.ts +1 -1
- package/src/transform/selectY.ts +1 -1
- package/src/transform/sort.ts +53 -21
package/src/theme/dark.ts
CHANGED
|
@@ -2,30 +2,14 @@ import { ThemeComponent as TC, Theme } from '../runtime';
|
|
|
2
2
|
|
|
3
3
|
export type DarkOptions = Theme;
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
65: '#595959',
|
|
10
|
-
45: '#8C8C8C',
|
|
11
|
-
25: '#BFBFBF',
|
|
12
|
-
15: '#D9D9D9',
|
|
13
|
-
6: '#F0F0F0',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const BLACK_COLORS = {
|
|
17
|
-
100: '#FFFFFF',
|
|
18
|
-
95: '#F2F2F2',
|
|
19
|
-
85: '#D9D9D9',
|
|
20
|
-
65: '#A6A6A6',
|
|
21
|
-
45: '#737373',
|
|
22
|
-
25: '#404040',
|
|
23
|
-
15: '#262626',
|
|
24
|
-
6: '#0F0F0F',
|
|
5
|
+
const COLORS = {
|
|
6
|
+
BLACK: '#fff',
|
|
7
|
+
WHITE: '#000',
|
|
8
|
+
STROKE: '#416180',
|
|
25
9
|
};
|
|
26
10
|
|
|
27
11
|
const BACKGROUND_COLOR = '#141414';
|
|
28
|
-
const STROKE_COLOR = '#
|
|
12
|
+
const STROKE_COLOR = '#416180';
|
|
29
13
|
|
|
30
14
|
/**
|
|
31
15
|
* Dark theme.
|
|
@@ -37,12 +21,22 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
37
21
|
defaultCategory10: 'category10',
|
|
38
22
|
defaultCategory20: 'category20',
|
|
39
23
|
defaultSize: 1,
|
|
40
|
-
elementActiveStroke:
|
|
24
|
+
elementActiveStroke: COLORS.BLACK,
|
|
41
25
|
enter: {
|
|
42
26
|
duration: 300,
|
|
43
27
|
fill: 'both',
|
|
44
28
|
delay: 0,
|
|
45
29
|
},
|
|
30
|
+
update: {
|
|
31
|
+
duration: 300,
|
|
32
|
+
fill: 'both',
|
|
33
|
+
delay: 0,
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
duration: 300,
|
|
37
|
+
fill: 'both',
|
|
38
|
+
delay: 0,
|
|
39
|
+
},
|
|
46
40
|
// --- Theme of area style
|
|
47
41
|
viewFill: BACKGROUND_COLOR,
|
|
48
42
|
plotFill: 'transparent',
|
|
@@ -54,6 +48,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
54
48
|
fill: '',
|
|
55
49
|
strokeOpacity: 1,
|
|
56
50
|
lineWidth: 1,
|
|
51
|
+
connectStroke: '#666',
|
|
57
52
|
},
|
|
58
53
|
},
|
|
59
54
|
point: {
|
|
@@ -95,6 +90,8 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
95
90
|
area: {
|
|
96
91
|
fillOpacity: 0.85,
|
|
97
92
|
lineWidth: 0,
|
|
93
|
+
connectFill: COLORS.BLACK,
|
|
94
|
+
connectFillOpacity: 0.1,
|
|
98
95
|
},
|
|
99
96
|
},
|
|
100
97
|
polygon: {
|
|
@@ -103,6 +100,16 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
103
100
|
},
|
|
104
101
|
},
|
|
105
102
|
cell: {
|
|
103
|
+
cell: {
|
|
104
|
+
fillOpacity: 0.95,
|
|
105
|
+
},
|
|
106
|
+
hollow: {
|
|
107
|
+
fill: '',
|
|
108
|
+
strokeOpacity: 1,
|
|
109
|
+
lineWidth: 2,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
rect: {
|
|
106
113
|
rect: {
|
|
107
114
|
fillOpacity: 0.95,
|
|
108
115
|
},
|
|
@@ -132,8 +139,10 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
132
139
|
},
|
|
133
140
|
text: {
|
|
134
141
|
text: {
|
|
135
|
-
fill:
|
|
142
|
+
fill: COLORS.BLACK,
|
|
143
|
+
fillOpacity: 0.65,
|
|
136
144
|
fontSize: 12,
|
|
145
|
+
strokeWidth: 0,
|
|
137
146
|
connectorStroke: STROKE_COLOR,
|
|
138
147
|
connectorStrokeOpacity: 0.45,
|
|
139
148
|
connectorLineWidth: 1,
|
|
@@ -203,7 +212,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
203
212
|
line: { lineWidth: 3 },
|
|
204
213
|
},
|
|
205
214
|
interval: {
|
|
206
|
-
rect: { stroke:
|
|
215
|
+
rect: { stroke: COLORS.BLACK },
|
|
207
216
|
},
|
|
208
217
|
area: {
|
|
209
218
|
area: { fillOpacity: 0.5 },
|
|
@@ -219,93 +228,96 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
219
228
|
},
|
|
220
229
|
axis: {
|
|
221
230
|
// axis title
|
|
222
|
-
titleFill:
|
|
223
|
-
titleFillOpacity:
|
|
231
|
+
titleFill: COLORS.BLACK,
|
|
232
|
+
titleFillOpacity: 0.65,
|
|
224
233
|
titleFontSize: 12,
|
|
225
234
|
titleFontWeight: 'normal',
|
|
226
235
|
titleSpacing: 12,
|
|
227
236
|
// axis line
|
|
228
|
-
lineStroke:
|
|
237
|
+
lineStroke: COLORS.BLACK,
|
|
229
238
|
lineStrokeOpacity: 0.45,
|
|
230
239
|
lineLineWidth: 0.5,
|
|
231
|
-
// axis
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
240
|
+
// axis tick line
|
|
241
|
+
tickStroke: COLORS.BLACK,
|
|
242
|
+
tickStrokeOpacity: 0.25,
|
|
243
|
+
tickLineWidth: 1,
|
|
244
|
+
tickLength: 4,
|
|
235
245
|
// axis label
|
|
236
|
-
labelFill:
|
|
237
|
-
labelFillOpacity:
|
|
246
|
+
labelFill: COLORS.BLACK,
|
|
247
|
+
labelFillOpacity: 0.65,
|
|
238
248
|
labelFontSize: 12,
|
|
239
249
|
labelFontWeight: 'lighter',
|
|
240
250
|
labelSpacing: 8, // spacing between label and it's tick
|
|
241
251
|
// axis grid
|
|
242
|
-
gridStroke:
|
|
243
|
-
gridStrokeOpacity:
|
|
252
|
+
gridStroke: COLORS.BLACK,
|
|
253
|
+
gridStrokeOpacity: 0.05,
|
|
244
254
|
gridLineWidth: 0.5,
|
|
245
255
|
gridLineDash: [0, 0],
|
|
246
256
|
},
|
|
247
257
|
legend: {
|
|
248
258
|
padding: 8,
|
|
249
|
-
// legend title
|
|
250
259
|
showTitle: false,
|
|
251
|
-
titleFill:
|
|
260
|
+
titleFill: COLORS.BLACK,
|
|
261
|
+
titleFillOpacity: 0.45,
|
|
252
262
|
titleFontSize: 12,
|
|
253
|
-
titleLineHeight: 21,
|
|
254
263
|
titleFontWeight: 'normal',
|
|
255
264
|
titleSpacing: 4,
|
|
256
265
|
// legend marker
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
itemLabelFill:
|
|
262
|
-
itemLabelFillOpacity:
|
|
266
|
+
itemMarkerFill: DEFAULT_COLOR,
|
|
267
|
+
itemMarkerFillOpacity: 1,
|
|
268
|
+
itemMarkerSize: 8,
|
|
269
|
+
itemSpacing: [5, 8],
|
|
270
|
+
itemLabelFill: COLORS.BLACK,
|
|
271
|
+
itemLabelFillOpacity: 0.65,
|
|
263
272
|
itemLabelFontSize: 12,
|
|
264
273
|
itemLabelFontWeight: 'normal',
|
|
265
|
-
itemValueFill:
|
|
266
|
-
itemValueFillOpacity: 0.
|
|
274
|
+
itemValueFill: COLORS.BLACK,
|
|
275
|
+
itemValueFillOpacity: 0.65,
|
|
267
276
|
itemValueFontSize: 12,
|
|
268
277
|
itemValueFontWeight: 'normal',
|
|
269
278
|
itemBackgroundFill: 'transparent',
|
|
270
|
-
// [todo]
|
|
271
|
-
navButtonFill:
|
|
272
|
-
navButtonFillOpacity:
|
|
273
|
-
navPageNumFill:
|
|
279
|
+
// [todo] support navButtonSize
|
|
280
|
+
navButtonFill: COLORS.BLACK,
|
|
281
|
+
navButtonFillOpacity: 0.45,
|
|
282
|
+
navPageNumFill: COLORS.BLACK,
|
|
283
|
+
navPageNumFillOpacity: 0.45,
|
|
274
284
|
navPageNumFontSize: 12,
|
|
275
285
|
// others
|
|
276
286
|
backgroundFill: 'transparent',
|
|
277
287
|
},
|
|
278
288
|
continuousLegend: {
|
|
279
|
-
labelFill:
|
|
289
|
+
labelFill: COLORS.BLACK,
|
|
290
|
+
labelFillOpacity: 0.45,
|
|
280
291
|
labelFontSize: 12,
|
|
281
|
-
labelLineHeight: 12,
|
|
282
292
|
labelFontWeight: 'normal',
|
|
283
293
|
handleWidth: 10,
|
|
284
294
|
handleHeight: 12,
|
|
285
|
-
handleMarkerFill:
|
|
286
|
-
|
|
295
|
+
handleMarkerFill: COLORS.BLACK,
|
|
296
|
+
handleMarkerFillOpacity: 0.6,
|
|
297
|
+
handleMarkerStroke: COLORS.BLACK,
|
|
298
|
+
handleMarkerStrokeOpacity: 0.25,
|
|
287
299
|
handleMarkerLineWidth: 1,
|
|
288
|
-
handleLabelFill:
|
|
300
|
+
handleLabelFill: COLORS.BLACK,
|
|
301
|
+
handleLabelFillOpacity: 0.45,
|
|
289
302
|
handleLabelFontSize: 12,
|
|
290
|
-
handleLabelLineHeight: 12,
|
|
291
303
|
handleLabelFontWeight: 'normal',
|
|
292
304
|
// [todo] legend rail
|
|
293
305
|
},
|
|
294
306
|
label: {
|
|
295
|
-
fill:
|
|
307
|
+
fill: COLORS.BLACK,
|
|
296
308
|
fillOpacity: 0.65,
|
|
297
309
|
fontSize: 12,
|
|
298
310
|
fontWeight: 'normal',
|
|
299
311
|
stroke: null,
|
|
300
312
|
offset: 12,
|
|
301
|
-
connectorStroke:
|
|
313
|
+
connectorStroke: COLORS.BLACK,
|
|
302
314
|
connectorStrokeOpacity: 0.45,
|
|
303
315
|
connectorLineWidth: 1,
|
|
304
316
|
connectorLength2: 8,
|
|
305
317
|
connectorDistance: 4,
|
|
306
318
|
},
|
|
307
319
|
innerLabel: {
|
|
308
|
-
fill:
|
|
320
|
+
fill: COLORS.WHITE,
|
|
309
321
|
fontSize: 12,
|
|
310
322
|
fillOpacity: 0.85,
|
|
311
323
|
fontWeight: 'normal',
|
|
@@ -322,26 +334,26 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
322
334
|
handleWidth: 10,
|
|
323
335
|
handleFill: '#f7f7f7',
|
|
324
336
|
handleFillOpacity: 1,
|
|
325
|
-
handleStroke:
|
|
326
|
-
handleStrokeOpacity:
|
|
337
|
+
handleStroke: COLORS.BLACK,
|
|
338
|
+
handleStrokeOpacity: 0.25,
|
|
327
339
|
handleLineWidth: 1,
|
|
328
340
|
handleRadius: 2,
|
|
329
|
-
textFill:
|
|
341
|
+
textFill: COLORS.BLACK,
|
|
330
342
|
textFillOpacity: 0.45,
|
|
331
343
|
textFontSize: 12,
|
|
332
344
|
textFontWeight: 'normal',
|
|
333
345
|
},
|
|
334
346
|
scrollbar: {},
|
|
335
347
|
title: {
|
|
336
|
-
fill:
|
|
337
|
-
fillOpacity:
|
|
348
|
+
fill: COLORS.BLACK,
|
|
349
|
+
fillOpacity: 0.85,
|
|
338
350
|
fontSize: 24,
|
|
339
351
|
fontWeight: 'bold',
|
|
340
352
|
textBaseline: 'top',
|
|
341
353
|
},
|
|
342
354
|
subtitle: {
|
|
343
|
-
fill:
|
|
344
|
-
fillOpacity:
|
|
355
|
+
fill: COLORS.BLACK,
|
|
356
|
+
fillOpacity: 0.65,
|
|
345
357
|
fontSize: 10,
|
|
346
358
|
fontWeight: 'normal',
|
|
347
359
|
textBaseline: 'top',
|
package/src/theme/light.ts
CHANGED
|
@@ -2,30 +2,13 @@ import { ThemeComponent as TC, Theme } from '../runtime';
|
|
|
2
2
|
|
|
3
3
|
export type LightOptions = Theme;
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
65: '#595959',
|
|
10
|
-
45: '#8C8C8C',
|
|
11
|
-
25: '#BFBFBF',
|
|
12
|
-
15: '#D9D9D9',
|
|
13
|
-
6: '#F0F0F0',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const WHITE_COLORS = {
|
|
17
|
-
100: '#FFFFFF',
|
|
18
|
-
95: '#F2F2F2',
|
|
19
|
-
85: '#D9D9D9',
|
|
20
|
-
65: '#A6A6A6',
|
|
21
|
-
45: '#737373',
|
|
22
|
-
25: '#404040',
|
|
23
|
-
15: '#262626',
|
|
24
|
-
6: '#0F0F0F',
|
|
5
|
+
const COLORS = {
|
|
6
|
+
BLACK: '#000',
|
|
7
|
+
WHITE: '#fff',
|
|
8
|
+
STROKE: '#416180',
|
|
25
9
|
};
|
|
26
10
|
|
|
27
11
|
const BACKGROUND_COLOR = 'transparent';
|
|
28
|
-
const STROKE_COLOR = '#416180';
|
|
29
12
|
|
|
30
13
|
/**
|
|
31
14
|
* Default theme.
|
|
@@ -37,12 +20,22 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
37
20
|
defaultCategory10: 'category10',
|
|
38
21
|
defaultCategory20: 'category20',
|
|
39
22
|
defaultSize: 1,
|
|
40
|
-
elementActiveStroke:
|
|
23
|
+
elementActiveStroke: COLORS.BLACK,
|
|
41
24
|
enter: {
|
|
42
25
|
duration: 300,
|
|
43
26
|
fill: 'both',
|
|
44
27
|
delay: 0,
|
|
45
28
|
},
|
|
29
|
+
update: {
|
|
30
|
+
duration: 300,
|
|
31
|
+
fill: 'both',
|
|
32
|
+
delay: 0,
|
|
33
|
+
},
|
|
34
|
+
exit: {
|
|
35
|
+
duration: 300,
|
|
36
|
+
fill: 'both',
|
|
37
|
+
delay: 0,
|
|
38
|
+
},
|
|
46
39
|
// --- Theme of area style
|
|
47
40
|
viewFill: BACKGROUND_COLOR,
|
|
48
41
|
plotFill: 'transparent',
|
|
@@ -54,6 +47,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
54
47
|
fill: '',
|
|
55
48
|
strokeOpacity: 1,
|
|
56
49
|
lineWidth: 1,
|
|
50
|
+
connectStroke: '#aaa',
|
|
57
51
|
},
|
|
58
52
|
},
|
|
59
53
|
point: {
|
|
@@ -95,6 +89,8 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
95
89
|
area: {
|
|
96
90
|
fillOpacity: 0.85,
|
|
97
91
|
lineWidth: 0,
|
|
92
|
+
connectFill: COLORS.BLACK,
|
|
93
|
+
connectFillOpacity: 0.1,
|
|
98
94
|
},
|
|
99
95
|
},
|
|
100
96
|
polygon: {
|
|
@@ -103,6 +99,16 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
103
99
|
},
|
|
104
100
|
},
|
|
105
101
|
cell: {
|
|
102
|
+
cell: {
|
|
103
|
+
fillOpacity: 0.95,
|
|
104
|
+
},
|
|
105
|
+
hollow: {
|
|
106
|
+
fill: '',
|
|
107
|
+
strokeOpacity: 1,
|
|
108
|
+
lineWidth: 2,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
rect: {
|
|
106
112
|
rect: {
|
|
107
113
|
fillOpacity: 0.95,
|
|
108
114
|
},
|
|
@@ -132,14 +138,14 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
132
138
|
},
|
|
133
139
|
text: {
|
|
134
140
|
text: {
|
|
135
|
-
// fill:
|
|
141
|
+
// fill: COLORS.BLACK,fillOpacity: 0.65,
|
|
136
142
|
fill: '#1D2129',
|
|
137
143
|
fontSize: 12,
|
|
138
144
|
strokeWidth: 0,
|
|
139
|
-
connectorStroke:
|
|
145
|
+
connectorStroke: COLORS.STROKE,
|
|
140
146
|
connectorStrokeOpacity: 0.45,
|
|
141
147
|
connectorLineWidth: 1,
|
|
142
|
-
backgroundFill:
|
|
148
|
+
backgroundFill: COLORS.STROKE,
|
|
143
149
|
backgroundFillOpacity: 0.15,
|
|
144
150
|
backgroundPadding: [2, 4],
|
|
145
151
|
startMarkerSymbol: 'circle',
|
|
@@ -154,48 +160,48 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
154
160
|
fontSize: 10,
|
|
155
161
|
textAlign: 'center',
|
|
156
162
|
textBaseline: 'middle',
|
|
157
|
-
markerFill:
|
|
163
|
+
markerFill: COLORS.STROKE,
|
|
158
164
|
markerFillOpacity: 0.25,
|
|
159
165
|
markerStrokeOpacity: 0,
|
|
160
166
|
},
|
|
161
167
|
},
|
|
162
168
|
lineX: {
|
|
163
169
|
line: {
|
|
164
|
-
stroke:
|
|
170
|
+
stroke: COLORS.STROKE,
|
|
165
171
|
strokeOpacity: 0.45,
|
|
166
172
|
lineWidth: 1,
|
|
167
173
|
},
|
|
168
174
|
},
|
|
169
175
|
lineY: {
|
|
170
176
|
line: {
|
|
171
|
-
stroke:
|
|
177
|
+
stroke: COLORS.STROKE,
|
|
172
178
|
strokeOpacity: 0.45,
|
|
173
179
|
lineWidth: 1,
|
|
174
180
|
},
|
|
175
181
|
},
|
|
176
182
|
rangeX: {
|
|
177
183
|
range: {
|
|
178
|
-
fill:
|
|
184
|
+
fill: COLORS.STROKE,
|
|
179
185
|
fillOpacity: 0.15,
|
|
180
186
|
lineWidth: 0,
|
|
181
187
|
},
|
|
182
188
|
},
|
|
183
189
|
rangeY: {
|
|
184
190
|
range: {
|
|
185
|
-
fill:
|
|
191
|
+
fill: COLORS.STROKE,
|
|
186
192
|
fillOpacity: 0.15,
|
|
187
193
|
lineWidth: 0,
|
|
188
194
|
},
|
|
189
195
|
},
|
|
190
196
|
connector: {
|
|
191
197
|
connector: {
|
|
192
|
-
stroke:
|
|
198
|
+
stroke: COLORS.STROKE,
|
|
193
199
|
strokeOpacity: 0.45,
|
|
194
200
|
lineWidth: 1,
|
|
195
201
|
connectLength1: 12,
|
|
196
202
|
endMarker: true,
|
|
197
203
|
endMarkerSize: 6,
|
|
198
|
-
endMarkerFill:
|
|
204
|
+
endMarkerFill: COLORS.STROKE,
|
|
199
205
|
endMarkerFillOpacity: 0.95,
|
|
200
206
|
},
|
|
201
207
|
},
|
|
@@ -205,7 +211,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
205
211
|
line: { lineWidth: 3 },
|
|
206
212
|
},
|
|
207
213
|
interval: {
|
|
208
|
-
rect: { stroke:
|
|
214
|
+
rect: { stroke: COLORS.BLACK },
|
|
209
215
|
},
|
|
210
216
|
area: {
|
|
211
217
|
area: { fillOpacity: 0.5 },
|
|
@@ -221,93 +227,96 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
221
227
|
},
|
|
222
228
|
axis: {
|
|
223
229
|
// axis title
|
|
224
|
-
titleFill:
|
|
225
|
-
titleFillOpacity:
|
|
230
|
+
titleFill: COLORS.BLACK,
|
|
231
|
+
titleFillOpacity: 0.65,
|
|
226
232
|
titleFontSize: 12,
|
|
227
233
|
titleFontWeight: 'normal',
|
|
228
234
|
titleSpacing: 12,
|
|
229
235
|
// axis line
|
|
230
|
-
lineStroke:
|
|
236
|
+
lineStroke: COLORS.BLACK,
|
|
231
237
|
lineStrokeOpacity: 0.45,
|
|
232
238
|
lineLineWidth: 0.5,
|
|
233
|
-
// axis
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
239
|
+
// axis tick line
|
|
240
|
+
tickStroke: COLORS.BLACK,
|
|
241
|
+
tickStrokeOpacity: 0.25,
|
|
242
|
+
tickLineWidth: 1,
|
|
243
|
+
tickLength: 4,
|
|
237
244
|
// axis label
|
|
238
|
-
labelFill:
|
|
239
|
-
labelFillOpacity:
|
|
245
|
+
labelFill: COLORS.BLACK,
|
|
246
|
+
labelFillOpacity: 0.65,
|
|
240
247
|
labelFontSize: 12,
|
|
241
248
|
labelFontWeight: 'lighter',
|
|
242
249
|
labelSpacing: 8, // spacing between label and it's tick
|
|
243
250
|
// axis grid
|
|
244
|
-
gridStroke:
|
|
245
|
-
gridStrokeOpacity:
|
|
251
|
+
gridStroke: COLORS.BLACK,
|
|
252
|
+
gridStrokeOpacity: 0.05,
|
|
246
253
|
gridLineWidth: 0.5,
|
|
247
254
|
gridLineDash: [0, 0],
|
|
248
255
|
},
|
|
249
256
|
legend: {
|
|
250
257
|
padding: 8,
|
|
251
|
-
// legend title
|
|
252
258
|
showTitle: false,
|
|
253
|
-
titleFill:
|
|
259
|
+
titleFill: COLORS.BLACK,
|
|
260
|
+
titleFillOpacity: 0.45,
|
|
254
261
|
titleFontSize: 12,
|
|
255
|
-
titleLineHeight: 21,
|
|
256
262
|
titleFontWeight: 'normal',
|
|
257
263
|
titleSpacing: 4,
|
|
258
264
|
// legend marker
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
itemLabelFill:
|
|
264
|
-
itemLabelFillOpacity:
|
|
265
|
+
itemMarkerFill: DEFAULT_COLOR,
|
|
266
|
+
itemMarkerFillOpacity: 1,
|
|
267
|
+
itemMarkerSize: 8,
|
|
268
|
+
itemSpacing: [5, 8],
|
|
269
|
+
itemLabelFill: COLORS.BLACK,
|
|
270
|
+
itemLabelFillOpacity: 0.65,
|
|
265
271
|
itemLabelFontSize: 12,
|
|
266
272
|
itemLabelFontWeight: 'normal',
|
|
267
|
-
itemValueFill:
|
|
268
|
-
itemValueFillOpacity: 0.
|
|
273
|
+
itemValueFill: COLORS.BLACK,
|
|
274
|
+
itemValueFillOpacity: 0.65,
|
|
269
275
|
itemValueFontSize: 12,
|
|
270
276
|
itemValueFontWeight: 'normal',
|
|
271
277
|
itemBackgroundFill: 'transparent',
|
|
272
278
|
// [todo] rename legend navigator
|
|
273
|
-
navButtonFill:
|
|
274
|
-
navButtonFillOpacity:
|
|
275
|
-
navPageNumFill:
|
|
279
|
+
navButtonFill: COLORS.BLACK,
|
|
280
|
+
navButtonFillOpacity: 0.45,
|
|
281
|
+
navPageNumFill: COLORS.BLACK,
|
|
282
|
+
navPageNumFillOpacity: 0.45,
|
|
276
283
|
navPageNumFontSize: 12,
|
|
277
284
|
// others
|
|
278
285
|
backgroundFill: 'transparent',
|
|
279
286
|
},
|
|
280
287
|
continuousLegend: {
|
|
281
|
-
labelFill:
|
|
288
|
+
labelFill: COLORS.BLACK,
|
|
289
|
+
labelFillOpacity: 0.45,
|
|
282
290
|
labelFontSize: 12,
|
|
283
|
-
labelLineHeight: 12,
|
|
284
291
|
labelFontWeight: 'normal',
|
|
285
292
|
handleWidth: 10,
|
|
286
293
|
handleHeight: 12,
|
|
287
|
-
handleMarkerFill:
|
|
288
|
-
|
|
294
|
+
handleMarkerFill: COLORS.BLACK,
|
|
295
|
+
handleMarkerFillOpacity: 0.6,
|
|
296
|
+
handleMarkerStroke: COLORS.BLACK,
|
|
297
|
+
handleMarkerStrokeOpacity: 0.25,
|
|
289
298
|
handleMarkerLineWidth: 1,
|
|
290
|
-
handleLabelFill:
|
|
299
|
+
handleLabelFill: COLORS.BLACK,
|
|
300
|
+
handleLabelFillOpacity: 0.45,
|
|
291
301
|
handleLabelFontSize: 12,
|
|
292
|
-
handleLabelLineHeight: 12,
|
|
293
302
|
handleLabelFontWeight: 'normal',
|
|
294
303
|
// [todo] legend rail
|
|
295
304
|
},
|
|
296
305
|
label: {
|
|
297
|
-
fill:
|
|
306
|
+
fill: COLORS.BLACK,
|
|
298
307
|
fillOpacity: 0.65,
|
|
299
308
|
fontSize: 12,
|
|
300
309
|
fontWeight: 'normal',
|
|
301
310
|
stroke: null,
|
|
302
311
|
offset: 12,
|
|
303
|
-
connectorStroke:
|
|
312
|
+
connectorStroke: COLORS.BLACK,
|
|
304
313
|
connectorStrokeOpacity: 0.45,
|
|
305
314
|
connectorLineWidth: 1,
|
|
306
315
|
connectorLength2: 8,
|
|
307
316
|
connectorDistance: 4,
|
|
308
317
|
},
|
|
309
318
|
innerLabel: {
|
|
310
|
-
fill:
|
|
319
|
+
fill: COLORS.WHITE,
|
|
311
320
|
fontSize: 12,
|
|
312
321
|
fillOpacity: 0.85,
|
|
313
322
|
fontWeight: 'normal',
|
|
@@ -316,7 +325,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
316
325
|
},
|
|
317
326
|
slider: {
|
|
318
327
|
railHeight: 16,
|
|
319
|
-
railFill:
|
|
328
|
+
railFill: COLORS.STROKE,
|
|
320
329
|
railFillOpacity: 0.05,
|
|
321
330
|
railForegroundFill: DEFAULT_COLOR,
|
|
322
331
|
railForegroundFillOpacity: 0.15,
|
|
@@ -324,26 +333,26 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
324
333
|
handleWidth: 10,
|
|
325
334
|
handleFill: '#f7f7f7',
|
|
326
335
|
handleFillOpacity: 1,
|
|
327
|
-
handleStroke:
|
|
328
|
-
handleStrokeOpacity:
|
|
336
|
+
handleStroke: COLORS.BLACK,
|
|
337
|
+
handleStrokeOpacity: 0.25,
|
|
329
338
|
handleLineWidth: 1,
|
|
330
339
|
handleRadius: 2,
|
|
331
|
-
textFill:
|
|
340
|
+
textFill: COLORS.BLACK,
|
|
332
341
|
textFillOpacity: 0.45,
|
|
333
342
|
textFontSize: 12,
|
|
334
343
|
textFontWeight: 'normal',
|
|
335
344
|
},
|
|
336
345
|
scrollbar: {},
|
|
337
346
|
title: {
|
|
338
|
-
fill:
|
|
339
|
-
fillOpacity:
|
|
347
|
+
fill: COLORS.BLACK,
|
|
348
|
+
fillOpacity: 0.85,
|
|
340
349
|
fontSize: 24,
|
|
341
350
|
fontWeight: 'bold',
|
|
342
351
|
textBaseline: 'top',
|
|
343
352
|
},
|
|
344
353
|
subtitle: {
|
|
345
|
-
fill:
|
|
346
|
-
fillOpacity:
|
|
354
|
+
fill: COLORS.BLACK,
|
|
355
|
+
fillOpacity: 0.65,
|
|
347
356
|
fontSize: 10,
|
|
348
357
|
fontWeight: 'normal',
|
|
349
358
|
textBaseline: 'top',
|
package/src/transform/groupN.ts
CHANGED
|
@@ -94,6 +94,8 @@ export const GroupN: TC<GroupNOptions> = (options = {}) => {
|
|
|
94
94
|
return (I, mark) => {
|
|
95
95
|
const { data, encode } = mark;
|
|
96
96
|
const groups = groupBy(I, mark);
|
|
97
|
+
if (!groups) return [I, mark];
|
|
98
|
+
|
|
97
99
|
const outputs = Object.entries(rest).map(([channel, reducer]) => {
|
|
98
100
|
const [reducerFunction, formatter] = normalizeReducer(reducer);
|
|
99
101
|
const [V, field] = columnOf(encode, channel);
|
package/src/transform/index.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { Jitter } from './jitter';
|
|
|
24
24
|
export { JitterX } from './jitterX';
|
|
25
25
|
export { SymmetryY } from './symmetryY';
|
|
26
26
|
export { DiffY } from './diffY';
|
|
27
|
-
export { Select } from './
|
|
28
|
-
export { SelectX } from './
|
|
29
|
-
export { SelectY } from './
|
|
27
|
+
export { Select } from './select';
|
|
28
|
+
export { SelectX } from './selectX';
|
|
29
|
+
export { SelectY } from './selectY';
|
|
30
30
|
export { GroupX } from './groupX';
|
|
31
31
|
export { GroupY } from './groupY';
|
|
32
32
|
export { Group } from './group';
|
|
@@ -38,6 +38,7 @@ export { FlexX } from './flexX';
|
|
|
38
38
|
export { Pack } from './pack';
|
|
39
39
|
export { BinX } from './binX';
|
|
40
40
|
export { Bin } from './bin';
|
|
41
|
+
export { Sample } from './sample';
|
|
41
42
|
|
|
42
43
|
export type { MaybeZeroY1Options } from './maybeZeroY1';
|
|
43
44
|
export type { MaybeStackYOptions } from './maybeStackY';
|
|
@@ -65,9 +66,9 @@ export type { JitterOptions } from './jitter';
|
|
|
65
66
|
export type { JitterXOptions } from './jitterX';
|
|
66
67
|
export type { SymmetryYOptions } from './symmetryY';
|
|
67
68
|
export type { DiffYOptions } from './diffY';
|
|
68
|
-
export type { SelectOptions } from './
|
|
69
|
-
export type { SelectXOptions } from './
|
|
70
|
-
export type { SelectYOptions } from './
|
|
69
|
+
export type { SelectOptions } from './select';
|
|
70
|
+
export type { SelectXOptions } from './selectX';
|
|
71
|
+
export type { SelectYOptions } from './selectY';
|
|
71
72
|
export type { GroupXOptions } from './groupX';
|
|
72
73
|
export type { GroupYOptions } from './groupY';
|
|
73
74
|
export type { GroupOptions } from './group';
|
|
@@ -79,3 +80,4 @@ export type { FlexXOptions } from './flexX';
|
|
|
79
80
|
export type { PackOptions } from './pack';
|
|
80
81
|
export type { BinXOptions } from './binX';
|
|
81
82
|
export type { BinOptions } from './bin';
|
|
83
|
+
export type { SampleOptions } from './sample';
|