@fluentui/react-charting 5.24.13 → 5.24.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.
Files changed (32) 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/PlotlySchemaAdapter.js +16 -10
  6. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  7. package/lib/components/LineChart/LineChart.base.js +6 -11
  8. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  9. package/lib/components/ScatterChart/ScatterChart.base.js +4 -9
  10. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  11. package/lib/utilities/scatterpolar-utils.d.ts +7 -4
  12. package/lib/utilities/scatterpolar-utils.js +19 -2
  13. package/lib/utilities/scatterpolar-utils.js.map +1 -1
  14. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +16 -10
  15. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  16. package/lib-amd/components/LineChart/LineChart.base.js +6 -11
  17. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  18. package/lib-amd/components/ScatterChart/ScatterChart.base.js +4 -9
  19. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  20. package/lib-amd/utilities/scatterpolar-utils.d.ts +7 -4
  21. package/lib-amd/utilities/scatterpolar-utils.js +21 -3
  22. package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
  23. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +16 -10
  24. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  25. package/lib-commonjs/components/LineChart/LineChart.base.js +6 -11
  26. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  27. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +4 -9
  28. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  29. package/lib-commonjs/utilities/scatterpolar-utils.d.ts +7 -4
  30. package/lib-commonjs/utilities/scatterpolar-utils.js +21 -3
  31. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
  32. package/package.json +2 -2
@@ -333,7 +333,7 @@ export var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot, colorM
333
333
  });
334
334
  });
335
335
  var vsbcData = Object.values(mapXToDataPoints);
336
- return __assign(__assign(__assign(__assign(__assign(__assign({ data: vsbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_d = vsbcData[0]) === null || _d === void 0 ? void 0 : _d.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat);
336
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign({ data: vsbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_d = vsbcData[0]) === null || _d === void 0 ? void 0 : _d.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat);
337
337
  };
338
338
  export var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
339
339
  var _a, _b, _c, _d;
@@ -488,7 +488,7 @@ var transformPlotlyJsonToScatterTraceProps = function (input, isMultiPlot, chart
488
488
  var legendShape = getLegendShape(series);
489
489
  var validXYRanges = getValidXYRanges(series);
490
490
  return validXYRanges.map(function (_a, rangeIdx) {
491
- var _b, _c, _d;
491
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
492
492
  var rangeStart = _a[0], rangeEnd = _a[1];
493
493
  var rangeXValues = xValues.slice(rangeStart, rangeEnd);
494
494
  var rangeYValues = series.y.slice(rangeStart, rangeEnd);
@@ -508,10 +508,13 @@ var transformPlotlyJsonToScatterTraceProps = function (input, isMultiPlot, chart
508
508
  : {})), (textValues ? { text: textValues[i] } : {})), { yAxisCalloutData: getFormattedCalloutYData(rangeYValues[i], yAxisTickFormat) }));
509
509
  }),
510
510
  color: (_c = rgb(seriesColor).copy({ opacity: seriesOpacity }).formatHex8()) !== null && _c !== void 0 ? _c : seriesColor,
511
- lineOptions: __assign(__assign({}, (lineOptions !== null && lineOptions !== void 0 ? lineOptions : {})), { mode: series.type !== 'scatterpolar' ? series.mode : 'scatterpolar',
512
- // originXOffset is not typed on Layout, but may be present in input.layout as a part of projection of
513
- // scatter polar coordingates to cartesian coordinates
514
- originXOffset: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.__polarOriginX }),
511
+ lineOptions: __assign(__assign(__assign({}, (lineOptions !== null && lineOptions !== void 0 ? lineOptions : {})), { mode: series.type !== 'scatterpolar' ? series.mode : 'scatterpolar' }), (series.type === 'scatterpolar'
512
+ ? {
513
+ originXOffset: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.__polarOriginX,
514
+ 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,
515
+ 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,
516
+ }
517
+ : {})),
515
518
  useSecondaryYScale: usesSecondaryYScale(series, input.layout),
516
519
  };
517
520
  });
@@ -1117,7 +1120,7 @@ export var transformPlotlyJsonToFunnelChartProps = function (input, isMultiPlot,
1117
1120
  };
1118
1121
  };
1119
1122
  export var projectPolarToCartesian = function (input) {
1120
- var _a, _b;
1123
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1121
1124
  var projection = __assign({}, input);
1122
1125
  // 1. Find the global min and max radius across all series
1123
1126
  var minRadius = 0;
@@ -1154,6 +1157,9 @@ export var projectPolarToCartesian = function (input) {
1154
1157
  projection.data[sindex] = series;
1155
1158
  return "continue";
1156
1159
  }
1160
+ // retrieve polar axis settings
1161
+ var dirMultiplier = ((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.polar) === null || _b === void 0 ? void 0 : _b.angularaxis) === null || _c === void 0 ? void 0 : _c.direction) === 'clockwise' ? -1 : 1;
1162
+ var startAngleInRad = (((_g = (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.polar) === null || _e === void 0 ? void 0 : _e.angularaxis) === null || _f === void 0 ? void 0 : _f.rotation) !== null && _g !== void 0 ? _g : 0) * Math.PI) / 180;
1157
1163
  // Compute tick positions if categorical
1158
1164
  var uniqueTheta = [];
1159
1165
  var categorical = false;
@@ -1170,10 +1176,10 @@ export var projectPolarToCartesian = function (input) {
1170
1176
  if (categorical) {
1171
1177
  var idx = uniqueTheta.indexOf(thetas[ptindex]);
1172
1178
  var step = (2 * Math.PI) / uniqueTheta.length;
1173
- thetaRad = idx * step;
1179
+ thetaRad = startAngleInRad + dirMultiplier * idx * step;
1174
1180
  }
1175
1181
  else {
1176
- thetaRad = (thetas[ptindex] * Math.PI) / 180;
1182
+ thetaRad = startAngleInRad + dirMultiplier * ((thetas[ptindex] * Math.PI) / 180);
1177
1183
  }
1178
1184
  // 5. Shift only the polar origin (not the cartesian)
1179
1185
  var rawRadius = rVals[ptindex];
@@ -1227,7 +1233,7 @@ export var projectPolarToCartesian = function (input) {
1227
1233
  }
1228
1234
  }
1229
1235
  // 10. Customize layout for perfect square with absolute positioning
1230
- var size = ((_a = input.layout) === null || _a === void 0 ? void 0 : _a.width) || ((_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) || 500;
1236
+ var size = ((_h = input.layout) === null || _h === void 0 ? void 0 : _h.width) || ((_j = input.layout) === null || _j === void 0 ? void 0 : _j.height) || 500;
1231
1237
  projection.layout = __assign(__assign({}, projection.layout), { width: size, height: size });
1232
1238
  // Attach originX as custom properties
1233
1239
  projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;