@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,7 +1,7 @@
1
- define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/colors", "../GaugeChart/index", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-time-format", "d3-shape", "./PlotlyColorAdapter"], function (require, exports, tslib_1, d3_array_1, d3_scale_1, colors_1, index_1, utilities_1, chart_utilities_1, d3_time_format_1, d3_shape_1, PlotlyColorAdapter_1) {
1
+ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../../utilities/colors", "../GaugeChart/index", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-time-format", "d3-shape", "./PlotlyColorAdapter"], function (require, exports, tslib_1, d3_array_1, d3_scale_1, d3_format_1, colors_1, index_1, utilities_1, chart_utilities_1, d3_time_format_1, d3_shape_1, PlotlyColorAdapter_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- 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;
4
+ 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;
5
5
  var dashOptions = {
6
6
  dot: {
7
7
  strokeDasharray: '1, 5',
@@ -156,7 +156,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
156
156
  var mapLegendToDataPoint = {};
157
157
  (_j = firstData.labels) === null || _j === void 0 ? void 0 : _j.forEach(function (label, index) {
158
158
  var value = (0, exports.getNumberAtIndexOrDefault)(firstData.values, index);
159
- if ((0, exports.isInvalidValue)(value) || value < 0) {
159
+ if ((0, chart_utilities_1.isInvalidValue)(value) || value < 0) {
160
160
  return;
161
161
  }
162
162
  var legend = "".concat(label);
@@ -264,18 +264,41 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
264
264
  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 });
265
265
  };
266
266
  exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
267
+ var createColorScale = function (colorscale, domain) {
268
+ var dMin = domain[0], dMax = domain[1];
269
+ // Normalize colorscale domain to actual data domain
270
+ var scaleDomain = colorscale.map(function (_a) {
271
+ var pos = _a[0];
272
+ return dMin + pos * (dMax - dMin);
273
+ });
274
+ var scaleColors = colorscale.map(function (item) { return item[1]; });
275
+ return (0, d3_scale_1.scaleLinear)().domain(scaleDomain).range(scaleColors);
276
+ };
267
277
  var transformPlotlyJsonToGVBCProps = function (input, colorMap, colorwayType, isDarkTheme) {
268
278
  var _a, _b, _c;
269
279
  var mapXToDataPoints = {};
270
280
  var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout, 0, 0);
271
281
  var _d = getLegendProps(input.data, input.layout), legends = _d.legends, hideLegend = _d.hideLegend;
282
+ var colorScale = undefined;
272
283
  input.data.forEach(function (series, index1) {
273
- var _a, _b, _c, _d, _e;
284
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
285
+ 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) &&
286
+ (0, chart_utilities_1.isArrayOrTypedArray)((_d = series.marker) === null || _d === void 0 ? void 0 : _d.color) &&
287
+ ((_e = series.marker) === null || _e === void 0 ? void 0 : _e.color).length > 0 &&
288
+ typeof ((_g = (_f = series.marker) === null || _f === void 0 ? void 0 : _f.color) === null || _g === void 0 ? void 0 : _g[0]) === 'number') {
289
+ var scale = input.layout.coloraxis.colorscale;
290
+ var colorValues = (_h = series.marker) === null || _h === void 0 ? void 0 : _h.color;
291
+ var _t = [
292
+ (_k = (_j = input.layout.coloraxis) === null || _j === void 0 ? void 0 : _j.cmin) !== null && _k !== void 0 ? _k : Math.min.apply(Math, colorValues),
293
+ (_m = (_l = input.layout.coloraxis) === null || _l === void 0 ? void 0 : _l.cmax) !== null && _m !== void 0 ? _m : Math.max.apply(Math, colorValues),
294
+ ], dMin = _t[0], dMax = _t[1];
295
+ colorScale = createColorScale(scale, [dMin, dMax]);
296
+ }
274
297
  // extract colors for each series only once
275
- 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);
276
- (_e = series.x) === null || _e === void 0 ? void 0 : _e.forEach(function (x, xIndex) {
277
- var _a;
278
- if ((0, exports.isInvalidValue)(x) || (0, exports.isInvalidValue)((_a = series.y) === null || _a === void 0 ? void 0 : _a[xIndex])) {
298
+ 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);
299
+ (_s = series.x) === null || _s === void 0 ? void 0 : _s.forEach(function (x, xIndex) {
300
+ var _a, _b, _c, _d;
301
+ if ((0, chart_utilities_1.isInvalidValue)(x) || (0, chart_utilities_1.isInvalidValue)((_a = series.y) === null || _a === void 0 ? void 0 : _a[xIndex])) {
279
302
  return;
280
303
  }
281
304
  if (!mapXToDataPoints[x]) {
@@ -283,8 +306,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
283
306
  }
284
307
  if (series.type === 'bar') {
285
308
  var legend = legends[index1];
286
- // resolve color for each legend's bars from the extracted colors
287
- var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index1, legend, colorMap, isDarkTheme);
309
+ // resolve color for each legend's bars from the colorscale or extracted colors
310
+ var color = colorScale
311
+ ? 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)
312
+ : (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index1, legend, colorMap, isDarkTheme);
288
313
  mapXToDataPoints[x].series.push({
289
314
  key: legend,
290
315
  data: series.y[xIndex],
@@ -315,7 +340,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
315
340
  var yValues = [];
316
341
  series.x.forEach(function (xVal, index) {
317
342
  var yVal = (0, exports.getNumberAtIndexOrDefault)(series.y, index);
318
- if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)(yVal)) {
343
+ if ((0, chart_utilities_1.isInvalidValue)(xVal) || (0, chart_utilities_1.isInvalidValue)(yVal)) {
319
344
  return;
320
345
  }
321
346
  xValues.push(xVal);
@@ -446,7 +471,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
446
471
  return series.y
447
472
  .map(function (yValue, i) {
448
473
  var _a;
449
- if ((0, exports.isInvalidValue)((_a = series.x) === null || _a === void 0 ? void 0 : _a[i]) || (0, exports.isInvalidValue)(yValue)) {
474
+ if ((0, chart_utilities_1.isInvalidValue)((_a = series.x) === null || _a === void 0 ? void 0 : _a[i]) || (0, chart_utilities_1.isInvalidValue)(yValue)) {
450
475
  return null;
451
476
  }
452
477
  return {
@@ -504,7 +529,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
504
529
  (_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, index) {
505
530
  var _a;
506
531
  var zVal = (0, exports.getNumberAtIndexOrDefault)(firstData.z, index);
507
- if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)((_a = firstData.y) === null || _a === void 0 ? void 0 : _a[index]) || (0, exports.isInvalidValue)(zVal)) {
532
+ 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)) {
508
533
  return;
509
534
  }
510
535
  xValues_1.push(xVal);
@@ -628,7 +653,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
628
653
  var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
629
654
  .map(function (val, index) {
630
655
  var _a, _b;
631
- 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])) {
656
+ 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])) {
632
657
  return null;
633
658
  }
634
659
  return {
@@ -747,37 +772,132 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
747
772
  .replace(/\$[^$]*\$/g, '$')
748
773
  .trim();
749
774
  };
775
+ var formatValue = function (value, colIndex, cells) {
776
+ if (value === null || typeof value === 'boolean') {
777
+ return value;
778
+ }
779
+ var formatStr = Array.isArray(cells.format) ? cells.format[colIndex] : cells.format;
780
+ var prefix = Array.isArray(cells.prefix) ? cells.prefix[colIndex] : cells.prefix;
781
+ var suffix = Array.isArray(cells.suffix) ? cells.suffix[colIndex] : cells.suffix;
782
+ var formatted = value;
783
+ if (typeof value === 'number') {
784
+ if (typeof formatStr === 'string') {
785
+ try {
786
+ formatted = (0, d3_format_1.format)(formatStr)(value);
787
+ }
788
+ catch (_a) {
789
+ formatted = (0, utilities_1.formatValueLimitWidth)(value);
790
+ }
791
+ }
792
+ else {
793
+ formatted = (0, utilities_1.formatValueLimitWidth)(value);
794
+ }
795
+ }
796
+ return "".concat(prefix !== null && prefix !== void 0 ? prefix : '').concat(formatted).concat(suffix !== null && suffix !== void 0 ? suffix : '');
797
+ };
750
798
  var transformPlotlyJsonToChartTableProps = function (input, colorMap, isDarkTheme) {
751
- var _a, _b, _c, _d, _e, _f, _g, _h;
799
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
752
800
  var tableData = input.data[0];
753
- var normalizeHeaders = function (values) {
754
- // Case: values is array of arrays
755
- if (Array.isArray(values[0])) {
756
- return values.map(function (row) {
801
+ var normalizeHeaders = function (values, header) {
802
+ var cleanedValues = Array.isArray(values[0])
803
+ ? values.map(function (row) {
757
804
  return row
758
805
  .map(function (cell) { return cleanText(cell); })
759
806
  .filter(Boolean)
760
807
  .join(' ');
761
- });
762
- }
763
- // Case: values is 1d array
764
- return values.map(function (cell) { return cleanText(cell); });
808
+ })
809
+ : values.map(function (cell) { return cleanText(cell); });
810
+ return cleanedValues.map(function (value, colIndex) {
811
+ var _a, _b, _c;
812
+ var fontColorRaw = (_a = header === null || header === void 0 ? void 0 : header.font) === null || _a === void 0 ? void 0 : _a.color;
813
+ var fontColor;
814
+ if (Array.isArray(fontColorRaw)) {
815
+ var colorEntry = fontColorRaw[colIndex];
816
+ if (Array.isArray(colorEntry)) {
817
+ fontColor = typeof colorEntry[0] === 'string' ? colorEntry[0] : undefined;
818
+ }
819
+ else if (typeof colorEntry === 'string') {
820
+ fontColor = colorEntry;
821
+ }
822
+ }
823
+ else if (typeof fontColorRaw === 'string') {
824
+ fontColor = fontColorRaw;
825
+ }
826
+ var fontSizeRaw = (_b = header === null || header === void 0 ? void 0 : header.font) === null || _b === void 0 ? void 0 : _b.size;
827
+ var fontSize;
828
+ if (Array.isArray(fontSizeRaw)) {
829
+ fontSize = Array.isArray(fontSizeRaw[0]) ? fontSizeRaw[0][colIndex] : fontSizeRaw[colIndex];
830
+ }
831
+ else if (typeof fontSizeRaw === 'number') {
832
+ fontSize = fontSizeRaw;
833
+ }
834
+ var updatedColIndex = colIndex >= 1 ? 1 : 0;
835
+ var fillColorRaw = (_c = header === null || header === void 0 ? void 0 : header.fill) === null || _c === void 0 ? void 0 : _c.color;
836
+ var backgroundColor = Array.isArray(fillColorRaw) ? fillColorRaw[updatedColIndex] : fillColorRaw;
837
+ var textAlignRaw = header === null || header === void 0 ? void 0 : header.align;
838
+ var textAlign = Array.isArray(textAlignRaw) ? textAlignRaw[colIndex] : textAlignRaw;
839
+ 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 } : {}));
840
+ return { value: value, style: style };
841
+ });
765
842
  };
766
843
  var columns = (_b = (_a = tableData.cells) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
844
+ 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;
767
845
  var rows = columns[0].map(function (_, rowIndex) {
768
- return columns.map(function (col) {
769
- var cell = col[rowIndex];
770
- return typeof cell === 'string' ? cleanText(cell) : cell;
846
+ return columns.map(function (col, colIndex) {
847
+ var _a, _b, _c;
848
+ var cellValue = col[rowIndex];
849
+ var cleanValue = typeof cellValue === 'string' ? cleanText(cellValue) : cellValue;
850
+ var formattedValue = typeof cleanValue === 'string' || typeof cleanValue === 'number'
851
+ ? formatValue(cleanValue, colIndex, cells)
852
+ : cleanValue;
853
+ var rawFontColor = (_a = cells === null || cells === void 0 ? void 0 : cells.font) === null || _a === void 0 ? void 0 : _a.color;
854
+ var fontColor;
855
+ if (Array.isArray(rawFontColor)) {
856
+ var entry = rawFontColor[colIndex];
857
+ var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
858
+ fontColor = typeof colorValue === 'string' ? colorValue : undefined;
859
+ }
860
+ else if (typeof rawFontColor === 'string') {
861
+ fontColor = rawFontColor;
862
+ }
863
+ var rawFontSize = (_b = cells === null || cells === void 0 ? void 0 : cells.font) === null || _b === void 0 ? void 0 : _b.size;
864
+ var fontSize;
865
+ if (Array.isArray(rawFontSize)) {
866
+ var entry = rawFontSize[colIndex];
867
+ var fontSizeValue = Array.isArray(entry) ? entry[rowIndex] : entry;
868
+ fontSize = typeof fontSizeValue === 'number' ? fontSizeValue : undefined;
869
+ }
870
+ else if (typeof rawFontSize === 'number') {
871
+ fontSize = rawFontSize;
872
+ }
873
+ var updatedColIndex = colIndex >= 1 ? 1 : 0;
874
+ var rawBackgroundColor = (_c = cells === null || cells === void 0 ? void 0 : cells.fill) === null || _c === void 0 ? void 0 : _c.color;
875
+ var backgroundColor;
876
+ if (Array.isArray(rawBackgroundColor)) {
877
+ var entry = rawBackgroundColor[updatedColIndex];
878
+ var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
879
+ backgroundColor = typeof colorValue === 'string' ? colorValue : undefined;
880
+ }
881
+ else if (typeof rawBackgroundColor === 'string') {
882
+ backgroundColor = rawBackgroundColor;
883
+ }
884
+ 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;
885
+ var textAlign = rawTextAlign;
886
+ 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 } : {}));
887
+ return {
888
+ value: formattedValue,
889
+ style: style,
890
+ };
771
891
  });
772
892
  });
773
893
  var styles = {
774
- 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 } : {})),
894
+ 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 } : {})),
775
895
  };
