@antv/gpt-vis 1.0.0-beta.1 → 1.0.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/README.md +223 -47
- package/README.zh-CN.md +227 -51
- package/dist/cjs/gpt-vis/index.d.ts +8 -1
- package/dist/cjs/gpt-vis/index.js +43 -20
- package/dist/cjs/index.d.ts +15 -2
- package/dist/cjs/index.js +22 -2
- package/dist/cjs/syntax/parser.d.ts +17 -2
- package/dist/cjs/syntax/parser.js +151 -38
- package/dist/cjs/util/container.d.ts +5 -0
- package/dist/cjs/util/container.js +43 -0
- package/dist/cjs/util/theme.d.ts +5 -0
- package/dist/cjs/util/theme.js +9 -2
- package/dist/cjs/vis/area/index.js +2 -1
- package/dist/cjs/vis/bar/index.js +5 -4
- package/dist/cjs/vis/boxplot/index.js +7 -2
- package/dist/cjs/vis/column/index.js +5 -4
- package/dist/cjs/vis/dual-axes/index.js +3 -3
- package/dist/cjs/vis/fishbone-diagram/index.d.ts +35 -0
- package/dist/cjs/vis/fishbone-diagram/index.js +191 -0
- package/dist/cjs/vis/flow-diagram/index.d.ts +27 -0
- package/dist/cjs/vis/flow-diagram/index.js +287 -0
- package/dist/cjs/vis/funnel/index.js +2 -1
- package/dist/cjs/vis/histogram/index.js +3 -7
- package/dist/cjs/vis/indented-tree/index.d.ts +40 -0
- package/dist/cjs/vis/indented-tree/index.js +385 -0
- package/dist/cjs/vis/line/index.js +2 -1
- package/dist/cjs/vis/liquid/index.js +2 -1
- package/dist/cjs/vis/mindmap/index.d.ts +32 -0
- package/dist/cjs/vis/mindmap/index.js +222 -0
- package/dist/cjs/vis/network-graph/index.d.ts +59 -0
- package/dist/cjs/vis/network-graph/index.js +175 -0
- package/dist/cjs/vis/organization-chart/index.d.ts +64 -0
- package/dist/cjs/vis/organization-chart/index.js +200 -0
- package/dist/cjs/vis/pie/index.js +3 -3
- package/dist/cjs/vis/radar/index.d.ts +1 -0
- package/dist/cjs/vis/radar/index.js +10 -9
- package/dist/cjs/vis/sankey/index.js +2 -1
- package/dist/cjs/vis/scatter/index.d.ts +2 -0
- package/dist/cjs/vis/scatter/index.js +9 -4
- package/dist/cjs/vis/summary/index.js +17 -3
- package/dist/cjs/vis/table/index.d.ts +1 -0
- package/dist/cjs/vis/table/index.js +37 -1
- package/dist/cjs/vis/treemap/index.js +2 -1
- package/dist/cjs/vis/venn/index.d.ts +2 -1
- package/dist/cjs/vis/venn/index.js +18 -3
- package/dist/cjs/vis/violin/index.js +2 -1
- package/dist/cjs/vis/waterfall/index.d.ts +6 -9
- package/dist/cjs/vis/waterfall/index.js +29 -6
- package/dist/cjs/vis/word-cloud/index.js +2 -1
- package/dist/cjs/vis-wrapper/icons.js +2 -2
- package/dist/cjs/vis-wrapper/index.d.ts +1 -0
- package/dist/cjs/vis-wrapper/index.js +27 -16
- package/dist/cjs/vis-wrapper/styles.d.ts +1 -1
- package/dist/cjs/vis-wrapper/styles.js +8 -1
- package/dist/esm/gpt-vis/index.d.ts +8 -1
- package/dist/esm/gpt-vis/index.js +47 -26
- package/dist/esm/index.d.ts +15 -2
- package/dist/esm/index.js +7 -1
- package/dist/esm/syntax/parser.d.ts +17 -2
- package/dist/esm/syntax/parser.js +248 -90
- package/dist/esm/util/container.d.ts +5 -0
- package/dist/esm/util/container.js +20 -0
- package/dist/esm/util/theme.d.ts +5 -0
- package/dist/esm/util/theme.js +9 -0
- package/dist/esm/vis/area/index.js +3 -2
- package/dist/esm/vis/bar/index.js +7 -6
- package/dist/esm/vis/boxplot/index.js +17 -4
- package/dist/esm/vis/column/index.js +7 -6
- package/dist/esm/vis/dual-axes/index.js +13 -5
- package/dist/esm/vis/fishbone-diagram/index.d.ts +35 -0
- package/dist/esm/vis/fishbone-diagram/index.js +219 -0
- package/dist/esm/vis/flow-diagram/index.d.ts +27 -0
- package/dist/esm/vis/flow-diagram/index.js +349 -0
- package/dist/esm/vis/funnel/index.js +3 -2
- package/dist/esm/vis/histogram/index.js +6 -7
- package/dist/esm/vis/indented-tree/index.d.ts +40 -0
- package/dist/esm/vis/indented-tree/index.js +569 -0
- package/dist/esm/vis/line/index.js +3 -2
- package/dist/esm/vis/liquid/index.js +3 -2
- package/dist/esm/vis/mindmap/index.d.ts +32 -0
- package/dist/esm/vis/mindmap/index.js +316 -0
- package/dist/esm/vis/network-graph/index.d.ts +59 -0
- package/dist/esm/vis/network-graph/index.js +242 -0
- package/dist/esm/vis/organization-chart/index.d.ts +64 -0
- package/dist/esm/vis/organization-chart/index.js +271 -0
- package/dist/esm/vis/pie/index.js +4 -8
- package/dist/esm/vis/radar/index.d.ts +1 -0
- package/dist/esm/vis/radar/index.js +20 -4
- package/dist/esm/vis/sankey/index.js +3 -2
- package/dist/esm/vis/scatter/index.d.ts +2 -0
- package/dist/esm/vis/scatter/index.js +15 -4
- package/dist/esm/vis/summary/index.js +25 -4
- package/dist/esm/vis/table/index.d.ts +1 -0
- package/dist/esm/vis/table/index.js +9 -2
- package/dist/esm/vis/treemap/index.js +3 -2
- package/dist/esm/vis/venn/index.d.ts +2 -1
- package/dist/esm/vis/venn/index.js +29 -4
- package/dist/esm/vis/violin/index.js +3 -2
- package/dist/esm/vis/waterfall/index.d.ts +6 -9
- package/dist/esm/vis/waterfall/index.js +33 -13
- package/dist/esm/vis/word-cloud/index.js +3 -2
- package/dist/esm/vis-wrapper/icons.js +2 -2
- package/dist/esm/vis-wrapper/index.d.ts +1 -0
- package/dist/esm/vis-wrapper/index.js +15 -10
- package/dist/esm/vis-wrapper/styles.d.ts +1 -1
- package/dist/esm/vis-wrapper/styles.js +1 -1
- package/dist/umd/index.min.js +1 -1
- package/package.json +17 -21
- package/src/gpt-vis/index.ts +0 -283
- package/src/index.ts +0 -44
- package/src/readme.md +0 -37
- package/src/syntax/index.ts +0 -2
- package/src/syntax/parser.ts +0 -411
- package/src/types/index.ts +0 -29
- package/src/util/theme.ts +0 -167
- package/src/vis/area/README.md +0 -143
- package/src/vis/area/index.ts +0 -212
- package/src/vis/bar/README.md +0 -158
- package/src/vis/bar/index.ts +0 -186
- package/src/vis/boxplot/README.md +0 -168
- package/src/vis/boxplot/index.ts +0 -162
- package/src/vis/column/README.md +0 -158
- package/src/vis/column/index.ts +0 -185
- package/src/vis/dual-axes/README.md +0 -191
- package/src/vis/dual-axes/index.ts +0 -218
- package/src/vis/funnel/README.md +0 -143
- package/src/vis/funnel/index.ts +0 -238
- package/src/vis/histogram/README.md +0 -130
- package/src/vis/histogram/index.ts +0 -153
- package/src/vis/line/README.md +0 -138
- package/src/vis/line/index.ts +0 -159
- package/src/vis/liquid/README.md +0 -150
- package/src/vis/liquid/index.ts +0 -130
- package/src/vis/pie/README.md +0 -127
- package/src/vis/pie/index.ts +0 -163
- package/src/vis/radar/README.md +0 -184
- package/src/vis/radar/index.ts +0 -214
- package/src/vis/sankey/README.md +0 -144
- package/src/vis/sankey/index.ts +0 -144
- package/src/vis/scatter/README.md +0 -145
- package/src/vis/scatter/index.ts +0 -147
- package/src/vis/summary/README.md +0 -272
- package/src/vis/summary/index.ts +0 -91
- package/src/vis/table/README.md +0 -174
- package/src/vis/table/index.ts +0 -241
- package/src/vis/treemap/README.md +0 -199
- package/src/vis/treemap/index.ts +0 -167
- package/src/vis/venn/README.md +0 -153
- package/src/vis/venn/index.ts +0 -149
- package/src/vis/violin/README.md +0 -168
- package/src/vis/violin/index.ts +0 -216
- package/src/vis/waterfall/README.md +0 -178
- package/src/vis/waterfall/index.ts +0 -258
- package/src/vis/word-cloud/README.md +0 -137
- package/src/vis/word-cloud/index.ts +0 -137
- package/src/vis-wrapper/README.md +0 -159
- package/src/vis-wrapper/icons.ts +0 -35
- package/src/vis-wrapper/index.ts +0 -276
- package/src/vis-wrapper/styles.ts +0 -195
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { Chart } from '@antv/g2';
|
|
8
|
-
import { getBackgroundColor,
|
|
8
|
+
import { getBackgroundColor, getThemeObject, normalizePalette } from "../../util/theme";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* TreemapDataItem is the type for each data item in the treemap chart.
|
|
@@ -83,7 +83,7 @@ export var Treemap = function Treemap(options) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Get colors from style.palette or theme defaults
|
|
86
|
-
var colors = style.palette
|
|
86
|
+
var colors = normalizePalette(style.palette, theme);
|
|
87
87
|
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
88
88
|
|
|
89
89
|
// Create chart
|
|
@@ -98,6 +98,7 @@ export var Treemap = function Treemap(options) {
|
|
|
98
98
|
// Note: Using 'any' type due to G2's complex type system with transformations
|
|
99
99
|
// This is consistent with how G2 5.0 is used elsewhere in the codebase
|
|
100
100
|
var chartOptions = {
|
|
101
|
+
animate: false,
|
|
101
102
|
type: 'treemap',
|
|
102
103
|
data: {
|
|
103
104
|
type: 'inline',
|
|
@@ -3,7 +3,8 @@ import type { VisualizationOptions } from '../../types';
|
|
|
3
3
|
* VennDataItem is the type for each data item in the venn chart.
|
|
4
4
|
*/
|
|
5
5
|
export type VennDataItem = {
|
|
6
|
-
|
|
6
|
+
/** Parser / DSL often yields a comma-separated string; G2 venn transform expects string[]. */
|
|
7
|
+
sets: string[] | string;
|
|
7
8
|
value: number;
|
|
8
9
|
label?: string;
|
|
9
10
|
};
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import { Chart } from '@antv/g2';
|
|
2
|
-
import { getBackgroundColor,
|
|
8
|
+
import { getBackgroundColor, getThemeObject, normalizePalette } from "../../util/theme";
|
|
3
9
|
|
|
4
10
|
/**
|
|
5
11
|
* VennDataItem is the type for each data item in the venn chart.
|
|
6
12
|
*/
|
|
7
13
|
|
|
14
|
+
function normalizeVennSets(sets) {
|
|
15
|
+
if (Array.isArray(sets)) return sets.map(function (s) {
|
|
16
|
+
return String(s);
|
|
17
|
+
});
|
|
18
|
+
if (typeof sets === 'string') {
|
|
19
|
+
return sets.split(',').map(function (s) {
|
|
20
|
+
return s.trim();
|
|
21
|
+
}).filter(Boolean);
|
|
22
|
+
}
|
|
23
|
+
if (sets == null) return [];
|
|
24
|
+
return [String(sets)];
|
|
25
|
+
}
|
|
26
|
+
|
|
8
27
|
/**
|
|
9
28
|
* VennConfig defines the configuration for rendering the venn chart.
|
|
10
29
|
*/
|
|
@@ -63,8 +82,13 @@ export var Venn = function Venn(options) {
|
|
|
63
82
|
}
|
|
64
83
|
|
|
65
84
|
// Get colors from style.palette or theme defaults
|
|
66
|
-
var colors = style.palette
|
|
85
|
+
var colors = normalizePalette(style.palette, theme);
|
|
67
86
|
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
87
|
+
var normalizedData = data.map(function (d) {
|
|
88
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
89
|
+
sets: normalizeVennSets(d.sets)
|
|
90
|
+
});
|
|
91
|
+
});
|
|
68
92
|
|
|
69
93
|
// Create chart
|
|
70
94
|
chart = new Chart({
|
|
@@ -78,9 +102,10 @@ export var Venn = function Venn(options) {
|
|
|
78
102
|
// Note: Using 'any' type due to G2's complex type system with transformations
|
|
79
103
|
// This is consistent with how G2 5.0 is used elsewhere in the codebase
|
|
80
104
|
var chartOptions = {
|
|
105
|
+
animate: false,
|
|
81
106
|
type: 'path',
|
|
82
107
|
data: {
|
|
83
|
-
value:
|
|
108
|
+
value: normalizedData,
|
|
84
109
|
transform: [{
|
|
85
110
|
type: 'venn',
|
|
86
111
|
padding: 8,
|
|
@@ -102,7 +127,7 @@ export var Venn = function Venn(options) {
|
|
|
102
127
|
style: {
|
|
103
128
|
// Set opacity: intersections (sets.length > 1) are nearly transparent, single sets are more opaque
|
|
104
129
|
opacity: function opacity(d) {
|
|
105
|
-
return d.sets.length > 1 ? 0.001 : 0.65;
|
|
130
|
+
return normalizeVennSets(d.sets).length > 1 ? 0.001 : 0.65;
|
|
106
131
|
}
|
|
107
132
|
},
|
|
108
133
|
labels: [{
|
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { Chart } from '@antv/g2';
|
|
8
|
-
import { getBackgroundColor,
|
|
8
|
+
import { getBackgroundColor, getThemeObject, normalizePalette } from "../../util/theme";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* ViolinDataItem is the type for each data item in the violin chart.
|
|
@@ -74,7 +74,7 @@ export var Violin = function Violin(options) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Get colors from style.palette or theme defaults
|
|
77
|
-
var colors = style.palette
|
|
77
|
+
var colors = normalizePalette(style.palette, theme);
|
|
78
78
|
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
79
79
|
var startAtZero = style.startAtZero || false;
|
|
80
80
|
|
|
@@ -195,6 +195,7 @@ export var Violin = function Violin(options) {
|
|
|
195
195
|
// Note: Using 'any' type due to G2's complex type system with transformations
|
|
196
196
|
// This is consistent with how G2 5.0 is used elsewhere in the codebase
|
|
197
197
|
var chartOptions = _objectSpread(_objectSpread({
|
|
198
|
+
animate: false,
|
|
198
199
|
type: 'view',
|
|
199
200
|
data: data,
|
|
200
201
|
title: title !== null && title !== void 0 ? title : '',
|
|
@@ -8,14 +8,6 @@ export type WaterfallDataItem = {
|
|
|
8
8
|
isIntermediateTotal?: boolean;
|
|
9
9
|
isTotal?: boolean;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* WaterfallPalette defines custom colors for positive, negative, total bars.
|
|
13
|
-
*/
|
|
14
|
-
export interface WaterfallPalette {
|
|
15
|
-
positiveColor?: string;
|
|
16
|
-
negativeColor?: string;
|
|
17
|
-
totalColor?: string;
|
|
18
|
-
}
|
|
19
11
|
/**
|
|
20
12
|
* WaterfallConfig defines the configuration for rendering the waterfall chart.
|
|
21
13
|
*/
|
|
@@ -28,7 +20,12 @@ export interface WaterfallConfig {
|
|
|
28
20
|
axisYTitle?: string;
|
|
29
21
|
style?: {
|
|
30
22
|
backgroundColor?: string;
|
|
31
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Custom color palette for waterfall bars.
|
|
25
|
+
* Array order: [0] positive color, [1] negative color, [2] total/intermediate-total color.
|
|
26
|
+
* Defaults: ['#FF4D4F', '#2EBB59', '#1783FF']
|
|
27
|
+
*/
|
|
28
|
+
palette?: string[];
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
31
|
/**
|
|
@@ -11,10 +11,6 @@ import { getBackgroundColor, getThemeObject } from "../../util/theme";
|
|
|
11
11
|
* WaterfallDataItem is the type for each data item in the waterfall chart.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* WaterfallPalette defines custom colors for positive, negative, total bars.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
14
|
/**
|
|
19
15
|
* WaterfallConfig defines the configuration for rendering the waterfall chart.
|
|
20
16
|
*/
|
|
@@ -132,11 +128,12 @@ export var Waterfall = function Waterfall(options) {
|
|
|
132
128
|
}
|
|
133
129
|
|
|
134
130
|
// Get colors from style.palette or defaults
|
|
131
|
+
// palette array order: [0] positive, [1] negative, [2] total
|
|
135
132
|
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
136
|
-
var palette = style.palette ||
|
|
137
|
-
var positiveColor = palette
|
|
138
|
-
var negativeColor = palette
|
|
139
|
-
var totalColor = palette
|
|
133
|
+
var palette = style.palette || [];
|
|
134
|
+
var positiveColor = palette[0] || DEFAULT_POSITIVE_COLOR;
|
|
135
|
+
var negativeColor = palette[1] || DEFAULT_NEGATIVE_COLOR;
|
|
136
|
+
var totalColor = palette[2] || DEFAULT_TOTAL_COLOR;
|
|
140
137
|
|
|
141
138
|
// Transform data to include __start__ and __end__ fields
|
|
142
139
|
var transformedData = transformWaterfallData(data);
|
|
@@ -156,6 +153,7 @@ export var Waterfall = function Waterfall(options) {
|
|
|
156
153
|
// Note: Using 'any' type due to G2's complex type system with transformations
|
|
157
154
|
// This is consistent with how G2 5.0 is used elsewhere in the codebase
|
|
158
155
|
var chartOptions = _objectSpread(_objectSpread({
|
|
156
|
+
animate: false,
|
|
159
157
|
type: 'view',
|
|
160
158
|
data: transformedData,
|
|
161
159
|
title: title !== null && title !== void 0 ? title : '',
|
|
@@ -176,20 +174,23 @@ export var Waterfall = function Waterfall(options) {
|
|
|
176
174
|
},
|
|
177
175
|
children: [{
|
|
178
176
|
type: 'interval',
|
|
177
|
+
animate: false,
|
|
179
178
|
data: transformedData,
|
|
180
179
|
encode: {
|
|
181
180
|
x: 'category',
|
|
182
181
|
y: ['__start__', '__end__'],
|
|
183
182
|
color: 'category'
|
|
184
183
|
},
|
|
185
|
-
style: {
|
|
184
|
+
style: _objectSpread(_objectSpread({
|
|
186
185
|
maxWidth: 60,
|
|
187
|
-
stroke: '#666'
|
|
188
|
-
|
|
186
|
+
stroke: '#666'
|
|
187
|
+
}, theme !== 'academy' ? {
|
|
188
|
+
radius: 4
|
|
189
|
+
} : {}), {}, {
|
|
189
190
|
fill: function fill(d) {
|
|
190
191
|
return d.isTotal || d.isIntermediateTotal ? totalColor : d.__value__ > 0 ? positiveColor : negativeColor;
|
|
191
192
|
}
|
|
192
|
-
},
|
|
193
|
+
}),
|
|
193
194
|
labels: [{
|
|
194
195
|
text: '__value__',
|
|
195
196
|
position: 'inside',
|
|
@@ -201,9 +202,28 @@ export var Waterfall = function Waterfall(options) {
|
|
|
201
202
|
fill: '#000',
|
|
202
203
|
fontWeight: 600,
|
|
203
204
|
stroke: '#fff'
|
|
204
|
-
}]
|
|
205
|
+
}],
|
|
206
|
+
tooltip: {
|
|
207
|
+
title: function title(d) {
|
|
208
|
+
return d.category;
|
|
209
|
+
},
|
|
210
|
+
items: [{
|
|
211
|
+
field: '__value__',
|
|
212
|
+
name: '数值',
|
|
213
|
+
valueFormatter: '~s'
|
|
214
|
+
}, {
|
|
215
|
+
field: '__start__',
|
|
216
|
+
name: '起始',
|
|
217
|
+
valueFormatter: '~s'
|
|
218
|
+
}, {
|
|
219
|
+
field: '__end__',
|
|
220
|
+
name: '结束',
|
|
221
|
+
valueFormatter: '~s'
|
|
222
|
+
}]
|
|
223
|
+
}
|
|
205
224
|
}, {
|
|
206
225
|
type: 'link',
|
|
226
|
+
animate: false,
|
|
207
227
|
data: linkData,
|
|
208
228
|
encode: {
|
|
209
229
|
x: 'x',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chart } from '@antv/g2';
|
|
2
|
-
import { getBackgroundColor,
|
|
2
|
+
import { getBackgroundColor, getThemeObject, normalizePalette } from "../../util/theme";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* WordCloudDataItem is the type for each data item in the word cloud chart.
|
|
@@ -63,7 +63,7 @@ export var WordCloud = function WordCloud(options) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// Get colors from style.palette or theme defaults
|
|
66
|
-
var colors = style.palette
|
|
66
|
+
var colors = normalizePalette(style.palette, theme);
|
|
67
67
|
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
68
68
|
|
|
69
69
|
// Create chart
|
|
@@ -78,6 +78,7 @@ export var WordCloud = function WordCloud(options) {
|
|
|
78
78
|
// Note: Using 'any' type due to G2's complex type system with transformations
|
|
79
79
|
// This is consistent with how G2 5.0 is used elsewhere in the codebase
|
|
80
80
|
var chartOptions = {
|
|
81
|
+
animate: false,
|
|
81
82
|
type: 'wordCloud',
|
|
82
83
|
data: data,
|
|
83
84
|
title: title !== null && title !== void 0 ? title : '',
|
|
@@ -20,10 +20,10 @@ export function createDownloadIcon() {
|
|
|
20
20
|
export function createZoomInIcon() {
|
|
21
21
|
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 18;
|
|
22
22
|
var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#707070';
|
|
23
|
-
return "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"").concat(fill, "\">\n <path d=\"M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z\"></path>\n <path d=\"M555 418.
|
|
23
|
+
return "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"").concat(fill, "\">\n <path d=\"M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z\"></path>\n <path d=\"M555 418.3h-99.8v-99.8c0-14-11.4-25.4-25.4-25.4s-25.4 11.4-25.4 25.4v99.8h-99.8c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4h99.8v99.8c0 14 11.4 25.4 25.4 25.4s25.4-11.4 25.4-25.4v-99.8H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z\"></path>\n </svg>");
|
|
24
24
|
}
|
|
25
25
|
export function createZoomOutIcon() {
|
|
26
26
|
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 18;
|
|
27
27
|
var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#707070';
|
|
28
|
-
return "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"").concat(fill, "\">\n <path d=\"M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z\"></path>\n <path d=\"M555 418.
|
|
28
|
+
return "<svg viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(size, "\" height=\"").concat(size, "\" fill=\"").concat(fill, "\">\n <path d=\"M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z\"></path>\n <path d=\"M555 418.3H304.7c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z\"></path>\n </svg>");
|
|
29
29
|
}
|
|
@@ -26,11 +26,6 @@ var DEFAULT_LABELS = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* G6 chart types that support zoom functionality
|
|
31
|
-
*/
|
|
32
|
-
var G6_CHART_TYPES = [];
|
|
33
|
-
|
|
34
29
|
/**
|
|
35
30
|
* Wrapper configuration options
|
|
36
31
|
*/
|
|
@@ -63,12 +58,11 @@ export function createVisWrapper(container) {
|
|
|
63
58
|
locale = _config$locale === void 0 ? 'zh-CN' : _config$locale;
|
|
64
59
|
var syntaxString = typeof syntax === 'string' ? syntax : JSON.stringify(syntax, null, 2);
|
|
65
60
|
var labels = DEFAULT_LABELS[locale] || DEFAULT_LABELS['en-US'];
|
|
66
|
-
var isG6Chart = G6_CHART_TYPES.includes(chartType);
|
|
67
61
|
var chartRef = null;
|
|
68
62
|
var copyTimeout;
|
|
69
63
|
|
|
70
|
-
// Build zoom buttons HTML
|
|
71
|
-
var zoomButtonsHTML =
|
|
64
|
+
// Build zoom buttons HTML (initially hidden, shown when chart has zoomTo method)
|
|
65
|
+
var zoomButtonsHTML = "\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide\"\n data-action=\"zoom-out\"\n aria-label=\"Zoom out\"\n title=\"Zoom out\">\n ".concat(createZoomOutIcon(18), "\n </button>\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide\"\n data-action=\"zoom-in\"\n aria-label=\"Zoom in\"\n title=\"Zoom in\">\n ").concat(createZoomInIcon(18), "\n </button>\n <div class=\"gpt-vis-wrapper-divider gpt-vis-wrapper-tab-hide\"></div>\n ");
|
|
72
66
|
|
|
73
67
|
// Create wrapper HTML structure using template string
|
|
74
68
|
var wrapperHTML = "\n <div class=\"gpt-vis-wrapper-container\">\n <div class=\"gpt-vis-wrapper-header\">\n <div class=\"gpt-vis-wrapper-tab-left\">\n <button class=\"gpt-vis-wrapper-tab-button active\" \n data-tab=\"chart\"\n role=\"tab\" \n aria-selected=\"true\" \n aria-controls=\"chart-panel\">\n ".concat(labels.chartTab, "\n </button>\n <button class=\"gpt-vis-wrapper-tab-button\" \n data-tab=\"code\"\n role=\"tab\" \n aria-selected=\"false\" \n aria-controls=\"code-panel\">\n ").concat(labels.codeTab, "\n </button>\n </div>\n <div class=\"gpt-vis-wrapper-tab-right\">\n ").concat(zoomButtonsHTML, "\n <button class=\"gpt-vis-wrapper-text-button\" \n data-action=\"download\"\n aria-label=\"").concat(labels.download, "\">\n ").concat(createDownloadIcon(16), " <span>").concat(labels.download, "</span>\n </button>\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-tab-hide\" \n data-action=\"copy\"\n aria-label=\"").concat(labels.copy, "\">\n ").concat(createCopyIcon(), " <span>").concat(labels.copy, "</span>\n </button>\n </div>\n </div>\n <div class=\"gpt-vis-wrapper-content\">\n <div class=\"gpt-vis-wrapper-chart\">\n <div class=\"gpt-vis-wrapper-chart-container\"></div>\n </div>\n <div class=\"gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide\">").concat(syntaxString, "</div>\n </div>\n </div>\n ");
|
|
@@ -91,6 +85,7 @@ export function createVisWrapper(container) {
|
|
|
91
85
|
|
|
92
86
|
// Event handlers
|
|
93
87
|
function switchTab(tab) {
|
|
88
|
+
var hasZoomSupport = chartRef && typeof chartRef.zoomTo === 'function';
|
|
94
89
|
if (tab === 'chart') {
|
|
95
90
|
chartTabButton.classList.add('active');
|
|
96
91
|
chartTabButton.setAttribute('aria-selected', 'true');
|
|
@@ -100,7 +95,7 @@ export function createVisWrapper(container) {
|
|
|
100
95
|
codeContainer.classList.add('gpt-vis-wrapper-tab-hide');
|
|
101
96
|
downloadButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
102
97
|
copyButton.classList.add('gpt-vis-wrapper-tab-hide');
|
|
103
|
-
if (
|
|
98
|
+
if (hasZoomSupport && zoomInButton && zoomOutButton && divider) {
|
|
104
99
|
zoomInButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
105
100
|
zoomOutButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
106
101
|
divider.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
@@ -114,7 +109,7 @@ export function createVisWrapper(container) {
|
|
|
114
109
|
codeContainer.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
115
110
|
downloadButton.classList.add('gpt-vis-wrapper-tab-hide');
|
|
116
111
|
copyButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
117
|
-
if (
|
|
112
|
+
if (hasZoomSupport && zoomInButton && zoomOutButton && divider) {
|
|
118
113
|
zoomInButton.classList.add('gpt-vis-wrapper-tab-hide');
|
|
119
114
|
zoomOutButton.classList.add('gpt-vis-wrapper-tab-hide');
|
|
120
115
|
divider.classList.add('gpt-vis-wrapper-tab-hide');
|
|
@@ -224,8 +219,18 @@ export function createVisWrapper(container) {
|
|
|
224
219
|
// Return wrapper instance
|
|
225
220
|
return {
|
|
226
221
|
chartContainer: chartContainer,
|
|
222
|
+
update: function update(newSyntax) {
|
|
223
|
+
var newSyntaxString = typeof newSyntax === 'string' ? newSyntax : JSON.stringify(newSyntax, null, 2);
|
|
224
|
+
codeContainer.textContent = newSyntaxString;
|
|
225
|
+
},
|
|
227
226
|
setChartRef: function setChartRef(chart) {
|
|
228
227
|
chartRef = chart;
|
|
228
|
+
// Show zoom buttons if chart has zoomTo method
|
|
229
|
+
if (chart && typeof chart.zoomTo === 'function') {
|
|
230
|
+
if (zoomInButton) zoomInButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
231
|
+
if (zoomOutButton) zoomOutButton.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
232
|
+
if (divider) divider.classList.remove('gpt-vis-wrapper-tab-hide');
|
|
233
|
+
}
|
|
229
234
|
},
|
|
230
235
|
destroy: function destroy() {
|
|
231
236
|
if (copyTimeout) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CSS styles for the wrapper component
|
|
3
3
|
*/
|
|
4
|
-
export declare const wrapperStyles = "\n.gpt-vis-wrapper-container {\n border-radius: 8px;\n overflow: hidden;\n}\n\n.gpt-vis-wrapper-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #f5f5f5;\n padding: 6px 14px 6px 6px;\n gap: 2px;\n position: relative;\n z-index: 10;\n}\n\n.gpt-vis-wrapper-tab-left {\n display: flex;\n gap: 2px;\n}\n\n.gpt-vis-wrapper-tab-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.gpt-vis-wrapper-tab-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n border-radius: 8px;\n height: 26px;\n width: 52px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n cursor: pointer;\n outline: none;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.gpt-vis-wrapper-tab-button.active {\n background: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.gpt-vis-wrapper-tab-button:hover,\n.gpt-vis-wrapper-tab-button:focus {\n color: #494949;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):hover,\n.gpt-vis-wrapper-tab-button:not(.active):focus {\n background: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n}\n\n.gpt-vis-wrapper-tab-button.active:hover,\n.gpt-vis-wrapper-tab-button.active:focus {\n background: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);\n}\n\n.gpt-vis-wrapper-tab-button:active {\n transform: scale(0.96);\n transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.gpt-vis-wrapper-tab-button.active:active {\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):active {\n background: #e8e8e8;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.gpt-vis-wrapper-text-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n height: 26px;\n padding: 0 8px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n border-radius: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n cursor: pointer;\n outline: none;\n font-family: inherit;\n}\n\n.gpt-vis-wrapper-text-button:hover,\n.gpt-vis-wrapper-text-button:focus {\n color: #666;\n background: #e8e8e8;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-text-button:active {\n background: #e8e8e8;\n transform: scale(0.98);\n}\n\n.gpt-vis-wrapper-zoom-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.gpt-vis-wrapper-divider {\n width: 1px;\n height: 16px;\n background-color: #d9d9d9;\n margin: 0 8px;\n flex-shrink: 0;\n}\n\n.gpt-vis-wrapper-content {\n overflow: hidden;\n position: relative;\n background: #fafafa;\n}\n\n.gpt-vis-wrapper-chart {\n min-width: 300px;\n max-width: 100%;\n overflow: hidden;\n position: relative;\n
|
|
4
|
+
export declare const wrapperStyles = "\n.gpt-vis-wrapper-container {\n border-radius: 8px;\n overflow: hidden;\n}\n\n.gpt-vis-wrapper-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #f5f5f5;\n padding: 6px 14px 6px 6px;\n gap: 2px;\n position: relative;\n z-index: 10;\n}\n\n.gpt-vis-wrapper-tab-left {\n display: flex;\n gap: 2px;\n}\n\n.gpt-vis-wrapper-tab-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.gpt-vis-wrapper-tab-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n border-radius: 8px;\n height: 26px;\n width: 52px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n cursor: pointer;\n outline: none;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.gpt-vis-wrapper-tab-button.active {\n background: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.gpt-vis-wrapper-tab-button:hover,\n.gpt-vis-wrapper-tab-button:focus {\n color: #494949;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):hover,\n.gpt-vis-wrapper-tab-button:not(.active):focus {\n background: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n}\n\n.gpt-vis-wrapper-tab-button.active:hover,\n.gpt-vis-wrapper-tab-button.active:focus {\n background: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);\n}\n\n.gpt-vis-wrapper-tab-button:active {\n transform: scale(0.96);\n transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.gpt-vis-wrapper-tab-button.active:active {\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):active {\n background: #e8e8e8;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.gpt-vis-wrapper-text-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n height: 26px;\n padding: 0 8px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n border-radius: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n cursor: pointer;\n outline: none;\n font-family: inherit;\n}\n\n.gpt-vis-wrapper-text-button:hover,\n.gpt-vis-wrapper-text-button:focus {\n color: #666;\n background: #e8e8e8;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-text-button:active {\n background: #e8e8e8;\n transform: scale(0.98);\n}\n\n.gpt-vis-wrapper-zoom-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.gpt-vis-wrapper-divider {\n width: 1px;\n height: 16px;\n background-color: #d9d9d9;\n margin: 0 8px;\n flex-shrink: 0;\n}\n\n.gpt-vis-wrapper-content {\n overflow: hidden;\n position: relative;\n background: #fafafa;\n}\n\n.gpt-vis-wrapper-chart {\n min-width: 300px;\n max-width: 100%;\n overflow: hidden;\n position: relative;\n}\n\n.gpt-vis-wrapper-chart--g6 {\n min-height: 400px;\n}\n\n.gpt-vis-wrapper-chart-container {\n width: 100%;\n height: 100%;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.gpt-vis-wrapper-chart--g6 .gpt-vis-wrapper-chart-container {\n min-height: 360px;\n}\n\n.gpt-vis-wrapper-chart-container::-webkit-scrollbar {\n display: none;\n}\n\n.gpt-vis-wrapper-code {\n max-height: 500px;\n overflow: auto;\n padding: 16px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\n font-size: 12px;\n line-height: 1.6;\n color: #333;\n background: #fafafa;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n\n.gpt-vis-wrapper-tab-hide {\n display: none;\n}\n";
|
|
5
5
|
/**
|
|
6
6
|
* Inject styles into the document head
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* CSS styles for the wrapper component
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export var wrapperStyles = "\n.gpt-vis-wrapper-container {\n border-radius: 8px;\n overflow: hidden;\n}\n\n.gpt-vis-wrapper-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #f5f5f5;\n padding: 6px 14px 6px 6px;\n gap: 2px;\n position: relative;\n z-index: 10;\n}\n\n.gpt-vis-wrapper-tab-left {\n display: flex;\n gap: 2px;\n}\n\n.gpt-vis-wrapper-tab-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.gpt-vis-wrapper-tab-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n border-radius: 8px;\n height: 26px;\n width: 52px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n cursor: pointer;\n outline: none;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.gpt-vis-wrapper-tab-button.active {\n background: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.gpt-vis-wrapper-tab-button:hover,\n.gpt-vis-wrapper-tab-button:focus {\n color: #494949;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):hover,\n.gpt-vis-wrapper-tab-button:not(.active):focus {\n background: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n}\n\n.gpt-vis-wrapper-tab-button.active:hover,\n.gpt-vis-wrapper-tab-button.active:focus {\n background: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);\n}\n\n.gpt-vis-wrapper-tab-button:active {\n transform: scale(0.96);\n transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.gpt-vis-wrapper-tab-button.active:active {\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):active {\n background: #e8e8e8;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.gpt-vis-wrapper-text-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n height: 26px;\n padding: 0 8px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n border-radius: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n cursor: pointer;\n outline: none;\n font-family: inherit;\n}\n\n.gpt-vis-wrapper-text-button:hover,\n.gpt-vis-wrapper-text-button:focus {\n color: #666;\n background: #e8e8e8;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-text-button:active {\n background: #e8e8e8;\n transform: scale(0.98);\n}\n\n.gpt-vis-wrapper-zoom-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.gpt-vis-wrapper-divider {\n width: 1px;\n height: 16px;\n background-color: #d9d9d9;\n margin: 0 8px;\n flex-shrink: 0;\n}\n\n.gpt-vis-wrapper-content {\n overflow: hidden;\n position: relative;\n background: #fafafa;\n}\n\n.gpt-vis-wrapper-chart {\n min-width: 300px;\n max-width: 100%;\n overflow: hidden;\n position: relative;\n
|
|
5
|
+
export var wrapperStyles = "\n.gpt-vis-wrapper-container {\n border-radius: 8px;\n overflow: hidden;\n}\n\n.gpt-vis-wrapper-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #f5f5f5;\n padding: 6px 14px 6px 6px;\n gap: 2px;\n position: relative;\n z-index: 10;\n}\n\n.gpt-vis-wrapper-tab-left {\n display: flex;\n gap: 2px;\n}\n\n.gpt-vis-wrapper-tab-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.gpt-vis-wrapper-tab-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n border-radius: 8px;\n height: 26px;\n width: 52px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n cursor: pointer;\n outline: none;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.gpt-vis-wrapper-tab-button.active {\n background: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.gpt-vis-wrapper-tab-button:hover,\n.gpt-vis-wrapper-tab-button:focus {\n color: #494949;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):hover,\n.gpt-vis-wrapper-tab-button:not(.active):focus {\n background: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n}\n\n.gpt-vis-wrapper-tab-button.active:hover,\n.gpt-vis-wrapper-tab-button.active:focus {\n background: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);\n}\n\n.gpt-vis-wrapper-tab-button:active {\n transform: scale(0.96);\n transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n\n.gpt-vis-wrapper-tab-button.active:active {\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n\n.gpt-vis-wrapper-tab-button:not(.active):active {\n background: #e8e8e8;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.gpt-vis-wrapper-text-button {\n border: none;\n box-shadow: none;\n background: transparent;\n color: #494949;\n height: 26px;\n padding: 0 8px;\n font-size: 12px;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform: scale(1);\n border-radius: 8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n cursor: pointer;\n outline: none;\n font-family: inherit;\n}\n\n.gpt-vis-wrapper-text-button:hover,\n.gpt-vis-wrapper-text-button:focus {\n color: #666;\n background: #e8e8e8;\n transform: scale(1.02);\n}\n\n.gpt-vis-wrapper-text-button:active {\n background: #e8e8e8;\n transform: scale(0.98);\n}\n\n.gpt-vis-wrapper-zoom-button {\n width: 24px;\n height: 24px;\n padding: 0;\n}\n\n.gpt-vis-wrapper-divider {\n width: 1px;\n height: 16px;\n background-color: #d9d9d9;\n margin: 0 8px;\n flex-shrink: 0;\n}\n\n.gpt-vis-wrapper-content {\n overflow: hidden;\n position: relative;\n background: #fafafa;\n}\n\n.gpt-vis-wrapper-chart {\n min-width: 300px;\n max-width: 100%;\n overflow: hidden;\n position: relative;\n}\n\n.gpt-vis-wrapper-chart--g6 {\n min-height: 400px;\n}\n\n.gpt-vis-wrapper-chart-container {\n width: 100%;\n height: 100%;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.gpt-vis-wrapper-chart--g6 .gpt-vis-wrapper-chart-container {\n min-height: 360px;\n}\n\n.gpt-vis-wrapper-chart-container::-webkit-scrollbar {\n display: none;\n}\n\n.gpt-vis-wrapper-code {\n max-height: 500px;\n overflow: auto;\n padding: 16px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\n font-size: 12px;\n line-height: 1.6;\n color: #333;\n background: #fafafa;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n\n.gpt-vis-wrapper-tab-hide {\n display: none;\n}\n";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Inject styles into the document head
|