@visactor/vseed 0.2.2 → 0.2.5
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/index.cjs +1 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/buildAdvanced.js +1 -2
- package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
- package/dist/esm/builder/builder/buildSpec.js +1 -2
- package/dist/esm/builder/builder/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +628 -334
- package/dist/esm/dataReshape/constant.d.ts +1 -0
- package/dist/esm/dataReshape/constant.js +2 -1
- package/dist/esm/dataReshape/constant.js.map +1 -1
- package/dist/esm/i18n/i18n.js +1 -4
- package/dist/esm/i18n/i18n.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +12 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +4 -12
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +4 -12
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/bandAxisStyle.d.ts +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/bandAxisStyle.js +65 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/bandAxisStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js +24 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/histogramXLinear.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/histogramXLinear.js +50 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/histogramXLinear.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/linearAxisStyle.d.ts +14 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/linearAxisStyle.js +78 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/linearAxisStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +15 -72
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +14 -68
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +17 -73
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +14 -68
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +13 -59
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +16 -57
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js +11 -13
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +10 -8
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js +0 -12
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +13 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.js +58 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/utils/boxplot.d.ts +1 -0
- package/dist/esm/pipeline/utils/boxplot.js +8 -0
- package/dist/esm/pipeline/utils/boxplot.js.map +1 -0
- package/dist/esm/pipeline/utils/index.d.ts +1 -0
- package/dist/esm/pipeline/utils/index.js +1 -0
- package/dist/esm/theme/common/legend.d.ts +3 -1
- package/dist/esm/theme/common/legend.js +13 -1
- package/dist/esm/theme/common/legend.js.map +1 -1
- package/dist/esm/theme/common/tooltip.js +1 -1
- package/dist/esm/theme/common/tooltip.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +4 -1
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +4 -1
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +252 -420
- package/dist/esm/types/chartType/area/zArea.d.ts +5 -281
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +5 -281
- package/dist/esm/types/chartType/bar/zBar.d.ts +5 -281
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +5 -281
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +5 -281
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +5 -281
- package/dist/esm/types/chartType/column/zColumn.d.ts +5 -281
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +5 -281
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +5 -281
- package/dist/esm/types/chartType/donut/zDonut.d.ts +1 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +5 -281
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +5 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +5 -0
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +5 -281
- package/dist/esm/types/chartType/line/zLine.d.ts +5 -281
- package/dist/esm/types/chartType/pie/zPie.d.ts +1 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +1 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +1 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +1 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +5 -281
- package/dist/esm/types/dataSelector/selector.d.ts +108 -0
- package/dist/esm/types/dataSelector/selector.js +58 -51
- package/dist/esm/types/dataSelector/selector.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotation.d.ts +4 -280
- package/dist/esm/types/properties/annotation/annotationArea.d.ts +2 -2
- package/dist/esm/types/properties/annotation/annotationHorizontalLine.d.ts +1 -6
- package/dist/esm/types/properties/annotation/annotationVerticalLine.d.ts +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationArea.d.ts +2 -2
- package/dist/esm/types/properties/annotation/zAnnotationArea.js +3 -3
- package/dist/esm/types/properties/annotation/zAnnotationArea.js.map +1 -1
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.d.ts +0 -69
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js.map +1 -1
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.d.ts +0 -69
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +2 -2
- package/dist/esm/types/properties/config/bar.d.ts +3 -3
- package/dist/esm/types/properties/config/boxplot.d.ts +1 -1
- package/dist/esm/types/properties/config/column.d.ts +3 -3
- package/dist/esm/types/properties/config/config.d.ts +102 -48
- package/dist/esm/types/properties/config/crosshair/crosshair.d.ts +36 -0
- package/dist/esm/types/properties/config/dualAxis.d.ts +1 -1
- package/dist/esm/types/properties/config/funnel.d.ts +1 -1
- package/dist/esm/types/properties/config/heatmap.d.ts +83 -29
- package/dist/esm/types/properties/config/heatmap.js +6 -3
- package/dist/esm/types/properties/config/heatmap.js.map +1 -1
- package/dist/esm/types/properties/config/histogram.d.ts +1 -1
- package/dist/esm/types/properties/config/legend/legend.d.ts +10 -2
- package/dist/esm/types/properties/config/legend/legend.js +7 -2
- package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +3 -3
- package/dist/esm/types/properties/config/rose.d.ts +2 -2
- package/dist/esm/types/properties/config/scatter.d.ts +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +204 -96
- package/dist/esm/types/zVseed.d.ts +829 -4407
- package/dist/umd/index.js +510 -505
- package/dist/umd/index.js.map +1 -1
- package/package.json +20 -15
package/dist/umd/index.js
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
zAnnotationVerticalLineConfig: ()=>zAnnotationVerticalLineConfig,
|
|
72
72
|
zCustomThemeConfig: ()=>zCustomThemeConfig,
|
|
73
73
|
zMeasureEncoding: ()=>zMeasureEncoding,
|
|
74
|
+
zMeasureSelector: ()=>zMeasureSelector,
|
|
74
75
|
MedianMeasureId: ()=>MedianMeasureId,
|
|
75
76
|
BinPercentageMeasureId: ()=>BinPercentageMeasureId,
|
|
76
77
|
AngleEncoding: ()=>AngleEncoding,
|
|
@@ -139,13 +140,14 @@
|
|
|
139
140
|
zLinearRegressionLine: ()=>zLinearRegressionLine,
|
|
140
141
|
createNumFormatter: ()=>createNumFormatter,
|
|
141
142
|
DEFAULT_PARENT_ID: ()=>DEFAULT_PARENT_ID,
|
|
142
|
-
isPivotChart: ()=>
|
|
143
|
+
isPivotChart: ()=>chatType_isPivotChart,
|
|
143
144
|
zPolynomialRegressionLine: ()=>zPolynomialRegressionLine,
|
|
144
145
|
zTableConfig: ()=>zTableConfig,
|
|
145
146
|
findFirstMeasure: ()=>findFirstMeasure,
|
|
146
147
|
isValueSelector: ()=>isValueSelector,
|
|
147
148
|
zFunnel: ()=>zFunnel,
|
|
148
149
|
zChartType: ()=>zChartType,
|
|
150
|
+
zAreaSelectors: ()=>zAreaSelectors,
|
|
149
151
|
registerColumnParallel: ()=>registerColumnParallel,
|
|
150
152
|
isDimensionSelector: ()=>isDimensionSelector,
|
|
151
153
|
BAND_AXIS_INNER_OFFSET_IN_PIVOT: ()=>2,
|
|
@@ -179,6 +181,7 @@
|
|
|
179
181
|
registerHistogram: ()=>registerHistogram,
|
|
180
182
|
Q1MeasureValue: ()=>"__Q1__",
|
|
181
183
|
lineAdvancedPipeline: ()=>lineAdvancedPipeline,
|
|
184
|
+
zAreaSelector: ()=>zAreaSelector,
|
|
182
185
|
zRadarConfig: ()=>zRadarConfig,
|
|
183
186
|
zRoseParallelConfig: ()=>zRoseParallelConfig,
|
|
184
187
|
isMeasureSelector: ()=>isMeasureSelector,
|
|
@@ -273,6 +276,7 @@
|
|
|
273
276
|
zDimensionLinkage: ()=>zDimensionLinkage,
|
|
274
277
|
preorderTraverse: ()=>preorderTraverse,
|
|
275
278
|
deleteMeasureTreeByCallback: ()=>deleteMeasureTreeByCallback,
|
|
279
|
+
zDimensionSelector: ()=>zDimensionSelector,
|
|
276
280
|
registerLightTheme: ()=>registerLightTheme,
|
|
277
281
|
isMeasure: ()=>isMeasure,
|
|
278
282
|
FoldYMeasureValue: ()=>FoldYMeasureValue,
|
|
@@ -294,6 +298,7 @@
|
|
|
294
298
|
registerDualAxis: ()=>registerDualAxis,
|
|
295
299
|
zAnnotationHorizontalLineConfig: ()=>zAnnotationHorizontalLineConfig,
|
|
296
300
|
registerFunnel: ()=>registerFunnel,
|
|
301
|
+
BoxPlotPivotIndicator: ()=>BoxPlotPivotIndicator,
|
|
297
302
|
histogramSpecPipeline: ()=>histogramSpecPipeline,
|
|
298
303
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
|
299
304
|
zNumFormat: ()=>zNumFormat,
|
|
@@ -310,9 +315,10 @@
|
|
|
310
315
|
columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
|
|
311
316
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
|
312
317
|
DimensionEncodingEnum: ()=>DimensionEncodingEnum,
|
|
313
|
-
|
|
318
|
+
revisedBoxPlotFieldKey: ()=>revisedBoxPlotFieldKey,
|
|
314
319
|
funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
|
|
315
320
|
zDataset: ()=>zDataset,
|
|
321
|
+
zDonutConfig: ()=>zDonutConfig,
|
|
316
322
|
zLogisticRegressionLine: ()=>zLogisticRegressionLine,
|
|
317
323
|
createFormatterByMeasure: ()=>createFormatterByMeasure,
|
|
318
324
|
zBoxGapInGroup: ()=>zBoxGapInGroup,
|
|
@@ -374,10 +380,7 @@
|
|
|
374
380
|
i18n = (segments, ...values)=>{
|
|
375
381
|
const text = segments.map((segment, index)=>segment + (values[index] || '')).join('');
|
|
376
382
|
const translatedText = this.translateMap?.[text]?.[this.locale];
|
|
377
|
-
if (chunk_JK3VNB42_n(translatedText))
|
|
378
|
-
console.warn(`i18n ${this.locale} no translate: ${text}`);
|
|
379
|
-
return text;
|
|
380
|
-
}
|
|
383
|
+
if (chunk_JK3VNB42_n(translatedText)) return text;
|
|
381
384
|
return translatedText;
|
|
382
385
|
};
|
|
383
386
|
setLocale = (locale)=>{
|
|
@@ -406,8 +409,7 @@
|
|
|
406
409
|
builder.advancedVSeed = advancedVSeed;
|
|
407
410
|
return advancedVSeed;
|
|
408
411
|
} catch (e) {
|
|
409
|
-
|
|
410
|
-
throw new Error(`buildAdvanced error: ${e.message}.\ndetails info in console`);
|
|
412
|
+
throw new Error(`buildAdvanced error: ${e.message}`);
|
|
411
413
|
} finally{
|
|
412
414
|
const end = 'undefined' != typeof performance ? performance.now() : Date.now();
|
|
413
415
|
builder.performance['buildAdvanced'] = `${(end - start).toFixed(4)}ms`;
|
|
@@ -428,8 +430,7 @@
|
|
|
428
430
|
builder.spec = spec;
|
|
429
431
|
return spec;
|
|
430
432
|
} catch (e) {
|
|
431
|
-
|
|
432
|
-
throw new Error(`buildSpec error: ${e.message}.\ndetails info in console`);
|
|
433
|
+
throw new Error(`buildSpec error: ${e.message}`);
|
|
433
434
|
} finally{
|
|
434
435
|
const end = 'undefined' != typeof performance ? performance.now() : Date.now();
|
|
435
436
|
builder.performance['buildSpec'] = `${(end - start).toFixed(4)}ms`;
|
|
@@ -635,7 +636,7 @@
|
|
|
635
636
|
'pivotTable'
|
|
636
637
|
].includes(vseed.chartType);
|
|
637
638
|
const isVChart = (vseed)=>!isVTable(vseed);
|
|
638
|
-
const
|
|
639
|
+
const chatType_isPivotChart = (vseed)=>{
|
|
639
640
|
if (isVTable(vseed)) return false;
|
|
640
641
|
if (chatType_isPivot(vseed)) return true;
|
|
641
642
|
return isCombination(vseed);
|
|
@@ -1653,6 +1654,7 @@
|
|
|
1653
1654
|
const DetailEncoding = '__Dim_Detail__';
|
|
1654
1655
|
const ColorEncoding = '__Dim_Color__';
|
|
1655
1656
|
const ColorIdEncoding = '__Dim_ColorId__';
|
|
1657
|
+
const BoxPlotPivotIndicator = '__BoxPlot_Pivot_Indicator__';
|
|
1656
1658
|
const LowerWhisker = '__Lower_Whisker__';
|
|
1657
1659
|
const UpperWhisker = '__Upper_Whisker__';
|
|
1658
1660
|
const OutliersMeasureId = '__Outliers__';
|
|
@@ -2316,7 +2318,7 @@
|
|
|
2316
2318
|
advancedVSeed.measures = generateMeasuresByParentId(advancedVSeed.measures);
|
|
2317
2319
|
return advancedVSeed;
|
|
2318
2320
|
}
|
|
2319
|
-
if (
|
|
2321
|
+
if (chatType_isPivotChart(advancedVSeed)) advancedVSeed.measures = basicMeasuresToMeasureTree(advancedVSeed.measures);
|
|
2320
2322
|
return advancedVSeed;
|
|
2321
2323
|
};
|
|
2322
2324
|
const generateMeasuresByParentId = (measures)=>{
|
|
@@ -2451,7 +2453,7 @@
|
|
|
2451
2453
|
};
|
|
2452
2454
|
const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
2453
2455
|
const { vseed } = context;
|
|
2454
|
-
const usePivotChart =
|
|
2456
|
+
const usePivotChart = chatType_isPivotChart(vseed);
|
|
2455
2457
|
if (usePivotChart) return execPipeline(pivotPipeline, context, advancedVSeed);
|
|
2456
2458
|
return execPipeline(pipeline, context, advancedVSeed);
|
|
2457
2459
|
};
|
|
@@ -2929,7 +2931,7 @@
|
|
|
2929
2931
|
...spec,
|
|
2930
2932
|
data: {
|
|
2931
2933
|
id,
|
|
2932
|
-
values:
|
|
2934
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
|
2933
2935
|
fields: fields
|
|
2934
2936
|
}
|
|
2935
2937
|
};
|
|
@@ -2954,24 +2956,14 @@
|
|
|
2954
2956
|
return alias;
|
|
2955
2957
|
}).join(' & ');
|
|
2956
2958
|
};
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
};
|
|
2961
|
-
const { advancedVSeed, vseed } = context;
|
|
2962
|
-
const { chartType } = vseed;
|
|
2963
|
-
const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed;
|
|
2964
|
-
const config = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
2965
|
-
if (!result.axes) result.axes = [];
|
|
2959
|
+
const isNull = (value)=>null === value;
|
|
2960
|
+
const common_isNull = isNull;
|
|
2961
|
+
const bandAxisStyle = (config)=>{
|
|
2966
2962
|
const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength = 80, labelAutoRotate, labelAutoRotateAngleRange } = config;
|
|
2967
|
-
|
|
2968
|
-
const onlyMeasureId = 0 === (encoding.x || []).filter((v)=>v !== MeasureId).length;
|
|
2969
|
-
const bandAxis = {
|
|
2970
|
-
visible,
|
|
2963
|
+
return {
|
|
2971
2964
|
type: 'band',
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
sampling,
|
|
2965
|
+
sampling: !(labelAutoHide || labelAutoRotate || labelAutoLimit),
|
|
2966
|
+
visible,
|
|
2975
2967
|
hover: true,
|
|
2976
2968
|
label: {
|
|
2977
2969
|
visible: label?.visible,
|
|
@@ -2995,7 +2987,7 @@
|
|
|
2995
2987
|
},
|
|
2996
2988
|
title: {
|
|
2997
2989
|
visible: title?.visible,
|
|
2998
|
-
text: title?.titleText
|
|
2990
|
+
text: title?.titleText,
|
|
2999
2991
|
style: {
|
|
3000
2992
|
fill: title?.titleColor,
|
|
3001
2993
|
fontSize: title?.titleFontSize,
|
|
@@ -3024,16 +3016,32 @@
|
|
|
3024
3016
|
lineWidth: line?.lineWidth,
|
|
3025
3017
|
stroke: line?.lineColor
|
|
3026
3018
|
}
|
|
3027
|
-
}
|
|
3028
|
-
paddingInner: [
|
|
3029
|
-
0.15,
|
|
3030
|
-
0.1
|
|
3031
|
-
],
|
|
3032
|
-
paddingOuter: [
|
|
3033
|
-
0.075,
|
|
3034
|
-
0.1
|
|
3035
|
-
]
|
|
3019
|
+
}
|
|
3036
3020
|
};
|
|
3021
|
+
};
|
|
3022
|
+
const xBand = (spec, context)=>{
|
|
3023
|
+
const result = {
|
|
3024
|
+
...spec
|
|
3025
|
+
};
|
|
3026
|
+
const { advancedVSeed, vseed } = context;
|
|
3027
|
+
const { chartType } = vseed;
|
|
3028
|
+
const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed;
|
|
3029
|
+
const config = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
3030
|
+
if (!result.axes) result.axes = [];
|
|
3031
|
+
const { labelAutoLimitLength = 80 } = config;
|
|
3032
|
+
const onlyMeasureId = 0 === (encoding.x || []).filter((v)=>v !== MeasureId).length;
|
|
3033
|
+
const bandAxis = bandAxisStyle(config);
|
|
3034
|
+
bandAxis.orient = 'bottom';
|
|
3035
|
+
bandAxis.maxHeight = labelAutoLimitLength + 60;
|
|
3036
|
+
bandAxis.paddingInner = [
|
|
3037
|
+
0.15,
|
|
3038
|
+
0.1
|
|
3039
|
+
];
|
|
3040
|
+
bandAxis.paddingOuter = [
|
|
3041
|
+
0.075,
|
|
3042
|
+
0.1
|
|
3043
|
+
];
|
|
3044
|
+
if (common_isNull(bandAxis.title?.text)) bandAxis.title.text = defaultTitleText(measures, dimensions, encoding.x);
|
|
3037
3045
|
if (onlyMeasureId && bandAxis.label) {
|
|
3038
3046
|
const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo;
|
|
3039
3047
|
const colorIdMap = allDatasetReshapeInfo.reduce((prev, cur)=>({
|
|
@@ -3060,22 +3068,9 @@
|
|
|
3060
3068
|
if (!chunk_VCYTMP4D_n(numFormat)) return formatter(value);
|
|
3061
3069
|
return String(value);
|
|
3062
3070
|
};
|
|
3063
|
-
const
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3066
|
-
};
|
|
3067
|
-
const { advancedVSeed, vseed } = context;
|
|
3068
|
-
const { chartType } = vseed;
|
|
3069
|
-
const { measures, dimensions, encoding } = advancedVSeed;
|
|
3070
|
-
const config = advancedVSeed.config?.[chartType]?.yAxis ?? {};
|
|
3071
|
-
if (!result.axes) result.axes = [];
|
|
3072
|
-
const isPivot = isPivotChart(vseed);
|
|
3073
|
-
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = config;
|
|
3074
|
-
const formatter = createNumFormatter(numFormat);
|
|
3075
|
-
const percentFormatter = createNumFormatter({
|
|
3076
|
-
type: 'percent'
|
|
3077
|
-
});
|
|
3078
|
-
const linearAxis = {
|
|
3071
|
+
const linearAxisStyle = (config)=>{
|
|
3072
|
+
const { orient, visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, formatMethod, titleText, id, seriesId, sync, isPivot = false } = config;
|
|
3073
|
+
const axisConfig = {
|
|
3079
3074
|
...isPivot ? {
|
|
3080
3075
|
range: {
|
|
3081
3076
|
min,
|
|
@@ -3088,17 +3083,14 @@
|
|
|
3088
3083
|
visible,
|
|
3089
3084
|
type: log ? 'log' : 'linear',
|
|
3090
3085
|
base: logBase,
|
|
3091
|
-
orient
|
|
3086
|
+
orient,
|
|
3092
3087
|
nice,
|
|
3093
3088
|
zero: log ? false : zero,
|
|
3094
3089
|
inverse,
|
|
3095
3090
|
label: {
|
|
3096
3091
|
space: 8,
|
|
3097
3092
|
visible: label?.visible,
|
|
3098
|
-
formatMethod
|
|
3099
|
-
if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
|
|
3100
|
-
return createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
3101
|
-
},
|
|
3093
|
+
formatMethod,
|
|
3102
3094
|
style: {
|
|
3103
3095
|
fill: label?.labelColor,
|
|
3104
3096
|
angle: label?.labelAngle,
|
|
@@ -3108,7 +3100,7 @@
|
|
|
3108
3100
|
},
|
|
3109
3101
|
title: {
|
|
3110
3102
|
visible: title?.visible,
|
|
3111
|
-
text:
|
|
3103
|
+
text: titleText,
|
|
3112
3104
|
style: {
|
|
3113
3105
|
fill: title?.titleColor,
|
|
3114
3106
|
fontSize: title?.titleFontSize,
|
|
@@ -3137,11 +3129,46 @@
|
|
|
3137
3129
|
lineWidth: line?.lineWidth,
|
|
3138
3130
|
stroke: line?.lineColor
|
|
3139
3131
|
}
|
|
3140
|
-
},
|
|
3141
|
-
innerOffset: {
|
|
3142
|
-
top: 12
|
|
3143
3132
|
}
|
|
3144
3133
|
};
|
|
3134
|
+
if ('bottom' === orient || 'top' === orient) axisConfig.innerOffset = {
|
|
3135
|
+
right: 12
|
|
3136
|
+
};
|
|
3137
|
+
else axisConfig.innerOffset = {
|
|
3138
|
+
top: 12
|
|
3139
|
+
};
|
|
3140
|
+
if (id) axisConfig.id = id;
|
|
3141
|
+
if (seriesId) axisConfig.seriesId = seriesId;
|
|
3142
|
+
if (sync) axisConfig.sync = sync;
|
|
3143
|
+
return axisConfig;
|
|
3144
|
+
};
|
|
3145
|
+
const yLinear = (spec, context)=>{
|
|
3146
|
+
const result = {
|
|
3147
|
+
...spec
|
|
3148
|
+
};
|
|
3149
|
+
const { advancedVSeed, vseed } = context;
|
|
3150
|
+
const { chartType } = vseed;
|
|
3151
|
+
const { measures, dimensions, encoding } = advancedVSeed;
|
|
3152
|
+
const config = advancedVSeed.config?.[chartType]?.yAxis ?? {};
|
|
3153
|
+
if (!result.axes) result.axes = [];
|
|
3154
|
+
const isPivot = chatType_isPivotChart(vseed);
|
|
3155
|
+
const { autoFormat, numFormat = {} } = config;
|
|
3156
|
+
const formatter = createNumFormatter(numFormat);
|
|
3157
|
+
const percentFormatter = createNumFormatter({
|
|
3158
|
+
type: 'percent'
|
|
3159
|
+
});
|
|
3160
|
+
const formatMethod = (value)=>{
|
|
3161
|
+
if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
|
|
3162
|
+
return createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
3163
|
+
};
|
|
3164
|
+
const titleText = config.title?.titleText || defaultTitleText(measures, dimensions, encoding.y);
|
|
3165
|
+
const linearAxis = linearAxisStyle({
|
|
3166
|
+
...config,
|
|
3167
|
+
orient: 'left',
|
|
3168
|
+
formatMethod,
|
|
3169
|
+
titleText,
|
|
3170
|
+
isPivot
|
|
3171
|
+
});
|
|
3145
3172
|
result.axes = [
|
|
3146
3173
|
...result.axes,
|
|
3147
3174
|
linearAxis
|
|
@@ -3337,7 +3364,7 @@
|
|
|
3337
3364
|
const baseConfig = advancedVSeed.config[chartType];
|
|
3338
3365
|
if (!baseConfig || !baseConfig.legend) return result;
|
|
3339
3366
|
const { legend } = baseConfig;
|
|
3340
|
-
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
|
3367
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight, railBackgroundColor, handlerBorderColor } = legend || {};
|
|
3341
3368
|
const orient = [
|
|
3342
3369
|
'bottom',
|
|
3343
3370
|
'bottomLeft',
|
|
@@ -3391,6 +3418,18 @@
|
|
|
3391
3418
|
fontSize: labelFontSize,
|
|
3392
3419
|
fontWeight: labelFontWeight
|
|
3393
3420
|
}
|
|
3421
|
+
},
|
|
3422
|
+
rail: {
|
|
3423
|
+
style: {
|
|
3424
|
+
fill: railBackgroundColor
|
|
3425
|
+
}
|
|
3426
|
+
},
|
|
3427
|
+
handler: {
|
|
3428
|
+
style: {
|
|
3429
|
+
outerBorder: {
|
|
3430
|
+
stroke: handlerBorderColor
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3394
3433
|
}
|
|
3395
3434
|
};
|
|
3396
3435
|
const colorMeasure = findTreeNodesBy(measures, (m)=>'color' === m.encoding)?.[0];
|
|
@@ -3638,7 +3677,7 @@
|
|
|
3638
3677
|
const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedDimensions, advancedVSeedMeasures, encoding, foldInfoList)=>{
|
|
3639
3678
|
const { enable, wrap, showValue, showValuePercent, showDimension, labelOverlap, labelColorSmartInvert, labelStroke, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
|
|
3640
3679
|
const hasDimLabelEncoding = vseedDimensions.some((item)=>encoding.label?.includes(item.id));
|
|
3641
|
-
const labelDims = T(hasDimLabelEncoding ? vseedDimensions.filter((item)=>encoding.label?.includes(item.id)) : showDimension ? advancedVSeedDimensions.filter((d)=>d.id !== MeasureId) : [], (item)=>item.id);
|
|
3680
|
+
const labelDims = T(hasDimLabelEncoding ? vseedDimensions.filter((item)=>encoding.label?.includes(item.id)) : showDimension ? advancedVSeedDimensions.filter((d)=>d.id !== MeasureId && 'row' !== d.encoding && 'column' !== d.encoding) : [], (item)=>item.id);
|
|
3642
3681
|
const labelMeas = T(vseedMeasures.filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
|
3643
3682
|
const percentFormat = chunk_5S4PYKVY_t(numFormat, {
|
|
3644
3683
|
type: 'percent'
|
|
@@ -3713,6 +3752,61 @@
|
|
|
3713
3752
|
fontWeight: 'bold'
|
|
3714
3753
|
}
|
|
3715
3754
|
});
|
|
3755
|
+
const setWholeIcon = (shapeContainer, color)=>{
|
|
3756
|
+
shapeContainer.style.backgroundColor = color;
|
|
3757
|
+
shapeContainer.style.borderColor = color;
|
|
3758
|
+
shapeContainer.style.width = '4px';
|
|
3759
|
+
shapeContainer.style.height = '100%';
|
|
3760
|
+
shapeContainer.style.display = 'inline-block';
|
|
3761
|
+
shapeContainer.style.borderRadius = '2px';
|
|
3762
|
+
shapeContainer.style.marginRight = '6px';
|
|
3763
|
+
const shapeElements = shapeContainer.children;
|
|
3764
|
+
for(let i = 0; i < shapeElements.length; i++){
|
|
3765
|
+
const shapeElement = shapeElements[i];
|
|
3766
|
+
const svgElement = shapeElement.children[0];
|
|
3767
|
+
if (svgElement) svgElement.style.visibility = 'hidden';
|
|
3768
|
+
shapeElement.style.background = 'transparent';
|
|
3769
|
+
shapeElement.style.borderColor = 'transparent';
|
|
3770
|
+
}
|
|
3771
|
+
};
|
|
3772
|
+
const updateTooltipElement = (tooltipElement, actualTooltip)=>{
|
|
3773
|
+
if (!tooltipElement || !tooltipElement.querySelector || !actualTooltip) return;
|
|
3774
|
+
const shapeContainer = tooltipElement.querySelector('.vchart-tooltip-shape-column');
|
|
3775
|
+
if (!shapeContainer) return;
|
|
3776
|
+
if ('mark' === actualTooltip.activeType) {
|
|
3777
|
+
const color = actualTooltip.content[0].shapeFill ?? 'transparent';
|
|
3778
|
+
setWholeIcon(shapeContainer, color);
|
|
3779
|
+
} else if ('dimension' === actualTooltip.activeType) {
|
|
3780
|
+
shapeContainer.style.background = 'transparent';
|
|
3781
|
+
shapeContainer.style.borderColor = 'transparent';
|
|
3782
|
+
shapeContainer.style.width = 'auto';
|
|
3783
|
+
shapeContainer.style.height = 'auto';
|
|
3784
|
+
shapeContainer.style.display = 'inline-block';
|
|
3785
|
+
shapeContainer.style.marginRight = '2px';
|
|
3786
|
+
const shapeElements = shapeContainer.children;
|
|
3787
|
+
for(let i = 0; i < shapeElements.length; i++){
|
|
3788
|
+
const shapeElement = shapeElements[i];
|
|
3789
|
+
const svgElement = shapeElement.children[0];
|
|
3790
|
+
if (svgElement) svgElement.style.visibility = 'hidden';
|
|
3791
|
+
const color = actualTooltip.content[i]?.shapeFill ?? 'transparent';
|
|
3792
|
+
shapeElement.style.width = '4px';
|
|
3793
|
+
shapeElement.style.height = '100%';
|
|
3794
|
+
shapeElement.style.borderRadius = '2px';
|
|
3795
|
+
shapeElement.style.marginRight = '4px';
|
|
3796
|
+
shapeElement.style.backgroundColor = color;
|
|
3797
|
+
shapeElement.style.borderColor = color;
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
const title = tooltipElement.querySelector('.vchart-tooltip-title');
|
|
3801
|
+
if (title) title.style.marginBottom = '8px';
|
|
3802
|
+
};
|
|
3803
|
+
const updateMarkTooltipElement = (tooltipElement, actualTooltip)=>{
|
|
3804
|
+
if (!tooltipElement || !tooltipElement.querySelector || !actualTooltip) return;
|
|
3805
|
+
const shapeContainer = tooltipElement.querySelector('.vchart-tooltip-shape-column');
|
|
3806
|
+
if (!shapeContainer) return;
|
|
3807
|
+
const color = actualTooltip.content[0].shapeFill ?? 'transparent';
|
|
3808
|
+
setWholeIcon(shapeContainer, color);
|
|
3809
|
+
};
|
|
3716
3810
|
const tooltip_tooltip = (spec, context)=>{
|
|
3717
3811
|
const result = {
|
|
3718
3812
|
...spec
|
|
@@ -3739,7 +3833,8 @@
|
|
|
3739
3833
|
visible: true
|
|
3740
3834
|
},
|
|
3741
3835
|
content: createDimensionContent(dimensions, measures, foldInfo, unfoldInfo)
|
|
3742
|
-
}
|
|
3836
|
+
},
|
|
3837
|
+
updateElement: updateTooltipElement
|
|
3743
3838
|
};
|
|
3744
3839
|
return result;
|
|
3745
3840
|
};
|
|
@@ -3968,8 +4063,7 @@
|
|
|
3968
4063
|
}
|
|
3969
4064
|
const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
3970
4065
|
const { advancedVSeed, vseed } = context;
|
|
3971
|
-
const { annotation,
|
|
3972
|
-
const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
|
|
4066
|
+
const { annotation, config } = advancedVSeed;
|
|
3973
4067
|
if (!annotation || !annotation.annotationVerticalLine) return spec;
|
|
3974
4068
|
const theme = config?.[vseed.chartType]?.annotation?.annotationVerticalLine;
|
|
3975
4069
|
const { annotationVerticalLine } = annotation;
|
|
@@ -3985,8 +4079,7 @@
|
|
|
3985
4079
|
insideEnd: 'insideEndTop'
|
|
3986
4080
|
};
|
|
3987
4081
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
|
3988
|
-
const {
|
|
3989
|
-
const dataset = advancedVSeed.dataset.flat();
|
|
4082
|
+
const { xValue, text = '', textPosition = 'insideEnd', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = 'center', textBaseline = 'top', lineColor = theme?.lineColor ?? '#212121', lineStyle = theme?.lineStyle ?? 'dashed', lineVisible = theme?.lineStyle ?? true, lineWidth = theme?.lineWidth ?? 1, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121', textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundPadding = theme?.textBackgroundPadding ?? 2 } = annotationVerticalLine;
|
|
3990
4083
|
const generateOneMarkLine = (x)=>({
|
|
3991
4084
|
x,
|
|
3992
4085
|
autoRange: true,
|
|
@@ -4057,18 +4150,13 @@
|
|
|
4057
4150
|
}
|
|
4058
4151
|
}
|
|
4059
4152
|
});
|
|
4060
|
-
if (
|
|
4153
|
+
if (chunk_BO3LQZNF_o(xValue) || chunk_SFZGYJFI_t(xValue) || chunk_6GTAPB47_e(xValue)) {
|
|
4061
4154
|
const xValueArr = Array.isArray(xValue) ? xValue : [
|
|
4062
4155
|
xValue
|
|
4063
4156
|
];
|
|
4064
4157
|
return xValueArr.map(generateOneMarkLine);
|
|
4065
4158
|
}
|
|
4066
|
-
|
|
4067
|
-
return selectedData.map((datum)=>{
|
|
4068
|
-
if (datum[unfoldInfo.encodingX]) return generateOneMarkLine(datum[unfoldInfo.encodingX]);
|
|
4069
|
-
if (datum[foldInfo.measureValue]) return generateOneMarkLine(datum[foldInfo.measureValue]);
|
|
4070
|
-
return {};
|
|
4071
|
-
});
|
|
4159
|
+
return [];
|
|
4072
4160
|
});
|
|
4073
4161
|
const specMarkLine = spec.markLine || [];
|
|
4074
4162
|
const newMarkLine = [
|
|
@@ -4082,8 +4170,7 @@
|
|
|
4082
4170
|
};
|
|
4083
4171
|
const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
4084
4172
|
const { advancedVSeed, vseed } = context;
|
|
4085
|
-
const { annotation,
|
|
4086
|
-
const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
|
|
4173
|
+
const { annotation, config } = advancedVSeed;
|
|
4087
4174
|
if (!annotation || !annotation.annotationHorizontalLine) return spec;
|
|
4088
4175
|
const theme = config?.[vseed.chartType]?.annotation?.annotationHorizontalLine;
|
|
4089
4176
|
const { annotationHorizontalLine } = annotation;
|
|
@@ -4099,8 +4186,7 @@
|
|
|
4099
4186
|
insideEnd: 'insideEndTop'
|
|
4100
4187
|
};
|
|
4101
4188
|
const markLine = annotationHorizontalLineList.flatMap((annotationHorizontalLine)=>{
|
|
4102
|
-
const {
|
|
4103
|
-
const dataset = advancedVSeed.dataset.flat();
|
|
4189
|
+
const { yValue, text = '', textPosition = 'insideEnd', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = 'right', textBaseline = 'bottom', lineColor = theme?.lineColor ?? '#212121', lineStyle = theme?.lineStyle ?? 'dashed', lineVisible = theme?.lineStyle ?? true, lineWidth = theme?.lineWidth ?? 1, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121', textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundPadding = theme?.textBackgroundPadding ?? 2 } = annotationHorizontalLine;
|
|
4104
4190
|
const generateOneMarkLine = (y)=>({
|
|
4105
4191
|
y,
|
|
4106
4192
|
autoRange: true,
|
|
@@ -4170,18 +4256,13 @@
|
|
|
4170
4256
|
}
|
|
4171
4257
|
}
|
|
4172
4258
|
});
|
|
4173
|
-
if (
|
|
4259
|
+
if (chunk_BO3LQZNF_o(yValue) || chunk_SFZGYJFI_t(yValue) || chunk_6GTAPB47_e(yValue)) {
|
|
4174
4260
|
const yValueArr = Array.isArray(yValue) ? yValue : [
|
|
4175
4261
|
yValue
|
|
4176
4262
|
];
|
|
4177
4263
|
return yValueArr.map(generateOneMarkLine);
|
|
4178
4264
|
}
|
|
4179
|
-
|
|
4180
|
-
return selectedData.map((datum)=>{
|
|
4181
|
-
if (datum[unfoldInfo.encodingY]) return generateOneMarkLine(datum[unfoldInfo.encodingY]);
|
|
4182
|
-
if (datum[foldInfo.measureValue]) return generateOneMarkLine(datum[foldInfo.measureValue]);
|
|
4183
|
-
return {};
|
|
4184
|
-
});
|
|
4265
|
+
return [];
|
|
4185
4266
|
});
|
|
4186
4267
|
const specMarkLine = spec.markLine || [];
|
|
4187
4268
|
const newMarkLine = [
|
|
@@ -5553,8 +5634,8 @@
|
|
|
5553
5634
|
});
|
|
5554
5635
|
spec.chartDimensionLinkage = {
|
|
5555
5636
|
showTooltip: config.showTooltip ?? chartSpec?.tooltip?.dimension?.visible ?? true,
|
|
5556
|
-
|
|
5557
|
-
|
|
5637
|
+
heightLimitToShowTooltipForEdgeRow: spec.defaultRowHeight / 2,
|
|
5638
|
+
widthLimitToShowTooltipForEdgeColumn: spec.defaultColWidth / 2,
|
|
5558
5639
|
labelHoverOnAxis
|
|
5559
5640
|
};
|
|
5560
5641
|
return spec;
|
|
@@ -5562,7 +5643,7 @@
|
|
|
5562
5643
|
const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>{
|
|
5563
5644
|
const adapted = (spec, context)=>{
|
|
5564
5645
|
const { vseed } = context;
|
|
5565
|
-
const usePivotChart =
|
|
5646
|
+
const usePivotChart = chatType_isPivotChart(vseed);
|
|
5566
5647
|
if (usePivotChart) return execPipeline(pivotPipeline, context, spec);
|
|
5567
5648
|
return execPipeline(pipeline, context, spec);
|
|
5568
5649
|
};
|
|
@@ -7080,7 +7161,7 @@
|
|
|
7080
7161
|
...spec,
|
|
7081
7162
|
data: {
|
|
7082
7163
|
id,
|
|
7083
|
-
values:
|
|
7164
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
|
7084
7165
|
fields: fields
|
|
7085
7166
|
}
|
|
7086
7167
|
};
|
|
@@ -7094,79 +7175,24 @@
|
|
|
7094
7175
|
const { chartType } = vseed;
|
|
7095
7176
|
const config = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
7096
7177
|
if (!result.axes) result.axes = [];
|
|
7097
|
-
const isPivot =
|
|
7098
|
-
const {
|
|
7178
|
+
const isPivot = chatType_isPivotChart(vseed);
|
|
7179
|
+
const { autoFormat, numFormat = {} } = config;
|
|
7099
7180
|
const formatter = createNumFormatter(numFormat);
|
|
7100
7181
|
const percentFormatter = createNumFormatter({
|
|
7101
7182
|
type: 'percent'
|
|
7102
7183
|
});
|
|
7103
|
-
const
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
min,
|
|
7107
|
-
max
|
|
7108
|
-
}
|
|
7109
|
-
} : {
|
|
7110
|
-
min,
|
|
7111
|
-
max
|
|
7112
|
-
},
|
|
7113
|
-
visible,
|
|
7114
|
-
type: log ? 'log' : 'linear',
|
|
7115
|
-
base: logBase,
|
|
7116
|
-
orient: 'bottom',
|
|
7117
|
-
nice,
|
|
7118
|
-
zero: log ? false : zero,
|
|
7119
|
-
inverse,
|
|
7120
|
-
label: {
|
|
7121
|
-
space: 8,
|
|
7122
|
-
visible: label?.visible,
|
|
7123
|
-
formatMethod: (value)=>{
|
|
7124
|
-
if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
|
|
7125
|
-
return createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
7126
|
-
},
|
|
7127
|
-
style: {
|
|
7128
|
-
fill: label?.labelColor,
|
|
7129
|
-
angle: label?.labelAngle,
|
|
7130
|
-
fontSize: label?.labelFontSize,
|
|
7131
|
-
fontWeight: label?.labelFontWeight
|
|
7132
|
-
}
|
|
7133
|
-
},
|
|
7134
|
-
title: {
|
|
7135
|
-
visible: title?.visible,
|
|
7136
|
-
text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x),
|
|
7137
|
-
style: {
|
|
7138
|
-
fill: title?.titleColor,
|
|
7139
|
-
fontSize: title?.titleFontSize,
|
|
7140
|
-
fontWeight: title?.titleFontWeight
|
|
7141
|
-
}
|
|
7142
|
-
},
|
|
7143
|
-
tick: {
|
|
7144
|
-
visible: tick?.visible,
|
|
7145
|
-
tickSize: tick?.tickSize,
|
|
7146
|
-
inside: tick?.tickInside,
|
|
7147
|
-
style: {
|
|
7148
|
-
stroke: tick?.tickColor
|
|
7149
|
-
}
|
|
7150
|
-
},
|
|
7151
|
-
grid: {
|
|
7152
|
-
visible: grid?.visible,
|
|
7153
|
-
style: {
|
|
7154
|
-
lineWidth: grid?.gridWidth,
|
|
7155
|
-
stroke: grid?.gridColor,
|
|
7156
|
-
lineDash: grid?.gridLineDash
|
|
7157
|
-
}
|
|
7158
|
-
},
|
|
7159
|
-
domainLine: {
|
|
7160
|
-
visible: line?.visible,
|
|
7161
|
-
style: {
|
|
7162
|
-
lineWidth: line?.lineWidth,
|
|
7163
|
-
stroke: line?.lineColor
|
|
7164
|
-
}
|
|
7165
|
-
},
|
|
7166
|
-
innerOffset: {
|
|
7167
|
-
right: 12
|
|
7168
|
-
}
|
|
7184
|
+
const formatMethod = (value)=>{
|
|
7185
|
+
if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
|
|
7186
|
+
return createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
7169
7187
|
};
|
|
7188
|
+
const titleText = config.title?.titleText || defaultTitleText(measures, dimensions, encoding.x);
|
|
7189
|
+
const linearAxis = linearAxisStyle({
|
|
7190
|
+
...config,
|
|
7191
|
+
orient: 'bottom',
|
|
7192
|
+
formatMethod,
|
|
7193
|
+
titleText,
|
|
7194
|
+
isPivot
|
|
7195
|
+
});
|
|
7170
7196
|
result.axes = [
|
|
7171
7197
|
...result.axes,
|
|
7172
7198
|
linearAxis
|
|
@@ -7182,78 +7208,22 @@
|
|
|
7182
7208
|
const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed;
|
|
7183
7209
|
const config = advancedVSeed.config?.[chartType]?.yAxis ?? {};
|
|
7184
7210
|
if (!result.axes) result.axes = [];
|
|
7185
|
-
const {
|
|
7186
|
-
const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit);
|
|
7211
|
+
const { labelAutoLimitLength = 80 } = config;
|
|
7187
7212
|
const onlyMeasureId = 0 === (encoding.y || []).filter((v)=>v !== MeasureId).length;
|
|
7188
|
-
const bandAxis =
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
fill: label?.labelColor,
|
|
7203
|
-
angle: label?.labelAngle,
|
|
7204
|
-
fontSize: label?.labelFontSize,
|
|
7205
|
-
fontWeight: label?.labelFontWeight
|
|
7206
|
-
},
|
|
7207
|
-
minGap: labelAutoHideGap,
|
|
7208
|
-
autoHide: labelAutoHide,
|
|
7209
|
-
autoHideMethod: 'greedy',
|
|
7210
|
-
autoHideSeparation: labelAutoHideGap,
|
|
7211
|
-
autoLimit: labelAutoLimit,
|
|
7212
|
-
autoRotate: labelAutoRotate,
|
|
7213
|
-
autoRotateAngle: labelAutoRotateAngleRange,
|
|
7214
|
-
lastVisible: true
|
|
7215
|
-
},
|
|
7216
|
-
title: {
|
|
7217
|
-
visible: title?.visible,
|
|
7218
|
-
text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y),
|
|
7219
|
-
style: {
|
|
7220
|
-
fill: title?.titleColor,
|
|
7221
|
-
fontSize: title?.titleFontSize,
|
|
7222
|
-
fontWeight: title?.titleFontWeight
|
|
7223
|
-
}
|
|
7224
|
-
},
|
|
7225
|
-
tick: {
|
|
7226
|
-
visible: tick?.visible,
|
|
7227
|
-
tickSize: tick?.tickSize,
|
|
7228
|
-
inside: tick?.tickInside,
|
|
7229
|
-
style: {
|
|
7230
|
-
stroke: tick?.tickColor
|
|
7231
|
-
}
|
|
7232
|
-
},
|
|
7233
|
-
grid: {
|
|
7234
|
-
visible: grid?.visible,
|
|
7235
|
-
style: {
|
|
7236
|
-
lineWidth: grid?.gridWidth,
|
|
7237
|
-
stroke: grid?.gridColor,
|
|
7238
|
-
lineDash: grid?.gridLineDash
|
|
7239
|
-
}
|
|
7240
|
-
},
|
|
7241
|
-
domainLine: {
|
|
7242
|
-
visible: line?.visible,
|
|
7243
|
-
style: {
|
|
7244
|
-
lineWidth: line?.lineWidth,
|
|
7245
|
-
stroke: line?.lineColor
|
|
7246
|
-
}
|
|
7247
|
-
},
|
|
7248
|
-
paddingInner: [
|
|
7249
|
-
0.15,
|
|
7250
|
-
0.1
|
|
7251
|
-
],
|
|
7252
|
-
paddingOuter: [
|
|
7253
|
-
0.075,
|
|
7254
|
-
0.1
|
|
7255
|
-
]
|
|
7256
|
-
};
|
|
7213
|
+
const bandAxis = bandAxisStyle(config);
|
|
7214
|
+
bandAxis.type = 'band';
|
|
7215
|
+
bandAxis.orient = 'left';
|
|
7216
|
+
bandAxis.maxWidth = labelAutoLimitLength + 60;
|
|
7217
|
+
if (bandAxis.label) bandAxis.label.containerAlign = 'right';
|
|
7218
|
+
bandAxis.paddingInner = [
|
|
7219
|
+
0.15,
|
|
7220
|
+
0.1
|
|
7221
|
+
];
|
|
7222
|
+
bandAxis.paddingOuter = [
|
|
7223
|
+
0.075,
|
|
7224
|
+
0.1
|
|
7225
|
+
];
|
|
7226
|
+
if (common_isNull(bandAxis.title?.text)) bandAxis.title.text = defaultTitleText(measures, dimensions, encoding.y);
|
|
7257
7227
|
if (onlyMeasureId && bandAxis.label) {
|
|
7258
7228
|
const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo;
|
|
7259
7229
|
const colorIdMap = allDatasetReshapeInfo.reduce((prev, cur)=>({
|
|
@@ -8247,7 +8217,7 @@
|
|
|
8247
8217
|
...spec,
|
|
8248
8218
|
data: {
|
|
8249
8219
|
id,
|
|
8250
|
-
values:
|
|
8220
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
|
|
8251
8221
|
fields: fields
|
|
8252
8222
|
}
|
|
8253
8223
|
};
|
|
@@ -8308,7 +8278,8 @@
|
|
|
8308
8278
|
},
|
|
8309
8279
|
dimension: {
|
|
8310
8280
|
visible: false
|
|
8311
|
-
}
|
|
8281
|
+
},
|
|
8282
|
+
updateElement: updateTooltipElement
|
|
8312
8283
|
};
|
|
8313
8284
|
return result;
|
|
8314
8285
|
};
|
|
@@ -8421,37 +8392,56 @@
|
|
|
8421
8392
|
const t = 1 - uu * uu * uu;
|
|
8422
8393
|
return t * t * t;
|
|
8423
8394
|
}
|
|
8395
|
+
function stratifiedSample(sortedData, maxSamples) {
|
|
8396
|
+
const n = sortedData.length;
|
|
8397
|
+
if (n <= maxSamples) return sortedData;
|
|
8398
|
+
const sampled = [], step = n / maxSamples;
|
|
8399
|
+
for(let i = 0; i < maxSamples; i++){
|
|
8400
|
+
const idx = Math.min(Math.floor(i * step), n - 1);
|
|
8401
|
+
sampled.push(sortedData[idx]);
|
|
8402
|
+
}
|
|
8403
|
+
return sampled;
|
|
8404
|
+
}
|
|
8424
8405
|
function regressionLowess(data, x = (d)=>d.x, y = (d)=>d.y, options = {}) {
|
|
8425
8406
|
var _a;
|
|
8426
|
-
const span = options.span || .3, degree = 0 === options.degree ? 0 : 1, alpha = null != (_a =
|
|
8407
|
+
const span = options.span || .3, degree = 0 === options.degree ? 0 : 1, alpha = null != (_a = options.alpha) ? _a : .05, iterations = null == options.iterations ? 2 : options.iterations, maxSamples = options.maxSamples || 1e3, rawPoints = [];
|
|
8427
8408
|
visitPoints(data, x, y, (dx, dy)=>{
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8409
|
+
rawPoints.push({
|
|
8410
|
+
x: dx,
|
|
8411
|
+
y: dy
|
|
8412
|
+
});
|
|
8413
|
+
}), rawPoints.sort((a, b)=>a.x - b.x);
|
|
8414
|
+
const sampledPoints = stratifiedSample(rawPoints, maxSamples), n = sampledPoints.length, ptsX = new Array(n), ptsY = new Array(n);
|
|
8415
|
+
for(let i = 0; i < n; i++)ptsX[i] = sampledPoints[i].x, ptsY[i] = sampledPoints[i].y;
|
|
8431
8416
|
function predictSingle(x0, robustWeights) {
|
|
8432
8417
|
if (0 === n) return 0;
|
|
8433
|
-
|
|
8434
|
-
for(
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
}
|
|
8438
|
-
|
|
8439
|
-
|
|
8418
|
+
let left = 0, right = n;
|
|
8419
|
+
for(; left < right;){
|
|
8420
|
+
const mid = left + right >> 1;
|
|
8421
|
+
ptsX[mid] < x0 ? left = mid + 1 : right = mid;
|
|
8422
|
+
}
|
|
8423
|
+
const m = Math.max(2, Math.min(n, Math.floor(span * n))), start = Math.max(0, left - Math.floor(m / 2)), end = Math.min(n, start + m), actualStart = Math.max(0, end - m);
|
|
8424
|
+
let maxDist = 0;
|
|
8425
|
+
const windowSize = end - actualStart, distances = new Array(windowSize);
|
|
8426
|
+
for(let i = actualStart; i < end; i++){
|
|
8427
|
+
const dist = Math.abs(ptsX[i] - x0);
|
|
8428
|
+
distances[i - actualStart] = dist, dist > maxDist && (maxDist = dist);
|
|
8429
|
+
}
|
|
8440
8430
|
let sumw = 0;
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
let wi = tricube(0 === maxDist ? 0 :
|
|
8444
|
-
robustWeights && null != robustWeights[
|
|
8431
|
+
const w = new Array(windowSize);
|
|
8432
|
+
for(let i = 0; i < windowSize; i++){
|
|
8433
|
+
let wi = tricube(0 === maxDist ? 0 : distances[i] / maxDist);
|
|
8434
|
+
robustWeights && null != robustWeights[actualStart + i] && (wi *= robustWeights[actualStart + i]), w[i] = wi, sumw += wi;
|
|
8445
8435
|
}
|
|
8446
|
-
if (0 === sumw) return ptsY[
|
|
8436
|
+
if (0 === sumw) return ptsY[left < n ? left : n - 1];
|
|
8447
8437
|
if (0 === degree) {
|
|
8448
8438
|
let s = 0;
|
|
8449
|
-
for(let i = 0; i <
|
|
8439
|
+
for(let i = 0; i < w.length; i++)s += w[i] * ptsY[actualStart + i];
|
|
8450
8440
|
return s / sumw;
|
|
8451
8441
|
}
|
|
8452
8442
|
let sw = 0, sx = 0, sy = 0, sxx = 0, sxy = 0;
|
|
8453
|
-
for(let i =
|
|
8454
|
-
const idx =
|
|
8443
|
+
for(let i = actualStart; i < end; i++){
|
|
8444
|
+
const idx = i - actualStart, xi = ptsX[i], yi = ptsY[i], wi = w[idx];
|
|
8455
8445
|
sw += wi, sx += wi * xi, sy += wi * yi, sxx += wi * xi * xi, sxy += wi * xi * yi;
|
|
8456
8446
|
}
|
|
8457
8447
|
const meanX = sx / sw, meanY = sy / sw, denom = sxx - sx * meanX, slope = Math.abs(denom) < 1e-12 ? 0 : (sxy - sx * meanY) / denom;
|
|
@@ -8459,8 +8449,8 @@
|
|
|
8459
8449
|
}
|
|
8460
8450
|
function predict(x0) {
|
|
8461
8451
|
if (Array.isArray(x0)) {
|
|
8462
|
-
const out =
|
|
8463
|
-
for(let i = 0; i <
|
|
8452
|
+
const len = x0.length, out = new Array(len);
|
|
8453
|
+
for(let i = 0; i < len; i++)out[i] = predictSingle(x0[i]);
|
|
8464
8454
|
return out;
|
|
8465
8455
|
}
|
|
8466
8456
|
return predictSingle(x0);
|
|
@@ -8469,26 +8459,23 @@
|
|
|
8469
8459
|
predict: predict,
|
|
8470
8460
|
evaluate: predict,
|
|
8471
8461
|
evaluateGrid: function(N) {
|
|
8472
|
-
|
|
8473
|
-
if (
|
|
8474
|
-
|
|
8475
|
-
let min = 1 / 0, max = -1 / 0;
|
|
8476
|
-
for(let i = 0; i < n; i++)ptsX[i] < min && (min = ptsX[i]), ptsX[i] > max && (max = ptsX[i]);
|
|
8462
|
+
if (N <= 0) return [];
|
|
8463
|
+
if (0 === n) return [];
|
|
8464
|
+
const out = new Array(N), min = ptsX[0], max = ptsX[n - 1];
|
|
8477
8465
|
if (min === max) {
|
|
8478
8466
|
const v = predictSingle(min);
|
|
8479
|
-
for(let i = 0; i < N; i++)out
|
|
8467
|
+
for(let i = 0; i < N; i++)out[i] = {
|
|
8480
8468
|
x: min,
|
|
8481
8469
|
y: v
|
|
8482
|
-
}
|
|
8470
|
+
};
|
|
8483
8471
|
return out;
|
|
8484
8472
|
}
|
|
8485
8473
|
const step = (max - min) / (N - 1);
|
|
8486
8474
|
let robustWeights;
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
for(let i = 0; i < n; i++)res.push(Math.abs(ptsY[i] - fits[i]));
|
|
8475
|
+
const effectiveIterations = null != options.iterations ? iterations : n > 500 ? 0 : iterations;
|
|
8476
|
+
if (effectiveIterations > 0) for(let iter = 0; iter < effectiveIterations; iter++){
|
|
8477
|
+
const fits = new Array(n), res = new Array(n);
|
|
8478
|
+
for(let i = 0; i < n; i++)fits[i] = predictSingle(ptsX[i], robustWeights), res[i] = Math.abs(ptsY[i] - fits[i]);
|
|
8492
8479
|
const med = res.slice().sort((a, b)=>a - b)[Math.floor(n / 2)] || 0;
|
|
8493
8480
|
robustWeights = new Array(n);
|
|
8494
8481
|
for(let i = 0; i < n; i++){
|
|
@@ -8498,10 +8485,10 @@
|
|
|
8498
8485
|
}
|
|
8499
8486
|
for(let i = 0; i < N; i++){
|
|
8500
8487
|
const px = i === N - 1 ? max : min + step * i;
|
|
8501
|
-
out
|
|
8488
|
+
out[i] = {
|
|
8502
8489
|
x: px,
|
|
8503
8490
|
y: predictSingle(px, robustWeights)
|
|
8504
|
-
}
|
|
8491
|
+
};
|
|
8505
8492
|
}
|
|
8506
8493
|
return out;
|
|
8507
8494
|
},
|
|
@@ -8509,9 +8496,8 @@
|
|
|
8509
8496
|
const out = [];
|
|
8510
8497
|
if (N <= 0) return out;
|
|
8511
8498
|
if (0 === n) return out;
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
if (min === 1 / 0 || max === -1 / 0) return out;
|
|
8499
|
+
const min = ptsX[0], max = ptsX[n - 1];
|
|
8500
|
+
if (void 0 === min || void 0 === max || min === 1 / 0 || max === -1 / 0) return out;
|
|
8515
8501
|
const comps = computeLinearCIComponents(data, x, y, (xx)=>predictSingle(xx));
|
|
8516
8502
|
if (0 === comps.n) return out;
|
|
8517
8503
|
const z = Math.abs(invNorm(1 - alpha / 2));
|
|
@@ -9341,6 +9327,10 @@
|
|
|
9341
9327
|
result.animation = true;
|
|
9342
9328
|
return result;
|
|
9343
9329
|
};
|
|
9330
|
+
const DEFAULT_DUAL_CHART_TYPE = {
|
|
9331
|
+
primary: 'column',
|
|
9332
|
+
secondary: 'line'
|
|
9333
|
+
};
|
|
9344
9334
|
const dualChartTypePrimary = (spec, context)=>{
|
|
9345
9335
|
const result = {
|
|
9346
9336
|
...spec,
|
|
@@ -9350,12 +9340,9 @@
|
|
|
9350
9340
|
const { chartType } = vseed;
|
|
9351
9341
|
const { datasetReshapeInfo } = advancedVSeed;
|
|
9352
9342
|
const index = datasetReshapeInfo[0].index;
|
|
9353
|
-
const config = advancedVSeed.config?.[chartType]?.dualChartType ||
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
};
|
|
9357
|
-
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
|
9358
|
-
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
|
9343
|
+
const config = advancedVSeed.config?.[chartType]?.dualChartType || DEFAULT_DUAL_CHART_TYPE;
|
|
9344
|
+
const primary = (Array.isArray(config) ? config[index]?.primary || config[0]?.primary : config.primary) ?? DEFAULT_DUAL_CHART_TYPE.primary;
|
|
9345
|
+
const secondary = (Array.isArray(config) ? config[index]?.secondary || config[0]?.secondary : config.secondary) ?? DEFAULT_DUAL_CHART_TYPE.secondary;
|
|
9359
9346
|
const bothColumn = 'column' === primary && 'column' === secondary;
|
|
9360
9347
|
const type = bothColumn ? 'columnParallel' : primary;
|
|
9361
9348
|
switch(type){
|
|
@@ -9406,13 +9393,10 @@
|
|
|
9406
9393
|
const { advancedVSeed, vseed } = context;
|
|
9407
9394
|
const { chartType } = vseed;
|
|
9408
9395
|
const { datasetReshapeInfo } = advancedVSeed;
|
|
9409
|
-
const config = advancedVSeed.config?.[chartType]?.dualChartType ||
|
|
9410
|
-
primary: 'column',
|
|
9411
|
-
secondary: 'line'
|
|
9412
|
-
};
|
|
9396
|
+
const config = advancedVSeed.config?.[chartType]?.dualChartType || DEFAULT_DUAL_CHART_TYPE;
|
|
9413
9397
|
const index = datasetReshapeInfo[0].index;
|
|
9414
|
-
const primary = Array.isArray(config) ? config[index]
|
|
9415
|
-
const secondary = Array.isArray(config) ? config[index]
|
|
9398
|
+
const primary = (Array.isArray(config) ? config[index]?.primary || config[0]?.primary : config.primary) ?? DEFAULT_DUAL_CHART_TYPE.primary;
|
|
9399
|
+
const secondary = (Array.isArray(config) ? config[index]?.secondary || config[0]?.secondary : config.secondary) ?? DEFAULT_DUAL_CHART_TYPE.secondary;
|
|
9416
9400
|
const bothColumn = 'column' === primary && 'column' === secondary;
|
|
9417
9401
|
const type = bothColumn ? 'columnParallel' : secondary;
|
|
9418
9402
|
switch(type){
|
|
@@ -9451,7 +9435,7 @@
|
|
|
9451
9435
|
result.type = 'scatter';
|
|
9452
9436
|
break;
|
|
9453
9437
|
default:
|
|
9454
|
-
result.type = secondary;
|
|
9438
|
+
result.type = secondary ?? DEFAULT_DUAL_CHART_TYPE.secondary;
|
|
9455
9439
|
}
|
|
9456
9440
|
return result;
|
|
9457
9441
|
};
|
|
@@ -9490,7 +9474,7 @@
|
|
|
9490
9474
|
...spec,
|
|
9491
9475
|
data: {
|
|
9492
9476
|
id: `${id}-primary-dataset`,
|
|
9493
|
-
values:
|
|
9477
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
|
9494
9478
|
fields: fields
|
|
9495
9479
|
}
|
|
9496
9480
|
};
|
|
@@ -9530,7 +9514,7 @@
|
|
|
9530
9514
|
...spec,
|
|
9531
9515
|
data: {
|
|
9532
9516
|
id: `${id}-secondary-dataset`,
|
|
9533
|
-
values:
|
|
9517
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
|
9534
9518
|
fields: fields
|
|
9535
9519
|
}
|
|
9536
9520
|
};
|
|
@@ -9637,7 +9621,8 @@
|
|
|
9637
9621
|
enable: true
|
|
9638
9622
|
} } = baseConfig;
|
|
9639
9623
|
result.tooltip = {
|
|
9640
|
-
style: getTooltipStyle(tooltip)
|
|
9624
|
+
style: getTooltipStyle(tooltip),
|
|
9625
|
+
updateElement: updateTooltipElement
|
|
9641
9626
|
};
|
|
9642
9627
|
return result;
|
|
9643
9628
|
};
|
|
@@ -9678,66 +9663,20 @@
|
|
|
9678
9663
|
];
|
|
9679
9664
|
const seriesId = alignTicksConfig ? seriesIds : seriesIds[0];
|
|
9680
9665
|
if (!result.axes) result.axes = [];
|
|
9681
|
-
const {
|
|
9666
|
+
const { autoFormat, numFormat = {} } = yAxisConfig ?? {};
|
|
9682
9667
|
const formatter = createNumFormatter(numFormat);
|
|
9668
|
+
const formatMethod = (value)=>createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
9669
|
+
const titleText = yAxisConfig?.title?.titleText || defaultTitleText(measures, dimensions, encoding.y);
|
|
9683
9670
|
const linearAxis = {
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
max,
|
|
9694
|
-
min,
|
|
9695
|
-
label: {
|
|
9696
|
-
space: 8,
|
|
9697
|
-
visible: label?.visible,
|
|
9698
|
-
formatMethod: (value)=>createLinearFormat(value, autoFormat, numFormat, formatter),
|
|
9699
|
-
style: {
|
|
9700
|
-
fill: label?.labelColor,
|
|
9701
|
-
angle: label?.labelAngle,
|
|
9702
|
-
fontSize: label?.labelFontSize,
|
|
9703
|
-
fontWeight: label?.labelFontWeight
|
|
9704
|
-
}
|
|
9705
|
-
},
|
|
9706
|
-
title: {
|
|
9707
|
-
visible: title?.visible,
|
|
9708
|
-
text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y),
|
|
9709
|
-
style: {
|
|
9710
|
-
fill: title?.titleColor,
|
|
9711
|
-
fontSize: title?.titleFontSize,
|
|
9712
|
-
fontWeight: title?.titleFontWeight
|
|
9713
|
-
}
|
|
9714
|
-
},
|
|
9715
|
-
tick: {
|
|
9716
|
-
visible: tick?.visible,
|
|
9717
|
-
tickSize: tick?.tickSize,
|
|
9718
|
-
inside: tick?.tickInside,
|
|
9719
|
-
style: {
|
|
9720
|
-
stroke: tick?.tickColor
|
|
9721
|
-
}
|
|
9722
|
-
},
|
|
9723
|
-
grid: {
|
|
9724
|
-
visible: grid?.visible,
|
|
9725
|
-
style: {
|
|
9726
|
-
lineWidth: grid?.gridWidth,
|
|
9727
|
-
stroke: grid?.gridColor,
|
|
9728
|
-
lineDash: grid?.gridLineDash
|
|
9729
|
-
}
|
|
9730
|
-
},
|
|
9731
|
-
domainLine: {
|
|
9732
|
-
visible: line?.visible,
|
|
9733
|
-
style: {
|
|
9734
|
-
lineWidth: line?.lineWidth,
|
|
9735
|
-
stroke: line?.lineColor
|
|
9736
|
-
}
|
|
9737
|
-
},
|
|
9738
|
-
innerOffset: {
|
|
9739
|
-
top: 12
|
|
9740
|
-
}
|
|
9671
|
+
...linearAxisStyle({
|
|
9672
|
+
...yAxisConfig,
|
|
9673
|
+
orient: 'left',
|
|
9674
|
+
formatMethod,
|
|
9675
|
+
titleText,
|
|
9676
|
+
id,
|
|
9677
|
+
seriesId
|
|
9678
|
+
}),
|
|
9679
|
+
visible: isEmptySecondary ? false : yAxisConfig?.visible ?? true
|
|
9741
9680
|
};
|
|
9742
9681
|
result.axes = [
|
|
9743
9682
|
...result.axes,
|
|
@@ -9771,66 +9710,25 @@
|
|
|
9771
9710
|
];
|
|
9772
9711
|
const seriesId = alignTicksConfig ? seriesIds : seriesIds[1];
|
|
9773
9712
|
if (!result.axes) result.axes = [];
|
|
9774
|
-
const {
|
|
9713
|
+
const { autoFormat, numFormat = {} } = yAxisConfig ?? {};
|
|
9775
9714
|
const formatter = createNumFormatter(numFormat);
|
|
9776
|
-
const
|
|
9777
|
-
|
|
9715
|
+
const formatMethod = (value)=>createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
9716
|
+
const titleText = yAxisConfig?.title?.titleText || defaultTitleText(measures, dimensions, encoding.y);
|
|
9717
|
+
const baseStyle = linearAxisStyle({
|
|
9718
|
+
...yAxisConfig,
|
|
9719
|
+
orient: 'right',
|
|
9720
|
+
formatMethod,
|
|
9721
|
+
titleText,
|
|
9778
9722
|
id,
|
|
9779
9723
|
seriesId,
|
|
9780
|
-
sync
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
zero: log ? false : zero,
|
|
9786
|
-
inverse,
|
|
9787
|
-
max,
|
|
9788
|
-
min,
|
|
9789
|
-
label: {
|
|
9790
|
-
space: 8,
|
|
9791
|
-
visible: label?.visible,
|
|
9792
|
-
formatMethod: (value)=>createLinearFormat(value, autoFormat, numFormat, formatter),
|
|
9793
|
-
style: {
|
|
9794
|
-
fill: label?.labelColor,
|
|
9795
|
-
angle: label?.labelAngle,
|
|
9796
|
-
fontSize: label?.labelFontSize,
|
|
9797
|
-
fontWeight: label?.labelFontWeight
|
|
9798
|
-
}
|
|
9799
|
-
},
|
|
9800
|
-
title: {
|
|
9801
|
-
visible: title?.visible,
|
|
9802
|
-
text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y),
|
|
9803
|
-
style: {
|
|
9804
|
-
fill: title?.titleColor,
|
|
9805
|
-
fontSize: title?.titleFontSize,
|
|
9806
|
-
fontWeight: title?.titleFontWeight
|
|
9807
|
-
}
|
|
9808
|
-
},
|
|
9809
|
-
tick: {
|
|
9810
|
-
visible: tick?.visible,
|
|
9811
|
-
tickSize: tick?.tickSize,
|
|
9812
|
-
inside: tick?.tickInside,
|
|
9813
|
-
style: {
|
|
9814
|
-
stroke: tick?.tickColor
|
|
9815
|
-
}
|
|
9816
|
-
},
|
|
9724
|
+
sync
|
|
9725
|
+
});
|
|
9726
|
+
const linearAxis = {
|
|
9727
|
+
...baseStyle,
|
|
9728
|
+
visible: isEmptySecondary ? false : yAxisConfig?.visible ?? true,
|
|
9817
9729
|
grid: {
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
lineWidth: grid?.gridWidth,
|
|
9821
|
-
stroke: grid?.gridColor,
|
|
9822
|
-
lineDash: grid?.gridLineDash
|
|
9823
|
-
}
|
|
9824
|
-
},
|
|
9825
|
-
domainLine: {
|
|
9826
|
-
visible: line?.visible,
|
|
9827
|
-
style: {
|
|
9828
|
-
lineWidth: line?.lineWidth,
|
|
9829
|
-
stroke: line?.lineColor
|
|
9830
|
-
}
|
|
9831
|
-
},
|
|
9832
|
-
innerOffset: {
|
|
9833
|
-
top: 12
|
|
9730
|
+
...baseStyle.grid,
|
|
9731
|
+
visible: onlySecondary ? true : yAxisConfig?.grid?.visible
|
|
9834
9732
|
}
|
|
9835
9733
|
};
|
|
9836
9734
|
result.axes = [
|
|
@@ -11235,6 +11133,26 @@
|
|
|
11235
11133
|
markStyle_markStyle,
|
|
11236
11134
|
annotation_annotation
|
|
11237
11135
|
];
|
|
11136
|
+
const heatmapBandAxis = (spec, context)=>{
|
|
11137
|
+
const result = {
|
|
11138
|
+
...spec
|
|
11139
|
+
};
|
|
11140
|
+
const { advancedVSeed, vseed } = context;
|
|
11141
|
+
const { chartType } = vseed;
|
|
11142
|
+
const xAxisConfig = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
11143
|
+
const yAxisConfig = advancedVSeed.config?.[chartType]?.yAxis ?? {};
|
|
11144
|
+
const xBandAxis = bandAxisStyle(xAxisConfig);
|
|
11145
|
+
const yBandAxis = bandAxisStyle(yAxisConfig);
|
|
11146
|
+
xBandAxis.orient = 'bottom';
|
|
11147
|
+
xBandAxis.bandPadding = 0;
|
|
11148
|
+
yBandAxis.orient = 'left';
|
|
11149
|
+
yBandAxis.bandPadding = 0;
|
|
11150
|
+
result.axes = [
|
|
11151
|
+
xBandAxis,
|
|
11152
|
+
yBandAxis
|
|
11153
|
+
];
|
|
11154
|
+
return result;
|
|
11155
|
+
};
|
|
11238
11156
|
const heatmapColorLegend = (spec, context)=>{
|
|
11239
11157
|
const result = colorLegend(spec, context);
|
|
11240
11158
|
if (result.legends) result.legends.customFilter = (data, range, key)=>{
|
|
@@ -11307,7 +11225,8 @@
|
|
|
11307
11225
|
},
|
|
11308
11226
|
dimension: {
|
|
11309
11227
|
visible: false
|
|
11310
|
-
}
|
|
11228
|
+
},
|
|
11229
|
+
updateElement: updateTooltipElement
|
|
11311
11230
|
};
|
|
11312
11231
|
return result;
|
|
11313
11232
|
};
|
|
@@ -11388,18 +11307,6 @@
|
|
|
11388
11307
|
result.seriesField = unfoldInfo.encodingColorId;
|
|
11389
11308
|
result.valueField = foldInfo.measureValue;
|
|
11390
11309
|
result.padding = 0;
|
|
11391
|
-
result.axes = [
|
|
11392
|
-
{
|
|
11393
|
-
type: 'band',
|
|
11394
|
-
orient: 'left',
|
|
11395
|
-
bandPadding: 0
|
|
11396
|
-
},
|
|
11397
|
-
{
|
|
11398
|
-
type: 'band',
|
|
11399
|
-
orient: 'bottom',
|
|
11400
|
-
bandPadding: 0
|
|
11401
|
-
}
|
|
11402
|
-
];
|
|
11403
11310
|
result.region = [
|
|
11404
11311
|
{
|
|
11405
11312
|
clip: true
|
|
@@ -11414,6 +11321,7 @@
|
|
|
11414
11321
|
datasetXY,
|
|
11415
11322
|
colorAdapter(color_color, linearColor),
|
|
11416
11323
|
label_label,
|
|
11324
|
+
heatmapBandAxis,
|
|
11417
11325
|
colorAdapter(discreteLegend, heatmapColorLegend),
|
|
11418
11326
|
colorCellStyleFill(markStyle_cellStyle_cellStyle),
|
|
11419
11327
|
tooltipHeatmap,
|
|
@@ -11433,6 +11341,7 @@
|
|
|
11433
11341
|
datasetXY,
|
|
11434
11342
|
colorAdapter(color_color, linearColor),
|
|
11435
11343
|
label_label,
|
|
11344
|
+
heatmapBandAxis,
|
|
11436
11345
|
tooltipHeatmap,
|
|
11437
11346
|
colorCellStyleFill(markStyle_cellStyle_cellStyle),
|
|
11438
11347
|
annotationPoint_annotationPoint,
|
|
@@ -11692,6 +11601,10 @@
|
|
|
11692
11601
|
measures
|
|
11693
11602
|
};
|
|
11694
11603
|
};
|
|
11604
|
+
const revisedBoxPlotFieldKey = (fieldKey, groupId, isPivotChart = true)=>{
|
|
11605
|
+
if (!isPivotChart) return fieldKey;
|
|
11606
|
+
return `${BoxPlotPivotIndicator}_${groupId}_${fieldKey}`;
|
|
11607
|
+
};
|
|
11695
11608
|
const pivotReshapeWithBoxplotEncoding = (advancedVSeed, context)=>{
|
|
11696
11609
|
const result = {
|
|
11697
11610
|
...advancedVSeed
|
|
@@ -11743,6 +11656,12 @@
|
|
|
11743
11656
|
boxPlotData.forEach((datum)=>{
|
|
11744
11657
|
datum[FoldMeasureId] = f;
|
|
11745
11658
|
datum[FoldMeasureName] = m?.alias ?? f;
|
|
11659
|
+
datum[revisedBoxPlotFieldKey("__Q1__", groupId)] = datum["__Q1__"];
|
|
11660
|
+
datum[revisedBoxPlotFieldKey("__Q3__", groupId)] = datum["__Q3__"];
|
|
11661
|
+
datum[revisedBoxPlotFieldKey(LowerWhisker, groupId)] = datum[LowerWhisker];
|
|
11662
|
+
datum[revisedBoxPlotFieldKey(UpperWhisker, groupId)] = datum[UpperWhisker];
|
|
11663
|
+
datum[revisedBoxPlotFieldKey(MedianMeasureId, groupId)] = datum[MedianMeasureId];
|
|
11664
|
+
datum[revisedBoxPlotFieldKey(OutliersMeasureId, groupId)] = datum[OutliersMeasureId];
|
|
11746
11665
|
});
|
|
11747
11666
|
boxPlotDataList.push(...boxPlotData);
|
|
11748
11667
|
});
|
|
@@ -11763,10 +11682,15 @@
|
|
|
11763
11682
|
});
|
|
11764
11683
|
res.dataset.forEach((datum)=>{
|
|
11765
11684
|
datum[UpperWhisker] = datum[encoding.max[0]];
|
|
11685
|
+
datum[revisedBoxPlotFieldKey("__Q1__", groupId)] = datum[encoding.max[0]];
|
|
11766
11686
|
datum[LowerWhisker] = datum[encoding.min[0]];
|
|
11687
|
+
datum[revisedBoxPlotFieldKey(LowerWhisker, groupId)] = datum[encoding.min[0]];
|
|
11767
11688
|
datum["__Q1__"] = datum[encoding.q1[0]];
|
|
11689
|
+
datum[revisedBoxPlotFieldKey("__Q1__", groupId)] = datum[encoding.q1[0]];
|
|
11768
11690
|
datum["__Q3__"] = datum[encoding.q3[0]];
|
|
11691
|
+
datum[revisedBoxPlotFieldKey("__Q3__", groupId)] = datum[encoding.q3[0]];
|
|
11769
11692
|
datum[MedianMeasureId] = datum[encoding.median[0]];
|
|
11693
|
+
datum[revisedBoxPlotFieldKey(MedianMeasureId, groupId)] = datum[encoding.median[0]];
|
|
11770
11694
|
});
|
|
11771
11695
|
newDatasets = res.dataset;
|
|
11772
11696
|
foldInfo = {};
|
|
@@ -11820,16 +11744,17 @@
|
|
|
11820
11744
|
const result = {
|
|
11821
11745
|
...spec
|
|
11822
11746
|
};
|
|
11823
|
-
const { advancedVSeed } = context;
|
|
11747
|
+
const { advancedVSeed, vseed } = context;
|
|
11824
11748
|
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
|
11825
|
-
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
11749
|
+
const { unfoldInfo, id } = datasetReshapeInfo[0];
|
|
11750
|
+
const usePivotChart = chatType_isPivotChart(vseed);
|
|
11826
11751
|
result.type = 'boxPlot';
|
|
11827
|
-
result.minField = LowerWhisker;
|
|
11828
|
-
result.maxField = UpperWhisker;
|
|
11829
|
-
result.q1Field = "__Q1__";
|
|
11830
|
-
result.medianField = MedianMeasureId;
|
|
11831
|
-
result.q3Field = "__Q3__";
|
|
11832
|
-
result.outliersField = OutliersMeasureId;
|
|
11752
|
+
result.minField = revisedBoxPlotFieldKey(LowerWhisker, id, usePivotChart);
|
|
11753
|
+
result.maxField = revisedBoxPlotFieldKey(UpperWhisker, id, usePivotChart);
|
|
11754
|
+
result.q1Field = revisedBoxPlotFieldKey("__Q1__", id, usePivotChart);
|
|
11755
|
+
result.medianField = revisedBoxPlotFieldKey(MedianMeasureId, id, usePivotChart);
|
|
11756
|
+
result.q3Field = revisedBoxPlotFieldKey("__Q3__", id, usePivotChart);
|
|
11757
|
+
result.outliersField = revisedBoxPlotFieldKey(OutliersMeasureId, id, usePivotChart);
|
|
11833
11758
|
result.xField = [
|
|
11834
11759
|
unfoldInfo.encodingX
|
|
11835
11760
|
];
|
|
@@ -11877,7 +11802,7 @@
|
|
|
11877
11802
|
...spec,
|
|
11878
11803
|
data: {
|
|
11879
11804
|
id,
|
|
11880
|
-
values:
|
|
11805
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
|
|
11881
11806
|
fields: fields
|
|
11882
11807
|
}
|
|
11883
11808
|
};
|
|
@@ -11949,7 +11874,8 @@
|
|
|
11949
11874
|
},
|
|
11950
11875
|
dimension: {
|
|
11951
11876
|
visible: false
|
|
11952
|
-
}
|
|
11877
|
+
},
|
|
11878
|
+
updateElement: updateTooltipElement
|
|
11953
11879
|
};
|
|
11954
11880
|
return result;
|
|
11955
11881
|
};
|
|
@@ -12440,15 +12366,21 @@
|
|
|
12440
12366
|
startMin
|
|
12441
12367
|
]; startMin <= max;)startMin += stepSize, thresholds.push(startMin);
|
|
12442
12368
|
} else {
|
|
12443
|
-
|
|
12369
|
+
let bins = options.bins && options.bins > 0 ? Math.floor(options.bins) : 10;
|
|
12444
12370
|
if (max - min > 1) {
|
|
12445
12371
|
const start = Math.floor(min), stepSizeInt = Math.ceil((max - start) / bins);
|
|
12446
12372
|
thresholds = new Array(bins + 1);
|
|
12447
|
-
for(let i = 0; i <= bins; i++)thresholds[i] = start + stepSizeInt * i
|
|
12373
|
+
for(let i = 0; i <= bins; i++)if (thresholds[i] = start + stepSizeInt * i, thresholds[i] > max) {
|
|
12374
|
+
bins = i, thresholds.length = bins + 1;
|
|
12375
|
+
break;
|
|
12376
|
+
}
|
|
12448
12377
|
} else {
|
|
12449
12378
|
const stepSize = (max - min) / bins;
|
|
12450
12379
|
thresholds = new Array(bins + 1);
|
|
12451
|
-
for(let i = 0; i <= bins; i++)thresholds[i] = min + stepSize * i
|
|
12380
|
+
for(let i = 0; i <= bins; i++)if (thresholds[i] = min + stepSize * i, thresholds[i] > max) {
|
|
12381
|
+
bins = i, thresholds.length = bins + 1;
|
|
12382
|
+
break;
|
|
12383
|
+
}
|
|
12452
12384
|
}
|
|
12453
12385
|
}
|
|
12454
12386
|
const numBins = Math.max(0, thresholds.length - 1);
|
|
@@ -12758,11 +12690,52 @@
|
|
|
12758
12690
|
...spec,
|
|
12759
12691
|
data: {
|
|
12760
12692
|
id,
|
|
12761
|
-
values:
|
|
12693
|
+
values: chatType_isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
|
|
12762
12694
|
fields: fields
|
|
12763
12695
|
}
|
|
12764
12696
|
};
|
|
12765
12697
|
};
|
|
12698
|
+
const histogramXLinear = (spec, context)=>{
|
|
12699
|
+
const result = {
|
|
12700
|
+
...spec
|
|
12701
|
+
};
|
|
12702
|
+
const { advancedVSeed, vseed } = context;
|
|
12703
|
+
const { encoding, dimensions, measures, dataset } = advancedVSeed;
|
|
12704
|
+
const { chartType } = vseed;
|
|
12705
|
+
const config = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
12706
|
+
if (!result.axes) result.axes = [];
|
|
12707
|
+
const isPivot = chatType_isPivotChart(vseed);
|
|
12708
|
+
const { autoFormat, numFormat = {} } = config;
|
|
12709
|
+
const formatter = createNumFormatter(numFormat);
|
|
12710
|
+
const percentFormatter = createNumFormatter({
|
|
12711
|
+
type: 'percent'
|
|
12712
|
+
});
|
|
12713
|
+
const formatMethod = (value)=>{
|
|
12714
|
+
if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter);
|
|
12715
|
+
return createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
12716
|
+
};
|
|
12717
|
+
const titleText = config.title?.titleText || defaultTitleText(measures, dimensions, encoding.x);
|
|
12718
|
+
const linearAxis = linearAxisStyle({
|
|
12719
|
+
...config,
|
|
12720
|
+
orient: 'bottom',
|
|
12721
|
+
formatMethod,
|
|
12722
|
+
titleText,
|
|
12723
|
+
isPivot
|
|
12724
|
+
});
|
|
12725
|
+
linearAxis.tick.tickMode = ()=>{
|
|
12726
|
+
const binValues = [];
|
|
12727
|
+
dataset.forEach((entry)=>{
|
|
12728
|
+
binValues.push(entry[BinStartMeasureId]);
|
|
12729
|
+
binValues.push(entry[BinEndMeasureId]);
|
|
12730
|
+
});
|
|
12731
|
+
return chunk_QJLMYOTX_i(binValues);
|
|
12732
|
+
};
|
|
12733
|
+
result.axes = [
|
|
12734
|
+
...result.axes,
|
|
12735
|
+
linearAxis
|
|
12736
|
+
];
|
|
12737
|
+
return result;
|
|
12738
|
+
};
|
|
12766
12739
|
const getDefaultXFormatterOfHistogram = (advancedVSeed)=>{
|
|
12767
12740
|
const { chartType, config } = advancedVSeed;
|
|
12768
12741
|
const xConfig = config?.[chartType]?.xAxis;
|
|
@@ -12802,7 +12775,8 @@
|
|
|
12802
12775
|
visible: false
|
|
12803
12776
|
},
|
|
12804
12777
|
content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding, defaultXFormatter, defaultValueFormatter)
|
|
12805
|
-
}
|
|
12778
|
+
},
|
|
12779
|
+
updateElement: updateMarkTooltipElement
|
|
12806
12780
|
};
|
|
12807
12781
|
return result;
|
|
12808
12782
|
};
|
|
@@ -13262,7 +13236,7 @@
|
|
|
13262
13236
|
background_backgroundColor,
|
|
13263
13237
|
datasetHistogram,
|
|
13264
13238
|
progressive,
|
|
13265
|
-
|
|
13239
|
+
histogramXLinear,
|
|
13266
13240
|
yLinear,
|
|
13267
13241
|
label_label,
|
|
13268
13242
|
tooltipHistogram,
|
|
@@ -13286,7 +13260,7 @@
|
|
|
13286
13260
|
background_backgroundColor,
|
|
13287
13261
|
datasetHistogram,
|
|
13288
13262
|
progressive,
|
|
13289
|
-
|
|
13263
|
+
histogramXLinear,
|
|
13290
13264
|
pivotAxisStyle(yLinear),
|
|
13291
13265
|
label_label,
|
|
13292
13266
|
tooltipHistogram,
|
|
@@ -13421,6 +13395,18 @@
|
|
|
13421
13395
|
pagerIconColor: '#89909D',
|
|
13422
13396
|
pagerIconDisableColor: '#F1F2F5'
|
|
13423
13397
|
});
|
|
13398
|
+
const getDarkColorLegend = ()=>({
|
|
13399
|
+
...getDefaultLegend(),
|
|
13400
|
+
labelColor: '#BBBDC3',
|
|
13401
|
+
railBackgroundColor: '#404349',
|
|
13402
|
+
handlerBorderColor: '#4B4F54'
|
|
13403
|
+
});
|
|
13404
|
+
const getLightColorLegend = ()=>({
|
|
13405
|
+
...getDefaultLegend(),
|
|
13406
|
+
labelColor: '#606773',
|
|
13407
|
+
handlerBorderColor: '#fff',
|
|
13408
|
+
railBackgroundColor: '#f1f3f4'
|
|
13409
|
+
});
|
|
13424
13410
|
const getDefaultTableConfig = ()=>({
|
|
13425
13411
|
bodyFontSize: 12,
|
|
13426
13412
|
bodyBackgroundColor: 'transparent',
|
|
@@ -13482,7 +13468,7 @@
|
|
|
13482
13468
|
enable: true,
|
|
13483
13469
|
borderRadius: 12,
|
|
13484
13470
|
borderWidth: 1,
|
|
13485
|
-
padding:
|
|
13471
|
+
padding: 9,
|
|
13486
13472
|
lineHeight: 12,
|
|
13487
13473
|
fontSize: 12,
|
|
13488
13474
|
lineSpace: 6
|
|
@@ -14099,6 +14085,9 @@
|
|
|
14099
14085
|
},
|
|
14100
14086
|
heatmap: {
|
|
14101
14087
|
...baseConfig,
|
|
14088
|
+
legend: getLightColorLegend(),
|
|
14089
|
+
xAxis: bandAxis,
|
|
14090
|
+
yAxis: bandAxis,
|
|
14102
14091
|
label: {
|
|
14103
14092
|
...baseConfig.label,
|
|
14104
14093
|
labelColorSmartInvert: true
|
|
@@ -14364,6 +14353,9 @@
|
|
|
14364
14353
|
},
|
|
14365
14354
|
heatmap: {
|
|
14366
14355
|
...baseConfig,
|
|
14356
|
+
legend: getDarkColorLegend(),
|
|
14357
|
+
xAxis: bandAxis,
|
|
14358
|
+
yAxis: bandAxis,
|
|
14367
14359
|
label: {
|
|
14368
14360
|
...baseConfig.label,
|
|
14369
14361
|
labelColorSmartInvert: true
|
|
@@ -14618,6 +14610,9 @@
|
|
|
14618
14610
|
configurable: true
|
|
14619
14611
|
});
|
|
14620
14612
|
}
|
|
14613
|
+
function objectClone(obj) {
|
|
14614
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
14615
|
+
}
|
|
14621
14616
|
function assignProp(target, prop, value) {
|
|
14622
14617
|
Object.defineProperty(target, prop, {
|
|
14623
14618
|
value,
|
|
@@ -14660,6 +14655,12 @@
|
|
|
14660
14655
|
if (false === Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf")) return false;
|
|
14661
14656
|
return true;
|
|
14662
14657
|
}
|
|
14658
|
+
function shallowClone(o) {
|
|
14659
|
+
if (util_isPlainObject(o)) return {
|
|
14660
|
+
...o
|
|
14661
|
+
};
|
|
14662
|
+
return o;
|
|
14663
|
+
}
|
|
14663
14664
|
const propertyKeyTypes = new Set([
|
|
14664
14665
|
"string",
|
|
14665
14666
|
"number",
|
|
@@ -15430,7 +15431,7 @@
|
|
|
15430
15431
|
const versions_version = {
|
|
15431
15432
|
major: 4,
|
|
15432
15433
|
minor: 0,
|
|
15433
|
-
patch:
|
|
15434
|
+
patch: 17
|
|
15434
15435
|
};
|
|
15435
15436
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def)=>{
|
|
15436
15437
|
var _a;
|
|
@@ -15905,7 +15906,7 @@
|
|
|
15905
15906
|
$ZodType.init(inst, def);
|
|
15906
15907
|
const _normalized = cached(()=>{
|
|
15907
15908
|
const keys = Object.keys(def.shape);
|
|
15908
|
-
for (const k of keys)if (!
|
|
15909
|
+
for (const k of keys)if (!def.shape[k]._zod.traits.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
15909
15910
|
const okeys = optionalKeys(def.shape);
|
|
15910
15911
|
return {
|
|
15911
15912
|
shape: def.shape,
|
|
@@ -17461,9 +17462,7 @@
|
|
|
17461
17462
|
const def = {
|
|
17462
17463
|
type: "object",
|
|
17463
17464
|
get shape () {
|
|
17464
|
-
assignProp(this, "shape", {
|
|
17465
|
-
...shape
|
|
17466
|
-
});
|
|
17465
|
+
assignProp(this, "shape", shape ? objectClone(shape) : {});
|
|
17467
17466
|
return this.shape;
|
|
17468
17467
|
},
|
|
17469
17468
|
...normalizeParams(params)
|
|
@@ -17644,7 +17643,7 @@
|
|
|
17644
17643
|
type: "default",
|
|
17645
17644
|
innerType: innerType,
|
|
17646
17645
|
get defaultValue () {
|
|
17647
|
-
return "function" == typeof defaultValue ? defaultValue() : defaultValue;
|
|
17646
|
+
return "function" == typeof defaultValue ? defaultValue() : shallowClone(defaultValue);
|
|
17648
17647
|
}
|
|
17649
17648
|
});
|
|
17650
17649
|
}
|
|
@@ -17658,7 +17657,7 @@
|
|
|
17658
17657
|
type: "prefault",
|
|
17659
17658
|
innerType: innerType,
|
|
17660
17659
|
get defaultValue () {
|
|
17661
|
-
return "function" == typeof defaultValue ? defaultValue() : defaultValue;
|
|
17660
|
+
return "function" == typeof defaultValue ? defaultValue() : shallowClone(defaultValue);
|
|
17662
17661
|
}
|
|
17663
17662
|
});
|
|
17664
17663
|
}
|
|
@@ -18130,61 +18129,68 @@
|
|
|
18130
18129
|
const zLinearColor = schemas_object({
|
|
18131
18130
|
linearColorScheme: schemas_array(schemas_string()).nullish()
|
|
18132
18131
|
});
|
|
18132
|
+
const zMeasureSelector = schemas_object({
|
|
18133
|
+
field: schemas_string(),
|
|
18134
|
+
operator: schemas_enum([
|
|
18135
|
+
'=',
|
|
18136
|
+
'==',
|
|
18137
|
+
'!=',
|
|
18138
|
+
'>',
|
|
18139
|
+
'<',
|
|
18140
|
+
'>=',
|
|
18141
|
+
'<=',
|
|
18142
|
+
'between'
|
|
18143
|
+
]).nullish(),
|
|
18144
|
+
op: schemas_enum([
|
|
18145
|
+
'=',
|
|
18146
|
+
'==',
|
|
18147
|
+
'!=',
|
|
18148
|
+
'>',
|
|
18149
|
+
'<',
|
|
18150
|
+
'>=',
|
|
18151
|
+
'<=',
|
|
18152
|
+
'between'
|
|
18153
|
+
]).nullish(),
|
|
18154
|
+
value: union([
|
|
18155
|
+
schemas_string(),
|
|
18156
|
+
schemas_number(),
|
|
18157
|
+
schemas_array(union([
|
|
18158
|
+
schemas_string(),
|
|
18159
|
+
schemas_number()
|
|
18160
|
+
]))
|
|
18161
|
+
])
|
|
18162
|
+
});
|
|
18163
|
+
const zDimensionSelector = schemas_object({
|
|
18164
|
+
field: schemas_string(),
|
|
18165
|
+
operator: schemas_enum([
|
|
18166
|
+
'in',
|
|
18167
|
+
'not in'
|
|
18168
|
+
]).nullish(),
|
|
18169
|
+
op: schemas_enum([
|
|
18170
|
+
'in',
|
|
18171
|
+
'not in'
|
|
18172
|
+
]).nullish(),
|
|
18173
|
+
value: union([
|
|
18174
|
+
schemas_string(),
|
|
18175
|
+
schemas_number(),
|
|
18176
|
+
schemas_array(union([
|
|
18177
|
+
schemas_string(),
|
|
18178
|
+
schemas_number()
|
|
18179
|
+
]))
|
|
18180
|
+
])
|
|
18181
|
+
});
|
|
18133
18182
|
const zSelector = union([
|
|
18134
18183
|
schemas_string(),
|
|
18135
18184
|
schemas_number(),
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
operator: schemas_enum([
|
|
18139
|
-
'=',
|
|
18140
|
-
'==',
|
|
18141
|
-
'!=',
|
|
18142
|
-
'>',
|
|
18143
|
-
'<',
|
|
18144
|
-
'>=',
|
|
18145
|
-
'<=',
|
|
18146
|
-
'between'
|
|
18147
|
-
]).nullish(),
|
|
18148
|
-
op: schemas_enum([
|
|
18149
|
-
'=',
|
|
18150
|
-
'==',
|
|
18151
|
-
'!=',
|
|
18152
|
-
'>',
|
|
18153
|
-
'<',
|
|
18154
|
-
'>=',
|
|
18155
|
-
'<=',
|
|
18156
|
-
'between'
|
|
18157
|
-
]).nullish(),
|
|
18158
|
-
value: union([
|
|
18159
|
-
schemas_string(),
|
|
18160
|
-
schemas_number(),
|
|
18161
|
-
schemas_array(union([
|
|
18162
|
-
schemas_string(),
|
|
18163
|
-
schemas_number()
|
|
18164
|
-
]))
|
|
18165
|
-
])
|
|
18166
|
-
}),
|
|
18167
|
-
schemas_object({
|
|
18168
|
-
field: schemas_string(),
|
|
18169
|
-
operator: schemas_enum([
|
|
18170
|
-
'in',
|
|
18171
|
-
'not in'
|
|
18172
|
-
]).nullish(),
|
|
18173
|
-
op: schemas_enum([
|
|
18174
|
-
'in',
|
|
18175
|
-
'not in'
|
|
18176
|
-
]).nullish(),
|
|
18177
|
-
value: union([
|
|
18178
|
-
schemas_string(),
|
|
18179
|
-
schemas_number(),
|
|
18180
|
-
schemas_array(union([
|
|
18181
|
-
schemas_string(),
|
|
18182
|
-
schemas_number()
|
|
18183
|
-
]))
|
|
18184
|
-
])
|
|
18185
|
-
})
|
|
18185
|
+
zMeasureSelector,
|
|
18186
|
+
zDimensionSelector
|
|
18186
18187
|
]);
|
|
18187
18188
|
const zSelectors = schemas_array(zSelector);
|
|
18189
|
+
const zAreaSelector = union([
|
|
18190
|
+
zMeasureSelector,
|
|
18191
|
+
zDimensionSelector
|
|
18192
|
+
]);
|
|
18193
|
+
const zAreaSelectors = schemas_array(zAreaSelector);
|
|
18188
18194
|
const zLabel = schemas_object({
|
|
18189
18195
|
enable: schemas_boolean().nullish(),
|
|
18190
18196
|
wrap: schemas_boolean().nullish(),
|
|
@@ -18255,9 +18261,9 @@
|
|
|
18255
18261
|
'bl',
|
|
18256
18262
|
'br'
|
|
18257
18263
|
]).default('bottom').nullish(),
|
|
18258
|
-
labelColor: schemas_string().default('#fff').nullish(),
|
|
18259
18264
|
pagerIconColor: schemas_string().nullish(),
|
|
18260
18265
|
pagerIconDisableColor: schemas_string().nullish(),
|
|
18266
|
+
labelColor: schemas_string().default('#fff').nullish(),
|
|
18261
18267
|
labelFontSize: schemas_number().default(12).nullish(),
|
|
18262
18268
|
labelFontWeight: schemas_number().or(schemas_string()).default(400).nullish()
|
|
18263
18269
|
});
|
|
@@ -18284,7 +18290,12 @@
|
|
|
18284
18290
|
'bl',
|
|
18285
18291
|
'br'
|
|
18286
18292
|
]).default('bottom').nullish(),
|
|
18287
|
-
enable: schemas_boolean().default(true).nullish()
|
|
18293
|
+
enable: schemas_boolean().default(true).nullish(),
|
|
18294
|
+
railBackgroundColor: schemas_string().nullish(),
|
|
18295
|
+
handlerBorderColor: schemas_string().nullish(),
|
|
18296
|
+
labelColor: schemas_string().default('#fff').nullish(),
|
|
18297
|
+
labelFontSize: schemas_number().default(12).nullish(),
|
|
18298
|
+
labelFontWeight: schemas_number().or(schemas_string()).default(400).nullish()
|
|
18288
18299
|
});
|
|
18289
18300
|
const zTooltip = schemas_object({
|
|
18290
18301
|
enable: schemas_boolean().default(true).nullish(),
|
|
@@ -18329,10 +18340,6 @@
|
|
|
18329
18340
|
offsetX: schemas_number().default(0).nullish()
|
|
18330
18341
|
});
|
|
18331
18342
|
const zAnnotationHorizontalLine = schemas_object({
|
|
18332
|
-
selector: union([
|
|
18333
|
-
zSelector,
|
|
18334
|
-
zSelectors
|
|
18335
|
-
]).nullish(),
|
|
18336
18343
|
yValue: union([
|
|
18337
18344
|
schemas_number(),
|
|
18338
18345
|
schemas_string(),
|
|
@@ -18380,8 +18387,8 @@
|
|
|
18380
18387
|
});
|
|
18381
18388
|
const zAnnotationArea = schemas_object({
|
|
18382
18389
|
selector: union([
|
|
18383
|
-
|
|
18384
|
-
|
|
18390
|
+
zAreaSelector,
|
|
18391
|
+
zAreaSelectors
|
|
18385
18392
|
]).nullish(),
|
|
18386
18393
|
textPosition: schemas_enum([
|
|
18387
18394
|
'top',
|
|
@@ -18676,9 +18683,11 @@
|
|
|
18676
18683
|
label: zLabel.nullish(),
|
|
18677
18684
|
color: zColor.nullish(),
|
|
18678
18685
|
tooltip: zTooltip.nullish(),
|
|
18679
|
-
legend:
|
|
18686
|
+
legend: zColorLegend.nullish(),
|
|
18680
18687
|
pivotGrid: zPivotChartGridConfig.nullish(),
|
|
18681
|
-
cell: zHeatmapCell.nullish()
|
|
18688
|
+
cell: zHeatmapCell.nullish(),
|
|
18689
|
+
xAxis: zXBandAxis.nullish(),
|
|
18690
|
+
yAxis: zYBandAxis.nullish()
|
|
18682
18691
|
});
|
|
18683
18692
|
const zPivotTableConfig = zTableConfig;
|
|
18684
18693
|
const zWhiskersConfig = schemas_number().or(schemas_array(schemas_number())).default(1.5);
|
|
@@ -18854,10 +18863,6 @@
|
|
|
18854
18863
|
outlierStyle: zOutlierStyle.or(schemas_array(zOutlierStyle)).nullish()
|
|
18855
18864
|
});
|
|
18856
18865
|
const zAnnotationVerticalLine = schemas_object({
|
|
18857
|
-
selector: union([
|
|
18858
|
-
zSelector,
|
|
18859
|
-
zSelectors
|
|
18860
|
-
]).nullish(),
|
|
18861
18866
|
xValue: union([
|
|
18862
18867
|
schemas_number(),
|
|
18863
18868
|
schemas_string(),
|