@antv/g2 5.1.3 → 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.
Files changed (142) hide show
  1. package/dist/g2-lite.min.js +1 -1
  2. package/dist/g2.min.js +1 -1
  3. package/esm/api/chart.d.ts +1 -0
  4. package/esm/api/library.d.ts +1 -0
  5. package/esm/api/runtime.js +3 -2
  6. package/esm/api/runtime.js.map +1 -1
  7. package/esm/api/utils.d.ts +2 -0
  8. package/esm/api/utils.js +31 -8
  9. package/esm/api/utils.js.map +1 -1
  10. package/esm/composition/repeatMatrix.js +4 -1
  11. package/esm/composition/repeatMatrix.js.map +1 -1
  12. package/esm/interaction/fisheye.js +3 -1
  13. package/esm/interaction/fisheye.js.map +1 -1
  14. package/esm/interaction/legendFilter.d.ts +1 -1
  15. package/esm/interaction/legendFilter.js +72 -31
  16. package/esm/interaction/legendFilter.js.map +1 -1
  17. package/esm/interaction/tooltip.d.ts +2 -2
  18. package/esm/interaction/tooltip.js +82 -40
  19. package/esm/interaction/tooltip.js.map +1 -1
  20. package/esm/lib/core.d.ts +1 -0
  21. package/esm/lib/core.js +2 -1
  22. package/esm/lib/core.js.map +1 -1
  23. package/esm/lib/std.d.ts +1 -0
  24. package/esm/lib/threed.d.ts +1 -0
  25. package/esm/lib/threed.js +2 -1
  26. package/esm/lib/threed.js.map +1 -1
  27. package/esm/mark/index.d.ts +1 -0
  28. package/esm/mark/index.js +1 -0
  29. package/esm/mark/index.js.map +1 -1
  30. package/esm/mark/interval3D.d.ts +8 -0
  31. package/esm/mark/interval3D.js +65 -0
  32. package/esm/mark/interval3D.js.map +1 -0
  33. package/esm/runtime/plot.js +11 -4
  34. package/esm/runtime/plot.js.map +1 -1
  35. package/esm/shape/connector/connector.js +1 -1
  36. package/esm/shape/connector/connector.js.map +1 -1
  37. package/esm/shape/index.d.ts +2 -1
  38. package/esm/shape/index.js +1 -0
  39. package/esm/shape/index.js.map +1 -1
  40. package/esm/shape/interval3D/cube.d.ts +6 -0
  41. package/esm/shape/interval3D/cube.js +71 -0
  42. package/esm/shape/interval3D/cube.js.map +1 -0
  43. package/esm/spec/interaction.d.ts +1 -0
  44. package/esm/theme/academy.js +30 -358
  45. package/esm/theme/academy.js.map +1 -1
  46. package/esm/theme/classic.js +4 -433
  47. package/esm/theme/classic.js.map +1 -1
  48. package/esm/theme/classicDark.js +3 -404
  49. package/esm/theme/classicDark.js.map +1 -1
  50. package/esm/theme/create.d.ts +437 -0
  51. package/esm/theme/create.js +421 -0
  52. package/esm/theme/create.js.map +1 -0
  53. package/esm/theme/dark.d.ts +3 -0
  54. package/esm/theme/dark.js +76 -0
  55. package/esm/theme/dark.js.map +1 -0
  56. package/esm/theme/index.d.ts +1 -0
  57. package/esm/theme/index.js +1 -0
  58. package/esm/theme/index.js.map +1 -1
  59. package/esm/theme/light.js +52 -470
  60. package/esm/theme/light.js.map +1 -1
  61. package/lib/api/chart.d.ts +1 -0
  62. package/lib/api/library.d.ts +1 -0
  63. package/lib/api/runtime.js +2 -1
  64. package/lib/api/runtime.js.map +1 -1
  65. package/lib/api/utils.d.ts +2 -0
  66. package/lib/api/utils.js +32 -9
  67. package/lib/api/utils.js.map +1 -1
  68. package/lib/composition/repeatMatrix.js +4 -1
  69. package/lib/composition/repeatMatrix.js.map +1 -1
  70. package/lib/interaction/fisheye.js +3 -1
  71. package/lib/interaction/fisheye.js.map +1 -1
  72. package/lib/interaction/legendFilter.d.ts +1 -1
  73. package/lib/interaction/legendFilter.js +72 -31
  74. package/lib/interaction/legendFilter.js.map +1 -1
  75. package/lib/interaction/tooltip.d.ts +2 -2
  76. package/lib/interaction/tooltip.js +82 -40
  77. package/lib/interaction/tooltip.js.map +1 -1
  78. package/lib/lib/core.d.ts +1 -0
  79. package/lib/lib/core.js +1 -0
  80. package/lib/lib/core.js.map +1 -1
  81. package/lib/lib/std.d.ts +1 -0
  82. package/lib/lib/threed.d.ts +1 -0
  83. package/lib/lib/threed.js +1 -0
  84. package/lib/lib/threed.js.map +1 -1
  85. package/lib/mark/index.d.ts +1 -0
  86. package/lib/mark/index.js +3 -1
  87. package/lib/mark/index.js.map +1 -1
  88. package/lib/mark/interval3D.d.ts +8 -0
  89. package/lib/mark/interval3D.js +69 -0
  90. package/lib/mark/interval3D.js.map +1 -0
  91. package/lib/runtime/plot.js +11 -4
  92. package/lib/runtime/plot.js.map +1 -1
  93. package/lib/shape/connector/connector.js +1 -1
  94. package/lib/shape/connector/connector.js.map +1 -1
  95. package/lib/shape/index.d.ts +2 -1
  96. package/lib/shape/index.js +4 -2
  97. package/lib/shape/index.js.map +1 -1
  98. package/lib/shape/interval3D/cube.d.ts +6 -0
  99. package/lib/shape/interval3D/cube.js +75 -0
  100. package/lib/shape/interval3D/cube.js.map +1 -0
  101. package/lib/spec/interaction.d.ts +1 -0
  102. package/lib/theme/academy.js +30 -358
  103. package/lib/theme/academy.js.map +1 -1
  104. package/lib/theme/classic.js +4 -433
  105. package/lib/theme/classic.js.map +1 -1
  106. package/lib/theme/classicDark.js +3 -404
  107. package/lib/theme/classicDark.js.map +1 -1
  108. package/lib/theme/create.d.ts +437 -0
  109. package/lib/theme/create.js +425 -0
  110. package/lib/theme/create.js.map +1 -0
  111. package/lib/theme/dark.d.ts +3 -0
  112. package/lib/theme/dark.js +80 -0
  113. package/lib/theme/dark.js.map +1 -0
  114. package/lib/theme/index.d.ts +1 -0
  115. package/lib/theme/index.js +3 -1
  116. package/lib/theme/index.js.map +1 -1
  117. package/lib/theme/light.js +52 -470
  118. package/lib/theme/light.js.map +1 -1
  119. package/package.json +1 -1
  120. package/src/api/runtime.ts +2 -1
  121. package/src/api/utils.ts +29 -7
  122. package/src/composition/repeatMatrix.ts +11 -2
  123. package/src/interaction/fisheye.ts +3 -1
  124. package/src/interaction/legendFilter.ts +81 -48
  125. package/src/interaction/tooltip.ts +105 -49
  126. package/src/lib/core.ts +2 -1
  127. package/src/lib/threed.ts +2 -1
  128. package/src/mark/index.ts +1 -0
  129. package/src/mark/interval3D.ts +100 -0
  130. package/src/runtime/plot.ts +34 -7
  131. package/src/shape/connector/connector.ts +1 -1
  132. package/src/shape/index.ts +2 -1
  133. package/src/shape/interval3D/cube.ts +69 -0
  134. package/src/spec/interaction.ts +1 -0
  135. package/src/theme/academy.ts +74 -399
  136. package/src/theme/classic.ts +11 -438
  137. package/src/theme/classicDark.ts +10 -409
  138. package/src/theme/create.ts +439 -0
  139. package/src/theme/dark.ts +85 -0
  140. package/src/theme/index.ts +1 -0
  141. package/src/theme/light.ts +53 -473
  142. package/CHANGELOG.md +0 -385
