@antv/gpt-vis 1.0.2 → 1.3.1

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 (172) hide show
  1. package/README.md +53 -7
  2. package/README.zh-CN.md +32 -9
  3. package/dist/cjs/index.d.ts +1 -1
  4. package/dist/cjs/theme/g2.d.ts +9 -0
  5. package/dist/cjs/theme/g2.js +605 -0
  6. package/dist/cjs/theme/g6.d.ts +28 -0
  7. package/dist/cjs/theme/g6.js +124 -0
  8. package/dist/cjs/theme/merge.d.ts +2 -0
  9. package/dist/cjs/theme/merge.js +49 -0
  10. package/dist/cjs/theme/presets.d.ts +5 -0
  11. package/dist/cjs/theme/presets.js +663 -0
  12. package/dist/cjs/theme/resolve.d.ts +7 -0
  13. package/dist/cjs/theme/resolve.js +59 -0
  14. package/dist/cjs/theme/shared.d.ts +7 -0
  15. package/dist/cjs/theme/shared.js +61 -0
  16. package/dist/cjs/theme/summary.d.ts +11 -0
  17. package/dist/cjs/theme/summary.js +61 -0
  18. package/dist/cjs/theme/table.d.ts +13 -0
  19. package/dist/cjs/theme/table.js +121 -0
  20. package/dist/cjs/types/index.d.ts +8 -5
  21. package/dist/cjs/types/theme.d.ts +109 -0
  22. package/dist/cjs/types/theme.js +17 -0
  23. package/dist/cjs/util/animation.js +6 -1
  24. package/dist/cjs/util/components.d.ts +20 -0
  25. package/dist/cjs/util/components.js +40 -0
  26. package/dist/cjs/util/crosshair-axis-labels.d.ts +1 -2
  27. package/dist/cjs/util/crosshair-axis-labels.js +17 -0
  28. package/dist/cjs/util/index.d.ts +0 -2
  29. package/dist/cjs/util/index.js +1 -5
  30. package/dist/cjs/util/interaction.d.ts +4 -3
  31. package/dist/cjs/util/interaction.js +14 -1
  32. package/dist/cjs/util/tokens.d.ts +4 -3
  33. package/dist/cjs/util/tokens.js +9 -6
  34. package/dist/cjs/vis/area/index.d.ts +3 -6
  35. package/dist/cjs/vis/area/index.js +43 -30
  36. package/dist/cjs/vis/bar/index.d.ts +5 -5
  37. package/dist/cjs/vis/bar/index.js +34 -20
  38. package/dist/cjs/vis/boxplot/index.d.ts +4 -5
  39. package/dist/cjs/vis/boxplot/index.js +36 -23
  40. package/dist/cjs/vis/column/index.d.ts +5 -5
  41. package/dist/cjs/vis/column/index.js +38 -26
  42. package/dist/cjs/vis/dual-axes/index.d.ts +3 -4
  43. package/dist/cjs/vis/dual-axes/index.js +70 -52
  44. package/dist/cjs/vis/fishbone-diagram/index.d.ts +4 -10
  45. package/dist/cjs/vis/fishbone-diagram/index.js +43 -28
  46. package/dist/cjs/vis/flow-diagram/index.d.ts +4 -6
  47. package/dist/cjs/vis/flow-diagram/index.js +21 -22
  48. package/dist/cjs/vis/funnel/index.d.ts +3 -5
  49. package/dist/cjs/vis/funnel/index.js +63 -42
  50. package/dist/cjs/vis/histogram/index.d.ts +4 -6
  51. package/dist/cjs/vis/histogram/index.js +17 -19
  52. package/dist/cjs/vis/indented-tree/index.d.ts +4 -6
  53. package/dist/cjs/vis/indented-tree/index.js +58 -34
  54. package/dist/cjs/vis/line/index.d.ts +3 -6
  55. package/dist/cjs/vis/line/index.js +43 -22
  56. package/dist/cjs/vis/liquid/index.d.ts +4 -6
  57. package/dist/cjs/vis/liquid/index.js +22 -17
  58. package/dist/cjs/vis/mindmap/index.d.ts +4 -6
  59. package/dist/cjs/vis/mindmap/index.js +43 -25
  60. package/dist/cjs/vis/network-graph/index.d.ts +4 -6
  61. package/dist/cjs/vis/network-graph/index.js +26 -20
  62. package/dist/cjs/vis/organization-chart/index.d.ts +4 -6
  63. package/dist/cjs/vis/organization-chart/index.js +39 -33
  64. package/dist/cjs/vis/pie/index.d.ts +3 -5
  65. package/dist/cjs/vis/pie/index.js +45 -26
  66. package/dist/cjs/vis/radar/index.d.ts +3 -6
  67. package/dist/cjs/vis/radar/index.js +32 -24
  68. package/dist/cjs/vis/sankey/index.d.ts +4 -6
  69. package/dist/cjs/vis/sankey/index.js +17 -7
  70. package/dist/cjs/vis/scatter/index.d.ts +3 -5
  71. package/dist/cjs/vis/scatter/index.js +32 -19
  72. package/dist/cjs/vis/summary/index.js +5 -6
  73. package/dist/cjs/vis/table/index.d.ts +4 -2
  74. package/dist/cjs/vis/table/index.js +46 -4
  75. package/dist/cjs/vis/treemap/index.d.ts +4 -6
  76. package/dist/cjs/vis/treemap/index.js +11 -7
  77. package/dist/cjs/vis/venn/index.d.ts +4 -6
  78. package/dist/cjs/vis/venn/index.js +18 -16
  79. package/dist/cjs/vis/violin/index.d.ts +4 -5
  80. package/dist/cjs/vis/violin/index.js +35 -27
  81. package/dist/cjs/vis/waterfall/index.d.ts +4 -4
  82. package/dist/cjs/vis/waterfall/index.js +48 -39
  83. package/dist/cjs/vis/word-cloud/index.d.ts +3 -5
  84. package/dist/cjs/vis/word-cloud/index.js +18 -12
  85. package/dist/esm/index.d.ts +1 -1
  86. package/dist/esm/theme/g2.d.ts +9 -0
  87. package/dist/esm/theme/g2.js +504 -0
  88. package/dist/esm/theme/g6.d.ts +28 -0
  89. package/dist/esm/theme/g6.js +84 -0
  90. package/dist/esm/theme/merge.d.ts +2 -0
  91. package/dist/esm/theme/merge.js +36 -0
  92. package/dist/esm/theme/presets.d.ts +5 -0
  93. package/dist/esm/theme/presets.js +1070 -0
  94. package/dist/esm/theme/resolve.d.ts +7 -0
  95. package/dist/esm/theme/resolve.js +31 -0
  96. package/dist/esm/theme/shared.d.ts +7 -0
  97. package/dist/esm/theme/shared.js +21 -0
  98. package/dist/esm/theme/summary.d.ts +11 -0
  99. package/dist/esm/theme/summary.js +45 -0
  100. package/dist/esm/theme/table.d.ts +13 -0
  101. package/dist/esm/theme/table.js +112 -0
  102. package/dist/esm/types/index.d.ts +8 -5
  103. package/dist/esm/types/theme.d.ts +109 -0
  104. package/dist/esm/types/theme.js +1 -0
  105. package/dist/esm/util/animation.js +12 -2
  106. package/dist/esm/util/components.d.ts +20 -0
  107. package/dist/esm/util/components.js +57 -1
  108. package/dist/esm/util/crosshair-axis-labels.d.ts +1 -2
  109. package/dist/esm/util/crosshair-axis-labels.js +18 -0
  110. package/dist/esm/util/index.d.ts +0 -2
  111. package/dist/esm/util/index.js +1 -3
  112. package/dist/esm/util/interaction.d.ts +4 -3
  113. package/dist/esm/util/interaction.js +18 -1
  114. package/dist/esm/util/tokens.d.ts +4 -3
  115. package/dist/esm/util/tokens.js +9 -6
  116. package/dist/esm/vis/area/index.d.ts +3 -6
  117. package/dist/esm/vis/area/index.js +53 -45
  118. package/dist/esm/vis/bar/index.d.ts +5 -5
  119. package/dist/esm/vis/bar/index.js +38 -27
  120. package/dist/esm/vis/boxplot/index.d.ts +4 -5
  121. package/dist/esm/vis/boxplot/index.js +47 -29
  122. package/dist/esm/vis/column/index.d.ts +5 -5
  123. package/dist/esm/vis/column/index.js +46 -36
  124. package/dist/esm/vis/dual-axes/index.d.ts +3 -4
  125. package/dist/esm/vis/dual-axes/index.js +68 -58
  126. package/dist/esm/vis/fishbone-diagram/index.d.ts +4 -10
  127. package/dist/esm/vis/fishbone-diagram/index.js +52 -27
  128. package/dist/esm/vis/flow-diagram/index.d.ts +4 -6
  129. package/dist/esm/vis/flow-diagram/index.js +28 -23
  130. package/dist/esm/vis/funnel/index.d.ts +3 -5
  131. package/dist/esm/vis/funnel/index.js +63 -54
  132. package/dist/esm/vis/histogram/index.d.ts +4 -6
  133. package/dist/esm/vis/histogram/index.js +28 -21
  134. package/dist/esm/vis/indented-tree/index.d.ts +4 -6
  135. package/dist/esm/vis/indented-tree/index.js +59 -52
  136. package/dist/esm/vis/line/index.d.ts +3 -6
  137. package/dist/esm/vis/line/index.js +44 -32
  138. package/dist/esm/vis/liquid/index.d.ts +4 -6
  139. package/dist/esm/vis/liquid/index.js +28 -21
  140. package/dist/esm/vis/mindmap/index.d.ts +4 -6
  141. package/dist/esm/vis/mindmap/index.js +32 -28
  142. package/dist/esm/vis/network-graph/index.d.ts +4 -6
  143. package/dist/esm/vis/network-graph/index.js +37 -22
  144. package/dist/esm/vis/organization-chart/index.d.ts +4 -6
  145. package/dist/esm/vis/organization-chart/index.js +47 -36
  146. package/dist/esm/vis/pie/index.d.ts +3 -5
  147. package/dist/esm/vis/pie/index.js +42 -26
  148. package/dist/esm/vis/radar/index.d.ts +3 -6
  149. package/dist/esm/vis/radar/index.js +28 -20
  150. package/dist/esm/vis/sankey/index.d.ts +4 -6
  151. package/dist/esm/vis/sankey/index.js +20 -10
  152. package/dist/esm/vis/scatter/index.d.ts +3 -5
  153. package/dist/esm/vis/scatter/index.js +32 -21
  154. package/dist/esm/vis/summary/index.js +5 -7
  155. package/dist/esm/vis/table/index.d.ts +4 -2
  156. package/dist/esm/vis/table/index.js +41 -4
  157. package/dist/esm/vis/treemap/index.d.ts +4 -6
  158. package/dist/esm/vis/treemap/index.js +16 -11
  159. package/dist/esm/vis/venn/index.d.ts +4 -6
  160. package/dist/esm/vis/venn/index.js +24 -16
  161. package/dist/esm/vis/violin/index.d.ts +4 -5
  162. package/dist/esm/vis/violin/index.js +45 -37
  163. package/dist/esm/vis/waterfall/index.d.ts +4 -4
  164. package/dist/esm/vis/waterfall/index.js +46 -36
  165. package/dist/esm/vis/word-cloud/index.d.ts +3 -5
  166. package/dist/esm/vis/word-cloud/index.js +24 -17
  167. package/dist/umd/index.min.js +1 -1
  168. package/package.json +1 -1
  169. package/dist/cjs/util/theme.d.ts +0 -20
  170. package/dist/cjs/util/theme.js +0 -372
  171. package/dist/esm/util/theme.d.ts +0 -20
  172. package/dist/esm/util/theme.js +0 -326
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/gpt-vis",
3
- "version": "1.0.2",
3
+ "version": "1.3.1",
4
4
  "description": "Components for GPTs, generative AI, and LLM projects. Not only UI Components.",
