@antv/gpt-vis 1.3.0 → 1.3.2
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 +25 -2
- package/dist/cjs/theme/g6.d.ts +1 -1
- package/dist/cjs/theme/presets.d.ts +5 -0
- package/dist/cjs/theme/presets.js +663 -0
- package/dist/cjs/theme/resolve.js +2 -1
- package/dist/cjs/theme/table.js +1 -1
- package/dist/cjs/types/index.d.ts +3 -3
- package/dist/cjs/types/theme.d.ts +2 -0
- package/dist/cjs/vis/table/index.js +2 -0
- package/dist/cjs/vis-wrapper/index.js +2 -1
- package/dist/esm/theme/g6.d.ts +1 -1
- package/dist/esm/theme/presets.d.ts +5 -0
- package/dist/esm/theme/presets.js +1070 -0
- package/dist/esm/theme/resolve.js +5 -1
- package/dist/esm/theme/table.js +1 -1
- package/dist/esm/types/index.d.ts +3 -3
- package/dist/esm/types/theme.d.ts +2 -0
- package/dist/esm/vis/table/index.js +1 -1
- package/dist/esm/vis-wrapper/index.js +2 -1
- package/dist/umd/index.min.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,663 @@
|
|
|
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/theme/presets.ts
|
|
20
|
+
var presets_exports = {};
|
|
21
|
+
__export(presets_exports, {
|
|
22
|
+
THEME_PRESETS: () => THEME_PRESETS
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(presets_exports);
|
|
25
|
+
function createPreset(id, label, description, colors, options = {}) {
|
|
26
|
+
const { dark = false, serif = false, radius = 6, product = false } = options;
|
|
27
|
+
const fontFamily = serif ? 'Georgia, "Times New Roman", serif' : product ? '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif' : "Alibaba PuHuiTi, sans-serif";
|
|
28
|
+
const inverse = dark ? "#101827" : product ? colors.text : "#ffffff";
|
|
29
|
+
return {
|
|
30
|
+
id,
|
|
31
|
+
label,
|
|
32
|
+
description,
|
|
33
|
+
baseTheme: dark ? "dark" : serif ? "academy" : "default",
|
|
34
|
+
tokens: {
|
|
35
|
+
colorDefault: colors.palette[0],
|
|
36
|
+
colorBackground: colors.background,
|
|
37
|
+
colorSurface: colors.surface,
|
|
38
|
+
colorText: colors.text,
|
|
39
|
+
colorTextSecondary: colors.secondary,
|
|
40
|
+
colorTextInverse: inverse,
|
|
41
|
+
colorStroke: colors.stroke,
|
|
42
|
+
colorPositive: colors.positive,
|
|
43
|
+
colorNegative: colors.negative,
|
|
44
|
+
colorNeutral: colors.secondary,
|
|
45
|
+
category10: colors.palette,
|
|
46
|
+
fontFamily,
|
|
47
|
+
fontSize: 11,
|
|
48
|
+
fontWeight: 400,
|
|
49
|
+
lineHeight: 22,
|
|
50
|
+
spacingSmall: 6,
|
|
51
|
+
spacingMedium: 12,
|
|
52
|
+
lineWidth: serif ? 1 : 2,
|
|
53
|
+
radius
|
|
54
|
+
},
|
|
55
|
+
style: {
|
|
56
|
+
title: {
|
|
57
|
+
titleFontSize: 16,
|
|
58
|
+
titleFontWeight: serif ? 500 : product ? 600 : 700,
|
|
59
|
+
spacing: 5
|
|
60
|
+
},
|
|
61
|
+
axis: { line: serif, tick: serif, gridLineWidth: 0.5, gridLineDash: serif ? [2, 3] : [0, 0] },
|
|
62
|
+
mark: {
|
|
63
|
+
line: { lineCap: serif ? "butt" : "round" },
|
|
64
|
+
area: { shape: serif ? "area" : "smooth", fillOpacity: serif ? 0.1 : product ? 0.12 : 0.2 },
|
|
65
|
+
point: {
|
|
66
|
+
size: serif ? 3 : 4,
|
|
67
|
+
shape: serif ? "hollow" : "point",
|
|
68
|
+
stroke: colors.background
|
|
69
|
+
},
|
|
70
|
+
interval: { stroke: colors.background },
|
|
71
|
+
treemap: { stroke: colors.background },
|
|
72
|
+
liquid: {
|
|
73
|
+
contentFontSize: 28
|
|
74
|
+
},
|
|
75
|
+
sankey: { nodeStroke: colors.background, nodeLineWidth: 1, linkFillOpacity: 0.25 }
|
|
76
|
+
},
|
|
77
|
+
table: {
|
|
78
|
+
header: {
|
|
79
|
+
backgroundColor: product ? colors.surface : colors.palette[0],
|
|
80
|
+
fill: product ? colors.text : inverse,
|
|
81
|
+
fontWeight: 700
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
summary: { fontSize: 15, lineHeight: 27 }
|
|
85
|
+
},
|
|
86
|
+
charts: {
|
|
87
|
+
line: { style: { mark: { line: { shape: serif ? "line" : "smooth" } } } },
|
|
88
|
+
area: { style: { mark: { line: { shape: serif ? "line" : "smooth" } } } },
|
|
89
|
+
pie: { style: { mark: { interval: { stroke: colors.background, lineWidth: 3 } } } },
|
|
90
|
+
radar: { style: { mark: { line: { shape: "line" } } } }
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
var THEME_PRESETS = [
|
|
95
|
+
createPreset("gpt-vis", "GPT-Vis", "Clear, expressive, and ready for your next idea.", {
|
|
96
|
+
background: "#ffffff",
|
|
97
|
+
surface: "#f5f3ff",
|
|
98
|
+
text: "#23272f",
|
|
99
|
+
secondary: "#626478",
|
|
100
|
+
stroke: "#d9d7e6",
|
|
101
|
+
palette: [
|
|
102
|
+
"#7047eb",
|
|
103
|
+
"#3b9bb7",
|
|
104
|
+
"#f0af54",
|
|
105
|
+
"#e87787",
|
|
106
|
+
"#6baa8f",
|
|
107
|
+
"#a68ae0",
|
|
108
|
+
"#cf8253",
|
|
109
|
+
"#6379b9",
|
|
110
|
+
"#a99b53",
|
|
111
|
+
"#8b94a5"
|
|
112
|
+
],
|
|
113
|
+
positive: "#278160",
|
|
114
|
+
negative: "#c64d64"
|
|
115
|
+
}),
|
|
116
|
+
createPreset(
|
|
117
|
+
"midnight",
|
|
118
|
+
"Midnight",
|
|
119
|
+
"Luminous data. A quieter kind of dark.",
|
|
120
|
+
{
|
|
121
|
+
background: "#141b2b",
|
|
122
|
+
surface: "#1d283b",
|
|
123
|
+
text: "#edf2fa",
|
|
124
|
+
secondary: "#a8b8d0",
|
|
125
|
+
stroke: "#3b4a65",
|
|
126
|
+
palette: [
|
|
127
|
+
"#a99aff",
|
|
128
|
+
"#6fd3de",
|
|
129
|
+
"#edbd76",
|
|
130
|
+
"#ee93ae",
|
|
131
|
+
"#8bd3a8",
|
|
132
|
+
"#77a8ef",
|
|
133
|
+
"#d4a2e8",
|
|
134
|
+
"#c7d989",
|
|
135
|
+
"#f0a888",
|
|
136
|
+
"#a6b9d0"
|
|
137
|
+
],
|
|
138
|
+
positive: "#8bd3a8",
|
|
139
|
+
negative: "#ee93ae"
|
|
140
|
+
},
|
|
141
|
+
{ dark: true }
|
|
142
|
+
),
|
|
143
|
+
createPreset(
|
|
144
|
+
"paper",
|
|
145
|
+
"Paper",
|
|
146
|
+
"Thoughtful typography for considered research.",
|
|
147
|
+
{
|
|
148
|
+
background: "#fcfbf8",
|
|
149
|
+
surface: "#f2efe8",
|
|
150
|
+
text: "#302f2b",
|
|
151
|
+
secondary: "#706b60",
|
|
152
|
+
stroke: "#d8d2c6",
|
|
153
|
+
palette: [
|
|
154
|
+
"#486b86",
|
|
155
|
+
"#a45e4a",
|
|
156
|
+
"#819272",
|
|
157
|
+
"#b89650",
|
|
158
|
+
"#867394",
|
|
159
|
+
"#5f9697",
|
|
160
|
+
"#c08773",
|
|
161
|
+
"#8b929c",
|
|
162
|
+
"#aa8c7b",
|
|
163
|
+
"#71875e"
|
|
164
|
+
],
|
|
165
|
+
positive: "#547a4d",
|
|
166
|
+
negative: "#ad4d47"
|
|
167
|
+
},
|
|
168
|
+
{ serif: true, radius: 0 }
|
|
169
|
+
),
|
|
170
|
+
createPreset(
|
|
171
|
+
"product",
|
|
172
|
+
"Product",
|
|
173
|
+
"Fresh sky blue, soft surfaces, and a modern product feel.",
|
|
174
|
+
{
|
|
175
|
+
background: "#f8fcff",
|
|
176
|
+
surface: "#e8f4fd",
|
|
177
|
+
text: "#17324d",
|
|
178
|
+
secondary: "#526e85",
|
|
179
|
+
stroke: "#c8dfef",
|
|
180
|
+
palette: [
|
|
181
|
+
"#38bdf8",
|
|
182
|
+
"#3b82f6",
|
|
183
|
+
"#2dd4bf",
|
|
184
|
+
"#818cf8",
|
|
185
|
+
"#fbbf24",
|
|
186
|
+
"#f472b6",
|
|
187
|
+
"#4ade80",
|
|
188
|
+
"#22d3ee",
|
|
189
|
+
"#a5b4fc",
|
|
190
|
+
"#94a3b8"
|
|
191
|
+
],
|
|
192
|
+
positive: "#15803d",
|
|
193
|
+
negative: "#be123c"
|
|
194
|
+
},
|
|
195
|
+
{ product: true, radius: 12 }
|
|
196
|
+
),
|
|
197
|
+
{
|
|
198
|
+
id: "neon-circuit",
|
|
199
|
+
label: "Neon Circuit",
|
|
200
|
+
description: "Midnight circuitry, electric cyan, hot magenta, and precise monospace type.",
|
|
201
|
+
baseTheme: "dark",
|
|
202
|
+
tokens: {
|
|
203
|
+
colorDefault: "#22d3ee",
|
|
204
|
+
colorBackground: "#080d1a",
|
|
205
|
+
colorSurface: "#111c30",
|
|
206
|
+
colorText: "#e8f6ff",
|
|
207
|
+
colorTextSecondary: "#a4b8d0",
|
|
208
|
+
colorTextInverse: "#080d1a",
|
|
209
|
+
colorStroke: "#415977",
|
|
210
|
+
colorPositive: "#4ade80",
|
|
211
|
+
colorNegative: "#fb7185",
|
|
212
|
+
colorNeutral: "#a4b8d0",
|
|
213
|
+
category10: [
|
|
214
|
+
"#22d3ee",
|
|
215
|
+
"#f472b6",
|
|
216
|
+
"#a3e635",
|
|
217
|
+
"#a78bfa",
|
|
218
|
+
"#facc15",
|
|
219
|
+
"#60a5fa",
|
|
220
|
+
"#fb923c",
|
|
221
|
+
"#2dd4bf",
|
|
222
|
+
"#fb7185",
|
|
223
|
+
"#c4b5fd"
|
|
224
|
+
],
|
|
225
|
+
category20: [
|
|
226
|
+
"#22d3ee",
|
|
227
|
+
"#f472b6",
|
|
228
|
+
"#a3e635",
|
|
229
|
+
"#a78bfa",
|
|
230
|
+
"#facc15",
|
|
231
|
+
"#60a5fa",
|
|
232
|
+
"#fb923c",
|
|
233
|
+
"#2dd4bf",
|
|
234
|
+
"#fb7185",
|
|
235
|
+
"#c4b5fd",
|
|
236
|
+
"#67e8f9",
|
|
237
|
+
"#f9a8d4",
|
|
238
|
+
"#bef264",
|
|
239
|
+
"#c084fc",
|
|
240
|
+
"#fde68a",
|
|
241
|
+
"#93c5fd",
|
|
242
|
+
"#fdba74",
|
|
243
|
+
"#5eead4",
|
|
244
|
+
"#fda4af",
|
|
245
|
+
"#e9d5ff"
|
|
246
|
+
],
|
|
247
|
+
fontFamily: '"SFMono-Regular", Consolas, "Liberation Mono", monospace',
|
|
248
|
+
fontSize: 11,
|
|
249
|
+
fontWeight: 500,
|
|
250
|
+
lineHeight: 20,
|
|
251
|
+
spacingSmall: 6,
|
|
252
|
+
spacingMedium: 12,
|
|
253
|
+
lineWidth: 2,
|
|
254
|
+
radius: 2
|
|
255
|
+
},
|
|
256
|
+
style: {
|
|
257
|
+
title: { titleFontWeight: 700, spacing: 6 },
|
|
258
|
+
axis: { line: true, tick: false, gridLineWidth: 0.5, gridLineDash: [2, 4] },
|
|
259
|
+
mark: {
|
|
260
|
+
line: { shape: "hv", lineCap: "square" },
|
|
261
|
+
area: { shape: "hv", fillOpacity: 0.22 },
|
|
262
|
+
point: { shape: "diamond", size: 4, stroke: "#080d1a" },
|
|
263
|
+
interval: { stroke: "#080d1a" },
|
|
264
|
+
treemap: { stroke: "#080d1a" },
|
|
265
|
+
liquid: { shape: "rect", contentFontSize: 30, contentFontWeight: 700 },
|
|
266
|
+
sankey: { linkFillOpacity: 0.35, nodeStroke: "#080d1a", linkLineWidth: 0 }
|
|
267
|
+
},
|
|
268
|
+
node: { fillOpacity: 0.16, stroke: "#22d3ee", labelFill: "#e8f6ff" },
|
|
269
|
+
edge: { stroke: "#7898bc", lineDash: [4, 3] },
|
|
270
|
+
table: { header: { fill: "#22d3ee", backgroundColor: "#172640", fontWeight: 700 } },
|
|
271
|
+
summary: {
|
|
272
|
+
fontSize: 14,
|
|
273
|
+
lineHeight: 25,
|
|
274
|
+
colorHeadingBase: "#22d3ee",
|
|
275
|
+
colorMetricValue: "#f472b6"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
charts: {
|
|
279
|
+
area: { style: { mark: { line: { shape: "hv" } } } },
|
|
280
|
+
radar: { style: { mark: { line: { shape: "line" } } } },
|
|
281
|
+
pie: { style: { mark: { interval: { radius: 0, lineWidth: 3 } } } },
|
|
282
|
+
"network-graph": { style: { node: { type: "hexagon" }, edge: { type: "line" } } }
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: "terra-print",
|
|
287
|
+
label: "Terra Print",
|
|
288
|
+
description: "Warm paper, terracotta ink, serif headlines, and crisp print-like geometry.",
|
|
289
|
+
baseTheme: "academy",
|
|
290
|
+
tokens: {
|
|
291
|
+
colorDefault: "#a33b28",
|
|
292
|
+
colorBackground: "#fff7e8",
|
|
293
|
+
colorSurface: "#f3e5cf",
|
|
294
|
+
colorText: "#36291f",
|
|
295
|
+
colorTextSecondary: "#75624f",
|
|
296
|
+
colorTextInverse: "#fff7e8",
|
|
297
|
+
colorStroke: "#c9b79b",
|
|
298
|
+
colorPositive: "#466343",
|
|
299
|
+
colorNegative: "#a33b28",
|
|
300
|
+
colorNeutral: "#75624f",
|
|
301
|
+
category10: [
|
|
302
|
+
"#a33b28",
|
|
303
|
+
"#426459",
|
|
304
|
+
"#8e681e",
|
|
305
|
+
"#695075",
|
|
306
|
+
"#335975",
|
|
307
|
+
"#a54d60",
|
|
308
|
+
"#6b7040",
|
|
309
|
+
"#805039",
|
|
310
|
+
"#4c6675",
|
|
311
|
+
"#775641"
|
|
312
|
+
],
|
|
313
|
+
fontFamily: 'Georgia, "Times New Roman", serif',
|
|
314
|
+
fontSize: 12,
|
|
315
|
+
fontWeight: 400,
|
|
316
|
+
lineHeight: 23,
|
|
317
|
+
spacingSmall: 5,
|
|
318
|
+
spacingMedium: 12,
|
|
319
|
+
lineWidth: 1,
|
|
320
|
+
radius: 0
|
|
321
|
+
},
|
|
322
|
+
style: {
|
|
323
|
+
title: { titleFontSize: 19, titleFontWeight: 700, titleFill: "#a33b28", spacing: 7 },
|
|
324
|
+
axis: { line: true, tick: true, gridLineDash: [2, 4], gridLineWidth: 0.5 },
|
|
325
|
+
mark: {
|
|
326
|
+
line: { lineWidth: 2, lineCap: "butt" },
|
|
327
|
+
area: { shape: "area", fillOpacity: 0.13 },
|
|
328
|
+
point: { shape: "hollowCircle", size: 4, lineWidth: 1.5 },
|
|
329
|
+
interval: { stroke: "#fff7e8", lineWidth: 1 },
|
|
330
|
+
treemap: { stroke: "#fff7e8", lineWidth: 2 },
|
|
331
|
+
liquid: { shape: "rect", contentFontSize: 30, contentFontWeight: 700 },
|
|
332
|
+
sankey: { nodeStroke: "#fff7e8", linkFillOpacity: 0.25 }
|
|
333
|
+
},
|
|
334
|
+
node: { fillOpacity: 0.18, stroke: "#a33b28", labelFill: "#36291f" },
|
|
335
|
+
edge: { stroke: "#937b62", lineWidth: 1 },
|
|
336
|
+
table: {
|
|
337
|
+
header: { backgroundColor: "#a33b28", fill: "#fff7e8", fontWeight: 700 },
|
|
338
|
+
cell: { backgroundColor: "#fff7e8", padding: [10, 12] },
|
|
339
|
+
border: { color: "#b7a081", width: 1, radius: 0 }
|
|
340
|
+
},
|
|
341
|
+
summary: { fontSize: 15, lineHeight: 28, colorHeadingBase: "#a33b28" }
|
|
342
|
+
},
|
|
343
|
+
charts: {
|
|
344
|
+
line: { style: { mark: { line: { shape: "line" } } } },
|
|
345
|
+
area: { style: { mark: { line: { shape: "line" } } } },
|
|
346
|
+
pie: { style: { mark: { interval: { lineWidth: 3 } } } },
|
|
347
|
+
"network-graph": { style: { node: { type: "rect" }, edge: { type: "line" } } },
|
|
348
|
+
"fishbone-diagram": { style: { texture: "rough" } }
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: "mono-signal",
|
|
353
|
+
label: "Mono Signal",
|
|
354
|
+
description: "Black ink, white space, monospaced detail, and precise technical outlines.",
|
|
355
|
+
baseTheme: "default",
|
|
356
|
+
tokens: {
|
|
357
|
+
colorDefault: "#18181b",
|
|
358
|
+
colorBackground: "#ffffff",
|
|
359
|
+
colorSurface: "#f4f4f5",
|
|
360
|
+
colorText: "#18181b",
|
|
361
|
+
colorTextSecondary: "#62626a",
|
|
362
|
+
colorTextInverse: "#ffffff",
|
|
363
|
+
colorStroke: "#b4b4bc",
|
|
364
|
+
colorPositive: "#28704a",
|
|
365
|
+
colorNegative: "#b33737",
|
|
366
|
+
colorNeutral: "#62626a",
|
|
367
|
+
category10: [
|
|
368
|
+
"#18181b",
|
|
369
|
+
"#64748b",
|
|
370
|
+
"#404040",
|
|
371
|
+
"#737373",
|
|
372
|
+
"#334155",
|
|
373
|
+
"#52525b",
|
|
374
|
+
"#475569",
|
|
375
|
+
"#71717a",
|
|
376
|
+
"#3f3f46",
|
|
377
|
+
"#78716c"
|
|
378
|
+
],
|
|
379
|
+
fontFamily: '"SFMono-Regular", Consolas, "Liberation Mono", monospace',
|
|
380
|
+
fontSize: 11,
|
|
381
|
+
fontWeight: 400,
|
|
382
|
+
lineHeight: 21,
|
|
383
|
+
spacingSmall: 4,
|
|
384
|
+
spacingMedium: 10,
|
|
385
|
+
lineWidth: 1,
|
|
386
|
+
radius: 0
|
|
387
|
+
},
|
|
388
|
+
style: {
|
|
389
|
+
title: { titleFontSize: 16, titleFontWeight: 700, spacing: 8 },
|
|
390
|
+
axis: { line: true, tick: true, grid: false, tickLength: 3 },
|
|
391
|
+
legend: { itemMarkerSize: 7, itemLabelFontSize: 10 },
|
|
392
|
+
mark: {
|
|
393
|
+
line: { shape: "hv", lineWidth: 1.5, lineCap: "square" },
|
|
394
|
+
area: { shape: "hv", fillOpacity: 0.12 },
|
|
395
|
+
point: { shape: "hollowSquare", size: 4, lineWidth: 1.5 },
|
|
396
|
+
interval: { stroke: "#ffffff", lineWidth: 1 },
|
|
397
|
+
treemap: { stroke: "#ffffff", lineWidth: 2 },
|
|
398
|
+
liquid: { shape: "rect", contentFontSize: 28 },
|
|
399
|
+
sankey: { linkFillOpacity: 0.18, nodeStroke: "#ffffff" }
|
|
400
|
+
},
|
|
401
|
+
node: { fillOpacity: 0.12, stroke: "#18181b", lineWidth: 1.5 },
|
|
402
|
+
edge: { stroke: "#71717a", lineDash: [3, 3], lineWidth: 1 },
|
|
403
|
+
table: {
|
|
404
|
+
header: { backgroundColor: "#18181b", fill: "#ffffff", fontWeight: 700 },
|
|
405
|
+
cell: { backgroundColor: "#ffffff", padding: [9, 10] },
|
|
406
|
+
border: { color: "#18181b", width: 1, radius: 0 }
|
|
407
|
+
},
|
|
408
|
+
summary: { fontSize: 13, lineHeight: 25, colorHeadingBase: "#18181b" }
|
|
409
|
+
},
|
|
410
|
+
charts: {
|
|
411
|
+
area: { style: { mark: { line: { shape: "hv" } } } },
|
|
412
|
+
radar: { style: { mark: { line: { shape: "line" } } } },
|
|
413
|
+
pie: { style: { mark: { interval: { lineWidth: 3 } } } },
|
|
414
|
+
"network-graph": { style: { node: { type: "diamond" }, edge: { type: "line" } } }
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: "candy-pop",
|
|
419
|
+
label: "Candy Pop",
|
|
420
|
+
description: "Candy colors, bold outlines, rounded bars, and playful geometric details.",
|
|
421
|
+
baseTheme: "default",
|
|
422
|
+
tokens: {
|
|
423
|
+
colorDefault: "#f6a3cb",
|
|
424
|
+
colorBackground: "#fff9f1",
|
|
425
|
+
colorSurface: "#fff0db",
|
|
426
|
+
colorText: "#292440",
|
|
427
|
+
colorTextSecondary: "#706079",
|
|
428
|
+
colorTextInverse: "#292440",
|
|
429
|
+
colorStroke: "#b4a3b9",
|
|
430
|
+
colorPositive: "#28704a",
|
|
431
|
+
colorNegative: "#b33753",
|
|
432
|
+
colorNeutral: "#706079",
|
|
433
|
+
category10: [
|
|
434
|
+
"#f6a3cb",
|
|
435
|
+
"#8dc9f5",
|
|
436
|
+
"#f6d766",
|
|
437
|
+
"#a9deb2",
|
|
438
|
+
"#c3b0ed",
|
|
439
|
+
"#f5b58a",
|
|
440
|
+
"#86d8d1",
|
|
441
|
+
"#d5cc89",
|
|
442
|
+
"#b3c0f3",
|
|
443
|
+
"#e8b6db"
|
|
444
|
+
],
|
|
445
|
+
fontFamily: '"Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif',
|
|
446
|
+
fontSize: 12,
|
|
447
|
+
fontWeight: 500,
|
|
448
|
+
lineHeight: 23,
|
|
449
|
+
spacingSmall: 6,
|
|
450
|
+
spacingMedium: 12,
|
|
451
|
+
lineWidth: 2,
|
|
452
|
+
radius: 14
|
|
453
|
+
},
|
|
454
|
+
style: {
|
|
455
|
+
title: { titleFontSize: 18, titleFontWeight: 800, spacing: 6 },
|
|
456
|
+
axis: { line: false, tick: false, gridLineDash: [2, 5], gridLineWidth: 0.75 },
|
|
457
|
+
mark: {
|
|
458
|
+
line: { shape: "smooth", lineWidth: 3, lineCap: "round" },
|
|
459
|
+
area: { shape: "smooth", fillOpacity: 0.35 },
|
|
460
|
+
point: { shape: "triangle", size: 5, stroke: "#292440", lineWidth: 1.5 },
|
|
461
|
+
interval: { stroke: "#292440", lineWidth: 1.5 },
|
|
462
|
+
treemap: { stroke: "#292440", lineWidth: 1.5, radius: 8 },
|
|
463
|
+
liquid: { shape: "circle", contentFill: "#292440", contentFontSize: 32 },
|
|
464
|
+
sankey: { nodeStroke: "#292440", nodeLineWidth: 1.5, linkFillOpacity: 0.45 }
|
|
465
|
+
},
|
|
466
|
+
node: { fillOpacity: 1, stroke: "#292440", labelFill: "#292440", lineWidth: 2 },
|
|
467
|
+
edge: { stroke: "#7c6d91", lineWidth: 2 },
|
|
468
|
+
table: {
|
|
469
|
+
header: { backgroundColor: "#f6a3cb", fill: "#292440", fontWeight: 700 },
|
|
470
|
+
cell: { backgroundColor: "#fff9f1", padding: [10, 12] },
|
|
471
|
+
border: { color: "#292440", width: 2, radius: 14 }
|
|
472
|
+
},
|
|
473
|
+
summary: {
|
|
474
|
+
fontSize: 15,
|
|
475
|
+
lineHeight: 28,
|
|
476
|
+
colorHeadingBase: "#292440",
|
|
477
|
+
colorMetricValue: "#87406e"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
charts: {
|
|
481
|
+
area: { style: { mark: { line: { shape: "smooth" } } } },
|
|
482
|
+
radar: { style: { mark: { line: { shape: "line" } } } },
|
|
483
|
+
pie: { style: { mark: { interval: { radius: 5, lineWidth: 2 } } } },
|
|
484
|
+
"network-graph": { style: { node: { type: "hexagon" }, edge: { type: "quadratic" } } }
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
// Adapted from Flint Chart. Copyright (c) Microsoft Corporation. MIT License.
|
|
489
|
+
// See the license notice at the top of this file.
|
|
490
|
+
// Visual reference: https://github.com/microsoft/flint-chart/blob/main/packages/flint-js/src/core/theme/presets/pop.ts
|
|
491
|
+
// Adapted to GPT-Vis appearance fields, including relationship graphs, Table and Summary.
|
|
492
|
+
id: "pop",
|
|
493
|
+
label: "Pop",
|
|
494
|
+
description: "Warm white, vivid contrasting colors, yellow accents, heavy black outlines, and bold display type.",
|
|
495
|
+
baseTheme: "default",
|
|
496
|
+
tokens: {
|
|
497
|
+
colorDefault: "#f04493",
|
|
498
|
+
colorBackground: "#fffdf5",
|
|
499
|
+
colorSurface: "#fff5cf",
|
|
500
|
+
colorText: "#111111",
|
|
501
|
+
colorTextSecondary: "#5f0047",
|
|
502
|
+
colorTextInverse: "#fffdf5",
|
|
503
|
+
colorStroke: "#111111",
|
|
504
|
+
colorPositive: "#166534",
|
|
505
|
+
colorNegative: "#a90055",
|
|
506
|
+
colorNeutral: "#111111",
|
|
507
|
+
category10: ["#ff6aaf", "#42cbe8", "#ff9752", "#b49aee", "#78ce93", "#f4d449"],
|
|
508
|
+
fontFamily: '"Arial Black", "Helvetica Neue", Arial, sans-serif',
|
|
509
|
+
fontSize: 11,
|
|
510
|
+
fontWeight: 700,
|
|
511
|
+
lineHeight: 22,
|
|
512
|
+
spacingSmall: 7,
|
|
513
|
+
spacingMedium: 12,
|
|
514
|
+
lineWidth: 3,
|
|
515
|
+
radius: 0
|
|
516
|
+
},
|
|
517
|
+
style: {
|
|
518
|
+
title: {
|
|
519
|
+
titleFontSize: 21,
|
|
520
|
+
titleFontWeight: 900,
|
|
521
|
+
titleFill: "#111111",
|
|
522
|
+
spacing: 8
|
|
523
|
+
},
|
|
524
|
+
axis: {
|
|
525
|
+
line: true,
|
|
526
|
+
lineLineWidth: 3,
|
|
527
|
+
tick: false,
|
|
528
|
+
gridStroke: "#ddd7c9",
|
|
529
|
+
gridLineWidth: 0.5,
|
|
530
|
+
gridLineDash: [0, 0]
|
|
531
|
+
},
|
|
532
|
+
legend: { itemMarkerSize: 9, itemLabelFontWeight: 700 },
|
|
533
|
+
mark: {
|
|
534
|
+
line: { shape: "line", lineWidth: 6, lineCap: "square", lineJoin: "miter" },
|
|
535
|
+
area: { shape: "area", fillOpacity: 0.25 },
|
|
536
|
+
point: { shape: "point", size: 6, stroke: "#111111", lineWidth: 2 },
|
|
537
|
+
interval: { stroke: "#111111", lineWidth: 3, radius: 0 },
|
|
538
|
+
treemap: { stroke: "#111111", lineWidth: 3, radius: 0 },
|
|
539
|
+
liquid: {
|
|
540
|
+
shape: "rect",
|
|
541
|
+
contentFill: "#111111",
|
|
542
|
+
contentFontSize: 36,
|
|
543
|
+
contentFontWeight: 900
|
|
544
|
+
},
|
|
545
|
+
sankey: { linkFillOpacity: 0.75, nodeStroke: "#111111", nodeLineWidth: 3 }
|
|
546
|
+
},
|
|
547
|
+
node: { fillOpacity: 1, stroke: "#111111", labelFill: "#111111", lineWidth: 3 },
|
|
548
|
+
edge: { stroke: "#111111", lineWidth: 3 },
|
|
549
|
+
table: {
|
|
550
|
+
header: { backgroundColor: "#f4d449", fill: "#111111", fontWeight: 900 },
|
|
551
|
+
cell: { backgroundColor: "#fffdf5", padding: [10, 12] },
|
|
552
|
+
border: { color: "#111111", width: 3, radius: 0 }
|
|
553
|
+
},
|
|
554
|
+
summary: {
|
|
555
|
+
fontSize: 15,
|
|
556
|
+
lineHeight: 28,
|
|
557
|
+
colorHeadingBase: "#111111",
|
|
558
|
+
colorMetricValue: "#a90055"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
charts: {
|
|
562
|
+
line: { style: { mark: { line: { shape: "line" } } } },
|
|
563
|
+
area: { style: { mark: { line: { shape: "line" } } } },
|
|
564
|
+
pie: { style: { mark: { interval: { radius: 0, stroke: "#111111", lineWidth: 3 } } } },
|
|
565
|
+
"network-graph": { style: { node: { type: "rect" }, edge: { type: "line" } } }
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
id: "bauhaus",
|
|
570
|
+
label: "Bauhaus",
|
|
571
|
+
description: "Bold primary colors, sharp geometry, black outlines, and confident sans-serif typography.",
|
|
572
|
+
baseTheme: "default",
|
|
573
|
+
tokens: {
|
|
574
|
+
colorDefault: "#2055c9",
|
|
575
|
+
colorBackground: "#ffffff",
|
|
576
|
+
colorSurface: "#f2f1ed",
|
|
577
|
+
colorText: "#191919",
|
|
578
|
+
colorTextSecondary: "#595954",
|
|
579
|
+
colorTextInverse: "#ffffff",
|
|
580
|
+
colorStroke: "#c9c9c2",
|
|
581
|
+
colorPositive: "#24754b",
|
|
582
|
+
colorNegative: "#bd3434",
|
|
583
|
+
colorNeutral: "#595954",
|
|
584
|
+
category10: [
|
|
585
|
+
"#2055c9",
|
|
586
|
+
"#d43c30",
|
|
587
|
+
"#b78100",
|
|
588
|
+
"#252525",
|
|
589
|
+
"#287b66",
|
|
590
|
+
"#8154a2",
|
|
591
|
+
"#b95120",
|
|
592
|
+
"#4f758a"
|
|
593
|
+
],
|
|
594
|
+
fontFamily: "Arial, sans-serif",
|
|
595
|
+
fontSize: 11,
|
|
596
|
+
fontWeight: 500,
|
|
597
|
+
lineHeight: 21,
|
|
598
|
+
spacingSmall: 6,
|
|
599
|
+
spacingMedium: 12,
|
|
600
|
+
lineWidth: 1.5,
|
|
601
|
+
radius: 0
|
|
602
|
+
},
|
|
603
|
+
style: {
|
|
604
|
+
title: { titleFontSize: 20, titleFontWeight: 700, spacing: 6 },
|
|
605
|
+
axis: {
|
|
606
|
+
gridLineWidth: 0.5,
|
|
607
|
+
line: true,
|
|
608
|
+
lineStroke: "#292929",
|
|
609
|
+
lineLineWidth: 1,
|
|
610
|
+
tick: true,
|
|
611
|
+
tickLength: 4,
|
|
612
|
+
gridStroke: "#deded8",
|
|
613
|
+
gridLineDash: [0, 0]
|
|
614
|
+
},
|
|
615
|
+
legend: { itemMarkerSize: 9, itemSpacing: [6, 6, 3] },
|
|
616
|
+
mark: {
|
|
617
|
+
line: { shape: "line", lineWidth: 3, lineCap: "butt", lineJoin: "miter" },
|
|
618
|
+
area: { shape: "area", fillOpacity: 0.16 },
|
|
619
|
+
point: { shape: "square", size: 4, stroke: "#191919", lineWidth: 1 },
|
|
620
|
+
interval: { stroke: "#191919", lineWidth: 1, fillOpacity: 1 },
|
|
621
|
+
treemap: { stroke: "#ffffff", lineWidth: 3, radius: 0 },
|
|
622
|
+
liquid: {
|
|
623
|
+
shape: "rect",
|
|
624
|
+
contentFill: "#191919",
|
|
625
|
+
contentFontSize: 32,
|
|
626
|
+
contentFontWeight: 700,
|
|
627
|
+
outlineStroke: "#191919",
|
|
628
|
+
outlineBorder: 2
|
|
629
|
+
},
|
|
630
|
+
sankey: { nodeStroke: "#191919", nodeLineWidth: 1, linkFillOpacity: 0.3 }
|
|
631
|
+
},
|
|
632
|
+
node: {
|
|
633
|
+
fillOpacity: 0.14,
|
|
634
|
+
labelFill: "#191919",
|
|
635
|
+
stroke: "#191919",
|
|
636
|
+
lineWidth: 1.5,
|
|
637
|
+
labelFontWeight: 600
|
|
638
|
+
},
|
|
639
|
+
edge: { stroke: "#595954", lineWidth: 1.5 },
|
|
640
|
+
table: {
|
|
641
|
+
header: { backgroundColor: "#2055c9", fill: "#ffffff", fontWeight: 700 },
|
|
642
|
+
cell: { backgroundColor: "#ffffff", padding: [9, 12], lineHeight: 20 },
|
|
643
|
+
border: { color: "#191919", width: 1.5, style: "solid", radius: 0 }
|
|
644
|
+
},
|
|
645
|
+
summary: {
|
|
646
|
+
fontSize: 14,
|
|
647
|
+
lineHeight: 26,
|
|
648
|
+
colorHeadingBase: "#191919",
|
|
649
|
+
colorMetricValue: "#2055c9"
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
charts: {
|
|
653
|
+
radar: { style: { mark: { line: { shape: "line" } } } },
|
|
654
|
+
waterfall: { style: { palette: ["#24754b", "#bd3434", "#2055c9"] } },
|
|
655
|
+
pie: { style: { mark: { interval: { stroke: "#ffffff", lineWidth: 3, radius: 0 } } } },
|
|
656
|
+
"network-graph": { style: { node: { type: "rect" }, edge: { type: "line" } } }
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
];
|
|
660
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
661
|
+
0 && (module.exports = {
|
|
662
|
+
THEME_PRESETS
|
|
663
|
+
});
|
|
@@ -22,9 +22,10 @@ __export(resolve_exports, {
|
|
|
22
22
|
resolveTheme: () => resolveTheme
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(resolve_exports);
|
|
25
|
+
var import_presets = require("./presets");
|
|
25
26
|
function resolveTheme(type, theme, localStyle) {
|
|
26
27
|
var _a, _b;
|
|
27
|
-
const spec = typeof theme === "object" ? theme :
|
|
28
|
+
const spec = typeof theme === "object" ? theme : import_presets.THEME_PRESETS.find((preset) => preset.id === theme);
|
|
28
29
|
const tokens = (spec == null ? void 0 : spec.tokens) ?? {};
|
|
29
30
|
const name = (spec == null ? void 0 : spec.baseTheme) ?? (typeof theme === "string" ? theme : "default");
|
|
30
31
|
const baseTheme = name === "dark" || name === "academy" ? name : "light";
|
package/dist/cjs/theme/table.js
CHANGED
|
@@ -96,7 +96,7 @@ var adaptTableCellStyle = (style) => {
|
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
var adaptTableBorderStyle = (style) => {
|
|
99
|
-
if (!style)
|
|
99
|
+
if (!style || Object.keys(style).length === 0)
|
|
100
100
|
return { table: {}, cell: {} };
|
|
101
101
|
const width = toPixels(style.width ?? 1);
|
|
102
102
|
const lineStyle = style.style ?? "solid";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ThemeSpec } from './theme';
|
|
2
|
-
export type { ChartType, ThemeSpec, ThemeStyle, ThemeTokens } from './theme';
|
|
1
|
+
import type { BuiltinThemeName, ThemeSpec } from './theme';
|
|
2
|
+
export type { BuiltinThemeName, ChartType, ThemeSpec, ThemeStyle, ThemeTokens } from './theme';
|
|
3
3
|
/** Built-in visualization themes supported by GPT-Vis. */
|
|
4
|
-
export type VisualizationTheme =
|
|
4
|
+
export type VisualizationTheme = BuiltinThemeName | ThemeSpec;
|
|
5
5
|
/** Common construction options shared by every visualization. */
|
|
6
6
|
export interface VisualizationOptions {
|
|
7
7
|
container: string | HTMLElement;
|