@fluentui/react-charts 0.0.0-nightly-20250826-0412.1 → 0.0.0-nightly-20250827-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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -15
  2. package/lib/components/ChartTable/ChartTable.js +87 -6
  3. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  4. package/lib/components/DeclarativeChart/DeclarativeChart.js +11 -1
  5. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  6. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +19 -0
  7. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  8. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +202 -63
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  10. package/lib/components/LineChart/LineChart.js +29 -4
  11. package/lib/components/LineChart/LineChart.js.map +1 -1
  12. package/lib/components/ScatterChart/ScatterChart.js +62 -45
  13. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  14. package/lib/utilities/scatterpolar-utils.js +63 -0
  15. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  16. package/lib/utilities/utilities.js +32 -8
  17. package/lib/utilities/utilities.js.map +1 -1
  18. package/lib-commonjs/components/ChartTable/ChartTable.js +87 -6
  19. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  20. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +11 -1
  21. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  22. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +22 -0
  23. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  24. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +201 -62
  25. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  26. package/lib-commonjs/components/LineChart/LineChart.js +28 -3
  27. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  28. package/lib-commonjs/components/ScatterChart/ScatterChart.js +61 -44
  29. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  30. package/lib-commonjs/utilities/scatterpolar-utils.js +78 -0
  31. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  32. package/lib-commonjs/utilities/utilities.js +28 -8
  33. package/lib-commonjs/utilities/utilities.js.map +1 -1
  34. package/package.json +12 -12
@@ -10,8 +10,9 @@ import { find } from '../../utilities/index';
10
10
  import { CartesianChart } from '../../index';
11
11
  import { EventsAnnotation } from './eventAnnotation/EventAnnotation';
12
12
  import { tokens } from '@fluentui/react-theme';
13
- import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineVerticalBarChart, domainRangeOfNumericForAreaChart, createStringYAxis, useRtl, formatDate, getCurveFactory } from '../../utilities/index';
13
+ import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineVerticalBarChart, domainRangeOfNumericForAreaChart, createStringYAxis, useRtl, formatDate, getCurveFactory, isScatterPolarSeries } from '../../utilities/index';
14
14
  import { toImage } from '../../utilities/image-export-utils';
15
+ import { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';
15
16
  var PointSize = /*#__PURE__*/ function(PointSize) {
16
17
  PointSize[PointSize["hoverSize"] = 11] = "hoverSize";
17
18
  PointSize[PointSize["invisibleSize"] = 1] = "invisibleSize";
@@ -92,6 +93,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
92
93
  var _props_legendProps_selectedLegends, _props_legendProps;
93
94
  let _hasMarkersMode = false;
94
95
  let _isXAxisDateType = false;
96
+ let _isScatterPolar = false;
95
97
  let _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
96
98
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
99
  let _calloutPoints = calloutData(_points) || [];
@@ -206,6 +208,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
206
208
  var _item_lineOptions_mode_includes, _item_lineOptions_mode, _item_lineOptions;
207
209
  return (_item_lineOptions = item.lineOptions) === null || _item_lineOptions === void 0 ? void 0 : (_item_lineOptions_mode = _item_lineOptions.mode) === null || _item_lineOptions_mode === void 0 ? void 0 : (_item_lineOptions_mode_includes = _item_lineOptions_mode.includes) === null || _item_lineOptions_mode_includes === void 0 ? void 0 : _item_lineOptions_mode_includes.call(_item_lineOptions_mode, 'markers');
208
210
  })) !== null && _filteredData_some !== void 0 ? _filteredData_some : false;
211
+ _isScatterPolar = isScatterPolarSeries(filteredData);
209
212
  return filteredData ? filteredData.map((item, index)=>{
210
213
  let color;
211
214
  if (typeof item.color === 'undefined') {
@@ -470,7 +473,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
470
473
  onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
471
474
  onBlur: _handleMouseOut,
472
475
  ..._getClickHandler(_points[i].data[0].onDataPointClick)
473
- }), supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
476
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
474
477
  key: `${circleId}-label`,
475
478
  x: _xAxisScale(x1),
476
479
  y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 3.5, 4) + 12,
@@ -600,7 +603,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
600
603
  strokeWidth: strokeWidth,
601
604
  role: "img",
602
605
  "aria-label": (_points_i_data__text1 = _points[i].data[j - 1].text) !== null && _points_i_data__text1 !== void 0 ? _points_i_data__text1 : _getAriaLabel(i, j - 1)
603
- }), supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
606
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
604
607
  key: `${circleId}-label`,
605
608
  x: _xAxisScale(x1),
606
609
  y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
@@ -658,7 +661,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
658
661
  strokeWidth: strokeWidth,
659
662
  role: "img",
660
663
  "aria-label": (_points_i_data_j_text = _points[i].data[j].text) !== null && _points_i_data_j_text !== void 0 ? _points_i_data_j_text : _getAriaLabel(i, j)
661
- }), lastSupportsTextMode && lastText && /*#__PURE__*/ React.createElement("text", {
664
+ }), !_isScatterPolar && lastSupportsTextMode && lastText && /*#__PURE__*/ React.createElement("text", {
662
665
  key: `${lastCircleId}-label`,
663
666
  x: _xAxisScale(x2),
664
667
  y: yScale(y2) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
@@ -766,6 +769,24 @@ const PATH_MULTIPLY_SIZE = 2.5;
766
769
  }
767
770
  }
768
771
  }
772
+ if (_isScatterPolar) {
773
+ var _points_i;
774
+ // Render category labels for all series at once to avoid overlap
775
+ const allSeriesData = _points.map((series)=>({
776
+ data: series.data.filter((pt)=>typeof pt.x === 'number' && typeof pt.y === 'number').map((pt)=>({
777
+ x: pt.x,
778
+ y: pt.y,
779
+ text: pt.text
780
+ }))
781
+ }));
782
+ pointsForLine.push(...renderScatterPolarCategoryLabels({
783
+ allSeriesData,
784
+ xAxisScale: _xAxisScale,
785
+ yAxisScale: yScale,
786
+ className: classes.markerLabel || '',
787
+ lineOptions: (_points_i = _points[i]) === null || _points_i === void 0 ? void 0 : _points_i.lineOptions
788
+ }));
789
+ }
769
790
  lines.push(/*#__PURE__*/ React.createElement("g", {
770
791
  key: `line_${i}`,
771
792
  role: "region",
@@ -1232,6 +1253,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
1232
1253
  getMinMaxOfYAxis: _getNumericMinMaxOfY,
1233
1254
  getGraphData: _initializeLineChartData,
1234
1255
  xAxisType: _isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis,
1256
+ ..._isScatterPolar ? {
1257
+ yMaxValue: 1,
1258
+ yMinValue: -1
1259
+ } : {},
1235
1260
  getDomainNRangeValues: _getDomainNRangeValues,
1236
1261
  createStringYAxis: createStringYAxis,
1237
1262
  onChartMouseLeave: _handleChartMouseLeave,