@rowsncolumns/charts 28.1.11 → 28.1.12
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/dist/cjs/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/basic-chart/basic-chart.js +212 -159
- package/dist/cjs/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/plotly/basic-chart/basic-chart.js +122 -95
- package/dist/cjs/utils/hierarchy.d.ts +6 -0
- package/dist/cjs/utils/hierarchy.d.ts.map +1 -1
- package/dist/cjs/utils/hierarchy.js +23 -1
- package/dist/cjs/utils/histogram.d.ts +42 -3
- package/dist/cjs/utils/histogram.d.ts.map +1 -1
- package/dist/cjs/utils/histogram.js +193 -5
- package/dist/cjs/utils/overrides.d.ts +1 -1
- package/dist/cjs/utils/overrides.d.ts.map +1 -1
- package/dist/cjs/utils/overrides.js +44 -39
- package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/basic-chart/basic-chart.js +106 -27
- package/dist/esm/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/plotly/basic-chart/basic-chart.js +45 -6
- package/dist/esm/utils/hierarchy.d.ts +6 -0
- package/dist/esm/utils/hierarchy.d.ts.map +1 -1
- package/dist/esm/utils/hierarchy.js +21 -0
- package/dist/esm/utils/histogram.d.ts +42 -3
- package/dist/esm/utils/histogram.d.ts.map +1 -1
- package/dist/esm/utils/histogram.js +171 -4
- package/dist/esm/utils/overrides.d.ts +1 -1
- package/dist/esm/utils/overrides.d.ts.map +1 -1
- package/dist/esm/utils/overrides.js +4 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-chart.d.ts","sourceRoot":"","sources":["../../../../plotly/basic-chart/basic-chart.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"basic-chart.d.ts","sourceRoot":"","sources":["../../../../plotly/basic-chart/basic-chart.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA+ZxD,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAmGnD,eAAO,MAAM,UAAU,GAAI,gPAkBxB,eAAe,sBA4nFjB,CAAC"}
|
|
@@ -509,9 +509,9 @@ var BasicChart = function (_a) {
|
|
|
509
509
|
var updateChart = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
510
510
|
var traces, chartType, position, isBubble, isHierarchy, textColor, bgColor, gridColor, skipHeaders_1, labels, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, resolvedLabel, _a, xValues, sizeValues_1, sharedXValues, sharedSizeValues, _b, categories_1, preparedSeries, sizeValues, sizeScale_1, hasStringX_1, hasBubbleSecondaryAxis, palette_1, isScatter_1, scatterStyle_1, plotlyModeForScatterStyle_1, lineShapeFor_1, traces_1, titleFmt, xAxisFmt, yAxisFmt, legendFmt, bubbleLayout, hierarchyRows, headerTitle, hierarchyData_1, seriesName, hierarchyPalette, nodeColors, isSunburst, SUNBURST_ROOT_ID_1, rootTotal, hierarchyTrace, layoutForHierarchy, labels, seriesEntry, rawValues_1, locations_1, z_1, ramp_1, colorscale, geoScope, regionTrace, surfaceToken, categories, surfaceSeriesInputs, _c, _d, seriesEntry, dataLabel, _e, _f, values, e_2_1, seriesNames, surfaceTrace, surfaceLayout, categories, radarStyle, radarTraces, radarInputs, _g, _h, seriesEntry, label, values, radarAxisOptions, indicators, _loop_1, i, radarScale, variant, categories, seriesValues, volumePoints_1, hasVolume, buildVolumeTrace, volumeLayout, priceYAxisDomain, roles, xs_1, candleTrace, lineSeries, stockPalette_1, xs_2, stockTraces, isStacked, isHorizontalBarChart, lineTraceVariant, shouldAggregate, primaryDomainSource, rawPrimaryDomainValues, domainData, categoryLevels, multicategoryX, aggregateDomainValues, domainAxisData, secondaryDomainData, categoriesFor, assignCartesianData, themeColorPalette, applyTraceColor, hasSecondaryAxis, hasSecondaryCategoryAxis, valueAxisKey, categoryAxisKey, secondaryValueAxisRef, secondaryCategoryAxisRef, isPareto, isOfPie, ofPieHandled, ofPieExtras, decorateCartesianTrace, domainSources, seriesIndex, _loop_2, _j, _k, series, e_3_1, authoredTitleFmt, isPercentStackedBars, primaryAxisNumberFormat, secondaryAxisNumberFormat, _l, legendOverrides, showlegend, axisFontSize, primaryValues, leftAxisLabelDepth, leftAxisDepth, rightAxisDepth, bottomAxisTitleStandoff, legendBand, newLayout, dlOpts, doughnutSeriesOrder, doughnutRingSet, traceDataLabels, doughnutHole, seriesNumberFormats, traceNumberFormat, piePull, formattedTraces, sortedTraces;
|
|
511
511
|
var e_2, _m, e_4, _o, e_3, _p, _q, _r;
|
|
512
|
-
var _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81;
|
|
513
|
-
return tslib_1.__generator(this, function (
|
|
514
|
-
switch (
|
|
512
|
+
var _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85;
|
|
513
|
+
return tslib_1.__generator(this, function (_86) {
|
|
514
|
+
switch (_86.label) {
|
|
515
515
|
case 0:
|
|
516
516
|
(0, utils_1.debug)("Updating chart", chart);
|
|
517
517
|
traces = [];
|
|
@@ -536,7 +536,7 @@ var BasicChart = function (_a) {
|
|
|
536
536
|
});
|
|
537
537
|
seriesInputs = [];
|
|
538
538
|
i = 0;
|
|
539
|
-
|
|
539
|
+
_86.label = 1;
|
|
540
540
|
case 1:
|
|
541
541
|
if (!(i < spec.series.length)) return [3 /*break*/, 5];
|
|
542
542
|
seriesEntry = spec.series[i];
|
|
@@ -545,13 +545,13 @@ var BasicChart = function (_a) {
|
|
|
545
545
|
_a = chart_spec_utils_1.coerceCalculatedLabel;
|
|
546
546
|
return [4 /*yield*/, onRequestCalculate(resolvedLabel, (_w = chart.position.sheetId) !== null && _w !== void 0 ? _w : sheetId, chart.position.overlayPosition.anchorCell.rowIndex, chart.position.overlayPosition.anchorCell.columnIndex)];
|
|
547
547
|
case 2:
|
|
548
|
-
resolvedLabel = _a.apply(void 0, [
|
|
549
|
-
|
|
548
|
+
resolvedLabel = _a.apply(void 0, [_86.sent()]);
|
|
549
|
+
_86.label = 3;
|
|
550
550
|
case 3:
|
|
551
551
|
xValues = (_x = perSeriesX[i]) !== null && _x !== void 0 ? _x : perSeriesX[0];
|
|
552
552
|
sizeValues_1 = (_y = perSeriesSize[i]) !== null && _y !== void 0 ? _y : perSeriesSize[0];
|
|
553
553
|
seriesInputs.push(tslib_1.__assign(tslib_1.__assign({ name: resolvedLabel, values: flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders_1) }, (xValues ? { xValues: xValues } : {})), (sizeValues_1 ? { sizeValues: sizeValues_1 } : {})));
|
|
554
|
-
|
|
554
|
+
_86.label = 4;
|
|
555
555
|
case 4:
|
|
556
556
|
i++;
|
|
557
557
|
return [3 /*break*/, 1];
|
|
@@ -824,7 +824,9 @@ var BasicChart = function (_a) {
|
|
|
824
824
|
SUNBURST_ROOT_ID_1 = "__rnc_sunburst_root__";
|
|
825
825
|
rootTotal = hierarchyData_1.values.reduce(function (sum, value, i) { return (hierarchyData_1.parents[i] === "" ? sum + value : sum); }, 0);
|
|
826
826
|
hierarchyTrace = tslib_1.__assign({ type: chartType, labels: isSunburst ? tslib_1.__spreadArray([""], tslib_1.__read(hierarchyData_1.labels), false) : hierarchyData_1.labels, ids: isSunburst ? tslib_1.__spreadArray([SUNBURST_ROOT_ID_1], tslib_1.__read(hierarchyData_1.ids), false) : hierarchyData_1.ids, parents: isSunburst
|
|
827
|
-
? tslib_1.__spreadArray([""], tslib_1.__read(hierarchyData_1.parents.map(function (parent) { return parent || SUNBURST_ROOT_ID_1; })), false) : hierarchyData_1.parents, values: isSunburst ? tslib_1.__spreadArray([rootTotal], tslib_1.__read(hierarchyData_1.values), false) : hierarchyData_1.values, marker: tslib_1.__assign({ colors: isSunburst ? tslib_1.__spreadArray(["rgba(0,0,0,0)"], tslib_1.__read(nodeColors), false) : nodeColors }, (isSunburst ? { line: { width: 1 } } : {})), name: seriesName,
|
|
827
|
+
? tslib_1.__spreadArray([""], tslib_1.__read(hierarchyData_1.parents.map(function (parent) { return parent || SUNBURST_ROOT_ID_1; })), false) : hierarchyData_1.parents, values: isSunburst ? tslib_1.__spreadArray([rootTotal], tslib_1.__read(hierarchyData_1.values), false) : hierarchyData_1.values, marker: tslib_1.__assign({ colors: isSunburst ? tslib_1.__spreadArray(["rgba(0,0,0,0)"], tslib_1.__read(nodeColors), false) : nodeColors }, (isSunburst ? { line: { width: 1 } } : {})), name: seriesName,
|
|
828
|
+
// `dataLabels: { show: false }` turns the labels off (#1086).
|
|
829
|
+
textinfo: ((_19 = spec.dataLabels) === null || _19 === void 0 ? void 0 : _19.show) === false ? "none" : "label+value", branchvalues: "total" }, (isSunburst || ((_20 = spec.dataLabels) === null || _20 === void 0 ? void 0 : _20.show) === false
|
|
828
830
|
? {}
|
|
829
831
|
: {
|
|
830
832
|
textposition: "bottom left",
|
|
@@ -882,7 +884,7 @@ var BasicChart = function (_a) {
|
|
|
882
884
|
// country-name matching and silently skips labels it can't place.
|
|
883
885
|
if ((0, region_map_1.isRegionMapSpec)(spec)) {
|
|
884
886
|
labels = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : "").trim(); });
|
|
885
|
-
seriesEntry = (
|
|
887
|
+
seriesEntry = (_21 = spec.series) === null || _21 === void 0 ? void 0 : _21[0];
|
|
886
888
|
rawValues_1 = seriesEntry
|
|
887
889
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
|
|
888
890
|
: [];
|
|
@@ -947,34 +949,34 @@ var BasicChart = function (_a) {
|
|
|
947
949
|
if (!(surfaceToken === "SURFACE" || surfaceToken === "SURFACE_3D")) return [3 /*break*/, 17];
|
|
948
950
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
949
951
|
surfaceSeriesInputs = [];
|
|
950
|
-
|
|
952
|
+
_86.label = 7;
|
|
951
953
|
case 7:
|
|
952
|
-
|
|
953
|
-
_c = tslib_1.__values((
|
|
954
|
-
|
|
954
|
+
_86.trys.push([7, 14, 15, 16]);
|
|
955
|
+
_c = tslib_1.__values((_22 = spec.series) !== null && _22 !== void 0 ? _22 : []), _d = _c.next();
|
|
956
|
+
_86.label = 8;
|
|
955
957
|
case 8:
|
|
956
958
|
if (!!_d.done) return [3 /*break*/, 13];
|
|
957
959
|
seriesEntry = _d.value;
|
|
958
960
|
if (!(!(0, utils_1.isNil)(seriesEntry.dataLabel) && (0, utils_1.isAFormula)(seriesEntry.dataLabel))) return [3 /*break*/, 10];
|
|
959
961
|
_f = chart_spec_utils_1.coerceCalculatedLabel;
|
|
960
|
-
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (
|
|
962
|
+
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_23 = position.sheetId) !== null && _23 !== void 0 ? _23 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
961
963
|
case 9:
|
|
962
|
-
_e = _f.apply(void 0, [
|
|
964
|
+
_e = _f.apply(void 0, [_86.sent()]);
|
|
963
965
|
return [3 /*break*/, 11];
|
|
964
966
|
case 10:
|
|
965
|
-
_e = (
|
|
966
|
-
|
|
967
|
+
_e = (_24 = seriesEntry.dataLabel) !== null && _24 !== void 0 ? _24 : "";
|
|
968
|
+
_86.label = 11;
|
|
967
969
|
case 11:
|
|
968
970
|
dataLabel = _e;
|
|
969
971
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
970
972
|
surfaceSeriesInputs.push({ name: dataLabel, values: values });
|
|
971
|
-
|
|
973
|
+
_86.label = 12;
|
|
972
974
|
case 12:
|
|
973
975
|
_d = _c.next();
|
|
974
976
|
return [3 /*break*/, 8];
|
|
975
977
|
case 13: return [3 /*break*/, 16];
|
|
976
978
|
case 14:
|
|
977
|
-
e_2_1 =
|
|
979
|
+
e_2_1 = _86.sent();
|
|
978
980
|
e_2 = { error: e_2_1 };
|
|
979
981
|
return [3 /*break*/, 16];
|
|
980
982
|
case 15:
|
|
@@ -1002,21 +1004,21 @@ var BasicChart = function (_a) {
|
|
|
1002
1004
|
}, paper_bgcolor: bgColor, plot_bgcolor: bgColor, showlegend: false, margin: { l: 60, r: 20, t: 50, b: 50 } }, (surfaceToken === "SURFACE"
|
|
1003
1005
|
? {
|
|
1004
1006
|
xaxis: {
|
|
1005
|
-
title: { text: (
|
|
1007
|
+
title: { text: (_25 = spec.horizontalAxisTitle) !== null && _25 !== void 0 ? _25 : "" },
|
|
1006
1008
|
automargin: true,
|
|
1007
1009
|
color: textColor,
|
|
1008
1010
|
},
|
|
1009
1011
|
yaxis: {
|
|
1010
|
-
title: { text: (
|
|
1012
|
+
title: { text: (_26 = spec.verticalAxisTitle) !== null && _26 !== void 0 ? _26 : "" },
|
|
1011
1013
|
automargin: true,
|
|
1012
1014
|
color: textColor,
|
|
1013
1015
|
},
|
|
1014
1016
|
}
|
|
1015
1017
|
: {
|
|
1016
1018
|
scene: {
|
|
1017
|
-
xaxis: { title: { text: (
|
|
1019
|
+
xaxis: { title: { text: (_27 = spec.horizontalAxisTitle) !== null && _27 !== void 0 ? _27 : "" } },
|
|
1018
1020
|
yaxis: { title: { text: "" } },
|
|
1019
|
-
zaxis: { title: { text: (
|
|
1021
|
+
zaxis: { title: { text: (_28 = spec.verticalAxisTitle) !== null && _28 !== void 0 ? _28 : "" } },
|
|
1020
1022
|
},
|
|
1021
1023
|
}));
|
|
1022
1024
|
setPlotData([surfaceTrace]);
|
|
@@ -1028,11 +1030,11 @@ var BasicChart = function (_a) {
|
|
|
1028
1030
|
// theta = the category names (closed by appending the first point).
|
|
1029
1031
|
if (spec.chartType === "radar") {
|
|
1030
1032
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1031
|
-
radarStyle = (
|
|
1033
|
+
radarStyle = (_29 = spec.radarStyle) !== null && _29 !== void 0 ? _29 : "standard";
|
|
1032
1034
|
radarTraces = [];
|
|
1033
1035
|
radarInputs = [];
|
|
1034
1036
|
try {
|
|
1035
|
-
for (_g = tslib_1.__values((
|
|
1037
|
+
for (_g = tslib_1.__values((_30 = spec.series) !== null && _30 !== void 0 ? _30 : []), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
1036
1038
|
seriesEntry = _h.value;
|
|
1037
1039
|
label = seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
|
|
1038
1040
|
? seriesEntry.dataLabel
|
|
@@ -1052,7 +1054,7 @@ var BasicChart = function (_a) {
|
|
|
1052
1054
|
indicators = (0, radar_1.buildRadarIndicators)(categories, radarInputs, radarAxisOptions);
|
|
1053
1055
|
_loop_1 = function (i) {
|
|
1054
1056
|
var input = radarInputs[i];
|
|
1055
|
-
var seriesColor = (
|
|
1057
|
+
var seriesColor = (_33 = (_32 = (_31 = spec.series) === null || _31 === void 0 ? void 0 : _31[i]) === null || _32 === void 0 ? void 0 : _32.color) !== null && _33 !== void 0 ? _33 : undefined;
|
|
1056
1058
|
var r = indicators.map(function (_, idx) { var _a; return (_a = input.values[idx]) !== null && _a !== void 0 ? _a : 0; });
|
|
1057
1059
|
var theta = indicators.map(function (ind) { return ind.name; });
|
|
1058
1060
|
radarTraces.push(tslib_1.__assign(tslib_1.__assign({ type: "scatterpolar", r: r.length ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(r), false), [r[0]], false) : r, theta: theta.length ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(theta), false), [theta[0]], false) : theta, name: input.name, mode: radarStyle === "standard" ? "lines" : "lines+markers" }, (radarStyle === "filled" ? { fill: "toself" } : {})), (seriesColor ? { line: { color: seriesColor } } : {})));
|
|
@@ -1060,7 +1062,7 @@ var BasicChart = function (_a) {
|
|
|
1060
1062
|
for (i = 0; i < radarInputs.length; i++) {
|
|
1061
1063
|
_loop_1(i);
|
|
1062
1064
|
}
|
|
1063
|
-
radarScale = (
|
|
1065
|
+
radarScale = (_34 = indicators[0]) !== null && _34 !== void 0 ? _34 : { min: 0, max: 1 };
|
|
1064
1066
|
setPlotData(radarTraces);
|
|
1065
1067
|
setLayout({
|
|
1066
1068
|
title: { text: (0, plotly_title_1.plotlyTitleText)(title, spec.titleTextFormat) },
|
|
@@ -1084,13 +1086,13 @@ var BasicChart = function (_a) {
|
|
|
1084
1086
|
// V-variants additionally get a volume column sub-pane below the
|
|
1085
1087
|
// price plot.
|
|
1086
1088
|
if (spec.chartType === "stock") {
|
|
1087
|
-
variant = ((
|
|
1089
|
+
variant = ((_35 = spec.stockVariant) !== null && _35 !== void 0 ? _35 : "HLC");
|
|
1088
1090
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1089
|
-
seriesValues = ((
|
|
1091
|
+
seriesValues = ((_36 = spec.series) !== null && _36 !== void 0 ? _36 : []).map(function (seriesEntry) {
|
|
1090
1092
|
return flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
1091
1093
|
});
|
|
1092
1094
|
volumePoints_1 = (0, stock_1.toVolumeSeries)(seriesValues, variant);
|
|
1093
|
-
hasVolume = ((
|
|
1095
|
+
hasVolume = ((_37 = volumePoints_1 === null || volumePoints_1 === void 0 ? void 0 : volumePoints_1.length) !== null && _37 !== void 0 ? _37 : 0) > 0;
|
|
1094
1096
|
buildVolumeTrace = function (xs) {
|
|
1095
1097
|
return ({
|
|
1096
1098
|
type: "bar",
|
|
@@ -1123,25 +1125,25 @@ var BasicChart = function (_a) {
|
|
|
1123
1125
|
roles = (0, stock_1.assignStockRoles)(seriesValues, variant);
|
|
1124
1126
|
xs_1 = categories.length > 0
|
|
1125
1127
|
? categories
|
|
1126
|
-
: ((
|
|
1128
|
+
: ((_38 = roles.close) !== null && _38 !== void 0 ? _38 : []).map(function (_, i) { return i + 1; });
|
|
1127
1129
|
candleTrace = {
|
|
1128
1130
|
type: "candlestick",
|
|
1129
1131
|
x: xs_1,
|
|
1130
|
-
open: ((
|
|
1131
|
-
high: ((
|
|
1132
|
-
low: ((
|
|
1133
|
-
close: ((
|
|
1132
|
+
open: ((_39 = roles.open) !== null && _39 !== void 0 ? _39 : []).map(function (v) { return v !== null && v !== void 0 ? v : null; }),
|
|
1133
|
+
high: ((_40 = roles.high) !== null && _40 !== void 0 ? _40 : []).map(function (v) { return v !== null && v !== void 0 ? v : null; }),
|
|
1134
|
+
low: ((_41 = roles.low) !== null && _41 !== void 0 ? _41 : []).map(function (v) { return v !== null && v !== void 0 ? v : null; }),
|
|
1135
|
+
close: ((_42 = roles.close) !== null && _42 !== void 0 ? _42 : []).map(function (v) { return v !== null && v !== void 0 ? v : null; }),
|
|
1134
1136
|
increasing: { line: { color: theme.themeColors.accent1 } },
|
|
1135
1137
|
decreasing: { line: { color: theme.themeColors.accent2 } },
|
|
1136
1138
|
};
|
|
1137
1139
|
setPlotData(hasVolume ? [candleTrace, buildVolumeTrace(xs_1)] : [candleTrace]);
|
|
1138
1140
|
setLayout(tslib_1.__assign(tslib_1.__assign({ title: { text: (0, plotly_title_1.plotlyTitleText)(title, spec.titleTextFormat) }, font: { color: textColor }, paper_bgcolor: bgColor, plot_bgcolor: bgColor, showlegend: false, xaxis: {
|
|
1139
|
-
title: { text: (
|
|
1141
|
+
title: { text: (_43 = spec.horizontalAxisTitle) !== null && _43 !== void 0 ? _43 : "" },
|
|
1140
1142
|
automargin: true,
|
|
1141
1143
|
showgrid: true,
|
|
1142
1144
|
gridcolor: gridColor,
|
|
1143
1145
|
rangeslider: { visible: false },
|
|
1144
|
-
}, yaxis: tslib_1.__assign({ title: { text: (
|
|
1146
|
+
}, yaxis: tslib_1.__assign({ title: { text: (_44 = spec.verticalAxisTitle) !== null && _44 !== void 0 ? _44 : "" }, automargin: true, showgrid: true, gridcolor: gridColor }, priceYAxisDomain) }, volumeLayout), { margin: { l: 50, r: 50, t: 50, b: 50 }, autosize: true }));
|
|
1145
1147
|
return [2 /*return*/];
|
|
1146
1148
|
}
|
|
1147
1149
|
lineSeries = (0, stock_1.toLineSeries)(seriesValues, variant);
|
|
@@ -1153,7 +1155,7 @@ var BasicChart = function (_a) {
|
|
|
1153
1155
|
]);
|
|
1154
1156
|
xs_2 = categories.length > 0
|
|
1155
1157
|
? categories
|
|
1156
|
-
: ((
|
|
1158
|
+
: ((_46 = (_45 = lineSeries[0]) === null || _45 === void 0 ? void 0 : _45.values) !== null && _46 !== void 0 ? _46 : []).map(function (_, i) { return i + 1; });
|
|
1157
1159
|
stockTraces = lineSeries.map(function (s, i) { return ({
|
|
1158
1160
|
type: "scatter",
|
|
1159
1161
|
mode: "lines",
|
|
@@ -1164,11 +1166,11 @@ var BasicChart = function (_a) {
|
|
|
1164
1166
|
}); });
|
|
1165
1167
|
setPlotData(hasVolume ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(stockTraces), false), [buildVolumeTrace(xs_2)], false) : stockTraces);
|
|
1166
1168
|
setLayout(tslib_1.__assign(tslib_1.__assign({ title: { text: (0, plotly_title_1.plotlyTitleText)(title, spec.titleTextFormat) }, font: { color: textColor }, paper_bgcolor: bgColor, plot_bgcolor: bgColor, showlegend: stockTraces.length > 1, xaxis: {
|
|
1167
|
-
title: { text: (
|
|
1169
|
+
title: { text: (_47 = spec.horizontalAxisTitle) !== null && _47 !== void 0 ? _47 : "" },
|
|
1168
1170
|
automargin: true,
|
|
1169
1171
|
showgrid: true,
|
|
1170
1172
|
gridcolor: gridColor,
|
|
1171
|
-
}, yaxis: tslib_1.__assign({ title: { text: (
|
|
1173
|
+
}, yaxis: tslib_1.__assign({ title: { text: (_48 = spec.verticalAxisTitle) !== null && _48 !== void 0 ? _48 : "" }, automargin: true, showgrid: true, gridcolor: gridColor }, priceYAxisDomain) }, volumeLayout), { margin: { l: 50, r: 50, t: 50, b: 50 }, autosize: true }));
|
|
1172
1174
|
return [2 /*return*/];
|
|
1173
1175
|
}
|
|
1174
1176
|
isStacked = spec.stackedType && spec.stackedType !== "UNSTACKED";
|
|
@@ -1215,12 +1217,12 @@ var BasicChart = function (_a) {
|
|
|
1215
1217
|
return extra;
|
|
1216
1218
|
};
|
|
1217
1219
|
shouldAggregate = (0, aggregation_1.shouldAggregateSeries)(spec.series);
|
|
1218
|
-
primaryDomainSource = (
|
|
1220
|
+
primaryDomainSource = (_51 = (_50 = (_49 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _49 === void 0 ? void 0 : _49[0]) === null || _50 === void 0 ? void 0 : _50.sources) === null || _51 === void 0 ? void 0 : _51[0];
|
|
1219
1221
|
rawPrimaryDomainValues = primaryDomainSource
|
|
1220
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
1222
|
+
? (0, aggregation_1.sanitizeDomainValues)((_52 = getDomainValuesFromRange(primaryDomainSource, spec.hiddenDimensionStrategy)) !== null && _52 !== void 0 ? _52 : [])
|
|
1221
1223
|
: [];
|
|
1222
1224
|
domainData = (0, aggregation_1.getDomainValuesForAxis)(rawPrimaryDomainValues, shouldAggregate);
|
|
1223
|
-
categoryLevels = (0, category_levels_1.resolveCategoryLevels)((
|
|
1225
|
+
categoryLevels = (0, category_levels_1.resolveCategoryLevels)((_53 = spec.categoryLevels) === null || _53 === void 0 ? void 0 : _53.map(function (level) {
|
|
1224
1226
|
return flattenChartDataValues([level], getDomainValuesFromRange, spec.hiddenDimensionStrategy, false);
|
|
1225
1227
|
}));
|
|
1226
1228
|
multicategoryX = categoryLevels
|
|
@@ -1230,7 +1232,7 @@ var BasicChart = function (_a) {
|
|
|
1230
1232
|
domainData = categoryLevels.leaf;
|
|
1231
1233
|
}
|
|
1232
1234
|
aggregateDomainValues = domainData;
|
|
1233
|
-
domainAxisData = (categoryLevels ? [] : (
|
|
1235
|
+
domainAxisData = (categoryLevels ? [] : (_54 = spec.domains) !== null && _54 !== void 0 ? _54 : []).map(function (domain, domainIndex) {
|
|
1234
1236
|
return domain.sources.flatMap(function (sheetRange, sourceIndex) {
|
|
1235
1237
|
var _a;
|
|
1236
1238
|
if (domainIndex === 0 && sourceIndex === 0) {
|
|
@@ -1487,29 +1489,29 @@ var BasicChart = function (_a) {
|
|
|
1487
1489
|
finally { if (e_8) throw e_8.error; }
|
|
1488
1490
|
}
|
|
1489
1491
|
};
|
|
1490
|
-
domainSources = (
|
|
1492
|
+
domainSources = (_57 = (_56 = (_55 = spec.domains) === null || _55 === void 0 ? void 0 : _55[0]) === null || _56 === void 0 ? void 0 : _56.sources) !== null && _57 !== void 0 ? _57 : [];
|
|
1491
1493
|
seriesIndex = 0;
|
|
1492
1494
|
_loop_2 = function (series) {
|
|
1493
|
-
var currentSeriesIndex, dataLabel,
|
|
1494
|
-
return tslib_1.__generator(this, function (
|
|
1495
|
-
switch (
|
|
1495
|
+
var currentSeriesIndex, dataLabel, _87, _88, effectiveChartType, lineLike, pieDomainLabels, piePointOffset, seriesData, seriesPlotlyType, seriesTraceStyle, rawValues, binCount, binningOptions, categories, prebinned, _89, labels, counts, cumulativePercents, barTrace, paretoLineColor, barTrace, trace, rawValues, quartileMethod, showOutliers, showMeanMarker, usePrecomputed, trace, summary, hideOutliers, rawValues, totalIndices_1, increaseColor, trace, rawValues, trace, pieData, _90, main_1, secondary, otherTotal, total, ofPieType, secondScale, halfAngle, paletteAt_1, MAIN_DOMAIN_X, CY, SECONDARY_CX, BAR_LEFT, BAR_RIGHT, plotW, plotH, hasGeometry, r, r2, clampFrac, rx2, ry2, barHalf, shapes, connectorColor, mainCx, px, pyTop, pyBottom, tx, half, line, pieData, trace, _91, x, y, orientation_1, trace, numericValues, _92, x, y, orientation_2, trace;
|
|
1496
|
+
return tslib_1.__generator(this, function (_93) {
|
|
1497
|
+
switch (_93.label) {
|
|
1496
1498
|
case 0:
|
|
1497
1499
|
currentSeriesIndex = seriesIndex++;
|
|
1498
1500
|
if (!(!(0, utils_1.isNil)(series.dataLabel) && (0, utils_1.isAFormula)(series.dataLabel))) return [3 /*break*/, 2];
|
|
1499
|
-
|
|
1500
|
-
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (
|
|
1501
|
+
_88 = chart_spec_utils_1.coerceCalculatedLabel;
|
|
1502
|
+
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (_59 = position.sheetId) !== null && _59 !== void 0 ? _59 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
1501
1503
|
case 1:
|
|
1502
|
-
|
|
1504
|
+
_87 = _88.apply(void 0, [_93.sent()]);
|
|
1503
1505
|
return [3 /*break*/, 3];
|
|
1504
1506
|
case 2:
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
+
_87 = (_60 = series.dataLabel) !== null && _60 !== void 0 ? _60 : "";
|
|
1508
|
+
_93.label = 3;
|
|
1507
1509
|
case 3:
|
|
1508
|
-
dataLabel =
|
|
1510
|
+
dataLabel = _87;
|
|
1509
1511
|
// A series with no ranges draws nothing.
|
|
1510
1512
|
if (series.sources.length === 0)
|
|
1511
1513
|
return [2 /*return*/, "continue"];
|
|
1512
|
-
effectiveChartType = (
|
|
1514
|
+
effectiveChartType = (_61 = series.seriesChartType) !== null && _61 !== void 0 ? _61 : spec.chartType;
|
|
1513
1515
|
lineLike = (0, empty_cells_1.isLineLikeChartType)(effectiveChartType);
|
|
1514
1516
|
pieDomainLabels = (spec.chartType === "pie" || spec.chartType === "doughnut") &&
|
|
1515
1517
|
(domainSources.length > 1 || series.sources.length > 1)
|
|
@@ -1544,36 +1546,58 @@ var BasicChart = function (_a) {
|
|
|
1544
1546
|
if (effectiveChartType === "histogram") {
|
|
1545
1547
|
rawValues = seriesValuesOf(seriesData);
|
|
1546
1548
|
binCount = spec.binCount;
|
|
1549
|
+
binningOptions = {
|
|
1550
|
+
binSize: spec.binSize,
|
|
1551
|
+
intervalClosed: spec.intervalClosed,
|
|
1552
|
+
overflow: spec.overflow,
|
|
1553
|
+
underflow: spec.underflow,
|
|
1554
|
+
};
|
|
1555
|
+
categories = domainData;
|
|
1556
|
+
prebinned = categories.length
|
|
1557
|
+
? (0, histogram_1.aggregateByCategory)(categories, rawValues, (_62 = series.aggregateType) !== null && _62 !== void 0 ? _62 : "SUM")
|
|
1558
|
+
: (0, histogram_1.hasExcelBinning)(binningOptions)
|
|
1559
|
+
? (0, histogram_1.binHistogram)(rawValues, binCount, binningOptions)
|
|
1560
|
+
: null;
|
|
1547
1561
|
if (isPareto) {
|
|
1548
|
-
|
|
1562
|
+
_89 = (0, histogram_1.computePareto)(prebinned !== null && prebinned !== void 0 ? prebinned : (0, histogram_1.binHistogram)(rawValues, binCount)), labels = _89.labels, counts = _89.counts, cumulativePercents = _89.cumulativePercents;
|
|
1549
1563
|
barTrace = {
|
|
1550
1564
|
type: "bar",
|
|
1551
1565
|
x: labels,
|
|
1552
1566
|
y: counts,
|
|
1553
1567
|
name: dataLabel,
|
|
1554
1568
|
};
|
|
1555
|
-
applyTraceColor(barTrace, (
|
|
1569
|
+
applyTraceColor(barTrace, (_63 = series.color) !== null && _63 !== void 0 ? _63 : undefined, {
|
|
1556
1570
|
noFill: series.noFill,
|
|
1557
1571
|
dataPointColors: series.dataPointColors,
|
|
1558
1572
|
seriesIndex: currentSeriesIndex,
|
|
1559
1573
|
effectiveChartType: effectiveChartType,
|
|
1560
1574
|
});
|
|
1561
1575
|
traces.push(barTrace);
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
x: labels,
|
|
1566
|
-
y: cumulativePercents,
|
|
1567
|
-
name: "Cumulative %",
|
|
1568
|
-
yaxis: "y2",
|
|
1569
|
-
});
|
|
1576
|
+
paretoLineColor = spec.paretoLineColor;
|
|
1577
|
+
// Excel draws the Pareto line without markers.
|
|
1578
|
+
traces.push(tslib_1.__assign({ type: "scatter", mode: "lines", x: labels, y: cumulativePercents, name: "Cumulative %", yaxis: "y2" }, (paretoLineColor ? { line: { color: paretoLineColor } } : {})));
|
|
1570
1579
|
hasSecondaryAxis = true;
|
|
1571
1580
|
}
|
|
1581
|
+
else if (prebinned) {
|
|
1582
|
+
barTrace = {
|
|
1583
|
+
type: "bar",
|
|
1584
|
+
x: prebinned.labels,
|
|
1585
|
+
y: prebinned.counts,
|
|
1586
|
+
name: dataLabel,
|
|
1587
|
+
};
|
|
1588
|
+
applyTraceColor(barTrace, (_64 = series.color) !== null && _64 !== void 0 ? _64 : undefined, {
|
|
1589
|
+
noFill: series.noFill,
|
|
1590
|
+
dataPointColors: series.dataPointColors,
|
|
1591
|
+
seriesIndex: currentSeriesIndex,
|
|
1592
|
+
effectiveChartType: effectiveChartType,
|
|
1593
|
+
});
|
|
1594
|
+
traces.push(barTrace);
|
|
1595
|
+
}
|
|
1572
1596
|
else {
|
|
1573
1597
|
trace = tslib_1.__assign({ type: "histogram", x: rawValues.map(function (v) { return (v !== null && v !== void 0 ? v : null); }), name: dataLabel }, (typeof binCount === "number" && binCount > 0
|
|
1574
1598
|
? { nbinsx: binCount }
|
|
1575
1599
|
: {}));
|
|
1576
|
-
applyTraceColor(trace, (
|
|
1600
|
+
applyTraceColor(trace, (_65 = series.color) !== null && _65 !== void 0 ? _65 : undefined, {
|
|
1577
1601
|
noFill: series.noFill,
|
|
1578
1602
|
dataPointColors: series.dataPointColors,
|
|
1579
1603
|
seriesIndex: currentSeriesIndex,
|
|
@@ -1621,7 +1645,7 @@ var BasicChart = function (_a) {
|
|
|
1621
1645
|
// default and `showOutliers: true` alike).
|
|
1622
1646
|
boxpoints: "outliers" }, (showMeanMarker ? { boxmean: true } : {}));
|
|
1623
1647
|
}
|
|
1624
|
-
applyTraceColor(trace, (
|
|
1648
|
+
applyTraceColor(trace, (_66 = series.color) !== null && _66 !== void 0 ? _66 : undefined, {
|
|
1625
1649
|
noFill: series.noFill,
|
|
1626
1650
|
dataPointColors: series.dataPointColors,
|
|
1627
1651
|
seriesIndex: currentSeriesIndex,
|
|
@@ -1631,8 +1655,8 @@ var BasicChart = function (_a) {
|
|
|
1631
1655
|
}
|
|
1632
1656
|
else if (effectiveChartType === "waterfall") {
|
|
1633
1657
|
rawValues = seriesValuesOf(seriesData);
|
|
1634
|
-
totalIndices_1 = new Set((
|
|
1635
|
-
increaseColor = (
|
|
1658
|
+
totalIndices_1 = new Set((_67 = spec.totalIndices) !== null && _67 !== void 0 ? _67 : []);
|
|
1659
|
+
increaseColor = (_68 = series.color) !== null && _68 !== void 0 ? _68 : (0, utils_1.chartPaletteColorAt)(themeColorPalette, currentSeriesIndex);
|
|
1636
1660
|
trace = {
|
|
1637
1661
|
type: "waterfall",
|
|
1638
1662
|
x: categoriesFor(series),
|
|
@@ -1644,10 +1668,10 @@ var BasicChart = function (_a) {
|
|
|
1644
1668
|
increasing: { marker: { color: increaseColor } },
|
|
1645
1669
|
decreasing: {
|
|
1646
1670
|
marker: {
|
|
1647
|
-
color: (
|
|
1671
|
+
color: (_70 = (_69 = series.negativeColor) !== null && _69 !== void 0 ? _69 : theme.themeColors.accent2) !== null && _70 !== void 0 ? _70 : increaseColor,
|
|
1648
1672
|
},
|
|
1649
1673
|
},
|
|
1650
|
-
totals: { marker: { color: (
|
|
1674
|
+
totals: { marker: { color: (_71 = theme.themeColors.accent3) !== null && _71 !== void 0 ? _71 : increaseColor } },
|
|
1651
1675
|
connector: {
|
|
1652
1676
|
line: {
|
|
1653
1677
|
color: isDarkMode ? "rgba(255,255,255,0.45)" : "#999999",
|
|
@@ -1667,7 +1691,7 @@ var BasicChart = function (_a) {
|
|
|
1667
1691
|
name: dataLabel,
|
|
1668
1692
|
textinfo: "none",
|
|
1669
1693
|
};
|
|
1670
|
-
applyTraceColor(trace, (
|
|
1694
|
+
applyTraceColor(trace, (_72 = series.color) !== null && _72 !== void 0 ? _72 : undefined, {
|
|
1671
1695
|
noFill: series.noFill,
|
|
1672
1696
|
dataPointColors: series.dataPointColors,
|
|
1673
1697
|
seriesIndex: currentSeriesIndex,
|
|
@@ -1685,10 +1709,10 @@ var BasicChart = function (_a) {
|
|
|
1685
1709
|
return [2 /*return*/, "continue"];
|
|
1686
1710
|
ofPieHandled = true;
|
|
1687
1711
|
pieData = seriesData;
|
|
1688
|
-
|
|
1712
|
+
_90 = (0, of_pie_1.splitOfPie)(pieData.values, pieData.labels, {
|
|
1689
1713
|
splitType: spec.splitType,
|
|
1690
1714
|
splitPos: spec.splitPos,
|
|
1691
|
-
}), main_1 =
|
|
1715
|
+
}), main_1 = _90.main, secondary = _90.secondary, otherTotal = _90.otherTotal, total = _90.total;
|
|
1692
1716
|
ofPieType = (0, of_pie_1.resolveOfPieType)(spec.ofPieType);
|
|
1693
1717
|
secondScale = (0, of_pie_1.clampSecondPieSize)(spec.secondPieSize) / 100;
|
|
1694
1718
|
halfAngle = (0, of_pie_1.otherSliceHalfAngle)(otherTotal, total);
|
|
@@ -1821,7 +1845,7 @@ var BasicChart = function (_a) {
|
|
|
1821
1845
|
trace.meta = {
|
|
1822
1846
|
rncSeriesIndex: currentSeriesIndex,
|
|
1823
1847
|
};
|
|
1824
|
-
applyTraceColor(trace, (
|
|
1848
|
+
applyTraceColor(trace, (_73 = series.color) !== null && _73 !== void 0 ? _73 : undefined, {
|
|
1825
1849
|
noFill: series.noFill,
|
|
1826
1850
|
dataPointColors: series.dataPointColors,
|
|
1827
1851
|
seriesIndex: currentSeriesIndex,
|
|
@@ -1830,13 +1854,13 @@ var BasicChart = function (_a) {
|
|
|
1830
1854
|
traces.push(trace);
|
|
1831
1855
|
}
|
|
1832
1856
|
else if ("values" in seriesData && "labels" in seriesData) {
|
|
1833
|
-
|
|
1857
|
+
_91 = assignCartesianData(categoriesFor(series), seriesData.values), x = _91.x, y = _91.y, orientation_1 = _91.orientation;
|
|
1834
1858
|
trace = tslib_1.__assign(tslib_1.__assign({ type: seriesPlotlyType, x: x, y: y, orientation: orientation_1, name: dataLabel, stackgroup: isStacked ? "one" : undefined }, seriesTraceStyle), lineTraceVariant(series, effectiveChartType, seriesData.values));
|
|
1835
1859
|
// Ties the trace back to spec.series for click selection
|
|
1836
1860
|
trace.meta = {
|
|
1837
1861
|
rncSeriesIndex: currentSeriesIndex,
|
|
1838
1862
|
};
|
|
1839
|
-
applyTraceColor(trace, (
|
|
1863
|
+
applyTraceColor(trace, (_74 = series.color) !== null && _74 !== void 0 ? _74 : undefined, {
|
|
1840
1864
|
noFill: series.noFill,
|
|
1841
1865
|
dataPointColors: series.dataPointColors,
|
|
1842
1866
|
invertIfNegative: series.invertIfNegative,
|
|
@@ -1851,13 +1875,13 @@ var BasicChart = function (_a) {
|
|
|
1851
1875
|
}
|
|
1852
1876
|
else {
|
|
1853
1877
|
numericValues = seriesData;
|
|
1854
|
-
|
|
1878
|
+
_92 = assignCartesianData(categoriesFor(series), numericValues), x = _92.x, y = _92.y, orientation_2 = _92.orientation;
|
|
1855
1879
|
trace = tslib_1.__assign(tslib_1.__assign({ type: seriesPlotlyType, x: x, y: y, orientation: orientation_2, name: dataLabel, stackgroup: isStacked ? "one" : undefined }, seriesTraceStyle), lineTraceVariant(series, effectiveChartType, numericValues));
|
|
1856
1880
|
// Ties the trace back to spec.series for click selection
|
|
1857
1881
|
trace.meta = {
|
|
1858
1882
|
rncSeriesIndex: currentSeriesIndex,
|
|
1859
1883
|
};
|
|
1860
|
-
applyTraceColor(trace, (
|
|
1884
|
+
applyTraceColor(trace, (_75 = series.color) !== null && _75 !== void 0 ? _75 : undefined, {
|
|
1861
1885
|
noFill: series.noFill,
|
|
1862
1886
|
dataPointColors: series.dataPointColors,
|
|
1863
1887
|
invertIfNegative: series.invertIfNegative,
|
|
@@ -1874,24 +1898,24 @@ var BasicChart = function (_a) {
|
|
|
1874
1898
|
}
|
|
1875
1899
|
});
|
|
1876
1900
|
};
|
|
1877
|
-
|
|
1901
|
+
_86.label = 18;
|
|
1878
1902
|
case 18:
|
|
1879
|
-
|
|
1880
|
-
_j = tslib_1.__values((
|
|
1881
|
-
|
|
1903
|
+
_86.trys.push([18, 23, 24, 25]);
|
|
1904
|
+
_j = tslib_1.__values((_58 = spec.series) !== null && _58 !== void 0 ? _58 : []), _k = _j.next();
|
|
1905
|
+
_86.label = 19;
|
|
1882
1906
|
case 19:
|
|
1883
1907
|
if (!!_k.done) return [3 /*break*/, 22];
|
|
1884
1908
|
series = _k.value;
|
|
1885
1909
|
return [5 /*yield**/, _loop_2(series)];
|
|
1886
1910
|
case 20:
|
|
1887
|
-
|
|
1888
|
-
|
|
1911
|
+
_86.sent();
|
|
1912
|
+
_86.label = 21;
|
|
1889
1913
|
case 21:
|
|
1890
1914
|
_k = _j.next();
|
|
1891
1915
|
return [3 /*break*/, 19];
|
|
1892
1916
|
case 22: return [3 /*break*/, 25];
|
|
1893
1917
|
case 23:
|
|
1894
|
-
e_3_1 =
|
|
1918
|
+
e_3_1 = _86.sent();
|
|
1895
1919
|
e_3 = { error: e_3_1 };
|
|
1896
1920
|
return [3 /*break*/, 25];
|
|
1897
1921
|
case 24:
|
|
@@ -1908,13 +1932,13 @@ var BasicChart = function (_a) {
|
|
|
1908
1932
|
? undefined
|
|
1909
1933
|
: (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
1910
1934
|
axisOptions: spec.valueAxisOptions,
|
|
1911
|
-
series: ((
|
|
1935
|
+
series: ((_76 = spec.series) !== null && _76 !== void 0 ? _76 : []).filter(function (s) { return !s.useSecondaryAxis; }),
|
|
1912
1936
|
getFormattingFromRange: getFormattingFromRange,
|
|
1913
1937
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
1914
1938
|
});
|
|
1915
1939
|
secondaryAxisNumberFormat = (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
1916
1940
|
axisOptions: spec.secondaryValueAxisOptions,
|
|
1917
|
-
series: ((
|
|
1941
|
+
series: ((_77 = spec.series) !== null && _77 !== void 0 ? _77 : []).filter(function (s) { return s.useSecondaryAxis; }),
|
|
1918
1942
|
getFormattingFromRange: getFormattingFromRange,
|
|
1919
1943
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
1920
1944
|
});
|
|
@@ -1962,14 +1986,14 @@ var BasicChart = function (_a) {
|
|
|
1962
1986
|
? VALUE_AXIS_TITLE_STANDOFF
|
|
1963
1987
|
: legend_layout_1.BAND_GAP;
|
|
1964
1988
|
legendBand = (0, legend_layout_1.reservePlotlyLegendBand)({
|
|
1965
|
-
position: (
|
|
1989
|
+
position: (_78 = spec.legend) === null || _78 === void 0 ? void 0 : _78.position,
|
|
1966
1990
|
visible: showlegend !== false,
|
|
1967
1991
|
labels: (0, legend_layout_1.legendLabelsFrom)(undefined, traces.map(function (trace) { return trace === null || trace === void 0 ? void 0 : trace.name; })),
|
|
1968
|
-
legendFontSize: (
|
|
1992
|
+
legendFontSize: (_81 = (_80 = (_79 = spec.legend) === null || _79 === void 0 ? void 0 : _79.textFormat) === null || _80 === void 0 ? void 0 : _80.fontSize) !== null && _81 !== void 0 ? _81 : axisFontSize,
|
|
1969
1993
|
width: Math.max(0, (width !== null && width !== void 0 ? width : 0) - 2),
|
|
1970
1994
|
height: Math.max(0, (height !== null && height !== void 0 ? height : 0) - 2),
|
|
1971
1995
|
hasTitle: Boolean(title),
|
|
1972
|
-
titleFontSize: (
|
|
1996
|
+
titleFontSize: (_82 = authoredTitleFmt === null || authoredTitleFmt === void 0 ? void 0 : authoredTitleFmt.fontSize) !== null && _82 !== void 0 ? _82 : 16,
|
|
1973
1997
|
hasBottomAxisTitle: Boolean(spec.horizontalAxisTitle),
|
|
1974
1998
|
hasLeftAxisTitle: Boolean(spec.verticalAxisTitle),
|
|
1975
1999
|
leftAxisDepth: leftAxisDepth,
|
|
@@ -1981,20 +2005,23 @@ var BasicChart = function (_a) {
|
|
|
1981
2005
|
family: "Untitled Sans, apple-system, sans-serif",
|
|
1982
2006
|
size: 16,
|
|
1983
2007
|
color: textColor,
|
|
1984
|
-
}, authoredTitleFmt), x: 0.02, xanchor: "left" }, legendBand.title), showlegend: showlegend === undefined ? true : showlegend, legend: tslib_1.__assign(tslib_1.__assign({}, legendOverrides), ((
|
|
2008
|
+
}, authoredTitleFmt), x: 0.02, xanchor: "left" }, legendBand.title), showlegend: showlegend === undefined ? true : showlegend, legend: tslib_1.__assign(tslib_1.__assign({}, legendOverrides), ((_83 = legendBand.legend) !== null && _83 !== void 0 ? _83 : {})), margin: legendBand.margin, autosize: true }, ((spec.chartType === "bar" || spec.chartType === "column") &&
|
|
1985
2009
|
spec.stackedType
|
|
1986
2010
|
? tslib_1.__assign({ barmode: spec.stackedType === "STACKED" ||
|
|
1987
2011
|
spec.stackedType === "PERCENT_STACKED"
|
|
1988
2012
|
? "stack"
|
|
1989
2013
|
: "group" }, (isPercentStackedBars ? { barnorm: "percent" } : {})) : {})), (typeof spec.gapWidth === "number"
|
|
1990
2014
|
? { bargap: Math.max(0, Math.min(0.95, spec.gapWidth / 400)) }
|
|
1991
|
-
:
|
|
2015
|
+
: spec.chartType === "histogram"
|
|
2016
|
+
? // Excel's histogram columns touch by default (#1087).
|
|
2017
|
+
{ bargap: 0 }
|
|
2018
|
+
: {})), { font: {
|
|
1992
2019
|
family: "Untitled Sans, apple-system, sans-serif",
|
|
1993
2020
|
size: 12,
|
|
1994
2021
|
color: textColor,
|
|
1995
2022
|
}, paper_bgcolor: bgColor, plot_bgcolor: bgColor, xaxis: applyAxisOverridesPlotly({
|
|
1996
2023
|
title: {
|
|
1997
|
-
text: (
|
|
2024
|
+
text: (_84 = spec.horizontalAxisTitle) !== null && _84 !== void 0 ? _84 : "",
|
|
1998
2025
|
font: { color: textColor },
|
|
1999
2026
|
standoff: bottomAxisTitleStandoff,
|
|
2000
2027
|
},
|
|
@@ -2012,7 +2039,7 @@ var BasicChart = function (_a) {
|
|
|
2012
2039
|
isHorizontalBarChart
|
|
2013
2040
|
? spec.valueAxisOptions
|
|
2014
2041
|
: spec.categoryAxisOptions, isHorizontalBarChart ? primaryAxisNumberFormat : undefined), yaxis: applyAxisOverridesPlotly({
|
|
2015
|
-
title: tslib_1.__assign({ text: (
|
|
2042
|
+
title: tslib_1.__assign({ text: (_85 = spec.verticalAxisTitle) !== null && _85 !== void 0 ? _85 : "", font: { color: textColor } }, (isHorizontalBarChart
|
|
2016
2043
|
? {}
|
|
2017
2044
|
: { standoff: VALUE_AXIS_TITLE_STANDOFF })),
|
|
2018
2045
|
showgrid: !isHorizontalBarChart,
|
|
@@ -46,5 +46,11 @@ export declare const toPlotlyHierarchy: (rows: HierarchyRow[]) => PlotlyHierarch
|
|
|
46
46
|
* Returns the colour per node of `toPlotlyHierarchy`'s flat arrays.
|
|
47
47
|
*/
|
|
48
48
|
export declare const hierarchyNodeColors: (hierarchy: Pick<PlotlyHierarchy, "ids" | "parents">, palette: string[]) => string[];
|
|
49
|
+
/**
|
|
50
|
+
* Black or white, whichever reads on `background` (a `#rgb` / `#rrggbb`
|
|
51
|
+
* colour; anything else gets white) — for a treemap banner filled with
|
|
52
|
+
* its category's colour (rowsncolumns/spreadsheet#1086).
|
|
53
|
+
*/
|
|
54
|
+
export declare const contrastTextColor: (background: string | undefined) => string;
|
|
49
55
|
export {};
|
|
50
56
|
//# sourceMappingURL=hierarchy.d.ts.map
|