@fluentui/react-charting 5.23.96 → 5.23.97

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 (38) hide show
  1. package/CHANGELOG.json +34 -1
  2. package/CHANGELOG.md +14 -2
  3. package/dist/react-charting.d.ts +8 -2
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +8 -2
  7. package/lib/components/ChartTable/ChartTable.base.js +2 -2
  8. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.types.d.ts +9 -2
  10. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +0 -1
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +145 -28
  13. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  14. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  15. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +40 -24
  16. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  17. package/lib-amd/components/ChartTable/ChartTable.base.js +2 -2
  18. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  19. package/lib-amd/components/ChartTable/ChartTable.types.d.ts +9 -2
  20. package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
  21. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +0 -1
  22. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +152 -37
  23. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  24. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  25. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +39 -24
  26. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  27. package/lib-commonjs/components/ChartTable/ChartTable.base.js +2 -2
  28. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  29. package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +9 -2
  30. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  31. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +0 -1
  32. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +152 -36
  33. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  34. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  35. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +39 -23
  36. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/components/ChartTable/ChartTable.types.ts +3 -2
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.isInvalidValue = exports.findArrayAttributes = exports.projectPolarToCartesian = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports._getGaugeAxisColor = exports.correctYearMonth = exports.isMonthArray = void 0;
3
+ exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.findArrayAttributes = exports.projectPolarToCartesian = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports._getGaugeAxisColor = exports.correctYearMonth = exports.isMonthArray = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var d3_array_1 = require("d3-array");
6
6
  var d3_scale_1 = require("d3-scale");
7
+ var d3_format_1 = require("d3-format");
7
8
  var colors_1 = require("../../utilities/colors");
8
9
  var index_1 = require("../GaugeChart/index");
9
10
  var utilities_1 = require("../../utilities/utilities");
