@fluentui/react-charting 5.24.18 → 5.24.19

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.
Files changed (38) hide show
  1. package/CHANGELOG.json +28 -1
  2. package/CHANGELOG.md +13 -2
  3. package/dist/react-charting.js +1 -1
  4. package/dist/react-charting.min.js +1 -1
  5. package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -1
  6. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  7. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
  8. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  9. package/lib/components/LineChart/LineChart.base.js +0 -7
  10. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  11. package/lib/components/ScatterChart/ScatterChart.base.js +1 -8
  12. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  13. package/lib/utilities/scatterpolar-utils.d.ts +2 -8
  14. package/lib/utilities/scatterpolar-utils.js +7 -15
  15. package/lib/utilities/scatterpolar-utils.js.map +1 -1
  16. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -1
  17. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  18. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
  19. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  20. package/lib-amd/components/LineChart/LineChart.base.js +0 -7
  21. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  22. package/lib-amd/components/ScatterChart/ScatterChart.base.js +1 -8
  23. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  24. package/lib-amd/utilities/scatterpolar-utils.d.ts +2 -8
  25. package/lib-amd/utilities/scatterpolar-utils.js +7 -15
  26. package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
  27. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -1
  28. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  29. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +20 -9
  30. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  31. package/lib-commonjs/components/LineChart/LineChart.base.js +0 -7
  32. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  33. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +1 -8
  34. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  35. package/lib-commonjs/utilities/scatterpolar-utils.d.ts +2 -8
  36. package/lib-commonjs/utilities/scatterpolar-utils.js +7 -15
  37. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
  38. package/package.json +3 -3
@@ -518,6 +518,9 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
518
518
  originXOffset: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.__polarOriginX,
519
519
  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,
520
520
  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,
521
+ axisLabel: series.__axisLabel
522
+ ? series.__axisLabel
523
+ : {},
521
524
  }
522
525
  : {})),
523
526
  useSecondaryYScale: usesSecondaryYScale(series, input.layout),
@@ -1145,7 +1148,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1145
1148
  var projectPolarToCartesian = function (input) {
1146
1149
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1147
1150
  var projection = tslib_1.__assign({}, input);
1148
- // 1. Find the global min and max radius across all series
1151
+ // Find the global min and max radius across all series
1149
1152
  var minRadius = 0;
1150
1153
  var maxRadius = 0;
1151
1154
  for (var sindex = 0; sindex < input.data.length; sindex++) {
@@ -1159,17 +1162,25 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1159
1162
  }
1160
1163
  }
1161
1164
  }
1162
- // 2. If there are negative radii, compute the shift
1165
+ // If there are negative radii, compute the shift
1163
1166
  var radiusShift = minRadius < 0 ? -minRadius : 0;
1164
- // 3. Project all points and create a perfect square domain
1167
+ // Collect all unique theta values from all scatterpolar series for equal spacing
1168
+ var allThetaValues = new Set();
1169
+ for (var sindex = 0; sindex < input.data.length; sindex++) {
1170
+ var series = input.data[sindex];
1171
+ if (series.theta && (0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
1172
+ series.theta.forEach(function (theta) { return allThetaValues.add(String(theta)); });
1173
+ }
1174
+ }
1175
+ // Project all points and create a perfect square domain
1165
1176
  var allX = [];
1166
1177
  var allY = [];
1167
1178
  var originX = null;
1168
1179
  var _loop_1 = function (sindex) {
1169
1180
  var series = input.data[sindex];
1170
- // If scatterpolar, set text to theta values as strings
1171
- if (series.type === 'scatterpolar' && Array.isArray(series.theta)) {
1172
- series.text = series.theta.map(function (v) { return String(v); });
1181
+ // If scatterpolar, set __axisLabel to all unique theta values for equal spacing
1182
+ if ((0, chart_utilities_1.isArrayOrTypedArray)(series.theta)) {
1183
+ series.__axisLabel = Array.from(allThetaValues);
1173
1184
  }
1174
1185
  series.x = [];
1175
1186
  series.y = [];
@@ -1194,7 +1205,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1194
1205
  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])) {
1195
1206
  continue;
1196
1207
  }
1197
- // 4. Map theta to angle in radians
1208
+ // Map theta to angle in radians
1198
1209
  var thetaRad = void 0;
1199
1210
  if (categorical) {
1200
1211
  var idx = uniqueTheta.indexOf(thetas[ptindex]);
@@ -1204,10 +1215,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
1204
1215
  else {
1205
1216
  thetaRad = startAngleInRad + dirMultiplier * ((thetas[ptindex] * Math.PI) / 180);
1206
1217
  }
1207
- // 5. Shift only the polar origin (not the cartesian)
1218
+ // Shift only the polar origin (not the cartesian)
1208
1219
  var rawRadius = rVals[ptindex];
1209
1220
  var polarRadius = rawRadius + radiusShift; // Only for projection
1210
- // 6. Calculate cartesian coordinates (with shifted polar origin)
1221
+ // Calculate cartesian coordinates (with shifted polar origin)
1211
1222
  var x = polarRadius * Math.cos(thetaRad);
1212
1223
  var y = polarRadius * Math.sin(thetaRad);
1213
1224
  // Calculate the cartesian coordinates of the original polar origin (0,0)