@fluentui/react-charts 0.0.0-nightly-20250908-0407.1 → 0.0.0-nightly-20250910-0406.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 (77) hide show
  1. package/CHANGELOG.md +54 -15
  2. package/dist/index.d.ts +1 -1
  3. package/lib/components/AreaChart/AreaChart.js +5 -4
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/ChartTable/ChartTable.js +9 -5
  6. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  7. package/lib/components/CommonComponents/CartesianChart.js +5 -5
  8. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  10. package/lib/components/CommonComponents/ChartPopover.js +5 -1
  11. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +22 -64
  13. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  14. package/lib/components/DonutChart/Arc/Arc.js +7 -8
  15. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  16. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  17. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +2 -2
  18. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  19. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
  20. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  21. package/lib/components/DonutChart/DonutChart.js +53 -23
  22. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  23. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  24. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +5 -1
  25. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  26. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  27. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  28. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +1 -1
  29. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  30. package/lib/components/LineChart/LineChart.js +6 -5
  31. package/lib/components/LineChart/LineChart.js.map +1 -1
  32. package/lib/components/ScatterChart/ScatterChart.js +5 -4
  33. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  34. package/lib/components/VerticalBarChart/VerticalBarChart.js +5 -1
  35. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  36. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +9 -5
  37. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  38. package/lib/utilities/utilities.js +6 -6
  39. package/lib/utilities/utilities.js.map +1 -1
  40. package/lib-commonjs/components/AreaChart/AreaChart.js +4 -3
  41. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  42. package/lib-commonjs/components/ChartTable/ChartTable.js +9 -5
  43. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  44. package/lib-commonjs/components/CommonComponents/CartesianChart.js +5 -5
  45. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  46. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  47. package/lib-commonjs/components/CommonComponents/ChartPopover.js +5 -1
  48. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  49. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +22 -64
  50. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  51. package/lib-commonjs/components/DonutChart/Arc/Arc.js +7 -8
  52. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  53. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  54. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +2 -2
  55. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  56. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
  57. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  58. package/lib-commonjs/components/DonutChart/DonutChart.js +52 -22
  59. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  60. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  61. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +5 -1
  62. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  63. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  64. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  65. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +1 -1
  66. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  67. package/lib-commonjs/components/LineChart/LineChart.js +5 -4
  68. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  69. package/lib-commonjs/components/ScatterChart/ScatterChart.js +4 -3
  70. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  71. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +5 -1
  72. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  73. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +8 -4
  74. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  75. package/lib-commonjs/utilities/utilities.js +6 -6
  76. package/lib-commonjs/utilities/utilities.js.map +1 -1
  77. package/package.json +12 -12
@@ -1300,6 +1300,18 @@ const formatValue = (value, colIndex, cells)=>{
1300
1300
  }
1301
1301
  return `${prefix !== null && prefix !== void 0 ? prefix : ''}${formatted}${suffix !== null && suffix !== void 0 ? suffix : ''}`;
1302
1302
  };
1303
+ function resolveCellStyle(raw, rowIndex, colIndex) {
1304
+ if (Array.isArray(raw)) {
1305
+ var _raw_colIndex;
1306
+ const rowEntry = (_raw_colIndex = raw[colIndex]) !== null && _raw_colIndex !== void 0 ? _raw_colIndex : raw[0];
1307
+ if (Array.isArray(rowEntry)) {
1308
+ var _rowEntry_rowIndex;
1309
+ return (_rowEntry_rowIndex = rowEntry[rowIndex]) !== null && _rowEntry_rowIndex !== void 0 ? _rowEntry_rowIndex : rowEntry[0];
1310
+ }
1311
+ return rowEntry;
1312
+ }
1313
+ return raw;
1314
+ }
1303
1315
  const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
1304
1316
  var _tableData_cells, _input_layout_template_data_table_, _input_layout_template_data_table, _input_layout_template_data, _input_layout_template, _input_layout, _input_layout_font, _input_layout1, _tableData_header, _input_layout_template_data1, _input_layout_template1, _input_layout2, _input_layout3, _input_layout4;
1305
1317
  const tableData = input.data[0];