@@ -165,7 +166,7 @@ var transformPlotlyJsonToDonutProps = function (input, colorMap, colorwayType, i
165
166
  var mapLegendToDataPoint = {};
166
167
  (_j = firstData.labels) === null || _j === void 0 ? void 0 : _j.forEach(function (label, index) {
167
168
  var value = (0, exports.getNumberAtIndexOrDefault)(firstData.values, index);
168
- if ((0, exports.isInvalidValue)(value) || value < 0) {
169
+ if ((0, chart_utilities_1.isInvalidValue)(value) || value < 0) {
169
170
  return;
170
171
  }
171
172
  var legend = "".concat(label);
@@ -273,18 +274,41 @@ var transformPlotlyJsonToVSBCProps = function (input, colorMap, colorwayType, is
273
274
  return tslib_1.__assign(tslib_1.__assign({ data: Object.values(mapXToDataPoints), 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, chartTitle: chartTitle, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2 });
274
275
  };
275
276
  exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
277
+ var createColorScale = function (colorscale, domain) {
278
+ var dMin = domain[0], dMax = domain[1];
279
+ // Normalize colorscale domain to actual data domain
280
+ var scaleDomain = colorscale.map(function (_a) {
281
+ var pos = _a[0];
282
+ return dMin + pos * (dMax - dMin);
283
+ });
284
+ var scaleColors = colorscale.map(function (item) { return item[1]; });
285
+ return (0, d3_scale_1.scaleLinear)().domain(scaleDomain).range(scaleColors);
286
+ };
276
287
  var transformPlotlyJsonToGVBCProps = function (input, colorMap, colorwayType, isDarkTheme) {
277
288
  var _a, _b, _c;
278
289
  var mapXToDataPoints = {};
279
290
  var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout, 0, 0);
280
291
  var _d = getLegendProps(input.data, input.layout), legends = _d.legends, hideLegend = _d.hideLegend;
292
+ var colorScale = undefined;
281
293
  input.data.forEach(function (series, index1) {
282
- var _a, _b, _c, _d, _e;
294
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
295
+ if (((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.coloraxis) === null || _b === void 0 ? void 0 : _b.colorscale) === null || _c === void 0 ? void 0 : _c.length) &&
296
+ (0, chart_utilities_1.isArrayOrTypedArray)((_d = series.marker) === null || _d === void 0 ? void 0 : _d.color) &&
297
+ ((_e = series.marker) === null || _e === void 0 ? void 0 : _e.color).length > 0 &&
298
+ typeof ((_g = (_f = series.marker) === null || _f === void 0 ? void 0 : _f.color) === null || _g === void 0 ? void 0 : _g[0]) === 'number') {
299
+ var scale = input.layout.coloraxis.colorscale;
300
+ var colorValues = (_h = series.marker) === null || _h === void 0 ? void 0 : _h.color;
301
+ var _t = [
302
+ (_k = (_j = input.layout.coloraxis) === null || _j === void 0 ? void 0 : _j.cmin) !== null && _k !== void 0 ? _k : Math.min.apply(Math, colorValues),
303
+ (_m = (_l = input.layout.coloraxis) === null || _l === void 0 ? void 0 : _l.cmax) !== null && _m !== void 0 ? _m : Math.max.apply(Math, colorValues),
304
+ ], dMin = _t[0], dMax = _t[1];
305
+ colorScale = createColorScale(scale, [dMin, dMax]);
306
+ }
283
307
  // extract colors for each series only once
284
- var extractedColors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, (_d = series.marker) === null || _d === void 0 ? void 0 : _d.color, colorMap, isDarkTheme);
285
- (_e = series.x) === null || _e === void 0 ? void 0 : _e.forEach(function (x, xIndex) {
286
- var _a;
287
- if ((0, exports.isInvalidValue)(x) || (0, exports.isInvalidValue)((_a = series.y) === null || _a === void 0 ? void 0 : _a[xIndex])) {
308
+ var extractedColors = (0, PlotlyColorAdapter_1.extractColor)((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.template) === null || _p === void 0 ? void 0 : _p.layout) === null || _q === void 0 ? void 0 : _q.colorway, colorwayType, (_r = series.marker) === null || _r === void 0 ? void 0 : _r.color, colorMap, isDarkTheme);
309
+ (_s = series.x) === null || _s === void 0 ? void 0 : _s.forEach(function (x, xIndex) {
310
+ var _a, _b, _c, _d;
311
+ if ((0, chart_utilities_1.isInvalidValue)(x) || (0, chart_utilities_1.isInvalidValue)((_a = series.y) === null || _a === void 0 ? void 0 : _a[xIndex])) {
288
312
  return;
289
313
  }
290
314
  if (!mapXToDataPoints[x]) {
@@ -292,8 +316,10 @@ var transformPlotlyJsonToGVBCProps = function (input, colorMap, colorwayType, is
292
316
  }
293
317
  if (series.type === 'bar') {
294
318
  var legend = legends[index1];
295
- // resolve color for each legend's bars from the extracted colors
296
- var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index1, legend, colorMap, isDarkTheme);
319
+ // resolve color for each legend's bars from the colorscale or extracted colors
320
+ var color = colorScale
321
+ ? colorScale((0, chart_utilities_1.isArrayOrTypedArray)((_b = series.marker) === null || _b === void 0 ? void 0 : _b.color) ? (_d = (_c = series.marker) === null || _c === void 0 ? void 0 : _c.color) === null || _d === void 0 ? void 0 : _d[xIndex] : 0)
322
+ : (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index1, legend, colorMap, isDarkTheme);
297
323
  mapXToDataPoints[x].series.push({
298
324
  key: legend,
299
325
  data: series.y[xIndex],
@@ -324,7 +350,7 @@ var transformPlotlyJsonToVBCProps = function (input, colorMap, colorwayType, isD
324
350
  var yValues = [];
325
351
  series.x.forEach(function (xVal, index) {
326
352
  var yVal = (0, exports.getNumberAtIndexOrDefault)(series.y, index);
327
- if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)(yVal)) {
353
+ if ((0, chart_utilities_1.isInvalidValue)(xVal) || (0, chart_utilities_1.isInvalidValue)(yVal)) {
328
354
  return;
329
355
  }
330
356
  xValues.push(xVal);
@@ -455,7 +481,7 @@ var transformPlotlyJsonToHorizontalBarWithAxisProps = function (input, colorMap,
455
481
  return series.y
456
482
  .map(function (yValue, i) {
457
483
  var _a;
458
- if ((0, exports.isInvalidValue)((_a = series.x) === null || _a === void 0 ? void 0 : _a[i]) || (0, exports.isInvalidValue)(yValue)) {
484
+ if ((0, chart_utilities_1.isInvalidValue)((_a = series.x) === null || _a === void 0 ? void 0 : _a[i]) || (0, chart_utilities_1.isInvalidValue)(yValue)) {
459
485
  return null;
460
486
  }
461
487
  return {
@@ -513,7 +539,7 @@ var transformPlotlyJsonToHeatmapProps = function (input) {
513
539
  (_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, index) {
514
540
  var _a;
515
541
  var zVal = (0, exports.getNumberAtIndexOrDefault)(firstData.z, index);
516
- if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)((_a = firstData.y) === null || _a === void 0 ? void 0 : _a[index]) || (0, exports.isInvalidValue)(zVal)) {
542
+ if ((0, chart_utilities_1.isInvalidValue)(xVal) || (0, chart_utilities_1.isInvalidValue)((_a = firstData.y) === null || _a === void 0 ? void 0 : _a[index]) || (0, chart_utilities_1.isInvalidValue)(zVal)) {
517
543
  return;
518
544
  }
519
545
  xValues_1.push(xVal);
@@ -637,7 +663,7 @@ var transformPlotlyJsonToSankeyProps = function (input, colorMap, colorwayType,
637
663
  var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
638
664
  .map(function (val, index) {
639
665
  var _a, _b;
640
- if ((0, exports.isInvalidValue)(val) || (0, exports.isInvalidValue)((_a = link === null || link === void 0 ? void 0 : link.source) === null || _a === void 0 ? void 0 : _a[index]) || (0, exports.isInvalidValue)((_b = link === null || link === void 0 ? void 0 : link.target) === null || _b === void 0 ? void 0 : _b[index])) {
666
+ if ((0, chart_utilities_1.isInvalidValue)(val) || (0, chart_utilities_1.isInvalidValue)((_a = link === null || link === void 0 ? void 0 : link.source) === null || _a === void 0 ? void 0 : _a[index]) || (0, chart_utilities_1.isInvalidValue)((_b = link === null || link === void 0 ? void 0 : link.target) === null || _b === void 0 ? void 0 : _b[index])) {
641
667
  return null;
642
668
  }
643
669
  return {
@@ -756,37 +782,132 @@ var cleanText = function (text) {
756
782
  .replace(/\$[^$]*\$/g, '$')
757
783
  .trim();
758
784
  };
785
+ var formatValue = function (value, colIndex, cells) {
786
+ if (value === null || typeof value === 'boolean') {
787
+ return value;
788
+ }
789
+ var formatStr = Array.isArray(cells.format) ? cells.format[colIndex] : cells.format;
790
+ var prefix = Array.isArray(cells.prefix) ? cells.prefix[colIndex] : cells.prefix;
791
+ var suffix = Array.isArray(cells.suffix) ? cells.suffix[colIndex] : cells.suffix;
792
+ var formatted = value;
793
+ if (typeof value === 'number') {
794
+ if (typeof formatStr === 'string') {
795
+ try {
796
+ formatted = (0, d3_format_1.format)(formatStr)(value);
797
+ }
798
+ catch (_a) {
799
+ formatted = (0, utilities_1.formatValueLimitWidth)(value);
800
+ }
801
+ }
802
+ else {
803
+ formatted = (0, utilities_1.formatValueLimitWidth)(value);
804
+ }
805
+ }
806
+ return "".concat(prefix !== null && prefix !== void 0 ? prefix : '').concat(formatted).concat(suffix !== null && suffix !== void 0 ? suffix : '');
807
+ };
759
808
  var transformPlotlyJsonToChartTableProps = function (input, colorMap, isDarkTheme) {
760
- var _a, _b, _c, _d, _e, _f, _g, _h;
809
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
761
810
  var tableData = input.data[0];
762
- var normalizeHeaders = function (values) {
763
- // Case: values is array of arrays
764
- if (Array.isArray(values[0])) {
765
- return values.map(function (row) {
811
+ var normalizeHeaders = function (values, header) {
812
+ var cleanedValues = Array.isArray(values[0])
813
+ ? values.map(function (row) {
766
814
  return row
767
815
  .map(function (cell) { return cleanText(cell); })
768
816
  .filter(Boolean)
769
817
  .join(' ');
770
- });
771
- }
772
- // Case: values is 1d array
773
- return values.map(function (cell) { return cleanText(cell); });
818
+ })
819
+ : values.map(function (cell) { return cleanText(cell); });
820
+ return cleanedValues.map(function (value, colIndex) {
821
+ var _a, _b, _c;
822
+ var fontColorRaw = (_a = header === null || header === void 0 ? void 0 : header.font) === null || _a === void 0 ? void 0 : _a.color;
823
+ var fontColor;
824
+ if (Array.isArray(fontColorRaw)) {
825
+ var colorEntry = fontColorRaw[colIndex];
826
+ if (Array.isArray(colorEntry)) {
827
+ fontColor = typeof colorEntry[0] === 'string' ? colorEntry[0] : undefined;
828
+ }
829
+ else if (typeof colorEntry === 'string') {
830
+ fontColor = colorEntry;
831
+ }
832
+ }
833
+ else if (typeof fontColorRaw === 'string') {
834
+ fontColor = fontColorRaw;
835
+ }
836
+ var fontSizeRaw = (_b = header === null || header === void 0 ? void 0 : header.font) === null || _b === void 0 ? void 0 : _b.size;
837
+ var fontSize;
838
+ if (Array.isArray(fontSizeRaw)) {
839
+ fontSize = Array.isArray(fontSizeRaw[0]) ? fontSizeRaw[0][colIndex] : fontSizeRaw[colIndex];
840
+ }
841
+ else if (typeof fontSizeRaw === 'number') {
842
+ fontSize = fontSizeRaw;
843
+ }
844
+ var updatedColIndex = colIndex >= 1 ? 1 : 0;
845
+ var fillColorRaw = (_c = header === null || header === void 0 ? void 0 : header.fill) === null || _c === void 0 ? void 0 : _c.color;
846
+ var backgroundColor = Array.isArray(fillColorRaw) ? fillColorRaw[updatedColIndex] : fillColorRaw;
847
+ var textAlignRaw = header === null || header === void 0 ? void 0 : header.align;
848
+ var textAlign = Array.isArray(textAlignRaw) ? textAlignRaw[colIndex] : textAlignRaw;
849
+ var style = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (typeof fontColor === 'string' ? { color: fontColor } : {})), (typeof fontSize === 'number' ? { fontSize: fontSize } : {})), (typeof backgroundColor === 'string' ? { backgroundColor: backgroundColor } : {})), (textAlign ? { textAlign: textAlign } : {}));
850
+ return { value: value, style: style };
851
+ });
774
852
  };
775
853
  var columns = (_b = (_a = tableData.cells) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
854
+ var cells = tableData.cells.font ? tableData.cells : (_e = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.template) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.table[0].cells;
776
855
  var rows = columns[0].map(function (_, rowIndex) {
777
- return columns.map(function (col) {
778
- var cell = col[rowIndex];
779
- return typeof cell === 'string' ? cleanText(cell) : cell;
856
+ return columns.map(function (col, colIndex) {
857
+ var _a, _b, _c;
858
+ var cellValue = col[rowIndex];
859
+ var cleanValue = typeof cellValue === 'string' ? cleanText(cellValue) : cellValue;
860
+ var formattedValue = typeof cleanValue === 'string' || typeof cleanValue === 'number'
861
+ ? formatValue(cleanValue, colIndex, cells)
862
+ : cleanValue;
863
+ var rawFontColor = (_a = cells === null || cells === void 0 ? void 0 : cells.font) === null || _a === void 0 ? void 0 : _a.color;
864
+ var fontColor;
865
+ if (Array.isArray(rawFontColor)) {
866
+ var entry = rawFontColor[colIndex];
867
+ var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
868
+ fontColor = typeof colorValue === 'string' ? colorValue : undefined;
869
+ }
870
+ else if (typeof rawFontColor === 'string') {
871
+ fontColor = rawFontColor;
872
+ }
873
+ var rawFontSize = (_b = cells === null || cells === void 0 ? void 0 : cells.font) === null || _b === void 0 ? void 0 : _b.size;
874
+ var fontSize;
875
+ if (Array.isArray(rawFontSize)) {
876
+ var entry = rawFontSize[colIndex];
877
+ var fontSizeValue = Array.isArray(entry) ? entry[rowIndex] : entry;
878
+ fontSize = typeof fontSizeValue === 'number' ? fontSizeValue : undefined;
879
+ }
880
+ else if (typeof rawFontSize === 'number') {
881
+ fontSize = rawFontSize;
882
+ }
883
+ var updatedColIndex = colIndex >= 1 ? 1 : 0;
884
+ var rawBackgroundColor = (_c = cells === null || cells === void 0 ? void 0 : cells.fill) === null || _c === void 0 ? void 0 : _c.color;
885
+ var backgroundColor;
886
+ if (Array.isArray(rawBackgroundColor)) {
887
+ var entry = rawBackgroundColor[updatedColIndex];
888
+ var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
889
+ backgroundColor = typeof colorValue === 'string' ? colorValue : undefined;
890
+ }
891
+ else if (typeof rawBackgroundColor === 'string') {
892
+ backgroundColor = rawBackgroundColor;
893
+ }
894
+ var rawTextAlign = Array.isArray(cells === null || cells === void 0 ? void 0 : cells.align) ? cells.align[colIndex] : cells === null || cells === void 0 ? void 0 : cells.align;
895
+ var textAlign = rawTextAlign;
896
+ var style = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (fontColor ? { color: fontColor } : {})), (typeof fontSize === 'number' ? { fontSize: fontSize } : {})), (backgroundColor ? { backgroundColor: backgroundColor } : {})), (textAlign ? { textAlign: textAlign } : {}));
897
+ return {
898
+ value: formattedValue,
899
+ style: style,
900
+ };
780
901
  });
781
902
  });
782
903
  var styles = {
783
- root: tslib_1.__assign({}, (((_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.font) === null || _d === void 0 ? void 0 : _d.size) ? { fontSize: input.layout.font.size } : {})),
904
+ root: tslib_1.__assign({}, (((_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.font) === null || _g === void 0 ? void 0 : _g.size) ? { fontSize: input.layout.font.size } : {})),
784
905
  };
785
906
  return {
786
- headers: normalizeHeaders((_f = (_e = tableData.header) === null || _e === void 0 ? void 0 : _e.values) !== null && _f !== void 0 ? _f : []),
907
+ headers: normalizeHeaders((_j = (_h = tableData.header) === null || _h === void 0 ? void 0 : _h.values) !== null && _j !== void 0 ? _j : [], ((_k = tableData.header) === null || _k === void 0 ? void 0 : _k.font) ? tableData.header : (_o = (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.template) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.table[0].header),
787
908
  rows: rows,
788
- width: (_g = input.layout) === null || _g === void 0 ? void 0 : _g.width,
789
- height: (_h = input.layout) === null || _h === void 0 ? void 0 : _h.height,
909
+ width: (_p = input.layout) === null || _p === void 0 ? void 0 : _p.width,
910
+ height: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.height,
790
911
  styles: styles,
791
912
  };
792
913
  };
@@ -799,7 +920,7 @@ var projectPolarToCartesian = function (input) {
799
920
  series.x = [];
800
921
  series.y = [];
801
922
  for (var ptindex = 0; ptindex < ((_b = (_a = series.r) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); ptindex++) {
802
- if ((0, exports.isInvalidValue)((_c = series.theta) === null || _c === void 0 ? void 0 : _c[ptindex]) || (0, exports.isInvalidValue)((_d = series.r) === null || _d === void 0 ? void 0 : _d[ptindex])) {
923
+ if ((0, chart_utilities_1.isInvalidValue)((_c = series.theta) === null || _c === void 0 ? void 0 : _c[ptindex]) || (0, chart_utilities_1.isInvalidValue)((_d = series.r) === null || _d === void 0 ? void 0 : _d[ptindex])) {
803
924
  continue;
804
925
  }
805
926
  var thetaRad = (series.theta[ptindex] * Math.PI) / 180;
@@ -1005,11 +1126,6 @@ var getLegendProps = function (data, layout) {
1005
1126
  hideLegend: (layout === null || layout === void 0 ? void 0 : layout.showlegend) === false || ((layout === null || layout === void 0 ? void 0 : layout.showlegend) !== true && legends.length < 2) ? true : hideLegends,
1006
1127
  };
1007
1128
  };
1008
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1009
- var isInvalidValue = function (value) {
1010
- return typeof value === 'undefined' || value === null || (typeof value === 'number' && !isFinite(value));
1011
- };
1012
- exports.isInvalidValue = isInvalidValue;
1013
1129
  var getNumberAtIndexOrDefault = function (data, index) {
1014
1130
  if ((0, chart_utilities_1.isArrayOrTypedArray)(data)) {
1015
1131
  if (typeof data[index] !== 'number' || !isFinite(data[index])) {
@@ -1028,7 +1144,7 @@ var getValidXYRanges = function (series) {
1028
1144
  var start = 0;
1029
1145
  var end = 0;
1030
1146
  for (; end < series.x.length; end++) {
1031
- if ((0, exports.isInvalidValue)(series.x[end]) || (0, exports.isInvalidValue)(series.y[end])) {
1147
+ if ((0, chart_utilities_1.isInvalidValue)(series.x[end]) || (0, chart_utilities_1.isInvalidValue)(series.y[end])) {
1032
1148
  if (end - start > 0) {
1033
1149
  ranges.push([start, end]);
1034
1150
  }