5
5
  "keywords": [
6
6
  "antv",
@@ -1,20 +0,0 @@
1
- import type { Theme } from '@antv/g2';
2
- import type { VisualizationTheme } from '../types';
3
- export declare const DEFAULT_COLOR_PALETTE: string[];
4
- export declare const ACADEMY_COLOR_PALETTE: string[];
5
- type G2ThemeType = 'light' | 'dark' | 'academy';
6
- type ChartTheme = Theme & {
7
- enter?: {
8
- duration?: number;
9
- easing?: string;
10
- };
11
- elementHighlightByColor?: Record<string, unknown>;
12
- elementHoverScale?: Record<string, unknown>;
13
- };
14
- export declare const THEME_MAP: Record<VisualizationTheme, ChartTheme>;
15
- export declare const getTheme: (theme: VisualizationTheme) => G2ThemeType;
16
- export declare const getThemeObject: (theme: VisualizationTheme) => ChartTheme;
17
- export declare const getThemeColors: (theme: VisualizationTheme) => string[];
18
- export declare const getBackgroundColor: (theme: VisualizationTheme) => string;
19
- export declare const normalizePalette: (palette: string | string[] | undefined, theme: VisualizationTheme) => string[];
20
- export {};
@@ -1,372 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/util/theme.ts
20
- var theme_exports = {};
21
- __export(theme_exports, {
22
- ACADEMY_COLOR_PALETTE: () => ACADEMY_COLOR_PALETTE,
23
- DEFAULT_COLOR_PALETTE: () => DEFAULT_COLOR_PALETTE,
24
- THEME_MAP: () => THEME_MAP,
25
- getBackgroundColor: () => getBackgroundColor,
26
- getTheme: () => getTheme,
27
- getThemeColors: () => getThemeColors,
28
- getThemeObject: () => getThemeObject,
29
- normalizePalette: () => normalizePalette
30
- });
31
- module.exports = __toCommonJS(theme_exports);
32
- var import_tokens = require("./tokens");
33
- var DEFAULT_COLOR_PALETTE = [
34
- "#5B6CFF",
35
- "#2DAF9E",
36
- "#F2B84B",
37
- "#EF6A6A",
38
- "#55A6D9",
39
- "#3AA76D",
40
- "#F58A57",
41
- "#8B6FD6",
42
- "#D96C9B"
43
- ];
44
- var ACADEMY_COLOR_PALETTE = [
45
- "#4e79a7",
46
- "#f28e2c",
47
- "#e15759",
48
- "#76b7b2",
49
- "#59a14f",
50
- "#edc949",
51
- "#af7aa1",
52
- "#ff9da7",
53
- "#9c755f",
54
- "#bab0ab"
55
- ];
56
- var filterBaselineGrid = (_, index) => index !== 0;
57
- var createTheme = (type) => {
58
- const tokens = (0, import_tokens.getChartVisualTokens)(type);
59
- const isDark = type === "dark";
60
- const isAcademy = type === "academy";
61
- const colors = isAcademy ? ACADEMY_COLOR_PALETTE : DEFAULT_COLOR_PALETTE;
62
- return {
63
- type,
64
- color: colors[0],
65
- category10: colors,
66
- category20: colors,
67
- view: {
68
- viewFill: tokens.background,
69
- plotFill: "transparent",
70
- mainFill: "transparent",
71
- contentFill: "transparent"
72
- },
73
- interval: {
74
- rect: {
75
- fillOpacity: 0.96
76
- }
77
- },
78
- line: {
79
- line: {
80
- lineWidth: import_tokens.CHART_STYLE_DEFAULTS.lineWidth
81
- }
82
- },
83
- area: {
84
- area: {
85
- fillOpacity: import_tokens.CHART_STYLE_DEFAULTS.areaOpacity
86
- }
87
- },
88
- point: {
89
- point: {
90
- lineWidth: import_tokens.CHART_STYLE_DEFAULTS.pointLineWidth,
91
- fillOpacity: 0.82
92
- },
93
- hollow: {
94
- lineWidth: 2,
95
- strokeOpacity: 1
96
- }
97
- },
98
- enter: {
99
- duration: import_tokens.CHART_STYLE_DEFAULTS.animationDuration,
100
- easing: "ease-out"
101
- },
102
- axis: {
103
- labelAutoHide: { keepHeader: true, keepTail: true },
104
- titleOpacity: 1,
105
- titleFillOpacity: 1,
106
- labelOpacity: 1,
107
- labelFillOpacity: 1,
108
- line: true,
109
- lineLineWidth: 1,
110
- lineStroke: tokens.axisLine,
111
- lineStrokeOpacity: 1,
112
- tick: true,
113
- tickLineWidth: 1,
114
- tickStroke: tokens.axisTick,
115
- tickStrokeOpacity: 1,
116
- ...isAcademy ? {
117
- titleFill: "#000000",
118
- titleStrokeOpacity: 1,
119
- titleFontSize: 11,
120
- titleFontWeight: "bold",
121
- titleSpacing: 12,
122
- labelFill: "#000000",
123
- labelStrokeOpacity: 1,
124
- labelFontSize: 10,
125
- labelFontWeight: "normal",
126
- labelSpacing: 4,
127
- tickLength: 5
128
- } : {
129
- titleFill: tokens.textSecondary,
130
- titleFontFamily: import_tokens.CHART_FONT_FAMILY,
131
- titleFontSize: 12,
132
- titleFontWeight: 500,
133
- titleLineWidth: 0,
134
- titleSpacing: 16,
135
- labelFill: tokens.textSecondary,
136
- labelFontFamily: import_tokens.CHART_FONT_FAMILY,
137
- labelFontSize: 12,
138
- labelFontWeight: 400,
139
- labelLineWidth: 0,
140
- labelSpacing: 6,
141
- tickLength: 3,
142
- tickOpacity: 1
143
- }
144
- },
145
- axisX: {
146
- grid: isAcademy,
147
- labelAutoRotate: {
148
- optionalAngles: [0, 45, 90],
149
- recoverWhenFailed: true
150
- },
151
- ...isAcademy ? {
152
- gridStroke: tokens.axisGrid,
153
- gridStrokeOpacity: 1,
154
- gridLineWidth: 1,
155
- gridLineDash: [0, 0]
156
- } : {}
157
- },
158
- axisY: {
159
- lineLineWidth: 1,
160
- grid: true,
161
- gridStroke: tokens.axisGrid,
162
- gridStrokeOpacity: 1,
163
- gridLineWidth: isAcademy ? 1 : 0.75,
164
- gridLineDash: isAcademy ? [0, 0] : [3, 3],
165
- gridFilter: filterBaselineGrid
166
- },
167
- axisRadar: {
168
- zIndex: 1,
169
- titleFill: isAcademy ? tokens.textPrimary : tokens.textSecondary,
170
- titleFontFamily: import_tokens.CHART_FONT_FAMILY,
171
- titleFontSize: isAcademy ? 10 : 12,
172
- titleFontWeight: isAcademy ? 600 : 500,
173
- titleSpacing: 10,
174
- labelFill: tokens.textSecondary,
175
- labelOpacity: 1,
176
- labelFontFamily: import_tokens.CHART_FONT_FAMILY,
177
- labelFontSize: isAcademy ? 10 : 11,
178
- line: true,
179
- lineStroke: tokens.axisLine,
180
- lineStrokeOpacity: isAcademy ? 1 : 0.64,
181
- lineLineWidth: isAcademy ? 1 : 0.75,
182
- tick: true,
183
- tickLength: isAcademy ? 4 : 2,
184
- tickStroke: tokens.axisTick,
185
- tickStrokeOpacity: isAcademy ? 1 : 0.68,
186
- tickCount: 4,
187
- gridStroke: tokens.axisGrid,
188
- gridStrokeOpacity: isAcademy ? 1 : 0.9,
189
- gridLineWidth: isAcademy ? 1 : 0.75,
190
- gridLineDash: [0, 0]
191
- },
192
- title: {
193
- spacing: 6,
194
- titleFill: tokens.textPrimary,
195
- titleFontSize: 16,
196
- titleFontWeight: 600,
197
- subtitleFill: tokens.textSecondary,
198
- subtitleFontSize: 12,
199
- subtitleFontWeight: 400
200
- },
201
- legendCategory: {
202
- backgroundFill: "transparent",
203
- padding: [5, 0, 10, 0],
204
- itemMarkerSize: 10,
205
- itemMarkerFillOpacity: 0.92,
206
- itemMarkerStrokeOpacity: 0.92,
207
- itemLabelFill: tokens.textPrimary,
208
- itemLabelFillOpacity: 0.78,
209
- itemLabelFontFamily: import_tokens.CHART_FONT_FAMILY,
210
- itemLabelFontSize: 12,
211
- itemLabelFontWeight: 400,
212
- itemLabelLineHeight: 16,
213
- itemLabelLetterSpacing: 0.1,
214
- itemLabelTextBaseline: "middle",
215
- itemSpacing: [8, 0, 0],
216
- itemCursor: "pointer",
217
- rowPadding: 8,
218
- colPadding: 22,
219
- navButtonFill: tokens.textSecondary,
220
- navButtonFillOpacity: 0.72,
221
- navButtonSize: 9,
222
- navPageNumFill: tokens.textSecondary,
223
- navPageNumFillOpacity: 0.72,
224
- navPageNumFontFamily: import_tokens.CHART_FONT_FAMILY,
225
- navPageNumFontSize: 11,
226
- navPageNumFontWeight: 400,
227
- navControllerPadding: 4,
228
- navControllerSpacing: 14
229
- },
230
- tooltip: {
231
- shared: false,
232
- series: false,
233
- crosshairs: false,
234
- marker: true,
235
- markerR: 4,
236
- markerLineWidth: 2,
237
- markerStroke: tokens.background,
238
- crosshairsStroke: tokens.textSecondary,
239
- crosshairsStrokeOpacity: 0.18,
240
- crosshairsLineWidth: 1,
241
- crosshairsLineDash: [0, 0],
242
- css: {
243
- ".g2-tooltip": {
244
- "background-color": tokens.tooltipBackground,
245
- border: `1px solid ${tokens.tooltipBorder}`,
246
- "border-radius": "10px",
247
- "box-shadow": tokens.tooltipShadow,
248
- color: tokens.textSecondary,
249
- padding: "10px 12px",
250
- "min-width": "164px",
251
- "max-width": "300px",
252
- overflow: "hidden",
253
- "box-sizing": "border-box",
254
- "backdrop-filter": "blur(10px) saturate(1.08)",
255
- "-webkit-backdrop-filter": "blur(10px) saturate(1.08)",
256
- "font-family": import_tokens.CHART_FONT_FAMILY,
257
- "font-size": "12px",
258
- "line-height": "18px",
259
- "font-variant-numeric": "tabular-nums",
260
- "font-feature-settings": '"tnum" 1, "zero" 1',
261
- "-webkit-font-smoothing": "antialiased",
262
- contain: "layout paint style"
263
- },
264
- ".g2-tooltip-title": {
265
- color: tokens.textSecondary,
266
- "font-size": "11px",
267
- "font-weight": "500",
268
- "line-height": "16px",
269
- "letter-spacing": "0.01em",
270
- "margin-bottom": "6px",
271
- "padding-bottom": "7px",
272
- "border-bottom": `1px solid ${tokens.tooltipDivider}`,
273
- "max-width": "276px"
274
- },
275
- ".g2-tooltip-list": {
276
- display: "grid",
277
- gap: "4px"
278
- },
279
- ".g2-tooltip-list-item": {
280
- display: "grid",
281
- "grid-template-columns": "minmax(0, 1fr) auto",
282
- "align-items": "center",
283
- "column-gap": "18px",
284
- "min-height": "22px",
285
- "line-height": "22px"
286
- },
287
- ".g2-tooltip-list-item-name": {
288
- gap: "8px",
289
- "min-width": "0",
290
- "max-width": "208px",
291
- overflow: "hidden",
292
- color: tokens.textSecondary
293
- },
294
- ".g2-tooltip-list-item-name-label": {
295
- color: tokens.textSecondary,
296
- "font-weight": "400"
297
- },
298
- ".g2-tooltip-list-item-value": {
299
- color: tokens.textPrimary,
300
- "font-weight": "600",
301
- flex: "0 0 auto",
302
- "min-width": "40px",
303
- "margin-left": "0",
304
- "text-align": "right",
305
- "letter-spacing": "-0.01em",
306
- "font-variant-numeric": "tabular-nums",
307
- "font-feature-settings": '"tnum" 1, "zero" 1'
308
- },
309
- ".g2-tooltip-list-item-marker": {
310
- width: "7px",
311
- height: "7px",
312
- flex: "0 0 auto",
313
- "margin-right": "0",
314
- "border-radius": "999px",
315
- "box-shadow": tokens.tooltipMarkerShadow
316
- },
317
- ".g2-tooltip-crosshair-x": {
318
- "background-color": isDark ? "rgba(255, 255, 255, 0.16)" : "rgba(71, 84, 103, 0.16)"
319
- },
320
- ".g2-tooltip-crosshair-y": {
321
- "background-color": isDark ? "rgba(255, 255, 255, 0.16)" : "rgba(71, 84, 103, 0.16)"
322
- }
323
- }
324
- },
325
- elementHighlight: {
326
- delay: import_tokens.CHART_STYLE_DEFAULTS.interactionDelay
327
- },
328
- elementHighlightByColor: {
329
- delay: import_tokens.CHART_STYLE_DEFAULTS.interactionDelay
330
- },
331
- elementHoverScale: {
332
- delay: import_tokens.CHART_STYLE_DEFAULTS.interactionDelay,
333
- scale: 1.04,
334
- shadow: true,
335
- shadowBlur: isDark ? 7 : isAcademy ? 5 : 6,
336
- shadowColor: isDark ? "rgba(226, 232, 240, 0.38)" : isAcademy ? "rgba(63, 49, 38, 0.44)" : "rgba(15, 23, 42, 0.46)",
337
- shadowOffsetX: 0,
338
- shadowOffsetY: isDark ? 0 : 3,
339
- zIndex: 10
340
- }
341
- };
342
- };
343
- var LIGHT_THEME = createTheme("light");
344
- var ACADEMY_THEME = createTheme("academy");
345
- var DARK_THEME = createTheme("dark");
346
- var THEME_MAP = {
347
- default: LIGHT_THEME,
348
- light: LIGHT_THEME,
349
- academy: ACADEMY_THEME,
350
- dark: DARK_THEME
351
- };
352
- var getTheme = (theme) => theme === "default" ? "light" : theme;
353
- var getThemeObject = (theme) => THEME_MAP[theme] || THEME_MAP.default;
354
- var getThemeColors = (theme) => theme === "academy" ? ACADEMY_COLOR_PALETTE : DEFAULT_COLOR_PALETTE;
355
- var getBackgroundColor = (theme) => (0, import_tokens.getChartVisualTokens)(theme).background;
356
- var normalizePalette = (palette, theme) => {
357
- if (!palette || Array.isArray(palette) && palette.length === 0) {
358
- return getThemeColors(theme);
359
- }
360
- return Array.isArray(palette) ? palette : [palette];
361
- };
362
- // Annotate the CommonJS export names for ESM import in node:
363
- 0 && (module.exports = {
364
- ACADEMY_COLOR_PALETTE,
365
- DEFAULT_COLOR_PALETTE,
366
- THEME_MAP,
367
- getBackgroundColor,
368
- getTheme,
369
- getThemeColors,
370
- getThemeObject,
371
- normalizePalette
372
- });
@@ -1,20 +0,0 @@
1
- import type { Theme } from '@antv/g2';
2
- import type { VisualizationTheme } from '../types';
3
- export declare const DEFAULT_COLOR_PALETTE: string[];
4
- export declare const ACADEMY_COLOR_PALETTE: string[];
5
- type G2ThemeType = 'light' | 'dark' | 'academy';
6
- type ChartTheme = Theme & {
7
- enter?: {
8
- duration?: number;
9
- easing?: string;
10
- };
11
- elementHighlightByColor?: Record<string, unknown>;
12
- elementHoverScale?: Record<string, unknown>;
13
- };
14
- export declare const THEME_MAP: Record<VisualizationTheme, ChartTheme>;
15
- export declare const getTheme: (theme: VisualizationTheme) => G2ThemeType;
16
- export declare const getThemeObject: (theme: VisualizationTheme) => ChartTheme;
17
- export declare const getThemeColors: (theme: VisualizationTheme) => string[];
18
- export declare const getBackgroundColor: (theme: VisualizationTheme) => string;
19
- export declare const normalizePalette: (palette: string | string[] | undefined, theme: VisualizationTheme) => string[];
20
- export {};