@@ -1307,36 +1319,12 @@ const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colo
1307
1319
  const cleanedValues = Array.isArray(values[0]) ? values.map((row)=>row.map((cell)=>cleanText(cell)).filter(Boolean).join(' ')) : values.map((cell)=>cleanText(cell));
1308
1320
  return cleanedValues.map((value, colIndex)=>{
1309
1321
  var _header_font, _header_font1, _header_fill;
1310
- const fontColorRaw = header === null || header === void 0 ? void 0 : (_header_font = header.font) === null || _header_font === void 0 ? void 0 : _header_font.color;
1311
- let fontColor;
1312
- if (Array.isArray(fontColorRaw)) {
1313
- var _fontColorRaw_colIndex;
1314
- const colorEntry = (_fontColorRaw_colIndex = fontColorRaw[colIndex]) !== null && _fontColorRaw_colIndex !== void 0 ? _fontColorRaw_colIndex : fontColorRaw[0];
1315
- if (Array.isArray(colorEntry)) {
1316
- fontColor = typeof colorEntry[0] === 'string' ? colorEntry[0] : undefined;
1317
- } else if (typeof colorEntry === 'string') {
1318
- fontColor = colorEntry;
1319
- }
1320
- } else if (typeof fontColorRaw === 'string') {
1321
- fontColor = fontColorRaw;
1322
- }
1323
- const fontSizeRaw = header === null || header === void 0 ? void 0 : (_header_font1 = header.font) === null || _header_font1 === void 0 ? void 0 : _header_font1.size;
1324
- let fontSize;
1325
- if (Array.isArray(fontSizeRaw)) {
1326
- var _fontSizeRaw_colIndex;
1327
- const fontSizeEntry = (_fontSizeRaw_colIndex = fontSizeRaw[colIndex]) !== null && _fontSizeRaw_colIndex !== void 0 ? _fontSizeRaw_colIndex : fontSizeRaw[0];
1328
- var _fontSizeRaw__colIndex;
1329
- fontSize = Array.isArray(fontSizeRaw[0]) ? (_fontSizeRaw__colIndex = fontSizeRaw[0][colIndex]) !== null && _fontSizeRaw__colIndex !== void 0 ? _fontSizeRaw__colIndex : fontSizeRaw[0][0] : typeof fontSizeEntry === 'number' ? fontSizeEntry : undefined;
1330
- } else if (typeof fontSizeRaw === 'number') {
1331
- fontSize = fontSizeRaw;
1332
- }
1333
- const updatedColIndex = colIndex >= 1 ? 1 : 0;
1334
- const fillColorRaw = header === null || header === void 0 ? void 0 : (_header_fill = header.fill) === null || _header_fill === void 0 ? void 0 : _header_fill.color;
1335
- var _fillColorRaw_updatedColIndex;
1336
- const backgroundColor = Array.isArray(fillColorRaw) ? (_fillColorRaw_updatedColIndex = fillColorRaw[updatedColIndex]) !== null && _fillColorRaw_updatedColIndex !== void 0 ? _fillColorRaw_updatedColIndex : fillColorRaw[0] : fillColorRaw;
1337
- const textAlignRaw = header === null || header === void 0 ? void 0 : header.align;
1338
- var _textAlignRaw_colIndex;
1339
- const textAlign = Array.isArray(textAlignRaw) ? (_textAlignRaw_colIndex = textAlignRaw[colIndex]) !== null && _textAlignRaw_colIndex !== void 0 ? _textAlignRaw_colIndex : textAlignRaw[0] : textAlignRaw;
1322
+ //headers are at first row only
1323
+ const rowIndex = 0;
1324
+ const fontColor = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_font = header.font) === null || _header_font === void 0 ? void 0 : _header_font.color, rowIndex, colIndex);
1325
+ const fontSize = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_font1 = header.font) === null || _header_font1 === void 0 ? void 0 : _header_font1.size, rowIndex, colIndex);
1326
+ const backgroundColor = resolveCellStyle(header === null || header === void 0 ? void 0 : (_header_fill = header.fill) === null || _header_fill === void 0 ? void 0 : _header_fill.color, rowIndex, colIndex);
1327
+ const textAlign = resolveCellStyle(header === null || header === void 0 ? void 0 : header.align, rowIndex, colIndex);
1340
1328
  const style = {
1341
1329
  ...typeof fontColor === 'string' ? {
1342
1330
  color: fontColor
@@ -1365,40 +1353,10 @@ const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colo
1365
1353
  const cellValue = col[rowIndex];
1366
1354
  const cleanValue = typeof cellValue === 'string' ? cleanText(cellValue) : cellValue;
1367
1355
  const formattedValue = typeof cleanValue === 'string' || typeof cleanValue === 'number' ? formatValue(cleanValue, colIndex, cells) : cleanValue;
1368
- const rawFontColor = cells === null || cells === void 0 ? void 0 : (_cells_font = cells.font) === null || _cells_font === void 0 ? void 0 : _cells_font.color;
1369
- let fontColor;
1370
- if (Array.isArray(rawFontColor)) {
1371
- var _rawFontColor_colIndex;
1372
- const entry = (_rawFontColor_colIndex = rawFontColor[colIndex]) !== null && _rawFontColor_colIndex !== void 0 ? _rawFontColor_colIndex : rawFontColor[0];
1373
- const colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1374
- fontColor = typeof colorValue === 'string' ? colorValue : undefined;
1375
- } else if (typeof rawFontColor === 'string') {
1376
- fontColor = rawFontColor;
1377
- }
1378
- const rawFontSize = cells === null || cells === void 0 ? void 0 : (_cells_font1 = cells.font) === null || _cells_font1 === void 0 ? void 0 : _cells_font1.size;
1379
- let fontSize;
1380
- if (Array.isArray(rawFontSize)) {
1381
- var _rawFontSize_colIndex;
1382
- const entry = (_rawFontSize_colIndex = rawFontSize[colIndex]) !== null && _rawFontSize_colIndex !== void 0 ? _rawFontSize_colIndex : rawFontSize[0];
1383
- const fontSizeValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1384
- fontSize = typeof fontSizeValue === 'number' ? fontSizeValue : undefined;
1385
- } else if (typeof rawFontSize === 'number') {
1386
- fontSize = rawFontSize;
1387
- }
1388
- const updatedColIndex = colIndex >= 1 ? 1 : 0;
1389
- const rawBackgroundColor = cells === null || cells === void 0 ? void 0 : (_cells_fill = cells.fill) === null || _cells_fill === void 0 ? void 0 : _cells_fill.color;
1390
- let backgroundColor;
1391
- if (Array.isArray(rawBackgroundColor)) {
1392
- var _rawBackgroundColor_updatedColIndex;
1393
- const entry = (_rawBackgroundColor_updatedColIndex = rawBackgroundColor[updatedColIndex]) !== null && _rawBackgroundColor_updatedColIndex !== void 0 ? _rawBackgroundColor_updatedColIndex : rawBackgroundColor[0];
1394
- const colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
1395
- backgroundColor = typeof colorValue === 'string' ? colorValue : undefined;
1396
- } else if (typeof rawBackgroundColor === 'string') {
1397
- backgroundColor = rawBackgroundColor;
1398
- }
1399
- var _cells_align_colIndex;
1400
- const rawTextAlign = Array.isArray(cells === null || cells === void 0 ? void 0 : cells.align) ? (_cells_align_colIndex = cells.align[colIndex]) !== null && _cells_align_colIndex !== void 0 ? _cells_align_colIndex : cells.align[0] : cells === null || cells === void 0 ? void 0 : cells.align;
1401
- const textAlign = rawTextAlign;
1356
+ const fontColor = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_font = cells.font) === null || _cells_font === void 0 ? void 0 : _cells_font.color, rowIndex, colIndex);
1357
+ const fontSize = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_font1 = cells.font) === null || _cells_font1 === void 0 ? void 0 : _cells_font1.size, rowIndex, colIndex);
1358
+ const backgroundColor = resolveCellStyle(cells === null || cells === void 0 ? void 0 : (_cells_fill = cells.fill) === null || _cells_fill === void 0 ? void 0 : _cells_fill.color, rowIndex, colIndex);
1359
+ const textAlign = resolveCellStyle(cells === null || cells === void 0 ? void 0 : cells.align, rowIndex, colIndex);
1402
1360
  const style = {
1403
1361
  ...fontColor ? {
1404
1362
  color: fontColor