@fluentui/react-charts 9.3.12 → 9.3.14
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/CHANGELOG.md +25 -2
- package/dist/index.d.ts +859 -0
- package/lib/VegaDeclarativeChart.js +1 -0
- package/lib/VegaDeclarativeChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +47 -7
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +12 -12
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +405 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +20 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +415 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +537 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3279 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +28 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/index.js +1 -0
- package/lib/components/VegaDeclarativeChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utilities/utilities.js +41 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/VegaDeclarativeChart.js +6 -0
- package/lib-commonjs/VegaDeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +46 -6
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +11 -11
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +274 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +35 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +412 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +533 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3214 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +31 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +33 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { DataVizPalette, getColorFromToken, getNextColor } from '../../utilities/colors';
|
|
2
|
+
import { areArraysEqual } from '../../utilities/utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Vega-Lite Color Scheme to Fluent DataViz Palette Adapter
|
|
5
|
+
*
|
|
6
|
+
* Maps standard Vega-Lite color schemes to Fluent UI DataViz colors
|
|
7
|
+
* Similar to PlotlyColorAdapter but for Vega-Lite specifications
|
|
8
|
+
*/ // Vega's category10 scheme (D3 Category10)
|
|
9
|
+
// https://vega.github.io/vega/docs/schemes/#categorical
|
|
10
|
+
const VEGA_CATEGORY10 = [
|
|
11
|
+
'#1f77b4',
|
|
12
|
+
'#ff7f0e',
|
|
13
|
+
'#2ca02c',
|
|
14
|
+
'#d62728',
|
|
15
|
+
'#9467bd',
|
|
16
|
+
'#8c564b',
|
|
17
|
+
'#e377c2',
|
|
18
|
+
'#7f7f7f',
|
|
19
|
+
'#bcbd22',
|
|
20
|
+
'#17becf'
|
|
21
|
+
];
|
|
22
|
+
// Vega's category20 scheme
|
|
23
|
+
const VEGA_CATEGORY20 = [
|
|
24
|
+
'#1f77b4',
|
|
25
|
+
'#aec7e8',
|
|
26
|
+
'#ff7f0e',
|
|
27
|
+
'#ffbb78',
|
|
28
|
+
'#2ca02c',
|
|
29
|
+
'#98df8a',
|
|
30
|
+
'#d62728',
|
|
31
|
+
'#ff9896',
|
|
32
|
+
'#9467bd',
|
|
33
|
+
'#c5b0d5',
|
|
34
|
+
'#8c564b',
|
|
35
|
+
'#c49c94',
|
|
36
|
+
'#e377c2',
|
|
37
|
+
'#f7b6d2',
|
|
38
|
+
'#7f7f7f',
|
|
39
|
+
'#c7c7c7',
|
|
40
|
+
'#bcbd22',
|
|
41
|
+
'#dbdb8d',
|
|
42
|
+
'#17becf',
|
|
43
|
+
'#9edae5'
|
|
44
|
+
];
|
|
45
|
+
// Tableau10 scheme (commonly used in Vega-Lite)
|
|
46
|
+
const VEGA_TABLEAU10 = [
|
|
47
|
+
'#4e79a7',
|
|
48
|
+
'#f28e2c',
|
|
49
|
+
'#e15759',
|
|
50
|
+
'#76b7b2',
|
|
51
|
+
'#59a14f',
|
|
52
|
+
'#edc949',
|
|
53
|
+
'#af7aa1',
|
|
54
|
+
'#ff9da7',
|
|
55
|
+
'#9c755f',
|
|
56
|
+
'#bab0ab'
|
|
57
|
+
];
|
|
58
|
+
// Tableau20 scheme
|
|
59
|
+
const VEGA_TABLEAU20 = [
|
|
60
|
+
'#4e79a7',
|
|
61
|
+
'#a0cbe8',
|
|
62
|
+
'#f28e2c',
|
|
63
|
+
'#ffbe7d',
|
|
64
|
+
'#59a14f',
|
|
65
|
+
'#8cd17d',
|
|
66
|
+
'#b6992d',
|
|
67
|
+
'#f1ce63',
|
|
68
|
+
'#499894',
|
|
69
|
+
'#86bcb6',
|
|
70
|
+
'#e15759',
|
|
71
|
+
'#ff9d9a',
|
|
72
|
+
'#79706e',
|
|
73
|
+
'#bab0ab',
|
|
74
|
+
'#d37295',
|
|
75
|
+
'#fabfd2',
|
|
76
|
+
'#b07aa1',
|
|
77
|
+
'#d4a6c8',
|
|
78
|
+
'#9d7660',
|
|
79
|
+
'#d7b5a6'
|
|
80
|
+
];
|
|
81
|
+
// Mapping from Vega category10 to Fluent DataViz tokens
|
|
82
|
+
const CATEGORY10_FLUENT_MAPPING = [
|
|
83
|
+
DataVizPalette.color26,
|
|
84
|
+
DataVizPalette.warning,
|
|
85
|
+
DataVizPalette.color5,
|
|
86
|
+
DataVizPalette.error,
|
|
87
|
+
DataVizPalette.color4,
|
|
88
|
+
DataVizPalette.color17,
|
|
89
|
+
DataVizPalette.color22,
|
|
90
|
+
DataVizPalette.disabled,
|
|
91
|
+
DataVizPalette.color10,
|
|
92
|
+
DataVizPalette.color3
|
|
93
|
+
];
|
|
94
|
+
// Mapping from Vega category20 to Fluent DataViz tokens
|
|
95
|
+
const CATEGORY20_FLUENT_MAPPING = [
|
|
96
|
+
DataVizPalette.color26,
|
|
97
|
+
DataVizPalette.color36,
|
|
98
|
+
DataVizPalette.warning,
|
|
99
|
+
DataVizPalette.color27,
|
|
100
|
+
DataVizPalette.color5,
|
|
101
|
+
DataVizPalette.color15,
|
|
102
|
+
DataVizPalette.error,
|
|
103
|
+
DataVizPalette.color32,
|
|
104
|
+
DataVizPalette.color4,
|
|
105
|
+
DataVizPalette.color24,
|
|
106
|
+
DataVizPalette.color17,
|
|
107
|
+
DataVizPalette.color37,
|
|
108
|
+
DataVizPalette.color22,
|
|
109
|
+
DataVizPalette.color12,
|
|
110
|
+
DataVizPalette.disabled,
|
|
111
|
+
DataVizPalette.color31,
|
|
112
|
+
DataVizPalette.color10,
|
|
113
|
+
DataVizPalette.color30,
|
|
114
|
+
DataVizPalette.color3,
|
|
115
|
+
DataVizPalette.color13
|
|
116
|
+
];
|
|
117
|
+
// Mapping from Tableau10 to Fluent DataViz tokens
|
|
118
|
+
const TABLEAU10_FLUENT_MAPPING = [
|
|
119
|
+
DataVizPalette.color1,
|
|
120
|
+
DataVizPalette.color7,
|
|
121
|
+
DataVizPalette.error,
|
|
122
|
+
DataVizPalette.color3,
|
|
123
|
+
DataVizPalette.color5,
|
|
124
|
+
DataVizPalette.color10,
|
|
125
|
+
DataVizPalette.color4,
|
|
126
|
+
DataVizPalette.color2,
|
|
127
|
+
DataVizPalette.color17,
|
|
128
|
+
DataVizPalette.disabled
|
|
129
|
+
];
|
|
130
|
+
// Mapping from Tableau20 to Fluent DataViz tokens
|
|
131
|
+
const TABLEAU20_FLUENT_MAPPING = [
|
|
132
|
+
DataVizPalette.color1,
|
|
133
|
+
DataVizPalette.color11,
|
|
134
|
+
DataVizPalette.color7,
|
|
135
|
+
DataVizPalette.color27,
|
|
136
|
+
DataVizPalette.color5,
|
|
137
|
+
DataVizPalette.color15,
|
|
138
|
+
DataVizPalette.color10,
|
|
139
|
+
DataVizPalette.color30,
|
|
140
|
+
DataVizPalette.color3,
|
|
141
|
+
DataVizPalette.color13,
|
|
142
|
+
DataVizPalette.error,
|
|
143
|
+
DataVizPalette.color32,
|
|
144
|
+
DataVizPalette.disabled,
|
|
145
|
+
DataVizPalette.color31,
|
|
146
|
+
DataVizPalette.color2,
|
|
147
|
+
DataVizPalette.color12,
|
|
148
|
+
DataVizPalette.color4,
|
|
149
|
+
DataVizPalette.color24,
|
|
150
|
+
DataVizPalette.color17,
|
|
151
|
+
DataVizPalette.color37
|
|
152
|
+
];
|
|
153
|
+
/**
|
|
154
|
+
* Gets the Fluent color mapping for a given Vega-Lite color scheme
|
|
155
|
+
*/ function getSchemeMapping(scheme) {
|
|
156
|
+
if (!scheme) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
const schemeLower = scheme.toLowerCase();
|
|
160
|
+
switch(schemeLower){
|
|
161
|
+
case 'category10':
|
|
162
|
+
return CATEGORY10_FLUENT_MAPPING;
|
|
163
|
+
case 'category20':
|
|
164
|
+
case 'category20b':
|
|
165
|
+
case 'category20c':
|
|
166
|
+
return CATEGORY20_FLUENT_MAPPING;
|
|
167
|
+
case 'tableau10':
|
|
168
|
+
return TABLEAU10_FLUENT_MAPPING;
|
|
169
|
+
case 'tableau20':
|
|
170
|
+
return TABLEAU20_FLUENT_MAPPING;
|
|
171
|
+
// For unsupported schemes, fall back to default Fluent palette
|
|
172
|
+
case 'accent':
|
|
173
|
+
case 'dark2':
|
|
174
|
+
case 'paired':
|
|
175
|
+
case 'pastel1':
|
|
176
|
+
case 'pastel2':
|
|
177
|
+
case 'set1':
|
|
178
|
+
case 'set2':
|
|
179
|
+
case 'set3':
|
|
180
|
+
// Color schemes not yet mapped to Fluent colors. Using default palette.
|
|
181
|
+
return undefined;
|
|
182
|
+
default:
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Gets a color for a series based on Vega-Lite color encoding
|
|
188
|
+
*
|
|
189
|
+
* @param index - Series index
|
|
190
|
+
* @param scheme - Vega-Lite color scheme name (e.g., 'category10', 'tableau10')
|
|
191
|
+
* @param range - Custom color range array
|
|
192
|
+
* @param isDarkTheme - Whether dark theme is active
|
|
193
|
+
* @returns Color string (hex)
|
|
194
|
+
*/ export function getVegaColor(index, scheme, range, isDarkTheme = false) {
|
|
195
|
+
// Priority 1: Custom range (highest priority)
|
|
196
|
+
if (range && range.length > 0) {
|
|
197
|
+
return range[index % range.length];
|
|
198
|
+
}
|
|
199
|
+
// Priority 2: Named color scheme mapped to Fluent
|
|
200
|
+
const schemeMapping = getSchemeMapping(scheme);
|
|
201
|
+
if (schemeMapping) {
|
|
202
|
+
const token = schemeMapping[index % schemeMapping.length];
|
|
203
|
+
return getColorFromToken(token, isDarkTheme);
|
|
204
|
+
}
|
|
205
|
+
// Priority 3: Default Fluent qualitative palette
|
|
206
|
+
return getNextColor(index, 0, isDarkTheme);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Gets a color from the color map or creates a new one based on Vega-Lite encoding
|
|
210
|
+
*
|
|
211
|
+
* @param legendLabel - Legend label for the series
|
|
212
|
+
* @param colorMap - Color mapping ref for consistent coloring across charts
|
|
213
|
+
* @param scheme - Vega-Lite color scheme name
|
|
214
|
+
* @param range - Custom color range array
|
|
215
|
+
* @param isDarkTheme - Whether dark theme is active
|
|
216
|
+
* @returns Color string (hex)
|
|
217
|
+
*/ export function getVegaColorFromMap(legendLabel, colorMap, scheme, range, isDarkTheme = false) {
|
|
218
|
+
var _colorMap_current, _colorMap_current1, _colorMap_current2;
|
|
219
|
+
// Check if color is already assigned
|
|
220
|
+
if ((_colorMap_current = colorMap.current) === null || _colorMap_current === void 0 ? void 0 : _colorMap_current.has(legendLabel)) {
|
|
221
|
+
return colorMap.current.get(legendLabel);
|
|
222
|
+
}
|
|
223
|
+
var _colorMap_current_size;
|
|
224
|
+
// Assign new color based on current map size
|
|
225
|
+
const index = (_colorMap_current_size = (_colorMap_current1 = colorMap.current) === null || _colorMap_current1 === void 0 ? void 0 : _colorMap_current1.size) !== null && _colorMap_current_size !== void 0 ? _colorMap_current_size : 0;
|
|
226
|
+
const color = getVegaColor(index, scheme, range, isDarkTheme);
|
|
227
|
+
(_colorMap_current2 = colorMap.current) === null || _colorMap_current2 === void 0 ? void 0 : _colorMap_current2.set(legendLabel, color);
|
|
228
|
+
return color;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Sequential and diverging color scheme ramps for heatmaps and continuous color scales.
|
|
232
|
+
* Each ramp is a 5-point gradient matching D3/Vega defaults.
|
|
233
|
+
*/ const SEQUENTIAL_SCHEMES = {
|
|
234
|
+
blues: [
|
|
235
|
+
'#deebf7',
|
|
236
|
+
'#9ecae1',
|
|
237
|
+
'#4292c6',
|
|
238
|
+
'#2171b5',
|
|
239
|
+
'#084594'
|
|
240
|
+
],
|
|
241
|
+
greens: [
|
|
242
|
+
'#e5f5e0',
|
|
243
|
+
'#a1d99b',
|
|
244
|
+
'#41ab5d',
|
|
245
|
+
'#238b45',
|
|
246
|
+
'#005a32'
|
|
247
|
+
],
|
|
248
|
+
reds: [
|
|
249
|
+
'#fee0d2',
|
|
250
|
+
'#fc9272',
|
|
251
|
+
'#ef3b2c',
|
|
252
|
+
'#cb181d',
|
|
253
|
+
'#99000d'
|
|
254
|
+
],
|
|
255
|
+
oranges: [
|
|
256
|
+
'#feedde',
|
|
257
|
+
'#fdbe85',
|
|
258
|
+
'#fd8d3c',
|
|
259
|
+
'#e6550d',
|
|
260
|
+
'#a63603'
|
|
261
|
+
],
|
|
262
|
+
purples: [
|
|
263
|
+
'#efedf5',
|
|
264
|
+
'#bcbddc',
|
|
265
|
+
'#807dba',
|
|
266
|
+
'#6a51a3',
|
|
267
|
+
'#4a1486'
|
|
268
|
+
],
|
|
269
|
+
greys: [
|
|
270
|
+
'#f0f0f0',
|
|
271
|
+
'#bdbdbd',
|
|
272
|
+
'#969696',
|
|
273
|
+
'#636363',
|
|
274
|
+
'#252525'
|
|
275
|
+
],
|
|
276
|
+
viridis: [
|
|
277
|
+
'#440154',
|
|
278
|
+
'#3b528b',
|
|
279
|
+
'#21918c',
|
|
280
|
+
'#5ec962',
|
|
281
|
+
'#fde725'
|
|
282
|
+
],
|
|
283
|
+
inferno: [
|
|
284
|
+
'#000004',
|
|
285
|
+
'#57106e',
|
|
286
|
+
'#bc3754',
|
|
287
|
+
'#f98c0a',
|
|
288
|
+
'#fcffa4'
|
|
289
|
+
],
|
|
290
|
+
magma: [
|
|
291
|
+
'#000004',
|
|
292
|
+
'#51127c',
|
|
293
|
+
'#b73779',
|
|
294
|
+
'#fc8961',
|
|
295
|
+
'#fcfdbf'
|
|
296
|
+
],
|
|
297
|
+
plasma: [
|
|
298
|
+
'#0d0887',
|
|
299
|
+
'#7e03a8',
|
|
300
|
+
'#cc4778',
|
|
301
|
+
'#f89540',
|
|
302
|
+
'#f0f921'
|
|
303
|
+
],
|
|
304
|
+
greenblue: [
|
|
305
|
+
'#e0f3db',
|
|
306
|
+
'#a8ddb5',
|
|
307
|
+
'#4eb3d3',
|
|
308
|
+
'#2b8cbe',
|
|
309
|
+
'#08589e'
|
|
310
|
+
],
|
|
311
|
+
yellowgreen: [
|
|
312
|
+
'#ffffcc',
|
|
313
|
+
'#c2e699',
|
|
314
|
+
'#78c679',
|
|
315
|
+
'#31a354',
|
|
316
|
+
'#006837'
|
|
317
|
+
],
|
|
318
|
+
yellowgreenblue: [
|
|
319
|
+
'#ffffcc',
|
|
320
|
+
'#a1dab4',
|
|
321
|
+
'#41b6c4',
|
|
322
|
+
'#2c7fb8',
|
|
323
|
+
'#253494'
|
|
324
|
+
],
|
|
325
|
+
redyellowgreen: [
|
|
326
|
+
'#d73027',
|
|
327
|
+
'#fc8d59',
|
|
328
|
+
'#fee08b',
|
|
329
|
+
'#91cf60',
|
|
330
|
+
'#1a9850'
|
|
331
|
+
],
|
|
332
|
+
blueorange: [
|
|
333
|
+
'#2166ac',
|
|
334
|
+
'#67a9cf',
|
|
335
|
+
'#f7f7f7',
|
|
336
|
+
'#f4a582',
|
|
337
|
+
'#b2182b'
|
|
338
|
+
],
|
|
339
|
+
redblue: [
|
|
340
|
+
'#ca0020',
|
|
341
|
+
'#f4a582',
|
|
342
|
+
'#f7f7f7',
|
|
343
|
+
'#92c5de',
|
|
344
|
+
'#0571b0'
|
|
345
|
+
]
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Gets a sequential or diverging color ramp for heatmap rendering.
|
|
349
|
+
* Returns an array of `steps` interpolated colors for the given scheme name.
|
|
350
|
+
*
|
|
351
|
+
* @param scheme - Vega-Lite scheme name (e.g., 'blues', 'viridis', 'redyellowgreen')
|
|
352
|
+
* @param steps - Number of color stops (default: 5)
|
|
353
|
+
* @returns Array of hex/rgb color strings, or undefined if scheme is not recognized
|
|
354
|
+
*/ export function getSequentialSchemeColors(scheme, steps = 5) {
|
|
355
|
+
const ramp = SEQUENTIAL_SCHEMES[scheme.toLowerCase()];
|
|
356
|
+
if (!ramp) {
|
|
357
|
+
return undefined;
|
|
358
|
+
}
|
|
359
|
+
if (steps === ramp.length) {
|
|
360
|
+
return [
|
|
361
|
+
...ramp
|
|
362
|
+
];
|
|
363
|
+
}
|
|
364
|
+
// Interpolate to requested number of steps
|
|
365
|
+
const result = [];
|
|
366
|
+
for(let i = 0; i < steps; i++){
|
|
367
|
+
const t = steps === 1 ? 0.5 : i / (steps - 1);
|
|
368
|
+
const pos = t * (ramp.length - 1);
|
|
369
|
+
const lo = Math.floor(pos);
|
|
370
|
+
const hi = Math.min(lo + 1, ramp.length - 1);
|
|
371
|
+
const frac = pos - lo;
|
|
372
|
+
if (frac === 0) {
|
|
373
|
+
result.push(ramp[lo]);
|
|
374
|
+
} else {
|
|
375
|
+
result.push(interpolateHexColor(ramp[lo], ramp[hi], frac));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Linearly interpolates between two hex colors
|
|
382
|
+
*/ function interpolateHexColor(c1, c2, t) {
|
|
383
|
+
const r1 = parseInt(c1.slice(1, 3), 16);
|
|
384
|
+
const g1 = parseInt(c1.slice(3, 5), 16);
|
|
385
|
+
const b1 = parseInt(c1.slice(5, 7), 16);
|
|
386
|
+
const r2 = parseInt(c2.slice(1, 3), 16);
|
|
387
|
+
const g2 = parseInt(c2.slice(3, 5), 16);
|
|
388
|
+
const b2 = parseInt(c2.slice(5, 7), 16);
|
|
389
|
+
const r = Math.round(r1 + (r2 - r1) * t);
|
|
390
|
+
const g = Math.round(g1 + (g2 - g1) * t);
|
|
391
|
+
const b = Math.round(b1 + (b2 - b1) * t);
|
|
392
|
+
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Checks if the provided range matches a standard Vega scheme
|
|
396
|
+
* Useful for optimizing color assignment
|
|
397
|
+
*/ export function isStandardVegaScheme(range) {
|
|
398
|
+
if (!range || range.length === 0) {
|
|
399
|
+
return undefined;
|
|
400
|
+
}
|
|
401
|
+
const rangeLower = range.map((c)=>c.toLowerCase());
|
|
402
|
+
if (areArraysEqual(rangeLower, VEGA_CATEGORY10)) {
|
|
403
|
+
return 'category10';
|
|
404
|
+
}
|
|
405
|
+
if (areArraysEqual(rangeLower, VEGA_CATEGORY20)) {
|
|
406
|
+
return 'category20';
|
|
407
|
+
}
|
|
408
|
+
if (areArraysEqual(rangeLower, VEGA_TABLEAU10)) {
|
|
409
|
+
return 'tableau10';
|
|
410
|
+
}
|
|
411
|
+
if (areArraysEqual(rangeLower, VEGA_TABLEAU20)) {
|
|
412
|
+
return 'tableau20';
|
|
413
|
+
}
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/VegaDeclarativeChart/VegaLiteColorAdapter.ts"],"sourcesContent":["import { DataVizPalette, getColorFromToken, getNextColor } from '../../utilities/colors';\nimport { areArraysEqual } from '../../utilities/utilities';\n\n/**\n * A ref-like object holding a mutable Map of legend-label to color.\n * Structurally compatible with React.RefObject<Map<string, string>>.\n */\nexport type ColorMapRef = { readonly current: Map<string, string> | null };\n\n/**\n * Vega-Lite Color Scheme to Fluent DataViz Palette Adapter\n *\n * Maps standard Vega-Lite color schemes to Fluent UI DataViz colors\n * Similar to PlotlyColorAdapter but for Vega-Lite specifications\n */\n\n// Vega's category10 scheme (D3 Category10)\n// https://vega.github.io/vega/docs/schemes/#categorical\nconst VEGA_CATEGORY10 = [\n '#1f77b4', // blue\n '#ff7f0e', // orange\n '#2ca02c', // green\n '#d62728', // red\n '#9467bd', // purple\n '#8c564b', // brown\n '#e377c2', // pink\n '#7f7f7f', // gray\n '#bcbd22', // olive\n '#17becf', // cyan\n];\n\n// Vega's category20 scheme\nconst VEGA_CATEGORY20 = [\n '#1f77b4',\n '#aec7e8', // blue shades\n '#ff7f0e',\n '#ffbb78', // orange shades\n '#2ca02c',\n '#98df8a', // green shades\n '#d62728',\n '#ff9896', // red shades\n '#9467bd',\n '#c5b0d5', // purple shades\n '#8c564b',\n '#c49c94', // brown shades\n '#e377c2',\n '#f7b6d2', // pink shades\n '#7f7f7f',\n '#c7c7c7', // gray shades\n '#bcbd22',\n '#dbdb8d', // olive shades\n '#17becf',\n '#9edae5', // cyan shades\n];\n\n// Tableau10 scheme (commonly used in Vega-Lite)\nconst VEGA_TABLEAU10 = [\n '#4e79a7', // blue\n '#f28e2c', // orange\n '#e15759', // red\n '#76b7b2', // teal\n '#59a14f', // green\n '#edc949', // yellow\n '#af7aa1', // purple\n '#ff9da7', // pink\n '#9c755f', // brown\n '#bab0ab', // gray\n];\n\n// Tableau20 scheme\nconst VEGA_TABLEAU20 = [\n '#4e79a7',\n '#a0cbe8', // blue shades\n '#f28e2c',\n '#ffbe7d', // orange shades\n '#59a14f',\n '#8cd17d', // green shades\n '#b6992d',\n '#f1ce63', // yellow shades\n '#499894',\n '#86bcb6', // teal shades\n '#e15759',\n '#ff9d9a', // red shades\n '#79706e',\n '#bab0ab', // gray shades\n '#d37295',\n '#fabfd2', // pink shades\n '#b07aa1',\n '#d4a6c8', // purple shades\n '#9d7660',\n '#d7b5a6', // brown shades\n];\n\n// Mapping from Vega category10 to Fluent DataViz tokens\nconst CATEGORY10_FLUENT_MAPPING: string[] = [\n DataVizPalette.color26, // blue -> lightBlue.shade10\n DataVizPalette.warning, // orange -> semantic warning\n DataVizPalette.color5, // green -> lightGreen.primary\n DataVizPalette.error, // red -> semantic error\n DataVizPalette.color4, // purple -> orchid.tint10\n DataVizPalette.color17, // brown -> pumpkin.shade20\n DataVizPalette.color22, // pink -> hotPink.tint20\n DataVizPalette.disabled, // gray -> semantic disabled\n DataVizPalette.color10, // olive/yellow-green -> gold.shade10\n DataVizPalette.color3, // cyan/teal -> teal.tint20\n];\n\n// Mapping from Vega category20 to Fluent DataViz tokens\nconst CATEGORY20_FLUENT_MAPPING: string[] = [\n DataVizPalette.color26,\n DataVizPalette.color36, // blue shades\n DataVizPalette.warning,\n DataVizPalette.color27, // orange shades\n DataVizPalette.color5,\n DataVizPalette.color15, // green shades\n DataVizPalette.error,\n DataVizPalette.color32, // red shades\n DataVizPalette.color4,\n DataVizPalette.color24, // purple shades\n DataVizPalette.color17,\n DataVizPalette.color37, // brown shades\n DataVizPalette.color22,\n DataVizPalette.color12, // pink shades\n DataVizPalette.disabled,\n DataVizPalette.color31, // gray shades\n DataVizPalette.color10,\n DataVizPalette.color30, // olive shades\n DataVizPalette.color3,\n DataVizPalette.color13, // cyan shades\n];\n\n// Mapping from Tableau10 to Fluent DataViz tokens\nconst TABLEAU10_FLUENT_MAPPING: string[] = [\n DataVizPalette.color1, // blue -> cornflower.tint10\n DataVizPalette.color7, // orange -> pumpkin.primary\n DataVizPalette.error, // red -> semantic error\n DataVizPalette.color3, // teal -> teal.tint20\n DataVizPalette.color5, // green -> lightGreen.primary\n DataVizPalette.color10, // yellow -> gold.shade10\n DataVizPalette.color4, // purple -> orchid.tint10\n DataVizPalette.color2, // pink -> hotPink.primary\n DataVizPalette.color17, // brown -> pumpkin.shade20\n DataVizPalette.disabled, // gray -> semantic disabled\n];\n\n// Mapping from Tableau20 to Fluent DataViz tokens\nconst TABLEAU20_FLUENT_MAPPING: string[] = [\n DataVizPalette.color1,\n DataVizPalette.color11, // blue shades\n DataVizPalette.color7,\n DataVizPalette.color27, // orange shades\n DataVizPalette.color5,\n DataVizPalette.color15, // green shades\n DataVizPalette.color10,\n DataVizPalette.color30, // yellow shades\n DataVizPalette.color3,\n DataVizPalette.color13, // teal shades\n DataVizPalette.error,\n DataVizPalette.color32, // red shades\n DataVizPalette.disabled,\n DataVizPalette.color31, // gray shades\n DataVizPalette.color2,\n DataVizPalette.color12, // pink shades\n DataVizPalette.color4,\n DataVizPalette.color24, // purple shades\n DataVizPalette.color17,\n DataVizPalette.color37, // brown shades\n];\n\n/**\n * Supported Vega-Lite color scheme names\n */\nexport type VegaColorScheme =\n | 'category10'\n | 'category20'\n | 'category20b'\n | 'category20c'\n | 'tableau10'\n | 'tableau20'\n | 'accent'\n | 'dark2'\n | 'paired'\n | 'pastel1'\n | 'pastel2'\n | 'set1'\n | 'set2'\n | 'set3';\n\n/**\n * Gets the Fluent color mapping for a given Vega-Lite color scheme\n */\nfunction getSchemeMapping(scheme: string | undefined): string[] | undefined {\n if (!scheme) {\n return undefined;\n }\n\n const schemeLower = scheme.toLowerCase();\n\n switch (schemeLower) {\n case 'category10':\n return CATEGORY10_FLUENT_MAPPING;\n case 'category20':\n case 'category20b':\n case 'category20c':\n return CATEGORY20_FLUENT_MAPPING;\n case 'tableau10':\n return TABLEAU10_FLUENT_MAPPING;\n case 'tableau20':\n return TABLEAU20_FLUENT_MAPPING;\n // For unsupported schemes, fall back to default Fluent palette\n case 'accent':\n case 'dark2':\n case 'paired':\n case 'pastel1':\n case 'pastel2':\n case 'set1':\n case 'set2':\n case 'set3':\n // Color schemes not yet mapped to Fluent colors. Using default palette.\n return undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Gets a color for a series based on Vega-Lite color encoding\n *\n * @param index - Series index\n * @param scheme - Vega-Lite color scheme name (e.g., 'category10', 'tableau10')\n * @param range - Custom color range array\n * @param isDarkTheme - Whether dark theme is active\n * @returns Color string (hex)\n */\nexport function getVegaColor(\n index: number,\n scheme: string | undefined,\n range: string[] | undefined,\n isDarkTheme: boolean = false,\n): string {\n // Priority 1: Custom range (highest priority)\n if (range && range.length > 0) {\n return range[index % range.length];\n }\n\n // Priority 2: Named color scheme mapped to Fluent\n const schemeMapping = getSchemeMapping(scheme);\n if (schemeMapping) {\n const token = schemeMapping[index % schemeMapping.length];\n return getColorFromToken(token, isDarkTheme);\n }\n\n // Priority 3: Default Fluent qualitative palette\n return getNextColor(index, 0, isDarkTheme);\n}\n\n/**\n * Gets a color from the color map or creates a new one based on Vega-Lite encoding\n *\n * @param legendLabel - Legend label for the series\n * @param colorMap - Color mapping ref for consistent coloring across charts\n * @param scheme - Vega-Lite color scheme name\n * @param range - Custom color range array\n * @param isDarkTheme - Whether dark theme is active\n * @returns Color string (hex)\n */\nexport function getVegaColorFromMap(\n legendLabel: string,\n colorMap: ColorMapRef,\n scheme: string | undefined,\n range: string[] | undefined,\n isDarkTheme: boolean = false,\n): string {\n // Check if color is already assigned\n if (colorMap.current?.has(legendLabel)) {\n return colorMap.current.get(legendLabel)!;\n }\n\n // Assign new color based on current map size\n const index = colorMap.current?.size ?? 0;\n const color = getVegaColor(index, scheme, range, isDarkTheme);\n\n colorMap.current?.set(legendLabel, color);\n return color;\n}\n\n/**\n * Sequential and diverging color scheme ramps for heatmaps and continuous color scales.\n * Each ramp is a 5-point gradient matching D3/Vega defaults.\n */\nconst SEQUENTIAL_SCHEMES: Record<string, string[]> = {\n blues: ['#deebf7', '#9ecae1', '#4292c6', '#2171b5', '#084594'],\n greens: ['#e5f5e0', '#a1d99b', '#41ab5d', '#238b45', '#005a32'],\n reds: ['#fee0d2', '#fc9272', '#ef3b2c', '#cb181d', '#99000d'],\n oranges: ['#feedde', '#fdbe85', '#fd8d3c', '#e6550d', '#a63603'],\n purples: ['#efedf5', '#bcbddc', '#807dba', '#6a51a3', '#4a1486'],\n greys: ['#f0f0f0', '#bdbdbd', '#969696', '#636363', '#252525'],\n viridis: ['#440154', '#3b528b', '#21918c', '#5ec962', '#fde725'],\n inferno: ['#000004', '#57106e', '#bc3754', '#f98c0a', '#fcffa4'],\n magma: ['#000004', '#51127c', '#b73779', '#fc8961', '#fcfdbf'],\n plasma: ['#0d0887', '#7e03a8', '#cc4778', '#f89540', '#f0f921'],\n greenblue: ['#e0f3db', '#a8ddb5', '#4eb3d3', '#2b8cbe', '#08589e'],\n yellowgreen: ['#ffffcc', '#c2e699', '#78c679', '#31a354', '#006837'],\n yellowgreenblue: ['#ffffcc', '#a1dab4', '#41b6c4', '#2c7fb8', '#253494'],\n redyellowgreen: ['#d73027', '#fc8d59', '#fee08b', '#91cf60', '#1a9850'],\n blueorange: ['#2166ac', '#67a9cf', '#f7f7f7', '#f4a582', '#b2182b'],\n redblue: ['#ca0020', '#f4a582', '#f7f7f7', '#92c5de', '#0571b0'],\n};\n\n/**\n * Gets a sequential or diverging color ramp for heatmap rendering.\n * Returns an array of `steps` interpolated colors for the given scheme name.\n *\n * @param scheme - Vega-Lite scheme name (e.g., 'blues', 'viridis', 'redyellowgreen')\n * @param steps - Number of color stops (default: 5)\n * @returns Array of hex/rgb color strings, or undefined if scheme is not recognized\n */\nexport function getSequentialSchemeColors(scheme: string, steps: number = 5): string[] | undefined {\n const ramp = SEQUENTIAL_SCHEMES[scheme.toLowerCase()];\n if (!ramp) {\n return undefined;\n }\n\n if (steps === ramp.length) {\n return [...ramp];\n }\n\n // Interpolate to requested number of steps\n const result: string[] = [];\n for (let i = 0; i < steps; i++) {\n const t = steps === 1 ? 0.5 : i / (steps - 1);\n const pos = t * (ramp.length - 1);\n const lo = Math.floor(pos);\n const hi = Math.min(lo + 1, ramp.length - 1);\n const frac = pos - lo;\n\n if (frac === 0) {\n result.push(ramp[lo]);\n } else {\n result.push(interpolateHexColor(ramp[lo], ramp[hi], frac));\n }\n }\n return result;\n}\n\n/**\n * Linearly interpolates between two hex colors\n */\nfunction interpolateHexColor(c1: string, c2: string, t: number): string {\n const r1 = parseInt(c1.slice(1, 3), 16);\n const g1 = parseInt(c1.slice(3, 5), 16);\n const b1 = parseInt(c1.slice(5, 7), 16);\n const r2 = parseInt(c2.slice(1, 3), 16);\n const g2 = parseInt(c2.slice(3, 5), 16);\n const b2 = parseInt(c2.slice(5, 7), 16);\n\n const r = Math.round(r1 + (r2 - r1) * t);\n const g = Math.round(g1 + (g2 - g1) * t);\n const b = Math.round(b1 + (b2 - b1) * t);\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\n}\n\n/**\n * Checks if the provided range matches a standard Vega scheme\n * Useful for optimizing color assignment\n */\nexport function isStandardVegaScheme(range: string[] | undefined): VegaColorScheme | undefined {\n if (!range || range.length === 0) {\n return undefined;\n }\n\n const rangeLower = range.map(c => c.toLowerCase());\n\n if (areArraysEqual(rangeLower, VEGA_CATEGORY10)) {\n return 'category10';\n }\n if (areArraysEqual(rangeLower, VEGA_CATEGORY20)) {\n return 'category20';\n }\n if (areArraysEqual(rangeLower, VEGA_TABLEAU10)) {\n return 'tableau10';\n }\n if (areArraysEqual(rangeLower, VEGA_TABLEAU20)) {\n return 'tableau20';\n }\n\n return undefined;\n}\n"],"names":["DataVizPalette","getColorFromToken","getNextColor","areArraysEqual","VEGA_CATEGORY10","VEGA_CATEGORY20","VEGA_TABLEAU10","VEGA_TABLEAU20","CATEGORY10_FLUENT_MAPPING","color26","warning","color5","error","color4","color17","color22","disabled","color10","color3","CATEGORY20_FLUENT_MAPPING","color36","color27","color15","color32","color24","color37","color12","color31","color30","color13","TABLEAU10_FLUENT_MAPPING","color1","color7","color2","TABLEAU20_FLUENT_MAPPING","color11","getSchemeMapping","scheme","undefined","schemeLower","toLowerCase","getVegaColor","index","range","isDarkTheme","length","schemeMapping","token","getVegaColorFromMap","legendLabel","colorMap","current","has","get","size","color","set","SEQUENTIAL_SCHEMES","blues","greens","reds","oranges","purples","greys","viridis","inferno","magma","plasma","greenblue","yellowgreen","yellowgreenblue","redyellowgreen","blueorange","redblue","getSequentialSchemeColors","steps","ramp","result","i","t","pos","lo","Math","floor","hi","min","frac","push","interpolateHexColor","c1","c2","r1","parseInt","slice","g1","b1","r2","g2","b2","r","round","g","b","toString","padStart","isStandardVegaScheme","rangeLower","map","c"],"mappings":"AAAA,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,YAAY,QAAQ,yBAAyB;AACzF,SAASC,cAAc,QAAQ,4BAA4B;AAQ3D;;;;;CAKC,GAED,2CAA2C;AAC3C,wDAAwD;AACxD,MAAMC,kBAAkB;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,2BAA2B;AAC3B,MAAMC,kBAAkB;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,gDAAgD;AAChD,MAAMC,iBAAiB;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,mBAAmB;AACnB,MAAMC,iBAAiB;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,wDAAwD;AACxD,MAAMC,4BAAsC;IAC1CR,eAAeS,OAAO;IACtBT,eAAeU,OAAO;IACtBV,eAAeW,MAAM;IACrBX,eAAeY,KAAK;IACpBZ,eAAea,MAAM;IACrBb,eAAec,OAAO;IACtBd,eAAee,OAAO;IACtBf,eAAegB,QAAQ;IACvBhB,eAAeiB,OAAO;IACtBjB,eAAekB,MAAM;CACtB;AAED,wDAAwD;AACxD,MAAMC,4BAAsC;IAC1CnB,eAAeS,OAAO;IACtBT,eAAeoB,OAAO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