@fluentui/react-charts 0.0.0-nightly-20250814-0406.1 → 0.0.0-nightly-20250815-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 (29) hide show
  1. package/CHANGELOG.md +15 -15
  2. package/dist/index.d.ts +15 -6
  3. package/lib/components/CommonComponents/CartesianChart.js +12 -16
  4. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  5. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  6. package/lib/components/DeclarativeChart/DeclarativeChart.js +3 -2
  7. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  8. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -6
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  10. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +126 -33
  11. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  12. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  13. package/lib/types/DataPoint.js.map +1 -1
  14. package/lib/utilities/utilities.js +10 -4
  15. package/lib/utilities/utilities.js.map +1 -1
  16. package/lib-commonjs/components/CommonComponents/CartesianChart.js +12 -15
  17. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  18. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  19. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -1
  20. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  21. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +15 -6
  22. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  23. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +125 -32
  24. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  25. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  26. package/lib-commonjs/types/DataPoint.js.map +1 -1
  27. package/lib-commonjs/utilities/utilities.js +10 -4
  28. package/lib-commonjs/utilities/utilities.js.map +1 -1
  29. package/package.json +12 -12
@@ -24,6 +24,9 @@ _export(exports, {
24
24
  getValidXYRanges: function() {
25
25
  return getValidXYRanges;
26
26
  },
27
+ isStringArray: function() {
28
+ return isStringArray;
29
+ },
27
30
  projectPolarToCartesian: function() {
28
31
  return projectPolarToCartesian;
29
32
  },
@@ -313,6 +316,9 @@ const transformPlotlyJsonToVSBCProps = (input, colorMap, colorwayType, isDarkThe
313
316
  data: yVal,
314
317
  color
315
318
  });
319
+ if (typeof yVal === 'number') {
320
+ yMaxValue = Math.max(yMaxValue, yVal);
321
+ }
316
322
  } else if (series.type === 'scatter' || !!fallbackVSBC) {
317
323
  var _series_line;
318
324
  const lineColor = (0, _PlotlyColorAdapter.resolveColor)(extractedLineColors, index1, legend, colorMap, isDarkTheme);
@@ -329,7 +335,7 @@ const transformPlotlyJsonToVSBCProps = (input, colorMap, colorwayType, isDarkThe
329
335
  } : {},
330
336
  useSecondaryYScale: usesSecondaryYScale(series)
331
337
  });
332
- if (!usesSecondaryYScale(series)) {
338
+ if (!usesSecondaryYScale(series) && typeof yVal === 'number') {
333
339
  yMaxValue = Math.max(yMaxValue, yVal);
334
340
  yMinValue = Math.min(yMinValue, yVal);
335
341
  }
@@ -357,7 +363,10 @@ const transformPlotlyJsonToVSBCProps = (input, colorMap, colorwayType, isDarkThe
357
363
  hideTickOverlap: true,
358
364
  barGapMax: 2,
359
365
  hideLegend,
360
- roundCorners: true
366
+ roundCorners: true,
367
+ showYAxisLables: true,
368
+ noOfCharsToTruncate: 20,
369
+ showYAxisLablesTooltip: true
361
370
  };
362
371
  };
363
372
  const createColorScale = (colorscale, domain)=>{
@@ -513,9 +522,10 @@ const transformPlotlyJsonToScatterChartProps = (input, isAreaChart, isScatterMar
513
522
  let mode = 'tonexty';
514
523
  const { legends, hideLegend } = getLegendProps(input.data, input.layout);
515
524
  const chartData = input.data.map((series, index)=>{
516
- var _input_layout_template_layout, _input_layout_template, _input_layout, _series_marker, _series_line, _series_line1;
525
+ var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _series_line2;
526
+ const colors = isScatterMarkers ? (series === null || series === void 0 ? void 0 : (_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('line')) ? (_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.color : (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color : (_series_line1 = series.line) === null || _series_line1 === void 0 ? void 0 : _series_line1.color;
517
527
  // extract colors for each series only once
518
- const extractedColors = (0, _PlotlyColorAdapter.extractColor)((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, isScatterMarkers ? (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color : (_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.color, colorMap, isDarkTheme);
528
+ const extractedColors = (0, _PlotlyColorAdapter.extractColor)((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, colors, colorMap, isDarkTheme);
519
529
  const xValues = series.x;
520
530
  const isXString = isStringArray(xValues);
521
531
  const isXDate = (0, _chartutilities.isDateArray)(xValues);
@@ -527,7 +537,7 @@ const transformPlotlyJsonToScatterChartProps = (input, isAreaChart, isScatterMar
527
537
  const seriesColor = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index, legend, colorMap, isDarkTheme);
528
538
  mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';
529
539
  const lineOptions = getLineOptions(series.line);
530
- const dashType = ((_series_line1 = series.line) === null || _series_line1 === void 0 ? void 0 : _series_line1.dash) || 'solid';
540
+ const dashType = ((_series_line2 = series.line) === null || _series_line2 === void 0 ? void 0 : _series_line2.dash) || 'solid';
531
541
  const legendShape = dashType === 'dot' || dashType === 'dash' || dashType === 'dashdot' ? 'dottedLine' : 'default';
532
542
  const validXYRanges = getValidXYRanges(series);
533
543
  return validXYRanges.map(([rangeStart, rangeEnd], rangeIdx)=>{
@@ -1149,7 +1159,6 @@ function getLineOptions(line) {
1149
1159
  }
1150
1160
  return Object.keys(lineOptions).length > 0 ? lineOptions : undefined;
1151
1161
  }
1152
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1153
1162
  const isStringArray = (arr)=>{
1154
1163
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1155
1164
  return (0, _chartutilities.isArrayOfType)(arr, (value)=>typeof value === 'string' || value === null);