@fluentui/react-charting 5.24.18 → 5.24.20
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.json +49 -1
- package/CHANGELOG.md +23 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +2 -3
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +0 -7
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +1 -8
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.d.ts +2 -8
- package/lib/utilities/scatterpolar-utils.js +7 -15
- package/lib/utilities/scatterpolar-utils.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +2 -3
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +0 -7
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +1 -8
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/utilities/scatterpolar-utils.d.ts +2 -8
- package/lib-amd/utilities/scatterpolar-utils.js +7 -15
- package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -3
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +0 -7
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +1 -8
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.d.ts +2 -8
- package/lib-commonjs/utilities/scatterpolar-utils.js +7 -15
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -528,6 +528,9 @@ var transformPlotlyJsonToScatterTraceProps = function (input, isMultiPlot, chart
|
|
|
528
528
|
originXOffset: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.__polarOriginX,
|
|
529
529
|
direction: (_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.polar) === null || _f === void 0 ? void 0 : _f.angularaxis) === null || _g === void 0 ? void 0 : _g.direction,
|
|
530
530
|
rotation: (_k = (_j = (_h = input.layout) === null || _h === void 0 ? void 0 : _h.polar) === null || _j === void 0 ? void 0 : _j.angularaxis) === null || _k === void 0 ? void 0 : _k.rotation,
|
|
531
|
+
axisLabel: series.__axisLabel
|
|
532
|
+
? series.__axisLabel
|
|
533
|
+
: {},
|
|
531
534
|
}
|
|
532
535
|
: {})),
|
|
533
536
|
useSecondaryYScale: usesSecondaryYScale(series, input.layout),
|
|
@@ -1155,7 +1158,7 @@ exports.transformPlotlyJsonToFunnelChartProps = transformPlotlyJsonToFunnelChart
|
|
|
1155
1158
|
var projectPolarToCartesian = function (input) {
|
|
1156
1159
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1157
1160
|
var projection = tslib_1.__assign({}, input);
|
|
1158
|
-
//
|
|
1161
|
+
// Find the global min and max radius across all series
|
|
1159
1162
|
var minRadius = 0;
|
|
1160
1163
|
var maxRadius = 0;
|
|
1161
1164
|
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
@@ -1169,17 +1172,25 @@ var projectPolarToCartesian = function (input) {
|
|
|
1169
1172
|
}
|
|
1170
1173
|
}
|
|
1171
1174
|
}
|
|
1172
|
-
//
|
|
1175
|
+
// If there are negative radii, compute the shift
|
|
1173
1176
|
var radiusShift = minRadius < 0 ? -minRadius : 0;
|
|
1174
|
-
//
|
|
1177
|
+
// Collect all unique theta values from all scatterpolar series for equal spacing
|
|
1178
|
+
var allThetaValues = new Set();
|
|
1179
|
+
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
1180
|
+
var series = input.data[sindex];
|
|
1181
|
+
if (series.theta && (0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
|
|
1182
|
+
series.theta.forEach(function (theta) { return allThetaValues.add(String(theta)); });
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
// Project all points and create a perfect square domain
|
|
1175
1186
|
var allX = [];
|
|
1176
1187
|
var allY = [];
|
|
1177
1188
|
var originX = null;
|
|
1178
1189
|
var _loop_1 = function (sindex) {
|
|
1179
1190
|
var series = input.data[sindex];
|
|
1180
|
-
// If scatterpolar, set
|
|
1181
|
-
if (
|
|
1182
|
-
series.
|
|
1191
|
+
// If scatterpolar, set __axisLabel to all unique theta values for equal spacing
|
|
1192
|
+
if ((0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
|
|
1193
|
+
series.__axisLabel = Array.from(allThetaValues);
|
|
1183
1194
|
}
|
|
1184
1195
|
series.x = [];
|
|
1185
1196
|
series.y = [];
|
|
@@ -1204,7 +1215,7 @@ var projectPolarToCartesian = function (input) {
|
|
|
1204
1215
|
if ((0, chart_utilities_1.isInvalidValue)(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || (0, chart_utilities_1.isInvalidValue)(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
|
|
1205
1216
|
continue;
|
|
1206
1217
|
}
|
|
1207
|
-
//
|
|
1218
|
+
// Map theta to angle in radians
|
|
1208
1219
|
var thetaRad = void 0;
|
|
1209
1220
|
if (categorical) {
|
|
1210
1221
|
var idx = uniqueTheta.indexOf(thetas[ptindex]);
|
|
@@ -1214,10 +1225,10 @@ var projectPolarToCartesian = function (input) {
|
|
|
1214
1225
|
else {
|
|
1215
1226
|
thetaRad = startAngleInRad + dirMultiplier * ((thetas[ptindex] * Math.PI) / 180);
|
|
1216
1227
|
}
|
|
1217
|
-
//
|
|
1228
|
+
// Shift only the polar origin (not the cartesian)
|
|
1218
1229
|
var rawRadius = rVals[ptindex];
|
|
1219
1230
|
var polarRadius = rawRadius + radiusShift; // Only for projection
|
|
1220
|
-
//
|
|
1231
|
+
// Calculate cartesian coordinates (with shifted polar origin)
|
|
1221
1232
|
var x = polarRadius * Math.cos(thetaRad);
|
|
1222
1233
|
var y = polarRadius * Math.sin(thetaRad);
|
|
1223
1234
|
// Calculate the cartesian coordinates of the original polar origin (0,0)
|