@fluentui/react-charting 5.24.16 → 5.24.18
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.
- package/CHANGELOG.json +49 -1
- package/CHANGELOG.md +23 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +83 -4
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +71 -26
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +44 -15
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.d.ts +8 -8
- package/lib/components/FunnelChart/funnelGeometry.js +4 -4
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +12 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +81 -4
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +71 -26
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +44 -15
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/FunnelChart/funnelGeometry.d.ts +8 -8
- package/lib-amd/components/FunnelChart/funnelGeometry.js +9 -9
- package/lib-amd/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +12 -4
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +82 -3
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +71 -26
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +44 -15
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.d.ts +8 -8
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +9 -9
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +12 -4
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/package.json +1 -1
|
@@ -340,7 +340,7 @@ var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot, colorMap, col
|
|
|
340
340
|
});
|
|
341
341
|
});
|
|
342
342
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
343
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, 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, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_d = vsbcData[0]) === null || _d === void 0 ? void 0 : _d.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat);
|
|
343
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, 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, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_d = vsbcData[0]) === null || _d === void 0 ? void 0 : _d.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout));
|
|
344
344
|
};
|
|
345
345
|
exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
|
|
346
346
|
var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -386,7 +386,7 @@ var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot, colorMap, col
|
|
|
386
386
|
});
|
|
387
387
|
});
|
|
388
388
|
var gvbcData = Object.values(mapXToDataPoints);
|
|
389
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: gvbcData, 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', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, wrapXAxisLables: typeof ((_d = gvbcData[0]) === null || _d === void 0 ? void 0 : _d.name) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat);
|
|
389
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: gvbcData, 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', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, wrapXAxisLables: typeof ((_d = gvbcData[0]) === null || _d === void 0 ? void 0 : _d.name) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout));
|
|
390
390
|
};
|
|
391
391
|
exports.transformPlotlyJsonToGVBCProps = transformPlotlyJsonToGVBCProps;
|
|
392
392
|
var transformPlotlyJsonToVBCProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -598,9 +598,9 @@ var transformPlotlyJsonToHorizontalBarWithAxisProps = function (input, isMultiPl
|
|
|
598
598
|
var scalingFactor = 0.01;
|
|
599
599
|
var gapFactor = 1 / (1 + scalingFactor * numberOfRows);
|
|
600
600
|
var barHeight = availableHeight / (numberOfRows * (1 + gapFactor));
|
|
601
|
-
return tslib_1.__assign(tslib_1.__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
|
|
601
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
|
|
602
602
|
? (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.yaxis2) === null || _m === void 0 ? void 0 : _m.title
|
|
603
|
-
: ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout));
|
|
603
|
+
: ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true));
|
|
604
604
|
};
|
|
605
605
|
exports.transformPlotlyJsonToHorizontalBarWithAxisProps = transformPlotlyJsonToHorizontalBarWithAxisProps;
|
|
606
606
|
var transformPlotlyJsonToGanttChartProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -647,7 +647,7 @@ var transformPlotlyJsonToGanttChartProps = function (input, isMultiPlot, colorMa
|
|
|
647
647
|
.filter(function (point) { return point !== null; });
|
|
648
648
|
})
|
|
649
649
|
.flat();
|
|
650
|
-
return tslib_1.__assign(tslib_1.__assign({ data: chartData, showYAxisLables: true, height: (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 350, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true, useUTC: false }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout));
|
|
650
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: chartData, showYAxisLables: true, height: (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 350, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true, useUTC: false }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true));
|
|
651
651
|
};
|
|
652
652
|
exports.transformPlotlyJsonToGanttChartProps = transformPlotlyJsonToGanttChartProps;
|
|
653
653
|
var transformPlotlyJsonToHeatmapProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -914,7 +914,7 @@ var formatValue = function (value, colIndex, cells) {
|
|
|
914
914
|
return "".concat(prefix !== null && prefix !== void 0 ? prefix : '').concat(formatted).concat(suffix !== null && suffix !== void 0 ? suffix : '');
|
|
915
915
|
};
|
|
916
916
|
var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
917
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
917
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
918
918
|
var tableData = input.data[0];
|
|
919
919
|
var normalizeHeaders = function (values, header) {
|
|
920
920
|
var cleanedValues = Array.isArray(values[0])
|
|
@@ -926,11 +926,11 @@ var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMa
|
|
|
926
926
|
})
|
|
927
927
|
: values.map(function (cell) { return cleanText(cell); });
|
|
928
928
|
return cleanedValues.map(function (value, colIndex) {
|
|
929
|
-
var _a, _b, _c;
|
|
929
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
930
930
|
var fontColorRaw = (_a = header === null || header === void 0 ? void 0 : header.font) === null || _a === void 0 ? void 0 : _a.color;
|
|
931
931
|
var fontColor;
|
|
932
932
|
if (Array.isArray(fontColorRaw)) {
|
|
933
|
-
var colorEntry = fontColorRaw[colIndex];
|
|
933
|
+
var colorEntry = (_b = fontColorRaw[colIndex]) !== null && _b !== void 0 ? _b : fontColorRaw[0];
|
|
934
934
|
if (Array.isArray(colorEntry)) {
|
|
935
935
|
fontColor = typeof colorEntry[0] === 'string' ? colorEntry[0] : undefined;
|
|
936
936
|
}
|
|
@@ -941,28 +941,37 @@ var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMa
|
|
|
941
941
|
else if (typeof fontColorRaw === 'string') {
|
|
942
942
|
fontColor = fontColorRaw;
|
|
943
943
|
}
|
|
944
|
-
var fontSizeRaw = (
|
|
944
|
+
var fontSizeRaw = (_c = header === null || header === void 0 ? void 0 : header.font) === null || _c === void 0 ? void 0 : _c.size;
|
|
945
945
|
var fontSize;
|
|
946
946
|
if (Array.isArray(fontSizeRaw)) {
|
|
947
|
-
|
|
947
|
+
var fontSizeEntry = (_d = fontSizeRaw[colIndex]) !== null && _d !== void 0 ? _d : fontSizeRaw[0];
|
|
948
|
+
fontSize = Array.isArray(fontSizeRaw[0])
|
|
949
|
+
? (_e = fontSizeRaw[0][colIndex]) !== null && _e !== void 0 ? _e : fontSizeRaw[0][0]
|
|
950
|
+
: typeof fontSizeEntry === 'number'
|
|
951
|
+
? fontSizeEntry
|
|
952
|
+
: undefined;
|
|
948
953
|
}
|
|
949
954
|
else if (typeof fontSizeRaw === 'number') {
|
|
950
955
|
fontSize = fontSizeRaw;
|
|
951
956
|
}
|
|
952
957
|
var updatedColIndex = colIndex >= 1 ? 1 : 0;
|
|
953
|
-
var fillColorRaw = (
|
|
954
|
-
var backgroundColor = Array.isArray(fillColorRaw)
|
|
958
|
+
var fillColorRaw = (_f = header === null || header === void 0 ? void 0 : header.fill) === null || _f === void 0 ? void 0 : _f.color;
|
|
959
|
+
var backgroundColor = Array.isArray(fillColorRaw)
|
|
960
|
+
? (_g = fillColorRaw[updatedColIndex]) !== null && _g !== void 0 ? _g : fillColorRaw[0]
|
|
961
|
+
: fillColorRaw;
|
|
955
962
|
var textAlignRaw = header === null || header === void 0 ? void 0 : header.align;
|
|
956
|
-
var textAlign = Array.isArray(textAlignRaw) ? textAlignRaw[colIndex] : textAlignRaw;
|
|
963
|
+
var textAlign = Array.isArray(textAlignRaw) ? (_h = textAlignRaw[colIndex]) !== null && _h !== void 0 ? _h : textAlignRaw[0] : textAlignRaw;
|
|
957
964
|
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 } : {}));
|
|
958
965
|
return { value: value, style: style };
|
|
959
966
|
});
|
|
960
967
|
};
|
|
961
968
|
var columns = (_b = (_a = tableData.cells) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
|
|
962
|
-
var cells = tableData.cells
|
|
969
|
+
var cells = tableData.cells && Object.keys(tableData.cells).length > 0
|
|
970
|
+
? tableData.cells
|
|
971
|
+
: (_g = (_f = (_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) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.cells;
|
|
963
972
|
var rows = columns[0].map(function (_, rowIndex) {
|
|
964
973
|
return columns.map(function (col, colIndex) {
|
|
965
|
-
var _a, _b, _c;
|
|
974
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
966
975
|
var cellValue = col[rowIndex];
|
|
967
976
|
var cleanValue = typeof cellValue === 'string' ? cleanText(cellValue) : cellValue;
|
|
968
977
|
var formattedValue = typeof cleanValue === 'string' || typeof cleanValue === 'number'
|
|
@@ -971,17 +980,17 @@ var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMa
|
|
|
971
980
|
var rawFontColor = (_a = cells === null || cells === void 0 ? void 0 : cells.font) === null || _a === void 0 ? void 0 : _a.color;
|
|
972
981
|
var fontColor;
|
|
973
982
|
if (Array.isArray(rawFontColor)) {
|
|
974
|
-
var entry = rawFontColor[colIndex];
|
|
983
|
+
var entry = (_b = rawFontColor[colIndex]) !== null && _b !== void 0 ? _b : rawFontColor[0];
|
|
975
984
|
var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
|
|
976
985
|
fontColor = typeof colorValue === 'string' ? colorValue : undefined;
|
|
977
986
|
}
|
|
978
987
|
else if (typeof rawFontColor === 'string') {
|
|
979
988
|
fontColor = rawFontColor;
|
|
980
989
|
}
|
|
981
|
-
var rawFontSize = (
|
|
990
|
+
var rawFontSize = (_c = cells === null || cells === void 0 ? void 0 : cells.font) === null || _c === void 0 ? void 0 : _c.size;
|
|
982
991
|
var fontSize;
|
|
983
992
|
if (Array.isArray(rawFontSize)) {
|
|
984
|
-
var entry = rawFontSize[colIndex];
|
|
993
|
+
var entry = (_d = rawFontSize[colIndex]) !== null && _d !== void 0 ? _d : rawFontSize[0];
|
|
985
994
|
var fontSizeValue = Array.isArray(entry) ? entry[rowIndex] : entry;
|
|
986
995
|
fontSize = typeof fontSizeValue === 'number' ? fontSizeValue : undefined;
|
|
987
996
|
}
|
|
@@ -989,17 +998,17 @@ var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMa
|
|
|
989
998
|
fontSize = rawFontSize;
|
|
990
999
|
}
|
|
991
1000
|
var updatedColIndex = colIndex >= 1 ? 1 : 0;
|
|
992
|
-
var rawBackgroundColor = (
|
|
1001
|
+
var rawBackgroundColor = (_e = cells === null || cells === void 0 ? void 0 : cells.fill) === null || _e === void 0 ? void 0 : _e.color;
|
|
993
1002
|
var backgroundColor;
|
|
994
1003
|
if (Array.isArray(rawBackgroundColor)) {
|
|
995
|
-
var entry = rawBackgroundColor[updatedColIndex];
|
|
1004
|
+
var entry = (_f = rawBackgroundColor[updatedColIndex]) !== null && _f !== void 0 ? _f : rawBackgroundColor[0];
|
|
996
1005
|
var colorValue = Array.isArray(entry) ? entry[rowIndex] : entry;
|
|
997
1006
|
backgroundColor = typeof colorValue === 'string' ? colorValue : undefined;
|
|
998
1007
|
}
|
|
999
1008
|
else if (typeof rawBackgroundColor === 'string') {
|
|
1000
1009
|
backgroundColor = rawBackgroundColor;
|
|
1001
1010
|
}
|
|
1002
|
-
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;
|
|
1011
|
+
var rawTextAlign = Array.isArray(cells === null || cells === void 0 ? void 0 : cells.align) ? (_g = cells.align[colIndex]) !== null && _g !== void 0 ? _g : cells.align[0] : cells === null || cells === void 0 ? void 0 : cells.align;
|
|
1003
1012
|
var textAlign = rawTextAlign;
|
|
1004
1013
|
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 } : {}));
|
|
1005
1014
|
return {
|
|
@@ -1009,13 +1018,15 @@ var transformPlotlyJsonToChartTableProps = function (input, isMultiPlot, colorMa
|
|
|
1009
1018
|
});
|
|
1010
1019
|
});
|
|
1011
1020
|
var styles = {
|
|
1012
|
-
root: tslib_1.__assign({}, (((
|
|
1021
|
+
root: tslib_1.__assign({}, (((_j = (_h = input.layout) === null || _h === void 0 ? void 0 : _h.font) === null || _j === void 0 ? void 0 : _j.size) ? { fontSize: input.layout.font.size } : {})),
|
|
1013
1022
|
};
|
|
1014
1023
|
return {
|
|
1015
|
-
headers: normalizeHeaders((
|
|
1024
|
+
headers: normalizeHeaders((_l = (_k = tableData.header) === null || _k === void 0 ? void 0 : _k.values) !== null && _l !== void 0 ? _l : [], tableData.header && Object.keys(tableData.header).length > 0
|
|
1025
|
+
? tableData.header
|
|
1026
|
+
: (_p = (_o = (_m = input.layout) === null || _m === void 0 ? void 0 : _m.template) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.table[0].header),
|
|
1016
1027
|
rows: rows,
|
|
1017
|
-
width: (
|
|
1018
|
-
height: (
|
|
1028
|
+
width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width,
|
|
1029
|
+
height: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.height,
|
|
1019
1030
|
styles: styles,
|
|
1020
1031
|
};
|
|
1021
1032
|
};
|
|
@@ -1136,7 +1147,7 @@ var transformPlotlyJsonToFunnelChartProps = function (input, isMultiPlot, colorM
|
|
|
1136
1147
|
data: funnelData,
|
|
1137
1148
|
width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
|
|
1138
1149
|
height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
|
|
1139
|
-
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? '
|
|
1150
|
+
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
1140
1151
|
hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
|
|
1141
1152
|
};
|
|
1142
1153
|
};
|
|
@@ -1773,4 +1784,38 @@ var parseLocalDate = function (value) {
|
|
|
1773
1784
|
}
|
|
1774
1785
|
return new Date(value);
|
|
1775
1786
|
};
|
|
1787
|
+
var getBarProps = function (data, layout, isHorizontal) {
|
|
1788
|
+
var padding;
|
|
1789
|
+
if (typeof (layout === null || layout === void 0 ? void 0 : layout.bargap) === 'number') {
|
|
1790
|
+
padding = layout.bargap;
|
|
1791
|
+
}
|
|
1792
|
+
var plotlyBarWidths = data
|
|
1793
|
+
.map(function (series) {
|
|
1794
|
+
if (series.type === 'bar' && ((0, chart_utilities_1.isArrayOrTypedArray)(series.width) || typeof series.width === 'number')) {
|
|
1795
|
+
return series.width;
|
|
1796
|
+
}
|
|
1797
|
+
return [];
|
|
1798
|
+
})
|
|
1799
|
+
.flat();
|
|
1800
|
+
var maxPlotlyBarWidth = (0, d3_array_1.max)(plotlyBarWidths);
|
|
1801
|
+
if (typeof maxPlotlyBarWidth === 'number') {
|
|
1802
|
+
padding = 1 - maxPlotlyBarWidth;
|
|
1803
|
+
padding = Math.max(0, Math.min(padding, 1));
|
|
1804
|
+
}
|
|
1805
|
+
if (typeof padding === 'undefined') {
|
|
1806
|
+
return {};
|
|
1807
|
+
}
|
|
1808
|
+
if (isHorizontal) {
|
|
1809
|
+
return {
|
|
1810
|
+
maxBarHeight: 1000,
|
|
1811
|
+
yAxisPadding: padding,
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
return {
|
|
1815
|
+
barWidth: 'auto',
|
|
1816
|
+
maxBarWidth: 1000,
|
|
1817
|
+
xAxisInnerPadding: padding,
|
|
1818
|
+
xAxisOuterPadding: padding / 2,
|
|
1819
|
+
};
|
|
1820
|
+
};
|
|
1776
1821
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|