@fluentui/react-charts 0.0.0-nightly-20251020-0413.1 → 0.0.0-nightly-20251020-1611.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 +15 -15
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +9 -71
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +9 -71
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/package.json +12 -12
|
@@ -580,6 +580,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
580
580
|
((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').forEach((shape, shapeIdx)=>{
|
|
581
581
|
var _shape_line;
|
|
582
582
|
const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
|
|
583
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
583
584
|
const resolveX = (val)=>{
|
|
584
585
|
if (typeof val === 'number' && Array.isArray(xCategories) && xCategories[val] !== undefined) {
|
|
585
586
|
return xCategories[val];
|
|
@@ -588,6 +589,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
588
589
|
};
|
|
589
590
|
const x0Key = resolveX(shape.x0);
|
|
590
591
|
const x1Key = resolveX(shape.x1);
|
|
592
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
591
593
|
const resolveY = (val)=>{
|
|
592
594
|
if (shape.yref === 'paper') {
|
|
593
595
|
if (val === 0) {
|
|
@@ -596,10 +598,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
596
598
|
if (val === 1) {
|
|
597
599
|
return yMaxValue;
|
|
598
600
|
}
|
|
599
|
-
|
|
600
|
-
return yMinValue + val * (yMaxValue - yMinValue);
|
|
601
|
-
}
|
|
602
|
-
return val;
|
|
601
|
+
return yMinValue + val * (yMaxValue - yMinValue);
|
|
603
602
|
}
|
|
604
603
|
return val;
|
|
605
604
|
};
|
|
@@ -862,29 +861,8 @@ const transformPlotlyJsonToLineChartProps = (input, isMultiPlot, colorMap, color
|
|
|
862
861
|
const transformPlotlyJsonToScatterChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
863
862
|
return transformPlotlyJsonToScatterTraceProps(input, isMultiPlot, 'scatter', colorMap, colorwayType, isDarkTheme);
|
|
864
863
|
};
|
|
865
|
-
const mapColorFillBars = (layout)=>{
|
|
866
|
-
if (!Array.isArray(layout === null || layout === void 0 ? void 0 : layout.shapes)) {
|
|
867
|
-
return [];
|
|
868
|
-
}
|
|
869
|
-
return layout.shapes.filter((shape)=>shape.type === 'rect').map((shape)=>{
|
|
870
|
-
//colorFillbars doesn't support string dates or categories
|
|
871
|
-
if (typeof shape.x0 === 'string' || typeof shape.x1 === 'string') {
|
|
872
|
-
return null;
|
|
873
|
-
}
|
|
874
|
-
return {
|
|
875
|
-
color: shape.fillcolor,
|
|
876
|
-
data: [
|
|
877
|
-
{
|
|
878
|
-
startX: shape.x0,
|
|
879
|
-
endX: shape.x1
|
|
880
|
-
}
|
|
881
|
-
],
|
|
882
|
-
applyPattern: false
|
|
883
|
-
};
|
|
884
|
-
});
|
|
885
|
-
};
|
|
886
864
|
const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, colorMap, colorwayType, isDarkTheme)=>{
|
|
887
|
-
var _input_data_,
|
|
865
|
+
var _input_data_, _input_layout, _input_layout1, _input_layout2;
|
|
888
866
|
const isScatterMarkers = [
|
|
889
867
|
'text',
|
|
890
868
|
'markers',
|
|
@@ -968,55 +946,21 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
968
946
|
};
|
|
969
947
|
});
|
|
970
948
|
}).flat();
|
|
971
|
-
const xMinValue = (_chartData_ = chartData[0]) === null || _chartData_ === void 0 ? void 0 : (_chartData__data_ = _chartData_.data[0]) === null || _chartData__data_ === void 0 ? void 0 : _chartData__data_.x;
|
|
972
|
-
const xMaxValue = (_chartData_1 = chartData[0]) === null || _chartData_1 === void 0 ? void 0 : (_chartData__data_1 = _chartData_1.data[chartData[0].data.length - 1]) === null || _chartData__data_1 === void 0 ? void 0 : _chartData__data_1.x;
|
|
973
|
-
const yMinValue = (_chartData_2 = chartData[0]) === null || _chartData_2 === void 0 ? void 0 : (_chartData__data_2 = _chartData_2.data[0]) === null || _chartData__data_2 === void 0 ? void 0 : _chartData__data_2.y;
|
|
974
|
-
const yMaxValue = (_chartData_3 = chartData[0]) === null || _chartData_3 === void 0 ? void 0 : (_chartData__data_3 = _chartData_3.data[chartData[0].data.length - 1]) === null || _chartData__data_3 === void 0 ? void 0 : _chartData__data_3.y;
|
|
975
949
|
var _input_layout_shapes;
|
|
976
950
|
const lineShape = ((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').map((shape, shapeIdx)=>{
|
|
977
951
|
var _shape_line;
|
|
978
952
|
const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
|
|
979
|
-
const resolveX = (val)=>{
|
|
980
|
-
if (shape.xref === 'paper') {
|
|
981
|
-
if (val === 0) {
|
|
982
|
-
return xMinValue;
|
|
983
|
-
}
|
|
984
|
-
if (val === 1) {
|
|
985
|
-
return xMaxValue;
|
|
986
|
-
}
|
|
987
|
-
if (typeof val === 'number' && typeof xMinValue === 'number' && typeof xMaxValue === 'number') {
|
|
988
|
-
return xMinValue + val * (xMaxValue - xMinValue);
|
|
989
|
-
}
|
|
990
|
-
return val;
|
|
991
|
-
}
|
|
992
|
-
return val;
|
|
993
|
-
};
|
|
994
|
-
const resolveY = (val)=>{
|
|
995
|
-
if (shape.yref === 'paper') {
|
|
996
|
-
if (val === 0) {
|
|
997
|
-
return yMinValue;
|
|
998
|
-
}
|
|
999
|
-
if (val === 1) {
|
|
1000
|
-
return yMaxValue;
|
|
1001
|
-
}
|
|
1002
|
-
if (typeof val === 'number') {
|
|
1003
|
-
return yMinValue + val * (yMaxValue - yMinValue);
|
|
1004
|
-
}
|
|
1005
|
-
return val;
|
|
1006
|
-
}
|
|
1007
|
-
return val;
|
|
1008
|
-
};
|
|
1009
953
|
var _rgb_formatHex8;
|
|
1010
954
|
return {
|
|
1011
955
|
legend: `Reference_${shapeIdx}`,
|
|
1012
956
|
data: [
|
|
1013
957
|
{
|
|
1014
|
-
x:
|
|
1015
|
-
y:
|
|
958
|
+
x: shape.x0,
|
|
959
|
+
y: shape.y0
|
|
1016
960
|
},
|
|
1017
961
|
{
|
|
1018
|
-
x:
|
|
1019
|
-
y:
|
|
962
|
+
x: shape.x1,
|
|
963
|
+
y: shape.y1
|
|
1020
964
|
}
|
|
1021
965
|
],
|
|
1022
966
|
color: (_rgb_formatHex8 = (0, _d3color.rgb)(lineColor).formatHex8()) !== null && _rgb_formatHex8 !== void 0 ? _rgb_formatHex8 : lineColor,
|
|
@@ -1072,13 +1016,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1072
1016
|
...isScatterChart ? {
|
|
1073
1017
|
showYAxisLablesTooltip: true,
|
|
1074
1018
|
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
1075
|
-
} : {}
|
|
1076
|
-
...!isScatterChart && (()=>{
|
|
1077
|
-
const bars = mapColorFillBars(input.layout);
|
|
1078
|
-
return bars && !bars.includes(null) ? {
|
|
1079
|
-
colorFillBars: bars
|
|
1080
|
-
} : {};
|
|
1081
|
-
})()
|
|
1019
|
+
} : {}
|
|
1082
1020
|
};
|
|
1083
1021
|
}
|
|
1084
1022
|
};
|