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