776
896
  return {
777
- headers: normalizeHeaders((_f = (_e = tableData.header) === null || _e === void 0 ? void 0 : _e.values) !== null && _f !== void 0 ? _f : []),
897
+ 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),
778
898
  rows: rows,
779
- width: (_g = input.layout) === null || _g === void 0 ? void 0 : _g.width,
780
- height: (_h = input.layout) === null || _h === void 0 ? void 0 : _h.height,
899
+ width: (_p = input.layout) === null || _p === void 0 ? void 0 : _p.width,
900
+ height: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.height,
781
901
  styles: styles,
782
902
  };
783
903
  };
@@ -790,7 +910,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
790
910
  series.x = [];
791
911
  series.y = [];
792
912
  for (var ptindex = 0; ptindex < ((_b = (_a = series.r) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); ptindex++) {
793
- 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])) {
913
+ 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])) {
794
914
  continue;
795
915
  }
796
916
  var thetaRad = (series.theta[ptindex] * Math.PI) / 180;
@@ -996,11 +1116,6 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
996
1116
  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,
997
1117
  };
998
1118
  };
999
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1000
- var isInvalidValue = function (value) {
1001
- return typeof value === 'undefined' || value === null || (typeof value === 'number' && !isFinite(value));
1002
- };
1003
- exports.isInvalidValue = isInvalidValue;
1004
1119
  var getNumberAtIndexOrDefault = function (data, index) {
1005
1120
  if ((0, chart_utilities_1.isArrayOrTypedArray)(data)) {
1006
1121
  if (typeof data[index] !== 'number' || !isFinite(data[index])) {
@@ -1019,7 +1134,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
1019
1134
  var start = 0;
1020
1135
  var end = 0;
1021
1136
  for (; end < series.x.length; end++) {
1022
- if ((0, exports.isInvalidValue)(series.x[end]) || (0, exports.isInvalidValue)(series.y[end])) {
1137
+ if ((0, chart_utilities_1.isInvalidValue)(series.x[end]) || (0, chart_utilities_1.isInvalidValue)(series.y[end])) {
1023
1138
  if (end - start > 0) {
1024
1139
  ranges.push([start, end]);
1025
1140
  }