@fluentui/react-charts 0.0.0-nightly-20250821-0406.1 → 0.0.0-nightly-20250822-0407.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -15
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +91 -57
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +90 -56
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,61 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-charts
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 22 Aug 2025 04:22:03 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20250822-0407.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v0.0.0-nightly-20250822-0407.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.2.
|
|
9
|
+
Fri, 22 Aug 2025 04:22:03 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.2.3..@fluentui/react-charts_v0.0.0-nightly-20250822-0407.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/react-button to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-overflow to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-popover to v0.0.0-nightly-
|
|
19
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
20
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
21
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
22
|
-
- Bump @fluentui/react-tooltip to v0.0.0-nightly-
|
|
23
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
24
|
-
- Bump @fluentui/react-conformance to v0.0.0-nightly-
|
|
25
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/react-button to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
17
|
+
- Bump @fluentui/react-overflow to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
18
|
+
- Bump @fluentui/react-popover to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
19
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
21
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
22
|
+
- Bump @fluentui/react-tooltip to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
24
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
25
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20250822-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/9214ada4ffc741f67015ead61a4ac0b9a7f2d2a1) by beachball)
|
|
26
|
+
|
|
27
|
+
## [9.2.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.2.3)
|
|
28
|
+
|
|
29
|
+
Thu, 21 Aug 2025 12:25:29 GMT
|
|
30
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.2.2..@fluentui/react-charts_v9.2.3)
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- add labels for text+markers ([PR #35025](https://github.com/microsoft/fluentui/pull/35025) by anushgupta@microsoft.com)
|
|
35
|
+
- fix scatter chart bugs ([PR #35047](https://github.com/microsoft/fluentui/pull/35047) by anushgupta@microsoft.com)
|
|
36
|
+
- update validation to tolerate invalid traces ([PR #34998](https://github.com/microsoft/fluentui/pull/34998) by anushgupta@microsoft.com)
|
|
37
|
+
- support for ordering tick labels ([PR #35053](https://github.com/microsoft/fluentui/pull/35053) by anushgupta@microsoft.com)
|
|
38
|
+
- colorscale support for bar charts ([PR #35026](https://github.com/microsoft/fluentui/pull/35026) by anushgupta@microsoft.com)
|
|
39
|
+
- pie chart fix ([PR #35013](https://github.com/microsoft/fluentui/pull/35013) by anushgupta@microsoft.com)
|
|
40
|
+
- use piecolorway for donut chart ([PR #34999](https://github.com/microsoft/fluentui/pull/34999) by anushgupta@microsoft.com)
|
|
41
|
+
- enable scatter chart in v9 declatative ([PR #35036](https://github.com/microsoft/fluentui/pull/35036) by anushgupta@microsoft.com)
|
|
42
|
+
- support for using opacity provided in plotly schema ([PR #35045](https://github.com/microsoft/fluentui/pull/35045) by anushgupta@microsoft.com)
|
|
43
|
+
- add date axis support in vsbc ([PR #35018](https://github.com/microsoft/fluentui/pull/35018) by anushgupta@microsoft.com)
|
|
44
|
+
- add support for multiplot declarative chart ([PR #35038](https://github.com/microsoft/fluentui/pull/35038) by anushgupta@microsoft.com)
|
|
45
|
+
- add styles to tables ([PR #35012](https://github.com/microsoft/fluentui/pull/35012) by anushgupta@microsoft.com)
|
|
46
|
+
- remove duplicated legends in line chart ([PR #34991](https://github.com/microsoft/fluentui/pull/34991) by anushgupta@microsoft.com)
|
|
47
|
+
- fix color issue in gvbc ([PR #35050](https://github.com/microsoft/fluentui/pull/35050) by anushgupta@microsoft.com)
|
|
48
|
+
- support for lines+markers ([PR #34997](https://github.com/microsoft/fluentui/pull/34997) by anushgupta@microsoft.com)
|
|
49
|
+
- use schema colorscale for gvbc ([PR #35011](https://github.com/microsoft/fluentui/pull/35011) by anushgupta@microsoft.com)
|
|
50
|
+
- add support for string y axis in VSBC ([PR #35016](https://github.com/microsoft/fluentui/pull/35016) by anushgupta@microsoft.com)
|
|
51
|
+
- Bump @fluentui/react-button to v9.6.5 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
52
|
+
- Bump @fluentui/react-jsx-runtime to v9.1.6 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
53
|
+
- Bump @fluentui/react-overflow to v9.5.5 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
54
|
+
- Bump @fluentui/react-popover to v9.12.5 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
55
|
+
- Bump @fluentui/react-shared-contexts to v9.25.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
56
|
+
- Bump @fluentui/react-tabster to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
57
|
+
- Bump @fluentui/react-tooltip to v9.8.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
58
|
+
- Bump @fluentui/react-utilities to v9.24.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
|
|
26
59
|
|
|
27
60
|
## [9.2.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.2.2)
|
|
28
61
|
|
|
@@ -4,7 +4,7 @@ import { scaleLinear as d3ScaleLinear } from 'd3-scale';
|
|
|
4
4
|
import { format as d3Format } from 'd3-format';
|
|
5
5
|
import { DataVizPalette, getColorFromToken } from '../../utilities/colors';
|
|
6
6
|
import { findNumericMinMaxOfY, formatScientificLimitWidth, MIN_DONUT_RADIUS } from '../../utilities/utilities';
|
|
7
|
-
import { isArrayOrTypedArray, isDate, isDateArray, isNumberArray, isStringArray, isYearArray, isInvalidValue } from '@fluentui/chart-utilities';
|
|
7
|
+
import { isArrayOrTypedArray, isDate, isDateArray, isNumberArray, isStringArray, isYearArray, isInvalidValue, formatToLocaleString } from '@fluentui/chart-utilities';
|
|
8
8
|
import { curveCardinal as d3CurveCardinal } from 'd3-shape';
|
|
9
9
|
import { getOpacity, extractColor, resolveColor } from './PlotlyColorAdapter';
|
|
10
10
|
import { rgb } from 'd3-color';
|
|
@@ -56,6 +56,47 @@ function getTitles(layout) {
|
|
|
56
56
|
};
|
|
57
57
|
return titles;
|
|
58
58
|
}
|
|
59
|
+
const getXAxisTickFormat = (series, layout)=>{
|
|
60
|
+
const xAxis = getXAxisProperties(series, layout);
|
|
61
|
+
if (xAxis === null || xAxis === void 0 ? void 0 : xAxis.tickformat) {
|
|
62
|
+
return {
|
|
63
|
+
tickFormat: xAxis === null || xAxis === void 0 ? void 0 : xAxis.tickformat
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {};
|
|
67
|
+
};
|
|
68
|
+
const getYAxisTickFormat = (series, layout)=>{
|
|
69
|
+
const yAxis = getYAxisProperties(series, layout);
|
|
70
|
+
if (yAxis === null || yAxis === void 0 ? void 0 : yAxis.tickformat) {
|
|
71
|
+
return {
|
|
72
|
+
yAxisTickFormat: d3Format(yAxis === null || yAxis === void 0 ? void 0 : yAxis.tickformat)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {};
|
|
76
|
+
};
|
|
77
|
+
const getYMinMaxValues = (series, layout)=>{
|
|
78
|
+
var _getYAxisProperties;
|
|
79
|
+
const range = (_getYAxisProperties = getYAxisProperties(series, layout)) === null || _getYAxisProperties === void 0 ? void 0 : _getYAxisProperties.range;
|
|
80
|
+
if (range && range.length === 2) {
|
|
81
|
+
return {
|
|
82
|
+
yMinValue: range[0],
|
|
83
|
+
yMaxValue: range[1]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {};
|
|
87
|
+
};
|
|
88
|
+
const getYAxisProperties = (series, layout)=>{
|
|
89
|
+
return layout === null || layout === void 0 ? void 0 : layout.yaxis;
|
|
90
|
+
};
|
|
91
|
+
const getXAxisProperties = (series, layout)=>{
|
|
92
|
+
return layout === null || layout === void 0 ? void 0 : layout.xaxis;
|
|
93
|
+
};
|
|
94
|
+
const getFormattedCalloutYData = (yVal, yAxisFormat)=>{
|
|
95
|
+
if (typeof (yAxisFormat === null || yAxisFormat === void 0 ? void 0 : yAxisFormat.yAxisTickFormat) === 'function' && typeof yVal === 'number') {
|
|
96
|
+
return yAxisFormat.yAxisTickFormat(yVal);
|
|
97
|
+
}
|
|
98
|
+
return formatToLocaleString(yVal);
|
|
99
|
+
};
|
|
59
100
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
101
|
export const correctYearMonth = (xValues)=>{
|
|
61
102
|
const presentYear = new Date().getFullYear();
|
|
@@ -219,6 +260,7 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
219
260
|
const secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
220
261
|
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
|
|
221
262
|
let colorScale = undefined;
|
|
263
|
+
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
222
264
|
let yMinValue = 0;
|
|
223
265
|
input.data.forEach((series, index1)=>{
|
|
224
266
|
var _input_layout_coloraxis_colorscale, _input_layout_coloraxis, _input_layout, _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout1, _series_marker3, _input_layout_template_layout1, _input_layout_template1, _input_layout2, _series_line;
|
|
@@ -252,6 +294,7 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
252
294
|
const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedBarColors, index2, legend, colorMap, isDarkTheme);
|
|
253
295
|
const opacity = getOpacity(series, index2);
|
|
254
296
|
const yVal = rangeYValues[index2];
|
|
297
|
+
const yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
|
|
255
298
|
if (series.type === 'bar') {
|
|
256
299
|
var _rgb_copy_formatHex8;
|
|
257
300
|
mapXToDataPoints[x].chartData.push({
|
|
@@ -259,7 +302,8 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
259
302
|
data: yVal,
|
|
260
303
|
color: (_rgb_copy_formatHex8 = rgb(color).copy({
|
|
261
304
|
opacity
|
|
262
|
-
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color
|
|
305
|
+
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color,
|
|
306
|
+
yAxisCalloutData
|
|
263
307
|
});
|
|
264
308
|
if (typeof yVal === 'number') {
|
|
265
309
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
@@ -281,7 +325,8 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
281
325
|
...lineOptions !== null && lineOptions !== void 0 ? lineOptions : {},
|
|
282
326
|
mode: series.mode
|
|
283
327
|
},
|
|
284
|
-
useSecondaryYScale: usesSecondaryYScale(series, input.layout)
|
|
328
|
+
useSecondaryYScale: usesSecondaryYScale(series, input.layout),
|
|
329
|
+
yAxisCalloutData
|
|
285
330
|
});
|
|
286
331
|
if (!usesSecondaryYScale(series, input.layout) && typeof yVal === 'number') {
|
|
287
332
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
@@ -292,7 +337,6 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
292
337
|
});
|
|
293
338
|
});
|
|
294
339
|
});
|
|
295
|
-
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
296
340
|
const vsbcData = Object.values(mapXToDataPoints);
|
|
297
341
|
var _input_layout_height;
|
|
298
342
|
return {
|
|
@@ -302,9 +346,6 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
302
346
|
barWidth: 'auto',
|
|
303
347
|
yMaxValue,
|
|
304
348
|
yMinValue,
|
|
305
|
-
chartTitle,
|
|
306
|
-
xAxisTitle,
|
|
307
|
-
yAxisTitle,
|
|
308
349
|
mode: 'plotly',
|
|
309
350
|
...secondaryYAxisValues,
|
|
310
351
|
wrapXAxisLables: typeof ((_vsbcData_ = vsbcData[0]) === null || _vsbcData_ === void 0 ? void 0 : _vsbcData_.xAxisPoint) === 'string',
|
|
@@ -315,6 +356,9 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
315
356
|
showYAxisLables: true,
|
|
316
357
|
noOfCharsToTruncate: 20,
|
|
317
358
|
showYAxisLablesTooltip: true,
|
|
359
|
+
...getTitles(input.layout),
|
|
360
|
+
...getXAxisTickFormat(input.data[0], input.layout),
|
|
361
|
+
...yAxisTickFormat,
|
|
318
362
|
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
319
363
|
};
|
|
320
364
|
};
|
|
@@ -338,6 +382,7 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
338
382
|
const secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout, 0, 0);
|
|
339
383
|
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
|
|
340
384
|
let colorScale = undefined;
|
|
385
|
+
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
341
386
|
input.data.forEach((series, index1)=>{
|
|
342
387
|
var _input_layout_coloraxis_colorscale, _input_layout_coloraxis, _input_layout, _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout1, _series_marker3, _series_x;
|
|
343
388
|
if (((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_coloraxis = _input_layout.coloraxis) === null || _input_layout_coloraxis === void 0 ? void 0 : (_input_layout_coloraxis_colorscale = _input_layout_coloraxis.colorscale) === null || _input_layout_coloraxis_colorscale === void 0 ? void 0 : _input_layout_coloraxis_colorscale.length) && isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) && ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length > 0 && typeof ((_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[0]) === 'number') {
|
|
@@ -362,21 +407,22 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
362
407
|
// resolve color for each legend's bars from the colorscale or extracted colors
|
|
363
408
|
const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index2, legend, colorMap, isDarkTheme);
|
|
364
409
|
const opacity = getOpacity(series, index2);
|
|
410
|
+
const yVal = series.y[index2];
|
|
365
411
|
var _rgb_copy_formatHex8;
|
|
366
412
|
mapXToDataPoints[x].series.push({
|
|
367
413
|
key: legend,
|
|
368
|
-
data:
|
|
414
|
+
data: yVal,
|
|
369
415
|
xAxisCalloutData: x,
|
|
370
416
|
color: (_rgb_copy_formatHex8 = rgb(color).copy({
|
|
371
417
|
opacity
|
|
372
418
|
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color,
|
|
373
419
|
legend,
|
|
374
|
-
useSecondaryYScale: usesSecondaryYScale(series, input.layout)
|
|
420
|
+
useSecondaryYScale: usesSecondaryYScale(series, input.layout),
|
|
421
|
+
yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat)
|
|
375
422
|
});
|
|
376
423
|
}
|
|
377
424
|
});
|
|
378
425
|
});
|
|
379
|
-
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
380
426
|
const gvbcData = Object.values(mapXToDataPoints);
|
|
381
427
|
var _input_layout_height;
|
|
382
428
|
return {
|
|
@@ -384,15 +430,16 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
384
430
|
width: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width,
|
|
385
431
|
height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
386
432
|
barWidth: 'auto',
|
|
387
|
-
chartTitle,
|
|
388
|
-
xAxisTitle,
|
|
389
|
-
yAxisTitle,
|
|
390
433
|
mode: 'plotly',
|
|
391
434
|
...secondaryYAxisValues,
|
|
392
435
|
hideTickOverlap: true,
|
|
393
436
|
wrapXAxisLables: typeof ((_gvbcData_ = gvbcData[0]) === null || _gvbcData_ === void 0 ? void 0 : _gvbcData_.name) === 'string',
|
|
394
437
|
hideLegend,
|
|
395
438
|
roundCorners: true,
|
|
439
|
+
...getTitles(input.layout),
|
|
440
|
+
...getYMinMaxValues(input.data[0], input.layout),
|
|
441
|
+
...getXAxisTickFormat(input.data[0], input.layout),
|
|
442
|
+
...yAxisTickFormat,
|
|
396
443
|
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
397
444
|
};
|
|
398
445
|
};
|
|
@@ -459,21 +506,19 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
459
506
|
});
|
|
460
507
|
});
|
|
461
508
|
});
|
|
462
|
-
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
463
509
|
var _input_layout_height;
|
|
464
510
|
return {
|
|
465
511
|
data: vbcData,
|
|
466
512
|
width: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width,
|
|
467
513
|
height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
468
|
-
chartTitle,
|
|
469
|
-
xAxisTitle,
|
|
470
|
-
yAxisTitle,
|
|
471
514
|
mode: 'histogram',
|
|
472
515
|
hideTickOverlap: true,
|
|
473
516
|
wrapXAxisLables: typeof ((_vbcData_ = vbcData[0]) === null || _vbcData_ === void 0 ? void 0 : _vbcData_.x) === 'string',
|
|
474
517
|
maxBarWidth: 50,
|
|
475
518
|
hideLegend,
|
|
476
519
|
roundCorners: true,
|
|
520
|
+
...getTitles(input.layout),
|
|
521
|
+
...getYMinMaxValues(input.data[0], input.layout),
|
|
477
522
|
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
478
523
|
};
|
|
479
524
|
};
|
|
@@ -487,7 +532,7 @@ export const transformPlotlyJsonToScatterChartProps = (input, isMultiPlot, color
|
|
|
487
532
|
return transformPlotlyJsonToScatterTraceProps(input, isMultiPlot, 'scatter', colorMap, colorwayType, isDarkTheme);
|
|
488
533
|
};
|
|
489
534
|
const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, colorMap, colorwayType, isDarkTheme)=>{
|
|
490
|
-
var _input_data_;
|
|
535
|
+
var _input_data_, _input_layout, _input_layout1;
|
|
491
536
|
const isScatterMarkers = [
|
|
492
537
|
'markers',
|
|
493
538
|
'text+markers',
|
|
@@ -501,6 +546,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
501
546
|
const secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout, isAreaChart ? 0 : undefined, isAreaChart ? 0 : undefined);
|
|
502
547
|
let mode = 'tonexty';
|
|
503
548
|
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
|
|
549
|
+
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
504
550
|
const chartData = input.data.map((series, index)=>{
|
|
505
551
|
var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _series_mode1;
|
|
506
552
|
const colors = isScatterMarkers ? (series === null || series === void 0 ? void 0 : (_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('line')) ? (_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.color : (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color : (_series_line1 = series.line) === null || _series_line1 === void 0 ? void 0 : _series_line1.color;
|
|
@@ -541,7 +587,8 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
541
587
|
} : {},
|
|
542
588
|
...textValues ? {
|
|
543
589
|
text: textValues[i]
|
|
544
|
-
} : {}
|
|
590
|
+
} : {},
|
|
591
|
+
yAxisCalloutData: getFormattedCalloutYData(rangeYValues[i], yAxisTickFormat)
|
|
545
592
|
};
|
|
546
593
|
}),
|
|
547
594
|
color: (_rgb_copy_formatHex8 = rgb(seriesColor).copy({
|
|
@@ -555,52 +602,45 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
555
602
|
};
|
|
556
603
|
});
|
|
557
604
|
}).flat();
|
|
558
|
-
const
|
|
559
|
-
|
|
605
|
+
const yMinMax = getYMinMaxValues(input.data[0], input.layout);
|
|
606
|
+
if (yMinMax.yMinValue === undefined && yMinMax.yMaxValue === undefined) {
|
|
607
|
+
const yMinMaxValues = findNumericMinMaxOfY(chartData);
|
|
608
|
+
yMinMax.yMinValue = yMinMaxValues.startValue;
|
|
609
|
+
yMinMax.yMaxValue = yMinMaxValues.endValue;
|
|
610
|
+
}
|
|
560
611
|
const numDataPoints = chartData.reduce((total, lineChartPoints)=>total + lineChartPoints.data.length, 0);
|
|
561
612
|
const chartProps = {
|
|
562
|
-
chartTitle,
|
|
563
613
|
lineChartData: chartData
|
|
564
614
|
};
|
|
565
615
|
const scatterChartProps = {
|
|
566
|
-
chartTitle,
|
|
567
616
|
scatterChartData: chartData
|
|
568
617
|
};
|
|
618
|
+
var _input_layout_height;
|
|
619
|
+
const commonProps = {
|
|
620
|
+
supportNegativeData: true,
|
|
621
|
+
...secondaryYAxisValues,
|
|
622
|
+
width: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width,
|
|
623
|
+
height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
624
|
+
hideTickOverlap: true,
|
|
625
|
+
hideLegend,
|
|
626
|
+
useUTC: false,
|
|
627
|
+
optimizeLargeData: numDataPoints > 1000,
|
|
628
|
+
...getTitles(input.layout),
|
|
629
|
+
...getXAxisTickFormat(input.data[0], input.layout),
|
|
630
|
+
...yAxisTickFormat
|
|
631
|
+
};
|
|
569
632
|
if (isAreaChart) {
|
|
570
|
-
var _input_layout, _input_layout1;
|
|
571
|
-
var _input_layout_height;
|
|
572
633
|
return {
|
|
573
634
|
data: chartProps,
|
|
574
|
-
supportNegativeData: true,
|
|
575
|
-
xAxisTitle,
|
|
576
|
-
yAxisTitle,
|
|
577
|
-
...secondaryYAxisValues,
|
|
578
635
|
mode,
|
|
579
|
-
|
|
580
|
-
height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
581
|
-
hideTickOverlap: true,
|
|
582
|
-
useUTC: false,
|
|
583
|
-
hideLegend,
|
|
584
|
-
optimizeLargeData: numDataPoints > 1000
|
|
636
|
+
...commonProps
|
|
585
637
|
};
|
|
586
638
|
} else {
|
|
587
|
-
var _input_layout2, _input_layout3;
|
|
588
|
-
var _input_layout_height1;
|
|
589
639
|
return {
|
|
590
640
|
data: isScatterChart ? scatterChartProps : chartProps,
|
|
591
|
-
supportNegativeData: true,
|
|
592
|
-
xAxisTitle,
|
|
593
|
-
yAxisTitle,
|
|
594
|
-
...secondaryYAxisValues,
|
|
595
641
|
roundedTicks: true,
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
width: (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.width,
|
|
599
|
-
height: (_input_layout_height1 = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.height) !== null && _input_layout_height1 !== void 0 ? _input_layout_height1 : 350,
|
|
600
|
-
hideTickOverlap: true,
|
|
601
|
-
useUTC: false,
|
|
602
|
-
hideLegend,
|
|
603
|
-
optimizeLargeData: numDataPoints > 1000
|
|
642
|
+
...commonProps,
|
|
643
|
+
...yMinMax
|
|
604
644
|
};
|
|
605
645
|
}
|
|
606
646
|
};
|
|
@@ -646,12 +686,8 @@ export const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPl
|
|
|
646
686
|
const scalingFactor = 0.01;
|
|
647
687
|
const gapFactor = 1 / (1 + scalingFactor * numberOfRows);
|
|
648
688
|
const barHeight = availableHeight / (numberOfRows * (1 + gapFactor));
|
|
649
|
-
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
650
689
|
return {
|
|
651
690
|
data: chartData,
|
|
652
|
-
chartTitle,
|
|
653
|
-
xAxisTitle,
|
|
654
|
-
yAxisTitle,
|
|
655
691
|
secondaryYAxistitle: typeof ((_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : (_input_layout_yaxis2 = _input_layout3.yaxis2) === null || _input_layout_yaxis2 === void 0 ? void 0 : _input_layout_yaxis2.title) === 'string' ? (_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : (_input_layout_yaxis21 = _input_layout4.yaxis2) === null || _input_layout_yaxis21 === void 0 ? void 0 : _input_layout_yaxis21.title : ((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_yaxis22 = _input_layout5.yaxis2) === null || _input_layout_yaxis22 === void 0 ? void 0 : (_input_layout_yaxis2_title = _input_layout_yaxis22.title) === null || _input_layout_yaxis2_title === void 0 ? void 0 : _input_layout_yaxis2_title.text) || '',
|
|
656
692
|
barHeight,
|
|
657
693
|
showYAxisLables: true,
|
|
@@ -662,6 +698,7 @@ export const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPl
|
|
|
662
698
|
showYAxisLablesTooltip: true,
|
|
663
699
|
hideLegend,
|
|
664
700
|
roundCorners: true,
|
|
701
|
+
...getTitles(input.layout),
|
|
665
702
|
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
666
703
|
};
|
|
667
704
|
};
|
|
@@ -776,7 +813,6 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
776
813
|
}
|
|
777
814
|
const domainValuesForColorScale = Array.isArray(colorscale) ? colorscale.map((arr)=>arr[0] * (zMax - zMin) + zMin) : defaultDomain;
|
|
778
815
|
const rangeValuesForColorScale = Array.isArray(colorscale) ? colorscale.map((arr)=>arr[1]) : defaultRange;
|
|
779
|
-
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
780
816
|
var _input_layout_height;
|
|
781
817
|
return {
|
|
782
818
|
data: [
|
|
@@ -786,9 +822,6 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
786
822
|
rangeValuesForColorScale,
|
|
787
823
|
hideLegend: true,
|
|
788
824
|
showYAxisLables: true,
|
|
789
|
-
chartTitle,
|
|
790
|
-
xAxisTitle,
|
|
791
|
-
yAxisTitle,
|
|
792
825
|
sortOrder: 'none',
|
|
793
826
|
width: (_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : _input_layout5.width,
|
|
794
827
|
height: (_input_layout_height = (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
@@ -796,6 +829,7 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
796
829
|
noOfCharsToTruncate: 20,
|
|
797
830
|
showYAxisLablesTooltip: true,
|
|
798
831
|
wrapXAxisLables: true,
|
|
832
|
+
...getTitles(input.layout),
|
|
799
833
|
...getAxisCategoryOrderProps([
|
|
800
834
|
firstData
|
|
801
835
|
], input.layout)
|