@@ -1,449 +1,22 @@
1
+ import { deepMix } from '@antv/util';
1
2
  import { ThemeComponent as TC, Theme } from '../runtime';
3
+ import { Light } from './light';
2
4
 
3
5
  export type ClassicOptions = Theme;
4
6
 
5
- const COLORS = {
6
- BLACK: '#1D2129',
7
- WHITE: '#fff',
8
- STROKE: '#416180',
9
- DEFAULT: '#5B8FF9',
10
- BACKGROUND: 'transparent',
11
- };
12
-
13
- const PADDING = {
14
- 1: 8,
15
- 2: 12,
16
- 3: 20,
17
- };
18
-
19
- const ALPHA = {
20
- 90: 0.9,
21
- 65: 0.65,
22
- 45: 0.45,
23
- 25: 0.25,
24
- 10: 0.1,
25
- };
26
-
27
7
  /**
28
8
  * Default theme.
29
9
  */
30
10
  export const Classic: TC<ClassicOptions> = (options) => {
31
- const defaultOptions: Theme = {
32
- padding: 'auto',
33
- margin: 16,
34
- color: COLORS.DEFAULT,
35
- size: 1,
36
- category10: 'category10',
37
- category20: 'category20',
38
- enter: {
39
- duration: 300,
40
- fill: 'both',
41
- delay: 0,
42
- },
43
- update: {
44
- duration: 300,
45
- fill: 'both',
46
- delay: 0,
47
- },
48
- exit: {
49
- duration: 300,
50
- fill: 'both',
51
- delay: 0,
52
- },
53
- view: {
54
- viewFill: COLORS.BACKGROUND,
55
- plotFill: 'transparent',
56
- mainFill: 'transparent',
57
- contentFill: 'transparent',
58
- },
59
- line: {
60
- line: {
61
- fill: '',
62
- strokeOpacity: 1,
63
- lineWidth: 1,
64
- },
65
- },
66
- point: {
67
- point: {
68
- r: 3,
69
- fillOpacity: 0.95,
70
- lineWidth: 0,
71
- },
72
- hollow: {
73
- r: 3,
74
- strokeOpacity: 0.95,
75
- lineWidth: 1,
76
- },
77
- plus: {
78
- r: 3,
79
- strokeOpacity: 0.95,
80
- lineWidth: 3,
81
- },
82
- diamond: {
83
- r: 3,
84
- strokeOpacity: 0.95,
85
- lineWidth: 1,
86
- },
87
- },
88
- interval: {
89
- rect: {
90
- fillOpacity: 0.95,
91
- },
92
- hollow: {
93
- fill: '',
94
- strokeOpacity: 1,
95
- lineWidth: 2,
96
- },
97
- },
98
- area: {
99
- area: {
100
- fillOpacity: 0.85,
101
- lineWidth: 0,
102
- },
103
- },
104
- polygon: {
105
- polygon: {
106
- fillOpacity: 0.95,
107
- },
108
- },
109
- cell: {
110
- cell: {
111
- fillOpacity: 0.95,
112
- },
113
- hollow: {
114
- fill: '',
115
- strokeOpacity: 1,
116
- lineWidth: 2,
117
- },
118
- },
119
- rect: {
120
- rect: {
121
- fillOpacity: 0.95,
122
- },
123
- hollow: {
124
- fill: '',
125
- strokeOpacity: 1,
126
- lineWidth: 2,
127
- },
128
- },
129
- link: {
130
- link: {
131
- fill: '',
132
- strokeOpacity: 1,
133
- },
134
- },
135
- vector: {
136
- vector: {
137
- fillOpacity: 1,
138
- },
139
- },
140
- box: {
141
- box: {
142
- fillOpacity: 0.95,
143
- stroke: COLORS.BLACK,
144
- lineWidth: 1,
145
- },
146
- },
147
- text: {
148
- text: {
149
- fill: '#1D2129',
150
- fontSize: 12,
151
- strokeWidth: 0,
152
- connectorStroke: COLORS.STROKE,
153
- connectorStrokeOpacity: 0.45,
154
- connectorLineWidth: 1,
155
- backgroundFill: COLORS.STROKE,
156
- backgroundFillOpacity: 0.15,
157
- backgroundPadding: [2, 4],
158
- startMarkerSymbol: 'circle',
159
- startMarkerSize: 4,
160
- endMarkerSymbol: 'circle',
161
- endMarkerSize: 4,
162
- },
163
- badge: {
164
- fill: '#1D2129',
165
- fillOpacity: 0.65,
166
- strokeWidth: 0,
167
- fontSize: 10,
168
- textAlign: 'center',
169
- textBaseline: 'middle',
170
- markerFill: COLORS.STROKE,
171
- markerFillOpacity: 0.25,
172
- markerStrokeOpacity: 0,
173
- },
174
- },
175
- lineX: {
176
- line: {
177
- stroke: COLORS.STROKE,
178
- strokeOpacity: 0.45,
179
- lineWidth: 1,
180
- },
181
- },
182
- lineY: {
183
- line: {
184
- stroke: COLORS.STROKE,
185
- strokeOpacity: 0.45,
186
- lineWidth: 1,
187
- },
188
- },
189
- rangeX: {
190
- range: {
191
- fill: COLORS.STROKE,
192
- fillOpacity: 0.15,
193
- lineWidth: 0,
194
- },
195
- },
196
- rangeY: {
197
- range: {
198
- fill: COLORS.STROKE,
199
- fillOpacity: 0.15,
200
- lineWidth: 0,
201
- },
202
- },
203
- connector: {
204
- connector: {
205
- stroke: COLORS.STROKE,
206
- strokeOpacity: 0.45,
207
- lineWidth: 1,
208
- connectLength1: 12,
209
- endMarker: true,
210
- endMarkerSize: 6,
211
- endMarkerFill: COLORS.STROKE,
212
- endMarkerFillOpacity: 0.95,
213
- },
214
- },
215
- axis: {
216
- arrow: false,
217
- gridLineDash: [3, 4],
218
- gridLineWidth: 0.5,
219
- gridStroke: COLORS.BLACK,
220
- gridStrokeOpacity: ALPHA[10],
221
- labelAlign: 'horizontal',
222
- labelFill: COLORS.BLACK,
223
- labelOpacity: ALPHA[45],
224
- labelFontSize: 12,
225
- labelFontWeight: 'normal',
226
- labelSpacing: PADDING[1], // spacing between label and it's tick
227
- line: false,
228
- lineLineWidth: 0.5,
229
- lineStroke: COLORS.BLACK,
230
- lineStrokeOpacity: ALPHA[45],
231
- tickLength: 4,
232
- tickLineWidth: 1,
233
- tickStroke: COLORS.BLACK,
234
- tickOpacity: ALPHA[45],
235
- titleFill: COLORS.BLACK,
236
- titleOpacity: ALPHA[90],
237
- titleFontSize: 12,
238
- titleFontWeight: 'normal',
239
- titleSpacing: 12,
240
- titleTransformOrigin: 'center',
241
- lineArrowOffset: 6,
242
- lineArrowSize: 6,
243
- },
244
- axisTop: {
245
- gridDirection: 'positive',
246
- labelDirection: 'negative',
247
- tickDirection: 'negative',
248
- titlePosition: 'top',
249
- titleSpacing: 12,
250
- titleTextBaseline: 'middle',
251
- },
252
- axisBottom: {
253
- gridDirection: 'negative',
254
- labelDirection: 'positive',
255
- labelAutoRotate: true,
256
- tickDirection: 'positive',
257
- titlePosition: 'bottom',
258
- titleSpacing: 12,
259
- titleTextBaseline: 'bottom',
260
- },
261
- axisLeft: {
262
- gridDirection: 'positive',
263
- labelAutoRotate: false,
264
- labelDirection: 'negative',
265
- labelSpacing: 4,
266
- tickDirection: 'negative',
267
- titlePosition: 'left',
268
- titleSpacing: 12,
269
- titleTextBaseline: 'middle',
270
- titleDirection: 'vertical',
271
- titleTransformOrigin: 'center',
272
- },
273
- axisRight: {
274
- gridDirection: 'negative',
275
- labelDirection: 'positive',
276
- labelSpacing: 4,
277
- tickDirection: 'positive',
278
- titlePosition: 'right',
279
- labelAutoRotate: false,
280
- titleSpacing: 12,
281
- titleTextBaseline: 'top',
282
- titleDirection: 'vertical',
283
- titleTransformOrigin: 'center',
284
- },
285
- axisLinear: {
286
- girdClosed: true,
287
- gridConnect: 'arc',
288
- gridDirection: 'negative',
289
- gridType: 'surround',
290
- titlePosition: 'top',
291
- titleSpacing: 0,
292
- },
293
- axisArc: {
294
- title: false,
295
- titlePosition: 'inner',
296
- line: false,
297
- tick: true,
298
- labelSpacing: 4,
299
- },
300
- axisRadar: {
301
- girdClosed: true,
302
- gridStrokeOpacity: 0.3,
303
- gridType: 'surround',
304
- label: false,
305
- tick: false,
306
- titlePosition: 'start',
307
- },
308
- legendCategory: {
309
- backgroundFill: 'transparent',
310
- itemBackgroundFill: 'transparent',
311
- itemLabelFill: COLORS.BLACK,
312
- itemLabelFillOpacity: ALPHA[90],
313
- itemLabelFontSize: 12,
314
- itemLabelFontWeight: 'normal',
315
- itemMarkerFillOpacity: 1,
316
- itemMarkerSize: 8,
317
- itemSpacing: [PADDING[1], PADDING[1]],
318
- itemValueFill: COLORS.BLACK,
319
- itemValueFillOpacity: 0.65,
320
- itemValueFontSize: 12,
321
- itemValueFontWeight: 'normal',
322
- navButtonFill: COLORS.BLACK,
323
- navButtonFillOpacity: 0.65,
324
- navPageNumFill: COLORS.BLACK,
325
- navPageNumFillOpacity: 0.45,
326
- navPageNumFontSize: 12,
327
- padding: 8,
328
- title: false,
329
- titleFill: COLORS.BLACK,
330
- titleFillOpacity: 0.65,
331
- titleFontSize: 12,
332
- titleFontWeight: 'normal',
333
- titleSpacing: 4,
334
- tickStroke: COLORS.BLACK,
335
- tickStrokeOpacity: 0.25,
336
- rowPadding: PADDING[1],
337
- colPadding: PADDING[2],
338
- maxRows: 3,
339
- maxCols: 3,
340
- },
341
- legendContinuous: {
342
- handleHeight: 12,
343
- handleLabelFill: COLORS.BLACK,
344
- handleLabelFillOpacity: ALPHA[45],
345
- handleLabelFontSize: 12,
346
- handleLabelFontWeight: 'normal',
347
- handleMarkerFill: COLORS.BLACK,
348
- handleMarkerFillOpacity: 0.6,
349
- handleMarkerLineWidth: 1,
350
- handleMarkerStroke: COLORS.BLACK,
351
- handleMarkerStrokeOpacity: 0.25,
352
- handleWidth: 10,
353
- labelFill: COLORS.BLACK,
354
- labelFillOpacity: ALPHA[45],
355
- labelFontSize: 12,
356
- labelFontWeight: 'normal',
357
- labelSpacing: 3,
358
- tick: true,
359
- tickLength: 12,
360
- ribbonSize: 12,
361
- ribbonFill: '#aaa',
362
- handle: true,
363
- handleLabel: false,
364
- handleShape: 'slider',
365
- handleIconSize: 12 / 1.8,
366
- indicator: false,
367
- titleFontSize: 12,
368
- titleSpacing: 4,
369
- titleFontWeight: 'normal',
370
- titleFillOpacity: ALPHA[90],
371
- tickStroke: COLORS.BLACK,
372
- tickStrokeOpacity: ALPHA[45],
373
- },
374
- label: {
375
- fill: COLORS.BLACK,
376
- fillOpacity: 0.65,
377
- fontSize: 12,
378
- fontWeight: 'normal',
379
- stroke: undefined,
380
- offset: 12,
381
- connectorStroke: COLORS.BLACK,
382
- connectorStrokeOpacity: 0.45,
383
- connectorLineWidth: 1,
384
- connectorLength: 12,
385
- connectorLength2: 8,
386
- connectorDistance: 4,
387
- },
388
- innerLabel: {
389
- fill: COLORS.WHITE,
390
- fontSize: 12,
391
- fillOpacity: 0.85,
392
- fontWeight: 'normal',
393
- stroke: undefined,
394
- offset: 0,
395
- },
396
- htmlLabel: {
397
- fontSize: 12,
398
- opacity: 0.65,
399
- color: COLORS.BLACK,
400
- fontWeight: 'normal',
401
- },
402
- slider: {
403
- trackSize: 16,
404
- trackFill: COLORS.STROKE,
405
- trackFillOpacity: 1,
406
- selectionFill: COLORS.DEFAULT,
407
- selectionFillOpacity: 0.15,
408
- handleIconSize: 10,
409
- handleIconFill: '#f7f7f7',
410
- handleIconFillOpacity: 1,
411
- handleIconStroke: COLORS.BLACK,
412
- handleIconStrokeOpacity: 0.25,
413
- handleIconLineWidth: 1,
414
- handleIconRadius: 2,
415
- handleLabelFill: COLORS.BLACK,
416
- handleLabelFillOpacity: 0.45,
417
- handleLabelFontSize: 12,
418
- handleLabelFontWeight: 'normal',
419
- },
420
- scrollbar: {
421
- padding: [0, 0, 0, 0],
422
- trackSize: 6,
423
- isRound: true,
424
- slidable: true,
425
- scrollable: true,
426
- trackFill: '#e5e5e5',
427
- trackFillOpacity: 0,
428
- thumbFill: '#000',
429
- thumbFillOpacity: 0.15,
430
- thumbHighlightedFillOpacity: 0.2,
431
- },
432
- title: {
433
- spacing: 8,
434
- titleFill: COLORS.BLACK,
435
- titleFillOpacity: ALPHA[90],
436
- titleFontSize: 16,
437
- titleFontWeight: 'bold',
438
- titleTextBaseline: 'top',
439
- subtitleFill: COLORS.BLACK,
440
- subtitleFillOpacity: ALPHA[65],
441
- subtitleFontSize: 12,
442
- subtitleFontWeight: 'normal',
443
- subtitleTextBaseline: 'top',
444
- },
445
- };
446
- return Object.assign({}, defaultOptions, options);
11
+ return deepMix(
12
+ {},
13
+ Light(),
14
+ {
15
+ category10: 'category10',
16
+ category20: 'category20',
17
+ },
18
+ options,
19
+ );
447
20
  };
448
21
 
449
22
  Classic.props = {};