@rowsncolumns/charts 28.1.16 → 28.1.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/Readme.md +18 -1
- package/dist/cjs/basic-chart/basic-chart.d.ts +1 -1
- package/dist/cjs/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/basic-chart/basic-chart.js +204 -172
- package/dist/cjs/components/editors/chart-editor.d.ts +7 -1
- package/dist/cjs/components/editors/chart-editor.d.ts.map +1 -1
- package/dist/cjs/components/editors/chart-editor.js +3 -2
- package/dist/cjs/components/editors/fields/text-format-fields.d.ts +5 -3
- package/dist/cjs/components/editors/fields/text-format-fields.d.ts.map +1 -1
- package/dist/cjs/components/editors/fields/text-format-fields.js +6 -6
- package/dist/cjs/config.d.ts +10 -0
- package/dist/cjs/config.d.ts.map +1 -1
- package/dist/cjs/config.js +45 -10
- package/dist/cjs/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/plotly/basic-chart/basic-chart.js +43 -4
- package/dist/cjs/types.d.ts +10 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils/echarts-gl-loader.d.ts +6 -0
- package/dist/cjs/utils/echarts-gl-loader.d.ts.map +1 -1
- package/dist/cjs/utils/echarts-gl-loader.js +42 -1
- package/dist/cjs/utils/overrides.d.ts +20 -0
- package/dist/cjs/utils/overrides.d.ts.map +1 -1
- package/dist/cjs/utils/overrides.js +28 -7
- package/dist/cjs/utils/three-d.d.ts +12 -1
- package/dist/cjs/utils/three-d.d.ts.map +1 -1
- package/dist/cjs/utils/three-d.js +4 -1
- package/dist/esm/basic-chart/basic-chart.d.ts +1 -1
- package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/basic-chart/basic-chart.js +79 -56
- package/dist/esm/components/editors/chart-editor.d.ts +7 -1
- package/dist/esm/components/editors/chart-editor.d.ts.map +1 -1
- package/dist/esm/components/editors/chart-editor.js +4 -3
- package/dist/esm/components/editors/fields/text-format-fields.d.ts +5 -3
- package/dist/esm/components/editors/fields/text-format-fields.d.ts.map +1 -1
- package/dist/esm/components/editors/fields/text-format-fields.js +6 -6
- package/dist/esm/config.d.ts +10 -0
- package/dist/esm/config.d.ts.map +1 -1
- package/dist/esm/config.js +20 -0
- package/dist/esm/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/plotly/basic-chart/basic-chart.js +44 -2
- package/dist/esm/types.d.ts +10 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utils/echarts-gl-loader.d.ts +6 -0
- package/dist/esm/utils/echarts-gl-loader.d.ts.map +1 -1
- package/dist/esm/utils/echarts-gl-loader.js +40 -0
- package/dist/esm/utils/overrides.d.ts +20 -0
- package/dist/esm/utils/overrides.d.ts.map +1 -1
- package/dist/esm/utils/overrides.js +22 -0
- package/dist/esm/utils/three-d.d.ts +12 -1
- package/dist/esm/utils/three-d.d.ts.map +1 -1
- package/dist/esm/utils/three-d.js +4 -1
- package/package.json +2 -2
|
@@ -33,6 +33,7 @@ var histogram_1 = require("../utils/histogram");
|
|
|
33
33
|
var legend_layout_1 = require("../utils/legend-layout");
|
|
34
34
|
var of_pie_1 = require("../utils/of-pie");
|
|
35
35
|
var overrides_1 = require("../utils/overrides");
|
|
36
|
+
var overrides_2 = require("../utils/overrides");
|
|
36
37
|
var pie_explosion_1 = require("../utils/pie-explosion");
|
|
37
38
|
var radar_1 = require("../utils/radar");
|
|
38
39
|
var region_map_1 = require("../utils/region-map");
|
|
@@ -254,8 +255,8 @@ var defaultLegendConfig = {
|
|
|
254
255
|
/** Category-axis title gap: clears one row of tick labels (#986). */
|
|
255
256
|
var CATEGORY_AXIS_NAME_GAP = (0, legend_layout_1.categoryAxisNameGap)();
|
|
256
257
|
var BasicChart = function (_a) {
|
|
257
|
-
var _b;
|
|
258
|
-
var width = _a.width, height = _a.height, chart = _a.chart, theme = _a.theme, isDarkMode = _a.isDarkMode, sheetId = _a.sheetId, readonly = _a.readonly, getDomainValuesFromRange = _a.getDomainValuesFromRange, getSeriesValuesFromRange = _a.getSeriesValuesFromRange, getFormattingFromRange = _a.getFormattingFromRange, onDeleteChart = _a.onDeleteChart, onUpdateChart = _a.onUpdateChart, onRequestEdit = _a.onRequestEdit, onRequestCalculate = _a.onRequestCalculate, isSelected = _a.isSelected, fieldButtons = _a.fieldButtons, locale = _a.locale;
|
|
258
|
+
var _b, _c, _d;
|
|
259
|
+
var width = _a.width, height = _a.height, chart = _a.chart, theme = _a.theme, isDarkMode = _a.isDarkMode, sheetId = _a.sheetId, readonly = _a.readonly, getDomainValuesFromRange = _a.getDomainValuesFromRange, getSeriesValuesFromRange = _a.getSeriesValuesFromRange, getFormattingFromRange = _a.getFormattingFromRange, onDeleteChart = _a.onDeleteChart, onUpdateChart = _a.onUpdateChart, onRequestEdit = _a.onRequestEdit, onRequestCalculate = _a.onRequestCalculate, isSelected = _a.isSelected, fieldButtons = _a.fieldButtons, locale = _a.locale, enable3D = _a.enable3D;
|
|
259
260
|
var spec = chart.spec;
|
|
260
261
|
var explicitChartTitle = (_b = chart.spec.title) !== null && _b !== void 0 ? _b : undefined;
|
|
261
262
|
var hierarchyTitleRef = (0, react_1.useRef)(explicitChartTitle);
|
|
@@ -310,7 +311,7 @@ var BasicChart = function (_a) {
|
|
|
310
311
|
// the chart upgrades from the immediate 2-D fallback to true 3-D.
|
|
311
312
|
var renderedIn3D = (0, react_1.useRef)(false);
|
|
312
313
|
var glUpgradeRequested = (0, react_1.useRef)(false);
|
|
313
|
-
var
|
|
314
|
+
var _e = tslib_1.__read((0, react_1.useState)(0), 2), glUpgradeTick = _e[0], setGlUpgradeTick = _e[1];
|
|
314
315
|
// Region-map (choropleth) pipeline state. The map option (geo +
|
|
315
316
|
// visualMap) doesn't merge back into a cartesian one, so the instance
|
|
316
317
|
// is re-initialized when entering/leaving the region-map rendering.
|
|
@@ -429,14 +430,14 @@ var BasicChart = function (_a) {
|
|
|
429
430
|
* Triggers a chart update
|
|
430
431
|
*/
|
|
431
432
|
var updateChart = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
432
|
-
var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, boxplotOverlayAxis, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, linkedLabel, resolvedLabel, _b, xValues, sizeValues_1, sharedXValues, sharedSizeValues, _c, categories_1, preparedSeries, sizeValues, sizeScale_1, bubblePalette_1, bubbleItemColor_1, hasBubbleSecondaryAxis, xAxisConfig, tooltipFormatter, bubbleSeriesLabelFor_1, bubbleSeries, bubbleOverlays, bubbleLegend, bubbleBand, hierarchyRows, headerTitle, hierarchyPalette, isTreemap, banner, hierarchyData, rootName, drillDown, seriesDisplayName, hierarchyDepth, levels, hierarchyLegend, legendShown, categoryLegendSeries, sizeNumberFormat_1, tooltipFormatter, hierarchyDataLabels, hierarchyLabelOpts, hierarchyLabel, hierarchyBand, isContour, categories_2, contourSeriesInputs, _d, _e, seriesEntry, dataLabel, _f, _g, _h, values, e_1_1, seriesNames_1, contourPoints, _j, zMin, zMax, contourFormats_1, contourLabel, categories_3, threeDSeriesInputs, _k, _l, seriesEntry, dataLabel, _m, _o, _p, values, e_2_1, seriesNames_2, threeDPalette_1, seriesColorAt_1, categoryAxisLabel, seriesAxisLabel, stackedBar3D_1, threeDFormats_1, threeDTooltipFormatter, threeDSeries, visualMap, xAxis3D, yAxis3D, categoryCount, categoryTotals_1, threeDSeriesInputs_1, threeDSeriesInputs_1_1, entry, isPercent_1, surfacePoints, _q, zMin, zMax, skipHeaders, categories, radarSeriesInputs, _r, _s, seriesEntry, label, values, radarAxisOptions_1, indicators_1, radarData, radarStyle_1, radarColors_1, radarFormats_1, radarDataLabels_1, radarSeriesLabelFor_1, radarTooltipFormatter, radarLegend, radarBand, radarPlotWidth, radarPlotHeight, radarGeometry, variant_1, categories, seriesValues, stockFormats_1, stockRoleIndex_1, stockFormatFor_1, stockDataLabels_1, stockSeriesLabelFor_1, upColor_1, downColor_1, volumePoints, hasVolume, stockGrid, baseStockXAxis, stockXAxis, volumeYAxis, volumeSeries, stockAxisPointer, candleData, lineSeries, stockColors_1, isStacked, isCircularChart, isOfPie, ofPieLayout, isHorizontalBarChart, shouldAggregate, primaryDomainSource, rawPrimaryDomainValues, aggregateDomainValues, categoryLevels, pushSeriesOverlays, sideBySideBarCount, specBarGap, specBarCategoryGap, seriesPalette, paletteColorAt, _loop_1, _t, _u, _v, specSeriesIndex, series, e_3_1, labels, seriesEntry, rawValues, _w, main_1, secondary, otherTotal, total, ofPieType_1, secondScale, halfAngle_1, hasSecondary, MAIN_CX_1, CY_1, MAIN_RADIUS_PCT_1, SECONDARY_CX_1, secondaryRadiusPct_1, BAR_LEFT_1, BAR_RIGHT, barHalfFrac_1, ofPiePalette_1, paletteAt_1, connectorColor_1, primaryDomainSource_1, rawDomainValues, labels, seriesEntry, rawValues_1, totalIndices, steps, accent_1, decreaseColor_1, totalColor_1, pointColors_1, _x, _y, dp, connectors, primaryDomainSource_2, rawDomainValues, labels_1, seriesEntry, rawValues, funnelPalette, funnelColor_1, stageColors_1, _z, _0, dp, funnelData, funnelLayout, funnelLabelsOff, quartileMethod_1, showOutliers_1, showMeanMarker_1, showInnerPoints_1, showMeanLine_1, boxDomainSource, boxCategories_2, grouped_1, groups_1, boxCategories_1, boxCategories_1_1, c, boxSeriesSpecs, slots, boxGap, boxPlotWidth, boxBand_1, boxWidthMax_1, boxCount_1, boxCentre_1, boxLegend_1, rawValues, histogramDomainSource, histogramCategories, _1, labels, counts, isPareto_1, cumulativePercents, pareto, histogramSeries, histogramColor, paretoLineColor, renderedSeriesCount, replaceMerge, valueAxisBase, isPareto, hasSecondaryAxis, isPercentStackedBars, primaryAxisNumberFormat, secondaryAxisNumberFormat, axisNumberFormatFor, seriesNumberFormats, seriesNumberFormatFor, tooltipConfig, finalLegend, bottomAxisNameGap, legendBand, positionedLegend, gridConfig, chartDataLabels, seriesLabelOptionFor, isDoughnut, doughnutHoleSize, doughnutSeriesOrder, doughnutRingSet, explosion, explosionOffset, barSeries, len, categoryTotals_2, barSeries_1, barSeries_1_1, s, i, raw, n, barSeries_2, barSeries_2_1, s, seriesWithLabels;
|
|
433
|
+
var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, boxplotOverlayAxis, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, linkedLabel, resolvedLabel, _b, xValues, sizeValues_1, sharedXValues, sharedSizeValues, _c, categories_1, preparedSeries, sizeValues, sizeScale_1, bubblePalette_1, bubbleItemColor_1, hasBubbleSecondaryAxis, xAxisConfig, tooltipFormatter, bubbleSeriesLabelFor_1, bubbleSeries, bubbleOverlays, bubbleLegend, bubbleBand, hierarchyRows, headerTitle, hierarchyPalette, isTreemap, banner, hierarchyData, rootName, drillDown, seriesDisplayName, hierarchyDepth, levels, hierarchyLegend, legendShown, categoryLegendSeries, sizeNumberFormat_1, tooltipFormatter, hierarchyDataLabels, hierarchyLabelOpts, hierarchyLabel, hierarchyBand, isContour, categories_2, contourSeriesInputs, _d, _e, seriesEntry, dataLabel, _f, _g, _h, values, e_1_1, seriesNames_1, contourPoints, _j, zMin, zMax, contourFormats_1, contourLabel, categories_3, threeDSeriesInputs, _k, _l, seriesEntry, dataLabel, _m, _o, _p, values, e_2_1, seriesNames_2, threeDPalette_1, seriesColorAt_1, categoryAxisLabel, seriesAxisLabel, stackedBar3D_1, threeDFormats_1, threeDTooltipFormatter, threeDSeries, visualMap, xAxis3D, yAxis3D, categoryCount, categoryTotals_1, threeDSeriesInputs_1, threeDSeriesInputs_1_1, entry, isPercent_1, surfacePoints, _q, zMin, zMax, error_1, skipHeaders, categories, radarSeriesInputs, _r, _s, seriesEntry, label, values, radarAxisOptions_1, indicators_1, radarData, radarStyle_1, radarColors_1, radarFormats_1, radarDataLabels_1, radarSeriesLabelFor_1, radarTooltipFormatter, radarLegend, radarBand, radarPlotWidth, radarPlotHeight, radarGeometry, variant_1, categories, seriesValues, stockFormats_1, stockRoleIndex_1, stockFormatFor_1, stockDataLabels_1, stockSeriesLabelFor_1, upColor_1, downColor_1, volumePoints, hasVolume, stockGrid, baseStockXAxis, stockXAxis, volumeYAxis, volumeSeries, stockAxisPointer, candleData, lineSeries, stockColors_1, isStacked, isCircularChart, isOfPie, ofPieLayout, isHorizontalBarChart, shouldAggregate, primaryDomainSource, rawPrimaryDomainValues, aggregateDomainValues, categoryLevels, pushSeriesOverlays, sideBySideBarCount, specBarGap, specBarCategoryGap, seriesPalette, paletteColorAt, _loop_1, _t, _u, _v, specSeriesIndex, series, e_3_1, labels, seriesEntry, rawValues, _w, main_1, secondary, otherTotal, total, ofPieType_1, secondScale, halfAngle_1, hasSecondary, MAIN_CX_1, CY_1, MAIN_RADIUS_PCT_1, SECONDARY_CX_1, secondaryRadiusPct_1, BAR_LEFT_1, BAR_RIGHT, barHalfFrac_1, ofPiePalette_1, paletteAt_1, connectorColor_1, primaryDomainSource_1, rawDomainValues, labels, seriesEntry, rawValues_1, totalIndices, steps, accent_1, decreaseColor_1, totalColor_1, pointColors_1, _x, _y, dp, connectors, primaryDomainSource_2, rawDomainValues, labels_1, seriesEntry, rawValues, funnelPalette, funnelColor_1, stageColors_1, _z, _0, dp, funnelData, funnelLayout, funnelLabelsOff, quartileMethod_1, showOutliers_1, showMeanMarker_1, showInnerPoints_1, showMeanLine_1, boxDomainSource, boxCategories_2, grouped_1, groups_1, boxCategories_1, boxCategories_1_1, c, boxSeriesSpecs, slots, boxGap, boxPlotWidth, boxBand_1, boxWidthMax_1, boxCount_1, boxCentre_1, boxLegend_1, rawValues, histogramDomainSource, histogramCategories, _1, labels, counts, isPareto_1, cumulativePercents, pareto, histogramSeries, histogramColor, paretoLineColor, renderedSeriesCount, replaceMerge, valueAxisBase, isPareto, hasSecondaryAxis, isPercentStackedBars, primaryAxisNumberFormat, secondaryAxisNumberFormat, axisNumberFormatFor, seriesNumberFormats, seriesNumberFormatFor, tooltipConfig, finalLegend, bottomAxisNameGap, legendBand, positionedLegend, gridConfig, chartDataLabels, seriesLabelOptionFor, isDoughnut, doughnutHoleSize, doughnutSeriesOrder, doughnutRingSet, explosion, explosionOffset, barSeries, len, categoryTotals_2, barSeries_1, barSeries_1_1, s, i, raw, n, barSeries_2, barSeries_2_1, s, seriesWithLabels;
|
|
433
434
|
var e_1, _2, e_2, _3, e_4, _4, e_5, _5, e_3, _6, e_6, _7, e_7, _8, e_8, _9, e_9, _10, e_10, _11;
|
|
434
|
-
var _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, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187;
|
|
435
|
-
return tslib_1.__generator(this, function (
|
|
436
|
-
switch (
|
|
435
|
+
var _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, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188;
|
|
436
|
+
return tslib_1.__generator(this, function (_189) {
|
|
437
|
+
switch (_189.label) {
|
|
437
438
|
case 0:
|
|
438
439
|
(0, utils_1.debug)("Updating chart", chart);
|
|
439
|
-
threeDRenderKind = (0, three_d_1.resolve3DRenderKind)(spec.sourceChartType);
|
|
440
|
+
threeDRenderKind = (0, three_d_1.resolve3DRenderKind)(spec.sourceChartType, { enable3D: enable3D });
|
|
440
441
|
canRender3D = threeDRenderKind !== null && (0, webgl_1.isWebGLAvailable)();
|
|
441
442
|
willRender3D = canRender3D && (0, echarts_gl_loader_1.getEchartsGlState)() === "ready";
|
|
442
443
|
if (canRender3D && !willRender3D && (0, echarts_gl_loader_1.getEchartsGlState)() !== "failed") {
|
|
@@ -484,7 +485,7 @@ var BasicChart = function (_a) {
|
|
|
484
485
|
geoScope = (0, region_map_1.resolveGeoScope)(regionSpec.geoScope);
|
|
485
486
|
return [4 /*yield*/, (0, region_map_loader_1.loadRegionMapGeo)(geoScope)];
|
|
486
487
|
case 1:
|
|
487
|
-
geo =
|
|
488
|
+
geo = _189.sent();
|
|
488
489
|
// Entering the region map from a cartesian render: the previous
|
|
489
490
|
// grid/axis option doesn't merge into the map one, so start from
|
|
490
491
|
// a bare instance (theme options are re-applied after setOption).
|
|
@@ -599,7 +600,7 @@ var BasicChart = function (_a) {
|
|
|
599
600
|
});
|
|
600
601
|
seriesInputs = [];
|
|
601
602
|
i = 0;
|
|
602
|
-
|
|
603
|
+
_189.label = 3;
|
|
603
604
|
case 3:
|
|
604
605
|
if (!(i < spec.series.length)) return [3 /*break*/, 7];
|
|
605
606
|
seriesEntry = spec.series[i];
|
|
@@ -609,13 +610,13 @@ var BasicChart = function (_a) {
|
|
|
609
610
|
_b = chart_spec_utils_1.coerceCalculatedLabel;
|
|
610
611
|
return [4 /*yield*/, onRequestCalculate(resolvedLabel, (_21 = position.sheetId) !== null && _21 !== void 0 ? _21 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
611
612
|
case 4:
|
|
612
|
-
resolvedLabel = _b.apply(void 0, [
|
|
613
|
-
|
|
613
|
+
resolvedLabel = _b.apply(void 0, [_189.sent()]);
|
|
614
|
+
_189.label = 5;
|
|
614
615
|
case 5:
|
|
615
616
|
xValues = (_22 = perSeriesX[i]) !== null && _22 !== void 0 ? _22 : perSeriesX[0];
|
|
616
617
|
sizeValues_1 = (_23 = perSeriesSize[i]) !== null && _23 !== void 0 ? _23 : perSeriesSize[0];
|
|
617
618
|
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 } : {})));
|
|
618
|
-
|
|
619
|
+
_189.label = 6;
|
|
619
620
|
case 6:
|
|
620
621
|
i++;
|
|
621
622
|
return [3 /*break*/, 3];
|
|
@@ -977,11 +978,11 @@ var BasicChart = function (_a) {
|
|
|
977
978
|
if (!isContour) return [3 /*break*/, 21];
|
|
978
979
|
categories_2 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
979
980
|
contourSeriesInputs = [];
|
|
980
|
-
|
|
981
|
+
_189.label = 9;
|
|
981
982
|
case 9:
|
|
982
|
-
|
|
983
|
+
_189.trys.push([9, 18, 19, 20]);
|
|
983
984
|
_d = tslib_1.__values((_55 = spec.series) !== null && _55 !== void 0 ? _55 : []), _e = _d.next();
|
|
984
|
-
|
|
985
|
+
_189.label = 10;
|
|
985
986
|
case 10:
|
|
986
987
|
if (!!_e.done) return [3 /*break*/, 17];
|
|
987
988
|
seriesEntry = _e.value;
|
|
@@ -993,25 +994,25 @@ var BasicChart = function (_a) {
|
|
|
993
994
|
_h = chart_spec_utils_1.coerceCalculatedLabel;
|
|
994
995
|
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_57 = position.sheetId) !== null && _57 !== void 0 ? _57 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
995
996
|
case 12:
|
|
996
|
-
_g = _h.apply(void 0, [
|
|
997
|
+
_g = _h.apply(void 0, [_189.sent()]);
|
|
997
998
|
return [3 /*break*/, 14];
|
|
998
999
|
case 13:
|
|
999
1000
|
_g = (_58 = seriesEntry.dataLabel) !== null && _58 !== void 0 ? _58 : "";
|
|
1000
|
-
|
|
1001
|
+
_189.label = 14;
|
|
1001
1002
|
case 14:
|
|
1002
1003
|
_f = (_g);
|
|
1003
|
-
|
|
1004
|
+
_189.label = 15;
|
|
1004
1005
|
case 15:
|
|
1005
1006
|
dataLabel = _f;
|
|
1006
1007
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
|
|
1007
1008
|
contourSeriesInputs.push({ name: dataLabel, values: values });
|
|
1008
|
-
|
|
1009
|
+
_189.label = 16;
|
|
1009
1010
|
case 16:
|
|
1010
1011
|
_e = _d.next();
|
|
1011
1012
|
return [3 /*break*/, 10];
|
|
1012
1013
|
case 17: return [3 /*break*/, 20];
|
|
1013
1014
|
case 18:
|
|
1014
|
-
e_1_1 =
|
|
1015
|
+
e_1_1 = _189.sent();
|
|
1015
1016
|
e_1 = { error: e_1_1 };
|
|
1016
1017
|
return [3 /*break*/, 20];
|
|
1017
1018
|
case 19:
|
|
@@ -1116,14 +1117,14 @@ var BasicChart = function (_a) {
|
|
|
1116
1117
|
previousSeriesCount.current = 1;
|
|
1117
1118
|
return [2 /*return*/];
|
|
1118
1119
|
case 21:
|
|
1119
|
-
if (!(willRender3D && threeDRenderKind)) return [3 /*break*/,
|
|
1120
|
+
if (!(willRender3D && threeDRenderKind)) return [3 /*break*/, 38];
|
|
1120
1121
|
categories_3 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1121
1122
|
threeDSeriesInputs = [];
|
|
1122
|
-
|
|
1123
|
+
_189.label = 22;
|
|
1123
1124
|
case 22:
|
|
1124
|
-
|
|
1125
|
+
_189.trys.push([22, 31, 32, 33]);
|
|
1125
1126
|
_k = tslib_1.__values((_62 = spec.series) !== null && _62 !== void 0 ? _62 : []), _l = _k.next();
|
|
1126
|
-
|
|
1127
|
+
_189.label = 23;
|
|
1127
1128
|
case 23:
|
|
1128
1129
|
if (!!_l.done) return [3 /*break*/, 30];
|
|
1129
1130
|
seriesEntry = _l.value;
|
|
@@ -1135,25 +1136,25 @@ var BasicChart = function (_a) {
|
|
|
1135
1136
|
_p = chart_spec_utils_1.coerceCalculatedLabel;
|
|
1136
1137
|
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_64 = position.sheetId) !== null && _64 !== void 0 ? _64 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
1137
1138
|
case 25:
|
|
1138
|
-
_o = _p.apply(void 0, [
|
|
1139
|
+
_o = _p.apply(void 0, [_189.sent()]);
|
|
1139
1140
|
return [3 /*break*/, 27];
|
|
1140
1141
|
case 26:
|
|
1141
1142
|
_o = (_65 = seriesEntry.dataLabel) !== null && _65 !== void 0 ? _65 : "";
|
|
1142
|
-
|
|
1143
|
+
_189.label = 27;
|
|
1143
1144
|
case 27:
|
|
1144
1145
|
_m = (_o);
|
|
1145
|
-
|
|
1146
|
+
_189.label = 28;
|
|
1146
1147
|
case 28:
|
|
1147
1148
|
dataLabel = _m;
|
|
1148
1149
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
|
|
1149
1150
|
threeDSeriesInputs.push({ name: dataLabel, values: values });
|
|
1150
|
-
|
|
1151
|
+
_189.label = 29;
|
|
1151
1152
|
case 29:
|
|
1152
1153
|
_l = _k.next();
|
|
1153
1154
|
return [3 /*break*/, 23];
|
|
1154
1155
|
case 30: return [3 /*break*/, 33];
|
|
1155
1156
|
case 31:
|
|
1156
|
-
e_2_1 =
|
|
1157
|
+
e_2_1 = _189.sent();
|
|
1157
1158
|
e_2 = { error: e_2_1 };
|
|
1158
1159
|
return [3 /*break*/, 33];
|
|
1159
1160
|
case 32:
|
|
@@ -1322,6 +1323,9 @@ var BasicChart = function (_a) {
|
|
|
1322
1323
|
inRange: { color: tslib_1.__spreadArray([], tslib_1.__read(three_d_1.SURFACE_COLOR_RAMP), false) },
|
|
1323
1324
|
};
|
|
1324
1325
|
}
|
|
1326
|
+
_189.label = 34;
|
|
1327
|
+
case 34:
|
|
1328
|
+
_189.trys.push([34, 35, , 37]);
|
|
1325
1329
|
(_66 = chartRef.current) === null || _66 === void 0 ? void 0 : _66.setOption(tslib_1.__assign(tslib_1.__assign({ tooltip: {
|
|
1326
1330
|
textStyle: { fontSize: 12 },
|
|
1327
1331
|
formatter: threeDTooltipFormatter,
|
|
@@ -1341,6 +1345,27 @@ var BasicChart = function (_a) {
|
|
|
1341
1345
|
"tooltip",
|
|
1342
1346
|
],
|
|
1343
1347
|
});
|
|
1348
|
+
return [3 /*break*/, 37];
|
|
1349
|
+
case 35:
|
|
1350
|
+
error_1 = _189.sent();
|
|
1351
|
+
(0, echarts_gl_loader_1.markEchartsGlFailed)(error_1);
|
|
1352
|
+
try {
|
|
1353
|
+
(_69 = chartRef.current) === null || _69 === void 0 ? void 0 : _69.dispose();
|
|
1354
|
+
}
|
|
1355
|
+
catch (_190) {
|
|
1356
|
+
// A GL instance that threw mid-build may not dispose cleanly.
|
|
1357
|
+
}
|
|
1358
|
+
chartRef.current = undefined;
|
|
1359
|
+
renderedIn3D.current = false;
|
|
1360
|
+
previousChartType.current = undefined;
|
|
1361
|
+
previousSeriesCount.current = undefined;
|
|
1362
|
+
initializeChart();
|
|
1363
|
+
applyThemeOptions();
|
|
1364
|
+
return [4 /*yield*/, updateChart()];
|
|
1365
|
+
case 36:
|
|
1366
|
+
_189.sent();
|
|
1367
|
+
return [2 /*return*/];
|
|
1368
|
+
case 37:
|
|
1344
1369
|
// Re-apply theme-derived title / palette / tooltip colors — lost
|
|
1345
1370
|
// when the instance was re-initialized on entry into 3-D.
|
|
1346
1371
|
renderedIn3D.current = true;
|
|
@@ -1348,7 +1373,7 @@ var BasicChart = function (_a) {
|
|
|
1348
1373
|
previousChartType.current = spec.chartType;
|
|
1349
1374
|
previousSeriesCount.current = threeDSeries.length;
|
|
1350
1375
|
return [2 /*return*/];
|
|
1351
|
-
case
|
|
1376
|
+
case 38:
|
|
1352
1377
|
// ---------------------------- Radar ----------------------------
|
|
1353
1378
|
// Radar is polar: a top-level `radar.indicator` list (one axis per
|
|
1354
1379
|
// category) plus one `radar`-type series carrying every data series'
|
|
@@ -1358,9 +1383,9 @@ var BasicChart = function (_a) {
|
|
|
1358
1383
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders);
|
|
1359
1384
|
radarSeriesInputs = [];
|
|
1360
1385
|
try {
|
|
1361
|
-
for (_r = tslib_1.__values((
|
|
1386
|
+
for (_r = tslib_1.__values((_70 = spec.series) !== null && _70 !== void 0 ? _70 : []), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1362
1387
|
seriesEntry = _s.value;
|
|
1363
|
-
label = (
|
|
1388
|
+
label = (_71 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _71 !== void 0 ? _71 : (seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
|
|
1364
1389
|
? seriesEntry.dataLabel
|
|
1365
1390
|
: "");
|
|
1366
1391
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
@@ -1377,7 +1402,7 @@ var BasicChart = function (_a) {
|
|
|
1377
1402
|
radarAxisOptions_1 = spec.valueAxisOptions;
|
|
1378
1403
|
indicators_1 = (0, radar_1.buildRadarIndicators)(categories, radarSeriesInputs, radarAxisOptions_1);
|
|
1379
1404
|
radarData = (0, radar_1.buildRadarSeriesData)(radarSeriesInputs, indicators_1.length);
|
|
1380
|
-
radarStyle_1 = (
|
|
1405
|
+
radarStyle_1 = (_72 = spec.radarStyle) !== null && _72 !== void 0 ? _72 : "standard";
|
|
1381
1406
|
radarColors_1 = radarSeriesInputs.map(function (_, i) { var _a, _b; return (_b = (_a = spec.series) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.color; });
|
|
1382
1407
|
radarFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
|
|
1383
1408
|
radarDataLabels_1 = spec.dataLabels;
|
|
@@ -1396,15 +1421,15 @@ var BasicChart = function (_a) {
|
|
|
1396
1421
|
};
|
|
1397
1422
|
radarLegend = (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, legend), { show: radarData.length > 1, data: radarData.map(function (d) { return d.name; }) }), spec.legend);
|
|
1398
1423
|
radarBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
1399
|
-
position: (
|
|
1424
|
+
position: (_73 = spec.legend) === null || _73 === void 0 ? void 0 : _73.position,
|
|
1400
1425
|
visible: radarLegend.show !== false,
|
|
1401
1426
|
labels: radarData.map(function (d) { return d.name; }),
|
|
1402
|
-
legendFontSize: (
|
|
1427
|
+
legendFontSize: (_78 = (_75 = (_74 = radarLegend.textStyle) === null || _74 === void 0 ? void 0 : _74.fontSize) !== null && _75 !== void 0 ? _75 : (_77 = (_76 = spec.legend) === null || _76 === void 0 ? void 0 : _76.textFormat) === null || _77 === void 0 ? void 0 : _77.fontSize) !== null && _78 !== void 0 ? _78 : 12,
|
|
1403
1428
|
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
1404
1429
|
width: width !== null && width !== void 0 ? width : 0,
|
|
1405
1430
|
height: height !== null && height !== void 0 ? height : 0,
|
|
1406
1431
|
hasTitle: Boolean(explicitChartTitle),
|
|
1407
|
-
titleFontSize: (
|
|
1432
|
+
titleFontSize: (_80 = (_79 = spec.titleTextFormat) === null || _79 === void 0 ? void 0 : _79.fontSize) !== null && _80 !== void 0 ? _80 : 16,
|
|
1408
1433
|
hasBottomAxisTitle: false,
|
|
1409
1434
|
bottomAxisNameGap: 0,
|
|
1410
1435
|
hasLeftAxisTitle: false,
|
|
@@ -1420,7 +1445,7 @@ var BasicChart = function (_a) {
|
|
|
1420
1445
|
radius: Math.max(10, Math.min(radarPlotWidth, radarPlotHeight) / 2 - 30),
|
|
1421
1446
|
}
|
|
1422
1447
|
: {};
|
|
1423
|
-
(
|
|
1448
|
+
(_81 = chartRef.current) === null || _81 === void 0 ? void 0 : _81.setOption({
|
|
1424
1449
|
radar: tslib_1.__assign(tslib_1.__assign({}, radarGeometry), {
|
|
1425
1450
|
// The common scale's tick labels along ONE axis, as Excel draws
|
|
1426
1451
|
// them: echarts labels every indicator axis, so each indicator
|
|
@@ -1474,9 +1499,9 @@ var BasicChart = function (_a) {
|
|
|
1474
1499
|
// V-variants additionally get a volume column sub-pane below the
|
|
1475
1500
|
// price plot.
|
|
1476
1501
|
if (spec.chartType === "stock") {
|
|
1477
|
-
variant_1 = ((
|
|
1502
|
+
variant_1 = ((_82 = spec.stockVariant) !== null && _82 !== void 0 ? _82 : "HLC");
|
|
1478
1503
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1479
|
-
seriesValues = ((
|
|
1504
|
+
seriesValues = ((_83 = spec.series) !== null && _83 !== void 0 ? _83 : []).map(function (seriesEntry) {
|
|
1480
1505
|
return flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
1481
1506
|
});
|
|
1482
1507
|
stockFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
|
|
@@ -1494,7 +1519,7 @@ var BasicChart = function (_a) {
|
|
|
1494
1519
|
upColor_1 = theme.themeColors.accent1;
|
|
1495
1520
|
downColor_1 = theme.themeColors.accent2;
|
|
1496
1521
|
volumePoints = (0, stock_1.toVolumeSeries)(seriesValues, variant_1);
|
|
1497
|
-
hasVolume = ((
|
|
1522
|
+
hasVolume = ((_84 = volumePoints === null || volumePoints === void 0 ? void 0 : volumePoints.length) !== null && _84 !== void 0 ? _84 : 0) > 0;
|
|
1498
1523
|
stockGrid = hasVolume
|
|
1499
1524
|
? [
|
|
1500
1525
|
{ left: "10%", right: "4%", top: "8%", height: "56%" },
|
|
@@ -1508,7 +1533,7 @@ var BasicChart = function (_a) {
|
|
|
1508
1533
|
axisLine: { show: true },
|
|
1509
1534
|
axisTick: { show: true },
|
|
1510
1535
|
splitLine: { show: false },
|
|
1511
|
-
name: (
|
|
1536
|
+
name: (_85 = spec.horizontalAxisTitle) !== null && _85 !== void 0 ? _85 : "",
|
|
1512
1537
|
nameLocation: "middle",
|
|
1513
1538
|
nameGap: 30,
|
|
1514
1539
|
}, spec.categoryAxisOptions);
|
|
@@ -1550,14 +1575,14 @@ var BasicChart = function (_a) {
|
|
|
1550
1575
|
// (no open) fall through to the line-derived rendering below.
|
|
1551
1576
|
if (variant_1 === "OHLC" || variant_1 === "VOHLC") {
|
|
1552
1577
|
candleData = (0, stock_1.toCandlestick)(seriesValues, variant_1);
|
|
1553
|
-
(
|
|
1578
|
+
(_86 = chartRef.current) === null || _86 === void 0 ? void 0 : _86.setOption({
|
|
1554
1579
|
xAxis: stockXAxis,
|
|
1555
1580
|
yAxis: tslib_1.__spreadArray([
|
|
1556
1581
|
(0, overrides_1.applyAxisOverrides)({
|
|
1557
1582
|
type: "value",
|
|
1558
1583
|
show: true,
|
|
1559
1584
|
scale: true,
|
|
1560
|
-
name: (
|
|
1585
|
+
name: (_87 = spec.verticalAxisTitle) !== null && _87 !== void 0 ? _87 : "",
|
|
1561
1586
|
nameLocation: "middle",
|
|
1562
1587
|
nameGap: 50,
|
|
1563
1588
|
gridIndex: 0,
|
|
@@ -1602,13 +1627,13 @@ var BasicChart = function (_a) {
|
|
|
1602
1627
|
theme.themeColors.accent3,
|
|
1603
1628
|
theme.themeColors.accent4,
|
|
1604
1629
|
]);
|
|
1605
|
-
(
|
|
1630
|
+
(_88 = chartRef.current) === null || _88 === void 0 ? void 0 : _88.setOption({
|
|
1606
1631
|
xAxis: stockXAxis,
|
|
1607
1632
|
yAxis: tslib_1.__spreadArray([
|
|
1608
1633
|
(0, overrides_1.applyAxisOverrides)({
|
|
1609
1634
|
type: "value",
|
|
1610
1635
|
show: true,
|
|
1611
|
-
name: (
|
|
1636
|
+
name: (_89 = spec.verticalAxisTitle) !== null && _89 !== void 0 ? _89 : "",
|
|
1612
1637
|
nameLocation: "middle",
|
|
1613
1638
|
nameGap: 50,
|
|
1614
1639
|
gridIndex: 0,
|
|
@@ -1647,14 +1672,14 @@ var BasicChart = function (_a) {
|
|
|
1647
1672
|
ofPieLayout = null;
|
|
1648
1673
|
isHorizontalBarChart = spec.chartType === "bar";
|
|
1649
1674
|
shouldAggregate = (0, aggregation_1.shouldAggregateSeries)(spec.series);
|
|
1650
|
-
primaryDomainSource = (
|
|
1675
|
+
primaryDomainSource = (_92 = (_91 = (_90 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _90 === void 0 ? void 0 : _90[0]) === null || _91 === void 0 ? void 0 : _91.sources) === null || _92 === void 0 ? void 0 : _92[0];
|
|
1651
1676
|
rawPrimaryDomainValues = primaryDomainSource
|
|
1652
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
1677
|
+
? (0, aggregation_1.sanitizeDomainValues)((_93 = getDomainValuesFromRange(primaryDomainSource, spec.hiddenDimensionStrategy)) !== null && _93 !== void 0 ? _93 : [])
|
|
1653
1678
|
: [];
|
|
1654
1679
|
aggregateDomainValues = (0, aggregation_1.getDomainValuesForAxis)(rawPrimaryDomainValues, shouldAggregate);
|
|
1655
1680
|
categoryLevels = isCircularChart
|
|
1656
1681
|
? undefined
|
|
1657
|
-
: (0, category_levels_1.resolveCategoryLevels)((
|
|
1682
|
+
: (0, category_levels_1.resolveCategoryLevels)((_94 = spec.categoryLevels) === null || _94 === void 0 ? void 0 : _94.map(function (level) {
|
|
1658
1683
|
return flattenChartDataValues([level], getDomainValuesFromRange, spec.hiddenDimensionStrategy, false);
|
|
1659
1684
|
}));
|
|
1660
1685
|
if (categoryLevels) {
|
|
@@ -1665,15 +1690,15 @@ var BasicChart = function (_a) {
|
|
|
1665
1690
|
axisTick: { show: true },
|
|
1666
1691
|
splitLine: { show: true },
|
|
1667
1692
|
name: isHorizontalBarChart
|
|
1668
|
-
? (
|
|
1669
|
-
: (
|
|
1693
|
+
? (_95 = spec.verticalAxisTitle) !== null && _95 !== void 0 ? _95 : ""
|
|
1694
|
+
: (_96 = spec.horizontalAxisTitle) !== null && _96 !== void 0 ? _96 : "",
|
|
1670
1695
|
nameLocation: "middle",
|
|
1671
1696
|
nameGap: CATEGORY_AXIS_NAME_GAP + 24 * categoryLevels.outer.length,
|
|
1672
1697
|
})), false));
|
|
1673
1698
|
}
|
|
1674
1699
|
// One category axis per domain (Excel): a domain drawn from several
|
|
1675
1700
|
// ranges lists their categories in sequence on that single axis.
|
|
1676
|
-
(categoryLevels ? [] : (
|
|
1701
|
+
(categoryLevels ? [] : (_97 = spec.domains) !== null && _97 !== void 0 ? _97 : []).forEach(function (domain, domainIndex) {
|
|
1677
1702
|
var _a, _b;
|
|
1678
1703
|
var axisData = domain.sources.flatMap(function (sheetRange, sourceIndex) {
|
|
1679
1704
|
var _a;
|
|
@@ -1709,8 +1734,8 @@ var BasicChart = function (_a) {
|
|
|
1709
1734
|
splitLine: { show: true },
|
|
1710
1735
|
gridIndex: 0,
|
|
1711
1736
|
name: isHorizontalBarChart
|
|
1712
|
-
? (
|
|
1713
|
-
: (
|
|
1737
|
+
? (_98 = spec.verticalAxisTitle) !== null && _98 !== void 0 ? _98 : ""
|
|
1738
|
+
: (_99 = spec.horizontalAxisTitle) !== null && _99 !== void 0 ? _99 : "",
|
|
1714
1739
|
nameLocation: "middle",
|
|
1715
1740
|
nameGap: CATEGORY_AXIS_NAME_GAP,
|
|
1716
1741
|
});
|
|
@@ -1742,7 +1767,7 @@ var BasicChart = function (_a) {
|
|
|
1742
1767
|
};
|
|
1743
1768
|
sideBySideBarCount = isStacked
|
|
1744
1769
|
? 1
|
|
1745
|
-
: ((
|
|
1770
|
+
: ((_100 = spec.series) !== null && _100 !== void 0 ? _100 : []).reduce(function (count, s) {
|
|
1746
1771
|
var _a;
|
|
1747
1772
|
var seriesType = (_a = s.seriesChartType) !== null && _a !== void 0 ? _a : spec.chartType;
|
|
1748
1773
|
return seriesType === "bar" || seriesType === "column"
|
|
@@ -1766,36 +1791,36 @@ var BasicChart = function (_a) {
|
|
|
1766
1791
|
return (0, utils_1.chartPaletteColorAt)(seriesPalette, index);
|
|
1767
1792
|
};
|
|
1768
1793
|
_loop_1 = function (specSeriesIndex, series) {
|
|
1769
|
-
var dataLabel,
|
|
1770
|
-
var e_12,
|
|
1771
|
-
return tslib_1.__generator(this, function (
|
|
1772
|
-
switch (
|
|
1794
|
+
var dataLabel, _191, _192, _193, effectiveChartType, lineLike, domainSources, pieDomainLabels, piePointOffset, data, seriesEchartsType, seriesStyleAttrs, seriesEntry, isBarOrColumn, seriesAny, markerSymbol, wantsMarkers, labelsWithoutMarkers, isolated, marked, isolated_1, isolated_1_1, i, gradientArgs, gradient, overrides_3, _194, _195, dp, fallback_1, overrides_4, _196, _197, dp, positiveColor_1, negativeColor_1;
|
|
1795
|
+
var e_12, _198, e_13, _199, e_14, _200;
|
|
1796
|
+
return tslib_1.__generator(this, function (_201) {
|
|
1797
|
+
switch (_201.label) {
|
|
1773
1798
|
case 0:
|
|
1774
|
-
if (!((
|
|
1775
|
-
|
|
1799
|
+
if (!((_102 = (0, series_name_1.linkedSeriesName)(series, getDomainValuesFromRange)) !== null && _102 !== void 0)) return [3 /*break*/, 1];
|
|
1800
|
+
_191 = _102;
|
|
1776
1801
|
return [3 /*break*/, 5];
|
|
1777
1802
|
case 1:
|
|
1778
1803
|
if (!(!(0, utils_1.isNil)(series.dataLabel) && (0, utils_1.isAFormula)(series.dataLabel))) return [3 /*break*/, 3];
|
|
1779
|
-
|
|
1780
|
-
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (
|
|
1804
|
+
_193 = chart_spec_utils_1.coerceCalculatedLabel;
|
|
1805
|
+
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (_103 = position.sheetId) !== null && _103 !== void 0 ? _103 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
1781
1806
|
case 2:
|
|
1782
|
-
|
|
1807
|
+
_192 = _193.apply(void 0, [_201.sent()]);
|
|
1783
1808
|
return [3 /*break*/, 4];
|
|
1784
1809
|
case 3:
|
|
1785
|
-
|
|
1786
|
-
|
|
1810
|
+
_192 = (_104 = series.dataLabel) !== null && _104 !== void 0 ? _104 : "";
|
|
1811
|
+
_201.label = 4;
|
|
1787
1812
|
case 4:
|
|
1788
|
-
|
|
1789
|
-
|
|
1813
|
+
_191 = (_192);
|
|
1814
|
+
_201.label = 5;
|
|
1790
1815
|
case 5:
|
|
1791
|
-
dataLabel =
|
|
1816
|
+
dataLabel = _191;
|
|
1792
1817
|
// Label
|
|
1793
1818
|
if (dataLabel) {
|
|
1794
|
-
(
|
|
1819
|
+
(_105 = legend.data) === null || _105 === void 0 ? void 0 : _105.push(dataLabel);
|
|
1795
1820
|
}
|
|
1796
|
-
effectiveChartType = (
|
|
1821
|
+
effectiveChartType = (_106 = series.seriesChartType) !== null && _106 !== void 0 ? _106 : spec.chartType;
|
|
1797
1822
|
lineLike = (0, empty_cells_1.isLineLikeChartType)(effectiveChartType);
|
|
1798
|
-
domainSources = (
|
|
1823
|
+
domainSources = (_109 = (_108 = (_107 = spec.domains) === null || _107 === void 0 ? void 0 : _107[0]) === null || _108 === void 0 ? void 0 : _108.sources) !== null && _109 !== void 0 ? _109 : [];
|
|
1799
1824
|
pieDomainLabels = isCircularChart &&
|
|
1800
1825
|
(domainSources.length > 1 || series.sources.length > 1)
|
|
1801
1826
|
? domainSources.flatMap(function (sheetRange) {
|
|
@@ -1827,7 +1852,7 @@ var BasicChart = function (_a) {
|
|
|
1827
1852
|
seriesEntry = tslib_1.__assign(tslib_1.__assign({ type: seriesEchartsType,
|
|
1828
1853
|
// Ties the rendered series back to spec.series for click selection
|
|
1829
1854
|
// One rendered series per spec series (source index 0).
|
|
1830
|
-
id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (
|
|
1855
|
+
id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (_110 = spec.smooth) !== null && _110 !== void 0 ? _110 : undefined, radius: (_111 = spec.radius) !== null && _111 !== void 0 ? _111 : (isCircularChart ? [0, "75%"] : undefined) }, ((0, empty_cells_1.connectsAcrossEmptyCells)(spec, lineLike)
|
|
1831
1856
|
? { connectNulls: true }
|
|
1832
1857
|
: {})), seriesStyleAttrs);
|
|
1833
1858
|
// Plot this series against a secondary value axis. The 2nd
|
|
@@ -1852,17 +1877,17 @@ var BasicChart = function (_a) {
|
|
|
1852
1877
|
}
|
|
1853
1878
|
seriesAny = series;
|
|
1854
1879
|
if (effectiveChartType === "line") {
|
|
1855
|
-
markerSymbol = (
|
|
1880
|
+
markerSymbol = (_112 = seriesAny.marker) === null || _112 === void 0 ? void 0 : _112.symbol;
|
|
1856
1881
|
wantsMarkers = markerSymbol === "none"
|
|
1857
1882
|
? false
|
|
1858
1883
|
: Boolean(spec.showMarkers) || !(0, utils_1.isNil)(markerSymbol);
|
|
1859
1884
|
labelsWithoutMarkers = !wantsMarkers &&
|
|
1860
|
-
Boolean((
|
|
1885
|
+
Boolean((_113 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesAny)) === null || _113 === void 0 ? void 0 : _113.show);
|
|
1861
1886
|
seriesEntry.showSymbol = wantsMarkers || labelsWithoutMarkers;
|
|
1862
1887
|
if (wantsMarkers) {
|
|
1863
1888
|
seriesEntry.symbol =
|
|
1864
|
-
(
|
|
1865
|
-
seriesEntry.symbolSize = (
|
|
1889
|
+
(_114 = (0, helpers_1.mapMarkerSymbolToEcharts)(markerSymbol)) !== null && _114 !== void 0 ? _114 : "circle";
|
|
1890
|
+
seriesEntry.symbolSize = (_116 = (_115 = seriesAny.marker) === null || _115 === void 0 ? void 0 : _115.size) !== null && _116 !== void 0 ? _116 : 6;
|
|
1866
1891
|
}
|
|
1867
1892
|
else {
|
|
1868
1893
|
if (labelsWithoutMarkers) {
|
|
@@ -1885,7 +1910,7 @@ var BasicChart = function (_a) {
|
|
|
1885
1910
|
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1886
1911
|
finally {
|
|
1887
1912
|
try {
|
|
1888
|
-
if (isolated_1_1 && !isolated_1_1.done && (
|
|
1913
|
+
if (isolated_1_1 && !isolated_1_1.done && (_198 = isolated_1.return)) _198.call(isolated_1);
|
|
1889
1914
|
}
|
|
1890
1915
|
finally { if (e_12) throw e_12.error; }
|
|
1891
1916
|
}
|
|
@@ -1897,9 +1922,9 @@ var BasicChart = function (_a) {
|
|
|
1897
1922
|
gradientArgs = (0, gradient_1.gradientToEcharts)(series.gradient);
|
|
1898
1923
|
if (gradientArgs && !seriesAny.noFill) {
|
|
1899
1924
|
gradient = new echarts.graphic.LinearGradient(gradientArgs.x, gradientArgs.y, gradientArgs.x2, gradientArgs.y2, gradientArgs.colorStops);
|
|
1900
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1925
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_117 = seriesEntry.itemStyle) !== null && _117 !== void 0 ? _117 : {})), { color: gradient });
|
|
1901
1926
|
if (effectiveChartType === "area") {
|
|
1902
|
-
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1927
|
+
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_118 = seriesEntry.areaStyle) !== null && _118 !== void 0 ? _118 : {})), { color: gradient });
|
|
1903
1928
|
}
|
|
1904
1929
|
}
|
|
1905
1930
|
else if (seriesAny.noFill) {
|
|
@@ -1907,58 +1932,58 @@ var BasicChart = function (_a) {
|
|
|
1907
1932
|
// with `transparent` so layout is preserved but nothing
|
|
1908
1933
|
// paints. Legend entries are also suppressed via `name: ""`
|
|
1909
1934
|
// since the series carries no semantic information.
|
|
1910
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1935
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_119 = seriesEntry.itemStyle) !== null && _119 !== void 0 ? _119 : {})), { color: "transparent", borderColor: "transparent" });
|
|
1911
1936
|
}
|
|
1912
1937
|
else if (isBarOrColumn &&
|
|
1913
1938
|
Array.isArray(seriesAny.dataPointColors) &&
|
|
1914
1939
|
seriesAny.dataPointColors.length) {
|
|
1915
|
-
|
|
1940
|
+
overrides_3 = new Map();
|
|
1916
1941
|
try {
|
|
1917
|
-
for (
|
|
1918
|
-
dp =
|
|
1942
|
+
for (_194 = (e_13 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _195 = _194.next(); !_195.done; _195 = _194.next()) {
|
|
1943
|
+
dp = _195.value;
|
|
1919
1944
|
if (typeof dp.idx === "number" && typeof dp.color === "string") {
|
|
1920
|
-
|
|
1945
|
+
overrides_3.set(dp.idx, dp.color);
|
|
1921
1946
|
}
|
|
1922
1947
|
}
|
|
1923
1948
|
}
|
|
1924
1949
|
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1925
1950
|
finally {
|
|
1926
1951
|
try {
|
|
1927
|
-
if (
|
|
1952
|
+
if (_195 && !_195.done && (_199 = _194.return)) _199.call(_194);
|
|
1928
1953
|
}
|
|
1929
1954
|
finally { if (e_13) throw e_13.error; }
|
|
1930
1955
|
}
|
|
1931
|
-
fallback_1 = (
|
|
1932
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1956
|
+
fallback_1 = (_120 = series.color) !== null && _120 !== void 0 ? _120 : paletteColorAt(specSeriesIndex);
|
|
1957
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_121 = seriesEntry.itemStyle) !== null && _121 !== void 0 ? _121 : {})), { color: function (params) { var _a; return (_a = overrides_3.get(params.dataIndex)) !== null && _a !== void 0 ? _a : fallback_1; } });
|
|
1933
1958
|
}
|
|
1934
1959
|
else if (isCircularChart &&
|
|
1935
1960
|
Array.isArray(seriesAny.dataPointColors) &&
|
|
1936
1961
|
seriesAny.dataPointColors.length) {
|
|
1937
|
-
|
|
1962
|
+
overrides_4 = new Map();
|
|
1938
1963
|
try {
|
|
1939
|
-
for (
|
|
1940
|
-
dp =
|
|
1964
|
+
for (_196 = (e_14 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _197 = _196.next(); !_197.done; _197 = _196.next()) {
|
|
1965
|
+
dp = _197.value;
|
|
1941
1966
|
if (typeof dp.idx === "number" && typeof dp.color === "string") {
|
|
1942
|
-
|
|
1967
|
+
overrides_4.set(dp.idx, dp.color);
|
|
1943
1968
|
}
|
|
1944
1969
|
}
|
|
1945
1970
|
}
|
|
1946
1971
|
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1947
1972
|
finally {
|
|
1948
1973
|
try {
|
|
1949
|
-
if (
|
|
1974
|
+
if (_197 && !_197.done && (_200 = _196.return)) _200.call(_196);
|
|
1950
1975
|
}
|
|
1951
1976
|
finally { if (e_14) throw e_14.error; }
|
|
1952
1977
|
}
|
|
1953
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1978
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_122 = seriesEntry.itemStyle) !== null && _122 !== void 0 ? _122 : {})), { color: function (params) {
|
|
1954
1979
|
var _a, _b;
|
|
1955
|
-
return (_b = (_a =
|
|
1980
|
+
return (_b = (_a = overrides_4.get(params.dataIndex)) !== null && _a !== void 0 ? _a : series.color) !== null && _b !== void 0 ? _b : paletteColorAt(params.dataIndex);
|
|
1956
1981
|
} });
|
|
1957
1982
|
}
|
|
1958
1983
|
else if (isBarOrColumn && series.invertIfNegative) {
|
|
1959
|
-
positiveColor_1 = (
|
|
1960
|
-
negativeColor_1 = (
|
|
1961
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1984
|
+
positiveColor_1 = (_123 = series.color) !== null && _123 !== void 0 ? _123 : paletteColorAt(specSeriesIndex);
|
|
1985
|
+
negativeColor_1 = (_124 = series.negativeColor) !== null && _124 !== void 0 ? _124 : "#FF0000";
|
|
1986
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_125 = seriesEntry.itemStyle) !== null && _125 !== void 0 ? _125 : {})), { color: function (params) {
|
|
1962
1987
|
var _a, _b;
|
|
1963
1988
|
var value = Array.isArray(params.data)
|
|
1964
1989
|
? params.data[1]
|
|
@@ -1969,10 +1994,10 @@ var BasicChart = function (_a) {
|
|
|
1969
1994
|
} });
|
|
1970
1995
|
}
|
|
1971
1996
|
else if (series.color) {
|
|
1972
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1973
|
-
seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1997
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_126 = seriesEntry.itemStyle) !== null && _126 !== void 0 ? _126 : {})), { color: series.color });
|
|
1998
|
+
seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((_127 = seriesEntry.lineStyle) !== null && _127 !== void 0 ? _127 : {})), { color: series.color });
|
|
1974
1999
|
if (effectiveChartType === "area") {
|
|
1975
|
-
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
2000
|
+
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_128 = seriesEntry.areaStyle) !== null && _128 !== void 0 ? _128 : {})), { color: series.color });
|
|
1976
2001
|
}
|
|
1977
2002
|
}
|
|
1978
2003
|
chartSeries.push(seriesEntry);
|
|
@@ -1981,33 +2006,33 @@ var BasicChart = function (_a) {
|
|
|
1981
2006
|
}
|
|
1982
2007
|
});
|
|
1983
2008
|
};
|
|
1984
|
-
|
|
1985
|
-
case
|
|
1986
|
-
|
|
1987
|
-
_t = tslib_1.__values(((
|
|
1988
|
-
|
|
1989
|
-
case
|
|
1990
|
-
if (!!_u.done) return [3 /*break*/,
|
|
2009
|
+
_189.label = 39;
|
|
2010
|
+
case 39:
|
|
2011
|
+
_189.trys.push([39, 44, 45, 46]);
|
|
2012
|
+
_t = tslib_1.__values(((_101 = spec.series) !== null && _101 !== void 0 ? _101 : []).entries()), _u = _t.next();
|
|
2013
|
+
_189.label = 40;
|
|
2014
|
+
case 40:
|
|
2015
|
+
if (!!_u.done) return [3 /*break*/, 43];
|
|
1991
2016
|
_v = tslib_1.__read(_u.value, 2), specSeriesIndex = _v[0], series = _v[1];
|
|
1992
2017
|
return [5 /*yield**/, _loop_1(specSeriesIndex, series)];
|
|
1993
|
-
case
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
case
|
|
2018
|
+
case 41:
|
|
2019
|
+
_189.sent();
|
|
2020
|
+
_189.label = 42;
|
|
2021
|
+
case 42:
|
|
1997
2022
|
_u = _t.next();
|
|
1998
|
-
return [3 /*break*/,
|
|
1999
|
-
case
|
|
2000
|
-
case
|
|
2001
|
-
e_3_1 =
|
|
2023
|
+
return [3 /*break*/, 40];
|
|
2024
|
+
case 43: return [3 /*break*/, 46];
|
|
2025
|
+
case 44:
|
|
2026
|
+
e_3_1 = _189.sent();
|
|
2002
2027
|
e_3 = { error: e_3_1 };
|
|
2003
|
-
return [3 /*break*/,
|
|
2004
|
-
case
|
|
2028
|
+
return [3 /*break*/, 46];
|
|
2029
|
+
case 45:
|
|
2005
2030
|
try {
|
|
2006
2031
|
if (_u && !_u.done && (_6 = _t.return)) _6.call(_t);
|
|
2007
2032
|
}
|
|
2008
2033
|
finally { if (e_3) throw e_3.error; }
|
|
2009
2034
|
return [7 /*endfinally*/];
|
|
2010
|
-
case
|
|
2035
|
+
case 46:
|
|
2011
2036
|
if (isCircularChart && !isOfPie) {
|
|
2012
2037
|
// Excel's pie / doughnut legend lists the categories, one entry per
|
|
2013
2038
|
// slice — not the series name (the loop above collected those). The
|
|
@@ -2016,7 +2041,7 @@ var BasicChart = function (_a) {
|
|
|
2016
2041
|
}
|
|
2017
2042
|
if (isOfPie) {
|
|
2018
2043
|
labels = rawPrimaryDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
2019
|
-
seriesEntry = (
|
|
2044
|
+
seriesEntry = (_129 = spec.series) === null || _129 === void 0 ? void 0 : _129[0];
|
|
2020
2045
|
rawValues = seriesEntry
|
|
2021
2046
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
|
|
2022
2047
|
: [];
|
|
@@ -2063,7 +2088,7 @@ var BasicChart = function (_a) {
|
|
|
2063
2088
|
};
|
|
2064
2089
|
chartSeries.push({
|
|
2065
2090
|
type: "pie",
|
|
2066
|
-
name: (
|
|
2091
|
+
name: (_130 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _130 !== void 0 ? _130 : "",
|
|
2067
2092
|
center: ["".concat(MAIN_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
|
|
2068
2093
|
radius: [0, "".concat(MAIN_RADIUS_PCT_1, "%")],
|
|
2069
2094
|
// Rotate the pie so the "Other" slice's angular midpoint faces
|
|
@@ -2081,7 +2106,7 @@ var BasicChart = function (_a) {
|
|
|
2081
2106
|
if (ofPieType_1 === "pie") {
|
|
2082
2107
|
chartSeries.push({
|
|
2083
2108
|
type: "pie",
|
|
2084
|
-
name: (
|
|
2109
|
+
name: (_131 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _131 !== void 0 ? _131 : "",
|
|
2085
2110
|
center: ["".concat(SECONDARY_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
|
|
2086
2111
|
radius: [0, "".concat(secondaryRadiusPct_1, "%")],
|
|
2087
2112
|
data: secondary.map(function (s, i) { return ({
|
|
@@ -2176,16 +2201,16 @@ var BasicChart = function (_a) {
|
|
|
2176
2201
|
legend.data = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(main_1.map(function (s) { return s.label; })), false), tslib_1.__read(secondary.map(function (s) { return s.label; })), false);
|
|
2177
2202
|
}
|
|
2178
2203
|
else if (spec.chartType === "waterfall") {
|
|
2179
|
-
primaryDomainSource_1 = (
|
|
2204
|
+
primaryDomainSource_1 = (_134 = (_133 = (_132 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _132 === void 0 ? void 0 : _132[0]) === null || _133 === void 0 ? void 0 : _133.sources) === null || _134 === void 0 ? void 0 : _134[0];
|
|
2180
2205
|
rawDomainValues = primaryDomainSource_1
|
|
2181
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
2206
|
+
? (0, aggregation_1.sanitizeDomainValues)((_135 = getDomainValuesFromRange(primaryDomainSource_1, spec.hiddenDimensionStrategy)) !== null && _135 !== void 0 ? _135 : [])
|
|
2182
2207
|
: [];
|
|
2183
2208
|
labels = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
2184
|
-
seriesEntry = (
|
|
2209
|
+
seriesEntry = (_136 = spec.series) === null || _136 === void 0 ? void 0 : _136[0];
|
|
2185
2210
|
rawValues_1 = seriesEntry
|
|
2186
2211
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
|
|
2187
2212
|
: [];
|
|
2188
|
-
totalIndices = new Set((
|
|
2213
|
+
totalIndices = new Set((_137 = spec.totalIndices) !== null && _137 !== void 0 ? _137 : []);
|
|
2189
2214
|
steps = (0, waterfall_1.computeWaterfall)(rawValues_1, labels, totalIndices);
|
|
2190
2215
|
chartDomains.length = 0;
|
|
2191
2216
|
chartDomains.push({
|
|
@@ -2195,7 +2220,7 @@ var BasicChart = function (_a) {
|
|
|
2195
2220
|
axisLine: { show: true },
|
|
2196
2221
|
axisTick: { show: true },
|
|
2197
2222
|
splitLine: { show: false },
|
|
2198
|
-
name: (
|
|
2223
|
+
name: (_138 = spec.horizontalAxisTitle) !== null && _138 !== void 0 ? _138 : "",
|
|
2199
2224
|
nameLocation: "middle",
|
|
2200
2225
|
nameGap: 30,
|
|
2201
2226
|
});
|
|
@@ -2212,12 +2237,12 @@ var BasicChart = function (_a) {
|
|
|
2212
2237
|
label: { show: false },
|
|
2213
2238
|
tooltip: { show: false },
|
|
2214
2239
|
});
|
|
2215
|
-
accent_1 = (
|
|
2216
|
-
decreaseColor_1 = (
|
|
2217
|
-
totalColor_1 = (
|
|
2240
|
+
accent_1 = (_139 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _139 !== void 0 ? _139 : theme.themeColors.accent1;
|
|
2241
|
+
decreaseColor_1 = (_141 = (_140 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.negativeColor) !== null && _140 !== void 0 ? _140 : theme.themeColors.accent2) !== null && _141 !== void 0 ? _141 : accent_1;
|
|
2242
|
+
totalColor_1 = (_142 = theme.themeColors.accent3) !== null && _142 !== void 0 ? _142 : accent_1;
|
|
2218
2243
|
pointColors_1 = new Map();
|
|
2219
2244
|
try {
|
|
2220
|
-
for (_x = tslib_1.__values((
|
|
2245
|
+
for (_x = tslib_1.__values((_143 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _143 !== void 0 ? _143 : []), _y = _x.next(); !_y.done; _y = _x.next()) {
|
|
2221
2246
|
dp = _y.value;
|
|
2222
2247
|
if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
|
|
2223
2248
|
pointColors_1.set(dp.idx, dp.color);
|
|
@@ -2239,7 +2264,7 @@ var BasicChart = function (_a) {
|
|
|
2239
2264
|
type: "bar",
|
|
2240
2265
|
id: (0, series_click_1.chartSeriesId)(0, 0),
|
|
2241
2266
|
stack: "waterfall",
|
|
2242
|
-
name: (
|
|
2267
|
+
name: (_144 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _144 !== void 0 ? _144 : "",
|
|
2243
2268
|
// A bar's height is the step's magnitude; the signed source value
|
|
2244
2269
|
// rides along as `originalValue` so labels and tooltips read
|
|
2245
2270
|
// "-90" for a decrease, like Excel.
|
|
@@ -2273,12 +2298,12 @@ var BasicChart = function (_a) {
|
|
|
2273
2298
|
legend.data = [];
|
|
2274
2299
|
}
|
|
2275
2300
|
else if (spec.chartType === "funnel") {
|
|
2276
|
-
primaryDomainSource_2 = (
|
|
2301
|
+
primaryDomainSource_2 = (_147 = (_146 = (_145 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _145 === void 0 ? void 0 : _145[0]) === null || _146 === void 0 ? void 0 : _146.sources) === null || _147 === void 0 ? void 0 : _147[0];
|
|
2277
2302
|
rawDomainValues = primaryDomainSource_2
|
|
2278
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
2303
|
+
? (0, aggregation_1.sanitizeDomainValues)((_148 = getDomainValuesFromRange(primaryDomainSource_2, spec.hiddenDimensionStrategy)) !== null && _148 !== void 0 ? _148 : [])
|
|
2279
2304
|
: [];
|
|
2280
2305
|
labels_1 = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
2281
|
-
seriesEntry = (
|
|
2306
|
+
seriesEntry = (_149 = spec.series) === null || _149 === void 0 ? void 0 : _149[0];
|
|
2282
2307
|
rawValues = seriesEntry
|
|
2283
2308
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : 0); })
|
|
2284
2309
|
: [];
|
|
@@ -2292,10 +2317,10 @@ var BasicChart = function (_a) {
|
|
|
2292
2317
|
theme.themeColors.accent5,
|
|
2293
2318
|
theme.themeColors.accent6,
|
|
2294
2319
|
]);
|
|
2295
|
-
funnelColor_1 = (
|
|
2320
|
+
funnelColor_1 = (_150 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _150 !== void 0 ? _150 : (0, utils_1.chartPaletteColorAt)(funnelPalette, 0);
|
|
2296
2321
|
stageColors_1 = new Map();
|
|
2297
2322
|
try {
|
|
2298
|
-
for (_z = tslib_1.__values((
|
|
2323
|
+
for (_z = tslib_1.__values((_151 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _151 !== void 0 ? _151 : []), _0 = _z.next(); !_0.done; _0 = _z.next()) {
|
|
2299
2324
|
dp = _0.value;
|
|
2300
2325
|
if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
|
|
2301
2326
|
stageColors_1.set(dp.idx, dp.color);
|
|
@@ -2323,9 +2348,9 @@ var BasicChart = function (_a) {
|
|
|
2323
2348
|
top: 60,
|
|
2324
2349
|
bottom: 20,
|
|
2325
2350
|
};
|
|
2326
|
-
funnelLabelsOff = ((
|
|
2351
|
+
funnelLabelsOff = ((_152 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesEntry)) === null || _152 === void 0 ? void 0 : _152.show) ===
|
|
2327
2352
|
false;
|
|
2328
|
-
chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: (0, series_click_1.chartSeriesId)(0, 0), name: (
|
|
2353
|
+
chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: (0, series_click_1.chartSeriesId)(0, 0), name: (_153 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _153 !== void 0 ? _153 : "", data: funnelData }, funnelLayout), { itemStyle: {
|
|
2329
2354
|
color: function (params) { var _a; return (_a = stageColors_1.get(params.dataIndex)) !== null && _a !== void 0 ? _a : funnelColor_1; },
|
|
2330
2355
|
}, label: funnelLabelsOff
|
|
2331
2356
|
? { show: false }
|
|
@@ -2348,9 +2373,9 @@ var BasicChart = function (_a) {
|
|
|
2348
2373
|
showMeanMarker_1 = spec.showMeanMarker === true;
|
|
2349
2374
|
showInnerPoints_1 = spec.showInnerPoints === true;
|
|
2350
2375
|
showMeanLine_1 = spec.showMeanLine === true;
|
|
2351
|
-
boxDomainSource = (
|
|
2376
|
+
boxDomainSource = (_156 = (_155 = (_154 = spec.domains) === null || _154 === void 0 ? void 0 : _154[0]) === null || _155 === void 0 ? void 0 : _155.sources) === null || _156 === void 0 ? void 0 : _156[0];
|
|
2352
2377
|
boxCategories_2 = boxDomainSource
|
|
2353
|
-
? ((
|
|
2378
|
+
? ((_157 = getDomainValuesFromRange(boxDomainSource, spec.hiddenDimensionStrategy)) !== null && _157 !== void 0 ? _157 : []).map(function (v) { return (v === null || v === undefined ? "" : "".concat(v).trim()); })
|
|
2354
2379
|
: [];
|
|
2355
2380
|
grouped_1 = boxCategories_2.some(function (c) { return c !== ""; });
|
|
2356
2381
|
groups_1 = [];
|
|
@@ -2370,7 +2395,7 @@ var BasicChart = function (_a) {
|
|
|
2370
2395
|
finally { if (e_8) throw e_8.error; }
|
|
2371
2396
|
}
|
|
2372
2397
|
}
|
|
2373
|
-
boxSeriesSpecs = (
|
|
2398
|
+
boxSeriesSpecs = (_158 = spec.series) !== null && _158 !== void 0 ? _158 : [];
|
|
2374
2399
|
slots = grouped_1 ? groups_1 : ["1"];
|
|
2375
2400
|
boxGap = typeof spec.gapWidth === "number" ? Math.max(0, spec.gapWidth) : 150;
|
|
2376
2401
|
boxPlotWidth = Math.max(0, (width !== null && width !== void 0 ? width : 0) * 0.85 - 40);
|
|
@@ -2393,7 +2418,7 @@ var BasicChart = function (_a) {
|
|
|
2393
2418
|
axisLine: { show: true },
|
|
2394
2419
|
axisTick: { show: true },
|
|
2395
2420
|
splitLine: { show: false },
|
|
2396
|
-
name: (
|
|
2421
|
+
name: (_159 = spec.horizontalAxisTitle) !== null && _159 !== void 0 ? _159 : "",
|
|
2397
2422
|
nameLocation: "middle",
|
|
2398
2423
|
nameGap: 30,
|
|
2399
2424
|
});
|
|
@@ -2521,12 +2546,12 @@ var BasicChart = function (_a) {
|
|
|
2521
2546
|
}
|
|
2522
2547
|
else if (spec.chartType === "histogram") {
|
|
2523
2548
|
rawValues = flattenChartDataValues(spec.series, getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
2524
|
-
histogramDomainSource = (
|
|
2549
|
+
histogramDomainSource = (_162 = (_161 = (_160 = spec.domains) === null || _160 === void 0 ? void 0 : _160[0]) === null || _161 === void 0 ? void 0 : _161.sources) === null || _162 === void 0 ? void 0 : _162[0];
|
|
2525
2550
|
histogramCategories = histogramDomainSource
|
|
2526
|
-
? ((
|
|
2551
|
+
? ((_163 = getDomainValuesFromRange(histogramDomainSource, spec.hiddenDimensionStrategy)) !== null && _163 !== void 0 ? _163 : [])
|
|
2527
2552
|
: [];
|
|
2528
2553
|
_1 = histogramCategories.length
|
|
2529
|
-
? (0, histogram_1.aggregateByCategory)(histogramCategories, rawValues, (
|
|
2554
|
+
? (0, histogram_1.aggregateByCategory)(histogramCategories, rawValues, (_166 = (_165 = (_164 = spec.series) === null || _164 === void 0 ? void 0 : _164[0]) === null || _165 === void 0 ? void 0 : _165.aggregateType) !== null && _166 !== void 0 ? _166 : "SUM")
|
|
2530
2555
|
: (0, histogram_1.binHistogram)(rawValues, spec.binCount, {
|
|
2531
2556
|
binSize: spec.binSize,
|
|
2532
2557
|
intervalClosed: spec.intervalClosed,
|
|
@@ -2549,20 +2574,20 @@ var BasicChart = function (_a) {
|
|
|
2549
2574
|
axisLine: { show: true },
|
|
2550
2575
|
axisTick: { show: true },
|
|
2551
2576
|
splitLine: { show: false },
|
|
2552
|
-
name: (
|
|
2577
|
+
name: (_167 = spec.horizontalAxisTitle) !== null && _167 !== void 0 ? _167 : "",
|
|
2553
2578
|
nameLocation: "middle",
|
|
2554
2579
|
nameGap: 30,
|
|
2555
2580
|
});
|
|
2556
2581
|
chartSeries.length = 0;
|
|
2557
2582
|
histogramSeries = {
|
|
2558
2583
|
type: "bar",
|
|
2559
|
-
name: (
|
|
2584
|
+
name: (_170 = (_169 = (_168 = spec.series) === null || _168 === void 0 ? void 0 : _168[0]) === null || _169 === void 0 ? void 0 : _169.dataLabel) !== null && _170 !== void 0 ? _170 : "",
|
|
2560
2585
|
data: counts,
|
|
2561
2586
|
// Excel's histogram columns touch unless `gapWidth` says otherwise
|
|
2562
2587
|
// (#1087); the gap maps like a column chart's.
|
|
2563
|
-
barCategoryGap: (
|
|
2588
|
+
barCategoryGap: (_172 = (0, bar_layout_1.gapWidthToBarCategoryGap)((_171 = spec.gapWidth) !== null && _171 !== void 0 ? _171 : 0, { seriesCount: 1 })) !== null && _172 !== void 0 ? _172 : "0%",
|
|
2564
2589
|
};
|
|
2565
|
-
histogramColor = (
|
|
2590
|
+
histogramColor = (_174 = (_173 = spec.series) === null || _173 === void 0 ? void 0 : _173[0]) === null || _174 === void 0 ? void 0 : _174.color;
|
|
2566
2591
|
if (histogramColor) {
|
|
2567
2592
|
histogramSeries.itemStyle = { color: histogramColor };
|
|
2568
2593
|
}
|
|
@@ -2598,20 +2623,20 @@ var BasicChart = function (_a) {
|
|
|
2598
2623
|
isPareto = spec.chartType === "histogram" && (0, histogram_1.isParetoSpec)(spec);
|
|
2599
2624
|
hasSecondaryAxis = !isCircularChart &&
|
|
2600
2625
|
!isHorizontalBarChart &&
|
|
2601
|
-
(((
|
|
2626
|
+
(((_175 = spec.series) !== null && _175 !== void 0 ? _175 : []).some(function (s) { return s.useSecondaryAxis; }) || isPareto);
|
|
2602
2627
|
isPercentStackedBars = spec.stackedType === "PERCENT_STACKED" &&
|
|
2603
2628
|
(spec.chartType === "bar" || spec.chartType === "column");
|
|
2604
2629
|
primaryAxisNumberFormat = isPercentStackedBars
|
|
2605
2630
|
? undefined
|
|
2606
2631
|
: (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
2607
2632
|
axisOptions: spec.valueAxisOptions,
|
|
2608
|
-
series: ((
|
|
2633
|
+
series: ((_176 = spec.series) !== null && _176 !== void 0 ? _176 : []).filter(function (s) { return !s.useSecondaryAxis; }),
|
|
2609
2634
|
getFormattingFromRange: getFormattingFromRange,
|
|
2610
2635
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
2611
2636
|
});
|
|
2612
2637
|
secondaryAxisNumberFormat = (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
2613
2638
|
axisOptions: spec.secondaryValueAxisOptions,
|
|
2614
|
-
series: ((
|
|
2639
|
+
series: ((_177 = spec.series) !== null && _177 !== void 0 ? _177 : []).filter(function (s) { return s.useSecondaryAxis; }),
|
|
2615
2640
|
getFormattingFromRange: getFormattingFromRange,
|
|
2616
2641
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
2617
2642
|
});
|
|
@@ -2640,17 +2665,17 @@ var BasicChart = function (_a) {
|
|
|
2640
2665
|
finalLegend = (0, overrides_1.applyLegendOverrides)(legend, spec.legend);
|
|
2641
2666
|
bottomAxisNameGap = isHorizontalBarChart
|
|
2642
2667
|
? valueAxisBase.nameGap
|
|
2643
|
-
: Number((
|
|
2668
|
+
: Number((_179 = (_178 = chartDomains[0]) === null || _178 === void 0 ? void 0 : _178.nameGap) !== null && _179 !== void 0 ? _179 : CATEGORY_AXIS_NAME_GAP);
|
|
2644
2669
|
legendBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
2645
|
-
position: (
|
|
2670
|
+
position: (_180 = spec.legend) === null || _180 === void 0 ? void 0 : _180.position,
|
|
2646
2671
|
visible: finalLegend.show !== false,
|
|
2647
2672
|
labels: (0, legend_layout_1.legendLabelsFrom)(finalLegend.data, chartSeries.map(function (s) { return s === null || s === void 0 ? void 0 : s.name; })),
|
|
2648
|
-
legendFontSize: (
|
|
2673
|
+
legendFontSize: (_185 = (_182 = (_181 = finalLegend.textStyle) === null || _181 === void 0 ? void 0 : _181.fontSize) !== null && _182 !== void 0 ? _182 : (_184 = (_183 = spec.legend) === null || _183 === void 0 ? void 0 : _183.textFormat) === null || _184 === void 0 ? void 0 : _184.fontSize) !== null && _185 !== void 0 ? _185 : 12,
|
|
2649
2674
|
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
2650
2675
|
width: width !== null && width !== void 0 ? width : 0,
|
|
2651
2676
|
height: height !== null && height !== void 0 ? height : 0,
|
|
2652
2677
|
hasTitle: Boolean(title),
|
|
2653
|
-
titleFontSize: (
|
|
2678
|
+
titleFontSize: (_187 = (_186 = spec.titleTextFormat) === null || _186 === void 0 ? void 0 : _186.fontSize) !== null && _187 !== void 0 ? _187 : 16,
|
|
2654
2679
|
hasBottomAxisTitle: !isCircularChart && Boolean(spec.horizontalAxisTitle),
|
|
2655
2680
|
bottomAxisNameGap: bottomAxisNameGap,
|
|
2656
2681
|
hasLeftAxisTitle: !isCircularChart && Boolean(spec.verticalAxisTitle),
|
|
@@ -2820,7 +2845,7 @@ var BasicChart = function (_a) {
|
|
|
2820
2845
|
return next;
|
|
2821
2846
|
});
|
|
2822
2847
|
// Update charts
|
|
2823
|
-
(
|
|
2848
|
+
(_188 = chartRef.current) === null || _188 === void 0 ? void 0 : _188.setOption({
|
|
2824
2849
|
xAxis: (function () {
|
|
2825
2850
|
var _a, _b;
|
|
2826
2851
|
if (isOfPie) {
|
|
@@ -3002,7 +3027,7 @@ var BasicChart = function (_a) {
|
|
|
3002
3027
|
// between the cartesian 2-D option and the grid3D / map one and must
|
|
3003
3028
|
// re-apply these.
|
|
3004
3029
|
var applyThemeOptions = function () {
|
|
3005
|
-
var _a, _b, _c, _d
|
|
3030
|
+
var _a, _b, _c, _d;
|
|
3006
3031
|
if (chartRef.current) {
|
|
3007
3032
|
var textColor = (0, spreadsheet_1.getStringifiedColor)({
|
|
3008
3033
|
theme: 1,
|
|
@@ -3020,21 +3045,23 @@ var BasicChart = function (_a) {
|
|
|
3020
3045
|
var options = {
|
|
3021
3046
|
title: {
|
|
3022
3047
|
text: title !== null && title !== void 0 ? title : undefined,
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
:
|
|
3048
|
+
// Every key is written (echarts merges setOption calls, so a key
|
|
3049
|
+
// left out keeps its previous value — turning bold off used to
|
|
3050
|
+
// leave the title bold, rowsncolumns/spreadsheet#1105).
|
|
3051
|
+
textStyle: (0, overrides_2.themedTextStyle)(authoredTitleFmt, {
|
|
3052
|
+
color: textColor,
|
|
3053
|
+
fontSize: 18,
|
|
3054
|
+
fontWeight: "bold",
|
|
3055
|
+
}),
|
|
3028
3056
|
},
|
|
3029
3057
|
legend: {
|
|
3030
|
-
textStyle:
|
|
3031
|
-
|
|
3032
|
-
:
|
|
3033
|
-
|
|
3034
|
-
: {})),
|
|
3058
|
+
textStyle: (0, overrides_2.themedTextStyle)(authoredLegendFmt, {
|
|
3059
|
+
color: textColor,
|
|
3060
|
+
fontSize: 12,
|
|
3061
|
+
}),
|
|
3035
3062
|
},
|
|
3036
3063
|
axisLabel: {
|
|
3037
|
-
color: (
|
|
3064
|
+
color: (_c = authoredDataLabelFmt === null || authoredDataLabelFmt === void 0 ? void 0 : authoredDataLabelFmt.color) !== null && _c !== void 0 ? _c : textColor,
|
|
3038
3065
|
},
|
|
3039
3066
|
tooltip: {
|
|
3040
3067
|
backgroundColor: bgColor,
|
|
@@ -3055,7 +3082,7 @@ var BasicChart = function (_a) {
|
|
|
3055
3082
|
])),
|
|
3056
3083
|
// Excel's Format Chart Area fill; `transparent` (echarts' own
|
|
3057
3084
|
// default) so clearing the fill undoes an earlier setOption.
|
|
3058
|
-
backgroundColor: (
|
|
3085
|
+
backgroundColor: (_d = chart.spec.backgroundColor) !== null && _d !== void 0 ? _d : "transparent",
|
|
3059
3086
|
};
|
|
3060
3087
|
// Skip when rendering 3-D or a region map: merging a cartesian
|
|
3061
3088
|
// yAxis into a grid3D / map option would create a stray empty
|
|
@@ -3074,7 +3101,9 @@ var BasicChart = function (_a) {
|
|
|
3074
3101
|
chartRef.current.setOption(options);
|
|
3075
3102
|
}
|
|
3076
3103
|
};
|
|
3077
|
-
// Update chart properties
|
|
3104
|
+
// Update chart properties — the authored text formats are inputs too, so
|
|
3105
|
+
// a font change applies at once instead of waiting for the next title
|
|
3106
|
+
// edit (rowsncolumns/spreadsheet#1105).
|
|
3078
3107
|
(0, ui_1.useIsomorphicLayoutEffect)(function () {
|
|
3079
3108
|
applyThemeOptions();
|
|
3080
3109
|
}, [
|
|
@@ -3084,6 +3113,9 @@ var BasicChart = function (_a) {
|
|
|
3084
3113
|
chart.spec.chartType,
|
|
3085
3114
|
chart.spec.palette,
|
|
3086
3115
|
chart.spec.backgroundColor,
|
|
3116
|
+
chart.spec.titleTextFormat,
|
|
3117
|
+
(_c = chart.spec.legend) === null || _c === void 0 ? void 0 : _c.textFormat,
|
|
3118
|
+
(_d = chart.spec.dataLabels) === null || _d === void 0 ? void 0 : _d.textFormat,
|
|
3087
3119
|
]);
|
|
3088
3120
|
// Draw chart. `glUpgradeTick` re-runs the draw when the lazily loaded
|
|
3089
3121
|
// echarts-gl module resolves, upgrading a 3-D spec's immediate 2-D
|