@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
@@ -21,6 +21,7 @@ const _index2 = require("../../index");
21
21
  const _EventAnnotation = require("./eventAnnotation/EventAnnotation");
22
22
  const _reacttheme = require("@fluentui/react-theme");
23
23
  const _imageexportutils = require("../../utilities/image-export-utils");
24
+ const _scatterpolarutils = require("../../utilities/scatterpolar-utils");
24
25
  var PointSize = /*#__PURE__*/ function(PointSize) {
25
26
  PointSize[PointSize["hoverSize"] = 11] = "hoverSize";
26
27
  PointSize[PointSize["invisibleSize"] = 1] = "invisibleSize";
@@ -97,6 +98,7 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
97
98
  var _props_legendProps_selectedLegends, _props_legendProps;
98
99
  let _hasMarkersMode = false;
99
100
  let _isXAxisDateType = false;
101
+ let _isScatterPolar = false;
100
102
  let _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
101
103
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
104
  let _calloutPoints = (0, _index1.calloutData)(_points) || [];
@@ -211,6 +213,7 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
211
213
  var _item_lineOptions_mode_includes, _item_lineOptions_mode, _item_lineOptions;
212
214
  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');
213
215
  })) !== null && _filteredData_some !== void 0 ? _filteredData_some : false;
216
+ _isScatterPolar = (0, _index1.isScatterPolarSeries)(filteredData);
214
217
  return filteredData ? filteredData.map((item, index)=>{
215
218
  let color;
216
219
  if (typeof item.color === 'undefined') {
@@ -475,7 +478,7 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
475
478
  onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
476
479
  onBlur: _handleMouseOut,
477
480
  ..._getClickHandler(_points[i].data[0].onDataPointClick)
478
- }), supportsTextMode && text && /*#__PURE__*/ _react.createElement("text", {
481
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ _react.createElement("text", {
479
482
  key: `${circleId}-label`,
480
483
  x: _xAxisScale(x1),
481
484
  y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 3.5, 4) + 12,
@@ -605,7 +608,7 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
605
608
  strokeWidth: strokeWidth,
606
609
  role: "img",
607
610
  "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)
608
- }), supportsTextMode && text && /*#__PURE__*/ _react.createElement("text", {
611
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ _react.createElement("text", {
609
612
  key: `${circleId}-label`,
610
613
  x: _xAxisScale(x1),
611
614
  y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
@@ -663,7 +666,7 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
663
666
  strokeWidth: strokeWidth,
664
667
  role: "img",
665
668
  "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)
666
- }), lastSupportsTextMode && lastText && /*#__PURE__*/ _react.createElement("text", {
669
+ }), !_isScatterPolar && lastSupportsTextMode && lastText && /*#__PURE__*/ _react.createElement("text", {
667
670
  key: `${lastCircleId}-label`,
668
671
  x: _xAxisScale(x2),
669
672
  y: yScale(y2) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
@@ -771,6 +774,24 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
771
774
  }
772
775
  }
773
776
  }
777
+ if (_isScatterPolar) {
778
+ var _points_i;
779
+ // Render category labels for all series at once to avoid overlap
780
+ const allSeriesData = _points.map((series)=>({
781
+ data: series.data.filter((pt)=>typeof pt.x === 'number' && typeof pt.y === 'number').map((pt)=>({
782
+ x: pt.x,
783
+ y: pt.y,
784
+ text: pt.text
785
+ }))
786
+ }));
787
+ pointsForLine.push(...(0, _scatterpolarutils.renderScatterPolarCategoryLabels)({
788
+ allSeriesData,
789
+ xAxisScale: _xAxisScale,
790
+ yAxisScale: yScale,
791
+ className: classes.markerLabel || '',
792
+ lineOptions: (_points_i = _points[i]) === null || _points_i === void 0 ? void 0 : _points_i.lineOptions
793
+ }));
794
+ }
774
795
  lines.push(/*#__PURE__*/ _react.createElement("g", {
775
796
  key: `line_${i}`,
776
797
  role: "region",
@@ -1237,6 +1258,10 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
1237
1258
  getMinMaxOfYAxis: _getNumericMinMaxOfY,
1238
1259
  getGraphData: _initializeLineChartData,
1239
1260
  xAxisType: _isXAxisDateType ? _index1.XAxisTypes.DateAxis : _index1.XAxisTypes.NumericAxis,
1261
+ ..._isScatterPolar ? {
1262
+ yMaxValue: 1,
1263
+ yMinValue: -1
1264
+ } : {},
1240
1265
  getDomainNRangeValues: _getDomainNRangeValues,
1241
1266
  createStringYAxis: _index1.createStringYAxis,
1242
1267
  onChartMouseLeave: _handleChartMouseLeave,