@visactor/vseed 0.1.41 → 0.1.43
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 +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/advanced/colorItems.d.ts +4 -1
- package/dist/esm/builder/builder/advanced/colorItems.js +1 -1
- package/dist/esm/builder/builder/advanced/colorItems.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +372 -3
- 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/dataReshape/dataReshapeByEncoding.d.ts +1 -0
- package/dist/esm/dataReshape/dataReshapeByEncoding.js +3 -2
- package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
- package/dist/esm/dataReshape/foldMeasures.d.ts +1 -0
- package/dist/esm/dataReshape/foldMeasures.js +5 -2
- package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
- package/dist/esm/dataReshape/unfoldDimensions.js +14 -9
- package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.d.ts +3 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.js +22 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js +4 -25
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.d.ts +1 -2
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.js +2 -20
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortYBand.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortYBand.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/{defaultMeasureName.d.ts → defaultMeasureId.d.ts} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureId.js +16 -0
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureId.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/default/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/index.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js +4 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +6 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +4 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +6 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +7 -4
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +7 -4
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js +169 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/color/color.d.ts +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/color.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/color.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +13 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +38 -32
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js +28 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js +10 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +7 -6
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +1 -6
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/theme/common/color.d.ts +4 -0
- package/dist/esm/theme/common/color.js +6 -2
- package/dist/esm/theme/common/color.js.map +1 -1
- package/dist/esm/theme/common/table.d.ts +6 -0
- package/dist/esm/theme/common/table.js +4 -1
- package/dist/esm/theme/common/table.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +2 -2
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +2 -2
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +124 -1
- package/dist/esm/types/builder/builder.d.ts +4 -1
- package/dist/esm/types/builder/builder.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotationHorizontalLine.d.ts +13 -0
- package/dist/esm/types/properties/config/area.d.ts +6 -0
- package/dist/esm/types/properties/config/bar.d.ts +9 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +3 -0
- package/dist/esm/types/properties/config/color/color.d.ts +8 -0
- package/dist/esm/types/properties/config/color/color.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +9 -0
- package/dist/esm/types/properties/config/config.d.ts +60 -0
- package/dist/esm/types/properties/config/dualAxis.d.ts +3 -0
- package/dist/esm/types/properties/config/funnel.d.ts +3 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +3 -0
- package/dist/esm/types/properties/config/histogram.d.ts +3 -0
- package/dist/esm/types/properties/config/line.d.ts +3 -0
- package/dist/esm/types/properties/config/pie.d.ts +9 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +3 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +4 -1
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
- package/dist/esm/types/properties/config/rose.d.ts +6 -0
- package/dist/esm/types/properties/config/scatter.d.ts +3 -0
- package/dist/esm/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +4 -1
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +8 -2
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js +4 -1
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js.map +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +120 -0
- package/dist/umd/index.js +863 -249
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sort.d.ts +0 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sort.js +0 -0
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureName.js +0 -16
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureName.js.map +0 -1
package/dist/umd/index.js
CHANGED
|
@@ -174,10 +174,11 @@
|
|
|
174
174
|
zBackgroundColor: ()=>zBackgroundColor,
|
|
175
175
|
zAreaPercentConfig: ()=>zAreaPercentConfig,
|
|
176
176
|
zLowessRegressionLine: ()=>zLowessRegressionLine,
|
|
177
|
+
MeasureId: ()=>MeasureId,
|
|
177
178
|
registerRadar: ()=>registerRadar,
|
|
178
|
-
zMeasure: ()=>zMeasure,
|
|
179
179
|
zLocale: ()=>zLocale,
|
|
180
180
|
isDimension: ()=>isDimension,
|
|
181
|
+
zMeasure: ()=>zMeasure,
|
|
181
182
|
registerScatter: ()=>registerScatter,
|
|
182
183
|
boxplotSpecPipeline: ()=>boxplotSpecPipeline,
|
|
183
184
|
autoNumFormatter: ()=>autoNumFormatter,
|
|
@@ -192,9 +193,9 @@
|
|
|
192
193
|
zColumnPercent: ()=>zColumnPercent,
|
|
193
194
|
foldMeasures: ()=>foldMeasures,
|
|
194
195
|
zFunnel: ()=>zFunnel,
|
|
196
|
+
zDimensionEncoding: ()=>zDimensionEncoding,
|
|
195
197
|
isPivotTable: ()=>isPivotTable,
|
|
196
198
|
registerPie: ()=>registerPie,
|
|
197
|
-
zDimensionEncoding: ()=>zDimensionEncoding,
|
|
198
199
|
zEcdfRegressionLine: ()=>zEcdfRegressionLine,
|
|
199
200
|
zBarParallelConfig: ()=>zBarParallelConfig,
|
|
200
201
|
lineAdvancedPipeline: ()=>lineAdvancedPipeline,
|
|
@@ -655,7 +656,7 @@
|
|
|
655
656
|
}), {});
|
|
656
657
|
return colorItems.map((d)=>({
|
|
657
658
|
id: d,
|
|
658
|
-
alias: colorIdMap[d]
|
|
659
|
+
alias: colorIdMap[d]?.alias
|
|
659
660
|
}));
|
|
660
661
|
};
|
|
661
662
|
const getColorIdMap = (builder)=>{
|
|
@@ -1360,6 +1361,7 @@
|
|
|
1360
1361
|
const FoldMeasureName = '__MeaName__';
|
|
1361
1362
|
const FoldMeasureId = '__MeaId__';
|
|
1362
1363
|
const FoldMeasureValue = '__MeaValue__';
|
|
1364
|
+
const MeasureId = FoldMeasureId;
|
|
1363
1365
|
const MeasureName = FoldMeasureName;
|
|
1364
1366
|
const FoldPrimaryMeasureValue = '__MeaPrimaryValue__';
|
|
1365
1367
|
const FoldSecondaryMeasureValue = '__MeaSecondaryValue__';
|
|
@@ -1461,7 +1463,7 @@
|
|
|
1461
1463
|
return o;
|
|
1462
1464
|
}
|
|
1463
1465
|
const foldMeasures = (dataset, measures, options)=>{
|
|
1464
|
-
const { measureId, measureName, measureValue, colorMeasureId, allowEmptyFold = true } = options || {};
|
|
1466
|
+
const { measureId, measureName, measureValue, colorMeasureId, allowEmptyFold = true, omitIds = [] } = options || {};
|
|
1465
1467
|
const foldInfo = {
|
|
1466
1468
|
measureId,
|
|
1467
1469
|
measureName,
|
|
@@ -1486,7 +1488,10 @@
|
|
|
1486
1488
|
for(let i = 0; i < dataset.length; i++)for(let j = 0; j < measures.length; j++){
|
|
1487
1489
|
const datum = chunk_KI5X74E2_y({
|
|
1488
1490
|
...dataset[i]
|
|
1489
|
-
},
|
|
1491
|
+
}, [
|
|
1492
|
+
...ids,
|
|
1493
|
+
...omitIds
|
|
1494
|
+
]);
|
|
1490
1495
|
datum[ORIGINAL_DATA] = dataset[i];
|
|
1491
1496
|
const measure = measures[j];
|
|
1492
1497
|
const { id, alias } = measure;
|
|
@@ -1897,15 +1902,15 @@
|
|
|
1897
1902
|
dimensions: newDimensions
|
|
1898
1903
|
};
|
|
1899
1904
|
};
|
|
1900
|
-
const
|
|
1905
|
+
const defaultMeasureId = (advancedVSeed)=>{
|
|
1901
1906
|
const result = {
|
|
1902
1907
|
...advancedVSeed
|
|
1903
1908
|
};
|
|
1904
|
-
const
|
|
1905
|
-
id:
|
|
1906
|
-
alias: intl.i18n
|
|
1909
|
+
const MeaIdDim = {
|
|
1910
|
+
id: MeasureId,
|
|
1911
|
+
alias: intl.i18n`指标Id`
|
|
1907
1912
|
};
|
|
1908
|
-
if (!result.dimensions?.some((dim)=>dim.id ===
|
|
1913
|
+
if (!result.dimensions?.some((dim)=>dim.id === MeasureId)) result.dimensions?.push(MeaIdDim);
|
|
1909
1914
|
return result;
|
|
1910
1915
|
};
|
|
1911
1916
|
const encodingAdapter = (noEncodingPipeline, hasEncodingPipeline)=>(advancedVSeed, context)=>{
|
|
@@ -1918,10 +1923,10 @@
|
|
|
1918
1923
|
};
|
|
1919
1924
|
const addColorToEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
|
1920
1925
|
encoding.color = chunk_QJLMYOTX_i(dimensions.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
|
1921
|
-
const
|
|
1922
|
-
if (isMultiMeasure &&
|
|
1926
|
+
const measureId = dimensions.find((item)=>item.id === MeasureId);
|
|
1927
|
+
if (isMultiMeasure && measureId && !measureId.encoding) encoding.color.push(MeasureId);
|
|
1923
1928
|
if (0 === encoding.color.length) encoding.color = [
|
|
1924
|
-
|
|
1929
|
+
MeasureId
|
|
1925
1930
|
];
|
|
1926
1931
|
};
|
|
1927
1932
|
const defaultEncodingForLine = (advancedVSeed)=>{
|
|
@@ -1954,7 +1959,7 @@
|
|
|
1954
1959
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
1955
1960
|
encoding.x = uniqueDimIds.slice(0, 1);
|
|
1956
1961
|
encoding.color = uniqueDimIds.slice(1);
|
|
1957
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
1962
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
1958
1963
|
encoding.detail = [];
|
|
1959
1964
|
encoding.label = [];
|
|
1960
1965
|
encoding.row = [];
|
|
@@ -1968,12 +1973,12 @@
|
|
|
1968
1973
|
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
|
1969
1974
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
1970
1975
|
if (0 === encoding.detail.length) encoding.detail = [
|
|
1971
|
-
|
|
1976
|
+
MeasureId
|
|
1972
1977
|
];
|
|
1973
1978
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
1974
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
1979
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
1975
1980
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
1976
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
1981
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
1977
1982
|
};
|
|
1978
1983
|
const line_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
1979
1984
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -2148,7 +2153,7 @@
|
|
|
2148
2153
|
};
|
|
2149
2154
|
}
|
|
2150
2155
|
const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
|
|
2151
|
-
const {
|
|
2156
|
+
const { separator } = options;
|
|
2152
2157
|
const unfoldInfo = {
|
|
2153
2158
|
encodingAngle: AngleEncoding,
|
|
2154
2159
|
encodingX: XEncoding,
|
|
@@ -2175,14 +2180,12 @@
|
|
|
2175
2180
|
applyEncoding(ColorEncoding, colorDimensions, datum, separator);
|
|
2176
2181
|
applyEncoding(DetailEncoding, detailDimensions, datum, separator);
|
|
2177
2182
|
if (!colorDimensions.length || !datum[ColorEncoding]) continue;
|
|
2178
|
-
const
|
|
2179
|
-
const colorItem = String(datum[ColorEncoding] ?? '');
|
|
2180
|
-
const colorId = colorItemAsId ? colorItem : measureId ? [
|
|
2181
|
-
colorItem,
|
|
2182
|
-
measureId
|
|
2183
|
-
].join(separator) : colorItem;
|
|
2183
|
+
const colorId = String(datum[ColorEncoding] ?? '');
|
|
2184
2184
|
datum[ColorIdEncoding] = colorId;
|
|
2185
|
-
colorIdMap[colorId] =
|
|
2185
|
+
colorIdMap[colorId] = {
|
|
2186
|
+
id: colorId,
|
|
2187
|
+
alias: getColorAliasItem(ColorEncoding, colorDimensions, datum, separator)
|
|
2188
|
+
};
|
|
2186
2189
|
colorItems.add(colorId);
|
|
2187
2190
|
}
|
|
2188
2191
|
unfoldInfo.colorItems = Array.from(colorItems);
|
|
@@ -2195,13 +2198,21 @@
|
|
|
2195
2198
|
const applyEncoding = (encoding, dimensions, datum, separator)=>{
|
|
2196
2199
|
if (encoding && dimensions.length) datum[encoding] = dimensions.map((dim)=>String(datum[dim.id])).join(separator);
|
|
2197
2200
|
};
|
|
2201
|
+
const getColorAliasItem = (encoding, dimensions, datum, separator)=>{
|
|
2202
|
+
if (encoding && dimensions.length) return dimensions.map((dim)=>{
|
|
2203
|
+
if (dim.id === MeasureId) return String(datum[MeasureName]);
|
|
2204
|
+
return String(datum[dim.id]);
|
|
2205
|
+
}).join(separator);
|
|
2206
|
+
return '';
|
|
2207
|
+
};
|
|
2198
2208
|
const dataReshapeByEncoding = (dataset, dimensions, measures, encoding, options)=>{
|
|
2199
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false, colorMeasureId } = options || {};
|
|
2209
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false, colorMeasureId, omitIds } = options || {};
|
|
2200
2210
|
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, {
|
|
2201
2211
|
measureId: foldMeasureId,
|
|
2202
2212
|
measureName: foldMeasureName,
|
|
2203
2213
|
measureValue: foldMeasureValue,
|
|
2204
|
-
colorMeasureId
|
|
2214
|
+
colorMeasureId,
|
|
2215
|
+
omitIds
|
|
2205
2216
|
});
|
|
2206
2217
|
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dimensions, encoding, {
|
|
2207
2218
|
foldMeasureId,
|
|
@@ -2267,6 +2278,7 @@
|
|
|
2267
2278
|
const { vseed } = context;
|
|
2268
2279
|
const { dataset } = vseed;
|
|
2269
2280
|
const { dimensions = [], measures = [], encoding } = advancedVSeed;
|
|
2281
|
+
const allMeasures = findAllMeasures(measures);
|
|
2270
2282
|
const measureGroups = [];
|
|
2271
2283
|
if (measures) measures.forEach((measure)=>{
|
|
2272
2284
|
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
|
@@ -2280,7 +2292,8 @@
|
|
|
2280
2292
|
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), T(measures, (item)=>item.id), encoding, {
|
|
2281
2293
|
colorItemAsId: false,
|
|
2282
2294
|
foldMeasureValue: `${FoldMeasureValue}${groupId}`,
|
|
2283
|
-
colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
|
|
2295
|
+
colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
|
|
2296
|
+
omitIds: allMeasures.map((item)=>item.id)
|
|
2284
2297
|
});
|
|
2285
2298
|
const reshapeInfo = {
|
|
2286
2299
|
id: groupId,
|
|
@@ -2306,22 +2319,6 @@
|
|
|
2306
2319
|
];
|
|
2307
2320
|
return e.sort(t), e;
|
|
2308
2321
|
}
|
|
2309
|
-
const sortXBandAxis = (advancedVSeed, context)=>{
|
|
2310
|
-
const result = {
|
|
2311
|
-
...advancedVSeed
|
|
2312
|
-
};
|
|
2313
|
-
const { vseed } = context;
|
|
2314
|
-
const { sort: sortAxis } = vseed;
|
|
2315
|
-
const { datasetReshapeInfo, dataset } = advancedVSeed;
|
|
2316
|
-
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
2317
|
-
const xField = unfoldInfo.encodingX;
|
|
2318
|
-
if (!sortAxis || !xField) return advancedVSeed;
|
|
2319
|
-
if (!result.analysis) result.analysis = {};
|
|
2320
|
-
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
|
2321
|
-
const axisOrderResult = calcOrder(sortAxis, xField, dataset.flat(2));
|
|
2322
|
-
result.analysis.orderMapping[xField] = axisOrderResult;
|
|
2323
|
-
return result;
|
|
2324
|
-
};
|
|
2325
2322
|
const calcOrder = (sortConfig, id, dataset)=>{
|
|
2326
2323
|
if (sortConfig.customOrder) return sortConfig.customOrder;
|
|
2327
2324
|
const order = sortConfig.order || 'asc';
|
|
@@ -2340,6 +2337,22 @@
|
|
|
2340
2337
|
});
|
|
2341
2338
|
return chunk_QJLMYOTX_i(res.map((item)=>item[id]));
|
|
2342
2339
|
};
|
|
2340
|
+
const sortXBandAxis = (advancedVSeed, context)=>{
|
|
2341
|
+
const result = {
|
|
2342
|
+
...advancedVSeed
|
|
2343
|
+
};
|
|
2344
|
+
const { vseed } = context;
|
|
2345
|
+
const { sort: sortAxis } = vseed;
|
|
2346
|
+
const { datasetReshapeInfo, dataset } = advancedVSeed;
|
|
2347
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
2348
|
+
const xField = unfoldInfo.encodingX;
|
|
2349
|
+
if (!sortAxis || !xField) return advancedVSeed;
|
|
2350
|
+
if (!result.analysis) result.analysis = {};
|
|
2351
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
|
2352
|
+
const axisOrderResult = calcOrder(sortAxis, xField, dataset.flat(2));
|
|
2353
|
+
result.analysis.orderMapping[xField] = axisOrderResult;
|
|
2354
|
+
return result;
|
|
2355
|
+
};
|
|
2343
2356
|
const sortLegend_sortLegend = (advancedVSeed, context)=>{
|
|
2344
2357
|
const result = {
|
|
2345
2358
|
...advancedVSeed
|
|
@@ -2348,42 +2361,21 @@
|
|
|
2348
2361
|
const { sortLegend } = vseed;
|
|
2349
2362
|
const { datasetReshapeInfo, dataset } = advancedVSeed;
|
|
2350
2363
|
const colorId = datasetReshapeInfo?.[0]?.unfoldInfo?.encodingColorId;
|
|
2351
|
-
const colorIdMap = datasetReshapeInfo?.[0]?.unfoldInfo?.colorIdMap;
|
|
2364
|
+
const colorIdMap = datasetReshapeInfo?.[0]?.unfoldInfo?.colorIdMap ?? {};
|
|
2352
2365
|
const colorItems = datasetReshapeInfo?.[0]?.unfoldInfo?.colorItems;
|
|
2353
2366
|
if (!sortLegend || !colorId || !colorIdMap || !colorItems) return advancedVSeed;
|
|
2354
2367
|
if (!result.analysis) result.analysis = {};
|
|
2355
2368
|
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
|
2356
2369
|
if (sortLegend.customOrder) {
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2359
|
-
return pre;
|
|
2360
|
-
}, {});
|
|
2361
|
-
const orderRes = sortLegend.customOrder.map((itemNameOrId)=>nameMap[itemNameOrId] ? nameMap[itemNameOrId] : itemNameOrId);
|
|
2370
|
+
const colorIds = Object.keys(colorIdMap);
|
|
2371
|
+
const orderRes = sortLegend.customOrder.map((itemNameOrId)=>colorIds.find((id)=>colorIdMap[id]?.alias === itemNameOrId || colorIdMap[id]?.id === itemNameOrId || id === itemNameOrId));
|
|
2362
2372
|
result.analysis.orderMapping[colorId] = orderRes;
|
|
2363
2373
|
return result;
|
|
2364
2374
|
}
|
|
2365
|
-
const orderRes =
|
|
2375
|
+
const orderRes = calcOrder(sortLegend, colorId, dataset?.flat(2) || []);
|
|
2366
2376
|
result.analysis.orderMapping[colorId] = orderRes;
|
|
2367
2377
|
return result;
|
|
2368
2378
|
};
|
|
2369
|
-
const sortLegend_calcOrder = (sortConfig, id, dataset)=>{
|
|
2370
|
-
if (sortConfig.customOrder) return sortConfig.customOrder;
|
|
2371
|
-
const order = sortConfig.order || 'asc';
|
|
2372
|
-
const orderBy = sortConfig.orderBy;
|
|
2373
|
-
const res = chunk_NFFV4IQT_m(dataset, (a, b)=>{
|
|
2374
|
-
const aValue = a[orderBy || id];
|
|
2375
|
-
const bValue = b[orderBy || id];
|
|
2376
|
-
if ('asc' === order) {
|
|
2377
|
-
if (aValue < bValue) return -1;
|
|
2378
|
-
if (aValue > bValue) return 1;
|
|
2379
|
-
return 0;
|
|
2380
|
-
}
|
|
2381
|
-
if (aValue > bValue) return -1;
|
|
2382
|
-
if (aValue < bValue) return 1;
|
|
2383
|
-
return 0;
|
|
2384
|
-
});
|
|
2385
|
-
return chunk_QJLMYOTX_i(res.map((item)=>item[id]));
|
|
2386
|
-
};
|
|
2387
2379
|
function chunk_3ZJAREUD_i(...e) {
|
|
2388
2380
|
return chunk_WIMGWYZL_u(chunk_3ZJAREUD_o, e);
|
|
2389
2381
|
}
|
|
@@ -2457,7 +2449,7 @@
|
|
|
2457
2449
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
2458
2450
|
default_defaultMeasures_defaultMeasures,
|
|
2459
2451
|
defaultDimensions_defaultDimensions,
|
|
2460
|
-
|
|
2452
|
+
defaultMeasureId,
|
|
2461
2453
|
encodingAdapter([
|
|
2462
2454
|
defaultEncodingForLine,
|
|
2463
2455
|
buildMeasures
|
|
@@ -2532,7 +2524,7 @@
|
|
|
2532
2524
|
const accurateMap = colors.reduce((prev, cur)=>{
|
|
2533
2525
|
const name = cur[0];
|
|
2534
2526
|
const colorValue = cur[1];
|
|
2535
|
-
const accurateMatchedList = Object.entries(colorIdMap).filter(([colorKey,
|
|
2527
|
+
const accurateMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorObj])=>colorKey === name || colorObj.alias === name || colorObj.id === name);
|
|
2536
2528
|
accurateMatchedList.forEach((item)=>{
|
|
2537
2529
|
prev[item[0]] = colorValue;
|
|
2538
2530
|
matchedList.push(name);
|
|
@@ -2543,7 +2535,7 @@
|
|
|
2543
2535
|
const name = cur[0];
|
|
2544
2536
|
const colorValue = cur[1];
|
|
2545
2537
|
if (matchedList.includes(name)) return prev;
|
|
2546
|
-
const fuzzyMatchedList = Object.entries(colorIdMap).filter(([colorKey,
|
|
2538
|
+
const fuzzyMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorObj])=>colorKey.includes(name) || colorObj.alias.includes(name) || colorObj.id.includes(name));
|
|
2547
2539
|
fuzzyMatchedList.forEach((item)=>{
|
|
2548
2540
|
if (prev[item[0]]) return;
|
|
2549
2541
|
prev[item[0]] = colorValue;
|
|
@@ -2964,7 +2956,7 @@
|
|
|
2964
2956
|
}
|
|
2965
2957
|
},
|
|
2966
2958
|
label: {
|
|
2967
|
-
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)] ?? value,
|
|
2959
|
+
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)].alias ?? value,
|
|
2968
2960
|
style: {
|
|
2969
2961
|
fontSize: labelFontSize,
|
|
2970
2962
|
fill: labelColor || labelFontColor,
|
|
@@ -3388,7 +3380,7 @@
|
|
|
3388
3380
|
const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedDimensions, advancedVSeedMeasures, encoding, foldInfoList)=>{
|
|
3389
3381
|
const { enable, wrap, showValue, showValuePercent, showDimension, labelOverlap, labelColorSmartInvert, labelStroke, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
|
|
3390
3382
|
const hasDimLabelEncoding = vseedDimensions.some((item)=>encoding.label?.includes(item.id));
|
|
3391
|
-
const labelDims = T(hasDimLabelEncoding ? vseedDimensions.filter((item)=>encoding.label?.includes(item.id)) : showDimension ? advancedVSeedDimensions.filter((d)=>d.id !==
|
|
3383
|
+
const labelDims = T(hasDimLabelEncoding ? vseedDimensions.filter((item)=>encoding.label?.includes(item.id)) : showDimension ? advancedVSeedDimensions.filter((d)=>d.id !== MeasureId) : [], (item)=>item.id);
|
|
3392
3384
|
const labelMeas = T(vseedMeasures.filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
|
3393
3385
|
const percentFormat = chunk_5S4PYKVY_t(numFormat, {
|
|
3394
3386
|
type: 'percent'
|
|
@@ -3459,23 +3451,24 @@
|
|
|
3459
3451
|
title: {
|
|
3460
3452
|
visible: true
|
|
3461
3453
|
},
|
|
3462
|
-
content: createDimensionContent(measures, foldInfo, unfoldInfo)
|
|
3454
|
+
content: createDimensionContent(dimensions, measures, foldInfo, unfoldInfo)
|
|
3463
3455
|
}
|
|
3464
3456
|
};
|
|
3465
3457
|
return result;
|
|
3466
3458
|
};
|
|
3467
|
-
const createDimensionContent = (measures, foldInfo, unfoldInfo)=>{
|
|
3468
|
-
const { measureId, measureValue } = foldInfo;
|
|
3459
|
+
const createDimensionContent = (dimensions, measures, foldInfo, unfoldInfo)=>{
|
|
3460
|
+
const { measureId, measureValue, foldMap } = foldInfo;
|
|
3469
3461
|
const { encodingColor } = unfoldInfo;
|
|
3470
3462
|
return [
|
|
3471
3463
|
{
|
|
3472
3464
|
visible: true,
|
|
3473
3465
|
shapeType: 'rectRound',
|
|
3474
3466
|
hasShape: true,
|
|
3475
|
-
key: (v)=>{
|
|
3467
|
+
key: dimensions.some((d)=>'color' === d.encoding) ? (v)=>{
|
|
3476
3468
|
const datum = v;
|
|
3477
|
-
|
|
3478
|
-
|
|
3469
|
+
const key = datum && datum[encodingColor] || '';
|
|
3470
|
+
return unfoldInfo.colorIdMap[key].alias ?? key;
|
|
3471
|
+
} : Object.values(foldMap)[0],
|
|
3479
3472
|
value: (v)=>{
|
|
3480
3473
|
const datum = v;
|
|
3481
3474
|
if (!datum) return '';
|
|
@@ -3976,6 +3969,547 @@
|
|
|
3976
3969
|
markArea: markArea
|
|
3977
3970
|
};
|
|
3978
3971
|
};
|
|
3972
|
+
const isType_isType = (value, type)=>Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
3973
|
+
const isType = isType_isType;
|
|
3974
|
+
const isArray_isArray = (value)=>Array.isArray ? Array.isArray(value) : isType(value, "Array");
|
|
3975
|
+
const common_isArray = isArray_isArray;
|
|
3976
|
+
const isValid = (value)=>null != value;
|
|
3977
|
+
const common_isValid = isValid;
|
|
3978
|
+
function array_array(arr) {
|
|
3979
|
+
return common_isValid(arr) ? common_isArray(arr) ? arr : [
|
|
3980
|
+
arr
|
|
3981
|
+
] : [];
|
|
3982
|
+
}
|
|
3983
|
+
const isNumber = (value, fuzzy = !1)=>{
|
|
3984
|
+
const type = typeof value;
|
|
3985
|
+
return fuzzy ? "number" === type : "number" === type || isType(value, "Number");
|
|
3986
|
+
};
|
|
3987
|
+
const common_isNumber = isNumber;
|
|
3988
|
+
const isNil = (value)=>null == value;
|
|
3989
|
+
const common_isNil = isNil;
|
|
3990
|
+
const clamp_clamp = function(input, min, max) {
|
|
3991
|
+
return input < min ? min : input > max ? max : input;
|
|
3992
|
+
};
|
|
3993
|
+
const clamp = clamp_clamp;
|
|
3994
|
+
function hslToRgb(h, s, l) {
|
|
3995
|
+
s /= 100, l /= 100;
|
|
3996
|
+
const c = (1 - Math.abs(2 * l - 1)) * s, x = c * (1 - Math.abs(h / 60 % 2 - 1)), m = l - c / 2;
|
|
3997
|
+
let r = 0, g = 0, b = 0;
|
|
3998
|
+
return 0 <= h && h < 60 ? (r = c, g = x, b = 0) : 60 <= h && h < 120 ? (r = x, g = c, b = 0) : 120 <= h && h < 180 ? (r = 0, g = c, b = x) : 180 <= h && h < 240 ? (r = 0, g = x, b = c) : 240 <= h && h < 300 ? (r = x, g = 0, b = c) : 300 <= h && h < 360 && (r = c, g = 0, b = x), r = Math.round(255 * (r + m)), g = Math.round(255 * (g + m)), b = Math.round(255 * (b + m)), {
|
|
3999
|
+
r: r,
|
|
4000
|
+
g: g,
|
|
4001
|
+
b: b
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
function rgbToHsl(r, g, b) {
|
|
4005
|
+
r /= 255, g /= 255, b /= 255;
|
|
4006
|
+
const cMin = Math.min(r, g, b), cMax = Math.max(r, g, b), delta = cMax - cMin;
|
|
4007
|
+
let h = 0, s = 0, l = 0;
|
|
4008
|
+
return h = 0 === delta ? 0 : cMax === r ? (g - b) / delta % 6 : cMax === g ? (b - r) / delta + 2 : (r - g) / delta + 4, h = Math.round(60 * h), h < 0 && (h += 360), l = (cMax + cMin) / 2, s = 0 === delta ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(100 * s).toFixed(1), l = +(100 * l).toFixed(1), {
|
|
4009
|
+
h: h,
|
|
4010
|
+
s: s,
|
|
4011
|
+
l: l
|
|
4012
|
+
};
|
|
4013
|
+
}
|
|
4014
|
+
const REG_HEX = /^#([0-9a-f]{3,8})$/, DEFAULT_COLORS_OPACITY = {
|
|
4015
|
+
transparent: 4294967040
|
|
4016
|
+
};
|
|
4017
|
+
const DEFAULT_COLORS = {
|
|
4018
|
+
aliceblue: 15792383,
|
|
4019
|
+
antiquewhite: 16444375,
|
|
4020
|
+
aqua: 65535,
|
|
4021
|
+
aquamarine: 8388564,
|
|
4022
|
+
azure: 15794175,
|
|
4023
|
+
beige: 16119260,
|
|
4024
|
+
bisque: 16770244,
|
|
4025
|
+
black: 0,
|
|
4026
|
+
blanchedalmond: 16772045,
|
|
4027
|
+
blue: 255,
|
|
4028
|
+
blueviolet: 9055202,
|
|
4029
|
+
brown: 10824234,
|
|
4030
|
+
burlywood: 14596231,
|
|
4031
|
+
cadetblue: 6266528,
|
|
4032
|
+
chartreuse: 8388352,
|
|
4033
|
+
chocolate: 13789470,
|
|
4034
|
+
coral: 16744272,
|
|
4035
|
+
cornflowerblue: 6591981,
|
|
4036
|
+
cornsilk: 16775388,
|
|
4037
|
+
crimson: 14423100,
|
|
4038
|
+
cyan: 65535,
|
|
4039
|
+
darkblue: 139,
|
|
4040
|
+
darkcyan: 35723,
|
|
4041
|
+
darkgoldenrod: 12092939,
|
|
4042
|
+
darkgray: 11119017,
|
|
4043
|
+
darkgreen: 25600,
|
|
4044
|
+
darkgrey: 11119017,
|
|
4045
|
+
darkkhaki: 12433259,
|
|
4046
|
+
darkmagenta: 9109643,
|
|
4047
|
+
darkolivegreen: 5597999,
|
|
4048
|
+
darkorange: 16747520,
|
|
4049
|
+
darkorchid: 10040012,
|
|
4050
|
+
darkred: 9109504,
|
|
4051
|
+
darksalmon: 15308410,
|
|
4052
|
+
darkseagreen: 9419919,
|
|
4053
|
+
darkslateblue: 4734347,
|
|
4054
|
+
darkslategray: 3100495,
|
|
4055
|
+
darkslategrey: 3100495,
|
|
4056
|
+
darkturquoise: 52945,
|
|
4057
|
+
darkviolet: 9699539,
|
|
4058
|
+
deeppink: 16716947,
|
|
4059
|
+
deepskyblue: 49151,
|
|
4060
|
+
dimgray: 6908265,
|
|
4061
|
+
dimgrey: 6908265,
|
|
4062
|
+
dodgerblue: 2003199,
|
|
4063
|
+
firebrick: 11674146,
|
|
4064
|
+
floralwhite: 16775920,
|
|
4065
|
+
forestgreen: 2263842,
|
|
4066
|
+
fuchsia: 16711935,
|
|
4067
|
+
gainsboro: 14474460,
|
|
4068
|
+
ghostwhite: 16316671,
|
|
4069
|
+
gold: 16766720,
|
|
4070
|
+
goldenrod: 14329120,
|
|
4071
|
+
gray: 8421504,
|
|
4072
|
+
green: 32768,
|
|
4073
|
+
greenyellow: 11403055,
|
|
4074
|
+
grey: 8421504,
|
|
4075
|
+
honeydew: 15794160,
|
|
4076
|
+
hotpink: 16738740,
|
|
4077
|
+
indianred: 13458524,
|
|
4078
|
+
indigo: 4915330,
|
|
4079
|
+
ivory: 16777200,
|
|
4080
|
+
khaki: 15787660,
|
|
4081
|
+
lavender: 15132410,
|
|
4082
|
+
lavenderblush: 16773365,
|
|
4083
|
+
lawngreen: 8190976,
|
|
4084
|
+
lemonchiffon: 16775885,
|
|
4085
|
+
lightblue: 11393254,
|
|
4086
|
+
lightcoral: 15761536,
|
|
4087
|
+
lightcyan: 14745599,
|
|
4088
|
+
lightgoldenrodyellow: 16448210,
|
|
4089
|
+
lightgray: 13882323,
|
|
4090
|
+
lightgreen: 9498256,
|
|
4091
|
+
lightgrey: 13882323,
|
|
4092
|
+
lightpink: 16758465,
|
|
4093
|
+
lightsalmon: 16752762,
|
|
4094
|
+
lightseagreen: 2142890,
|
|
4095
|
+
lightskyblue: 8900346,
|
|
4096
|
+
lightslategray: 7833753,
|
|
4097
|
+
lightslategrey: 7833753,
|
|
4098
|
+
lightsteelblue: 11584734,
|
|
4099
|
+
lightyellow: 16777184,
|
|
4100
|
+
lime: 65280,
|
|
4101
|
+
limegreen: 3329330,
|
|
4102
|
+
linen: 16445670,
|
|
4103
|
+
magenta: 16711935,
|
|
4104
|
+
maroon: 8388608,
|
|
4105
|
+
mediumaquamarine: 6737322,
|
|
4106
|
+
mediumblue: 205,
|
|
4107
|
+
mediumorchid: 12211667,
|
|
4108
|
+
mediumpurple: 9662683,
|
|
4109
|
+
mediumseagreen: 3978097,
|
|
4110
|
+
mediumslateblue: 8087790,
|
|
4111
|
+
mediumspringgreen: 64154,
|
|
4112
|
+
mediumturquoise: 4772300,
|
|
4113
|
+
mediumvioletred: 13047173,
|
|
4114
|
+
midnightblue: 1644912,
|
|
4115
|
+
mintcream: 16121850,
|
|
4116
|
+
mistyrose: 16770273,
|
|
4117
|
+
moccasin: 16770229,
|
|
4118
|
+
navajowhite: 16768685,
|
|
4119
|
+
navy: 128,
|
|
4120
|
+
oldlace: 16643558,
|
|
4121
|
+
olive: 8421376,
|
|
4122
|
+
olivedrab: 7048739,
|
|
4123
|
+
orange: 16753920,
|
|
4124
|
+
orangered: 16729344,
|
|
4125
|
+
orchid: 14315734,
|
|
4126
|
+
palegoldenrod: 15657130,
|
|
4127
|
+
palegreen: 10025880,
|
|
4128
|
+
paleturquoise: 11529966,
|
|
4129
|
+
palevioletred: 14381203,
|
|
4130
|
+
papayawhip: 16773077,
|
|
4131
|
+
peachpuff: 16767673,
|
|
4132
|
+
peru: 13468991,
|
|
4133
|
+
pink: 16761035,
|
|
4134
|
+
plum: 14524637,
|
|
4135
|
+
powderblue: 11591910,
|
|
4136
|
+
purple: 8388736,
|
|
4137
|
+
rebeccapurple: 6697881,
|
|
4138
|
+
red: 16711680,
|
|
4139
|
+
rosybrown: 12357519,
|
|
4140
|
+
royalblue: 4286945,
|
|
4141
|
+
saddlebrown: 9127187,
|
|
4142
|
+
salmon: 16416882,
|
|
4143
|
+
sandybrown: 16032864,
|
|
4144
|
+
seagreen: 3050327,
|
|
4145
|
+
seashell: 16774638,
|
|
4146
|
+
sienna: 10506797,
|
|
4147
|
+
silver: 12632256,
|
|
4148
|
+
skyblue: 8900331,
|
|
4149
|
+
slateblue: 6970061,
|
|
4150
|
+
slategray: 7372944,
|
|
4151
|
+
slategrey: 7372944,
|
|
4152
|
+
snow: 16775930,
|
|
4153
|
+
springgreen: 65407,
|
|
4154
|
+
steelblue: 4620980,
|
|
4155
|
+
tan: 13808780,
|
|
4156
|
+
teal: 32896,
|
|
4157
|
+
thistle: 14204888,
|
|
4158
|
+
tomato: 16737095,
|
|
4159
|
+
turquoise: 4251856,
|
|
4160
|
+
violet: 15631086,
|
|
4161
|
+
wheat: 16113331,
|
|
4162
|
+
white: 16777215,
|
|
4163
|
+
whitesmoke: 16119285,
|
|
4164
|
+
yellow: 16776960,
|
|
4165
|
+
yellowgreen: 10145074
|
|
4166
|
+
};
|
|
4167
|
+
function Color_hex(value) {
|
|
4168
|
+
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
4169
|
+
}
|
|
4170
|
+
function Color_rgb(value) {
|
|
4171
|
+
return common_isNumber(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : common_isArray(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
4172
|
+
}
|
|
4173
|
+
function rgba(value) {
|
|
4174
|
+
return common_isNumber(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : common_isArray(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
4175
|
+
}
|
|
4176
|
+
function SRGBToLinear(c) {
|
|
4177
|
+
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
4178
|
+
}
|
|
4179
|
+
function LinearToSRGB(c) {
|
|
4180
|
+
return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
|
|
4181
|
+
}
|
|
4182
|
+
const setHex = (formatValue, forceHex)=>{
|
|
4183
|
+
const isHex = REG_HEX.exec(formatValue);
|
|
4184
|
+
if (forceHex || isHex) {
|
|
4185
|
+
const hex = parseInt(isHex[1], 16), hexLength = isHex[1].length;
|
|
4186
|
+
return 3 === hexLength ? new RGB((hex >> 8 & 15) + ((hex >> 8 & 15) << 4), (hex >> 4 & 15) + ((hex >> 4 & 15) << 4), (15 & hex) + ((15 & hex) << 4), 1) : 6 === hexLength ? Color_rgb(hex) : 8 === hexLength ? new RGB(hex >> 24 & 255, hex >> 16 & 255, hex >> 8 & 255, (255 & hex) / 255) : null;
|
|
4187
|
+
}
|
|
4188
|
+
};
|
|
4189
|
+
class Color {
|
|
4190
|
+
static Brighter(source, b = 1) {
|
|
4191
|
+
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
4192
|
+
}
|
|
4193
|
+
static SetOpacity(source, o = 1) {
|
|
4194
|
+
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
4195
|
+
}
|
|
4196
|
+
static getColorBrightness(source, model = "hsl") {
|
|
4197
|
+
const color = source instanceof Color ? source : new Color(source);
|
|
4198
|
+
switch(model){
|
|
4199
|
+
case "hsv":
|
|
4200
|
+
default:
|
|
4201
|
+
return color.getHSVBrightness();
|
|
4202
|
+
case "hsl":
|
|
4203
|
+
return color.getHSLBrightness();
|
|
4204
|
+
case "lum":
|
|
4205
|
+
return color.getLuminance();
|
|
4206
|
+
case "lum2":
|
|
4207
|
+
return color.getLuminance2();
|
|
4208
|
+
case "lum3":
|
|
4209
|
+
return color.getLuminance3();
|
|
4210
|
+
case "wcag":
|
|
4211
|
+
return color.getLuminanceWCAG();
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
static parseColorString(value) {
|
|
4215
|
+
if (common_isValid(DEFAULT_COLORS_OPACITY[value])) return rgba(DEFAULT_COLORS_OPACITY[value]);
|
|
4216
|
+
if (common_isValid(DEFAULT_COLORS[value])) return Color_rgb(DEFAULT_COLORS[value]);
|
|
4217
|
+
const formatValue = `${value}`.trim().toLowerCase(), hexRes = setHex(formatValue);
|
|
4218
|
+
if (void 0 !== hexRes) return hexRes;
|
|
4219
|
+
if (/^(rgb|RGB|rgba|RGBA)/.test(formatValue)) {
|
|
4220
|
+
const aColor = formatValue.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g, "").split(",");
|
|
4221
|
+
return new RGB(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10), parseFloat(aColor[3]));
|
|
4222
|
+
}
|
|
4223
|
+
if (/^(hsl|HSL|hsla|HSLA)/.test(formatValue)) {
|
|
4224
|
+
const aColor = formatValue.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g, "").split(","), rgb = hslToRgb(parseInt(aColor[0], 10), parseInt(aColor[1], 10), parseInt(aColor[2], 10));
|
|
4225
|
+
return new RGB(rgb.r, rgb.g, rgb.b, parseFloat(aColor[3]));
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
constructor(value){
|
|
4229
|
+
const color = Color.parseColorString(value);
|
|
4230
|
+
color ? this.color = color : (console.warn(`Warn: 传入${value}无法解析为Color`), this.color = new RGB(255, 255, 255));
|
|
4231
|
+
}
|
|
4232
|
+
toRGBA() {
|
|
4233
|
+
return this.color.formatRgb();
|
|
4234
|
+
}
|
|
4235
|
+
toString() {
|
|
4236
|
+
return this.color.formatRgb();
|
|
4237
|
+
}
|
|
4238
|
+
toHex() {
|
|
4239
|
+
return this.color.formatHex();
|
|
4240
|
+
}
|
|
4241
|
+
toHsl() {
|
|
4242
|
+
return this.color.formatHsl();
|
|
4243
|
+
}
|
|
4244
|
+
brighter(k) {
|
|
4245
|
+
const { r: r, g: g, b: b } = this.color;
|
|
4246
|
+
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * k))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * k))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * k))), this;
|
|
4247
|
+
}
|
|
4248
|
+
add(color) {
|
|
4249
|
+
const { r: r, g: g, b: b } = this.color;
|
|
4250
|
+
return this.color.r += Math.min(255, r + color.color.r), this.color.g += Math.min(255, g + color.color.g), this.color.b += Math.min(255, b + color.color.b), this;
|
|
4251
|
+
}
|
|
4252
|
+
sub(color) {
|
|
4253
|
+
return this.color.r = Math.max(0, this.color.r - color.color.r), this.color.g = Math.max(0, this.color.g - color.color.g), this.color.b = Math.max(0, this.color.b - color.color.b), this;
|
|
4254
|
+
}
|
|
4255
|
+
multiply(color) {
|
|
4256
|
+
const { r: r, g: g, b: b } = this.color;
|
|
4257
|
+
return this.color.r = Math.max(0, Math.min(255, Math.floor(r * color.color.r))), this.color.g = Math.max(0, Math.min(255, Math.floor(g * color.color.g))), this.color.b = Math.max(0, Math.min(255, Math.floor(b * color.color.b))), this;
|
|
4258
|
+
}
|
|
4259
|
+
getHSVBrightness() {
|
|
4260
|
+
return Math.max(this.color.r, this.color.g, this.color.b) / 255;
|
|
4261
|
+
}
|
|
4262
|
+
getHSLBrightness() {
|
|
4263
|
+
return .5 * (Math.max(this.color.r, this.color.g, this.color.b) / 255 + Math.min(this.color.r, this.color.g, this.color.b) / 255);
|
|
4264
|
+
}
|
|
4265
|
+
setHsl(h, s, l) {
|
|
4266
|
+
const opacity = this.color.opacity, hsl = rgbToHsl(this.color.r, this.color.g, this.color.b), rgb = hslToRgb(common_isNil(h) ? hsl.h : clamp(h, 0, 360), common_isNil(s) ? hsl.s : s >= 0 && s <= 1 ? 100 * s : s, common_isNil(l) ? hsl.l : l <= 1 && l >= 0 ? 100 * l : l);
|
|
4267
|
+
return this.color = new RGB(rgb.r, rgb.g, rgb.b, opacity), this;
|
|
4268
|
+
}
|
|
4269
|
+
setRGB(r, g, b) {
|
|
4270
|
+
return common_isNil(r) || (this.color.r = r), common_isNil(g) || (this.color.g = g), common_isNil(b) || (this.color.b = b), this;
|
|
4271
|
+
}
|
|
4272
|
+
setHex(value) {
|
|
4273
|
+
const formatValue = `${value}`.trim().toLowerCase(), res = setHex(formatValue, !0);
|
|
4274
|
+
return null != res ? res : this;
|
|
4275
|
+
}
|
|
4276
|
+
setColorName(name) {
|
|
4277
|
+
const hex = DEFAULT_COLORS[name.toLowerCase()];
|
|
4278
|
+
return void 0 !== hex ? this.setHex(hex) : console.warn("THREE.Color: Unknown color " + name), this;
|
|
4279
|
+
}
|
|
4280
|
+
setScalar(scalar) {
|
|
4281
|
+
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
4282
|
+
}
|
|
4283
|
+
setOpacity(o = 1) {
|
|
4284
|
+
return this.color.opacity = o, this;
|
|
4285
|
+
}
|
|
4286
|
+
getLuminance() {
|
|
4287
|
+
return (.2126 * this.color.r + .7152 * this.color.g + .0722 * this.color.b) / 255;
|
|
4288
|
+
}
|
|
4289
|
+
getLuminance2() {
|
|
4290
|
+
return (.2627 * this.color.r + .678 * this.color.g + .0593 * this.color.b) / 255;
|
|
4291
|
+
}
|
|
4292
|
+
getLuminance3() {
|
|
4293
|
+
return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
|
|
4294
|
+
}
|
|
4295
|
+
getLuminanceWCAG() {
|
|
4296
|
+
const RsRGB = this.color.r / 255, GsRGB = this.color.g / 255, BsRGB = this.color.b / 255;
|
|
4297
|
+
let R, G, B;
|
|
4298
|
+
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
4299
|
+
return .2126 * R + .7152 * G + .0722 * B;
|
|
4300
|
+
}
|
|
4301
|
+
clone() {
|
|
4302
|
+
return new Color(this.color.toString());
|
|
4303
|
+
}
|
|
4304
|
+
copyGammaToLinear(color, gammaFactor = 2) {
|
|
4305
|
+
return this.color.r = Math.pow(color.color.r, gammaFactor), this.color.g = Math.pow(color.color.g, gammaFactor), this.color.b = Math.pow(color.color.b, gammaFactor), this;
|
|
4306
|
+
}
|
|
4307
|
+
copyLinearToGamma(color, gammaFactor = 2) {
|
|
4308
|
+
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
4309
|
+
return this.color.r = Math.pow(color.color.r, safeInverse), this.color.g = Math.pow(color.color.g, safeInverse), this.color.b = Math.pow(color.color.b, safeInverse), this;
|
|
4310
|
+
}
|
|
4311
|
+
convertGammaToLinear(gammaFactor) {
|
|
4312
|
+
return this.copyGammaToLinear(this, gammaFactor), this;
|
|
4313
|
+
}
|
|
4314
|
+
convertLinearToGamma(gammaFactor) {
|
|
4315
|
+
return this.copyLinearToGamma(this, gammaFactor), this;
|
|
4316
|
+
}
|
|
4317
|
+
copySRGBToLinear(color) {
|
|
4318
|
+
return this.color.r = SRGBToLinear(color.color.r), this.color.g = SRGBToLinear(color.color.g), this.color.b = SRGBToLinear(color.color.b), this;
|
|
4319
|
+
}
|
|
4320
|
+
copyLinearToSRGB(color) {
|
|
4321
|
+
return this.color.r = LinearToSRGB(color.color.r), this.color.g = LinearToSRGB(color.color.g), this.color.b = LinearToSRGB(color.color.b), this;
|
|
4322
|
+
}
|
|
4323
|
+
convertSRGBToLinear() {
|
|
4324
|
+
return this.copySRGBToLinear(this), this;
|
|
4325
|
+
}
|
|
4326
|
+
convertLinearToSRGB() {
|
|
4327
|
+
return this.copyLinearToSRGB(this), this;
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
class RGB {
|
|
4331
|
+
constructor(r, g, b, opacity){
|
|
4332
|
+
this.r = isNaN(+r) ? 255 : Math.max(0, Math.min(255, +r)), this.g = isNaN(+g) ? 255 : Math.max(0, Math.min(255, +g)), this.b = isNaN(+b) ? 255 : Math.max(0, Math.min(255, +b)), common_isValid(opacity) ? this.opacity = isNaN(+opacity) ? 1 : Math.max(0, Math.min(1, +opacity)) : this.opacity = 1;
|
|
4333
|
+
}
|
|
4334
|
+
formatHex() {
|
|
4335
|
+
return `#${Color_hex(this.r) + Color_hex(this.g) + Color_hex(this.b) + (1 === this.opacity ? "" : Color_hex(255 * this.opacity))}`;
|
|
4336
|
+
}
|
|
4337
|
+
formatRgb() {
|
|
4338
|
+
const opacity = this.opacity;
|
|
4339
|
+
return `${1 === opacity ? "rgb(" : "rgba("}${this.r},${this.g},${this.b}${1 === opacity ? ")" : `,${opacity})`}`;
|
|
4340
|
+
}
|
|
4341
|
+
formatHsl() {
|
|
4342
|
+
const opacity = this.opacity, { h: h, s: s, l: l } = rgbToHsl(this.r, this.g, this.b);
|
|
4343
|
+
return `${1 === opacity ? "hsl(" : "hsla("}${h},${s}%,${l}%${1 === opacity ? ")" : `,${opacity})`}`;
|
|
4344
|
+
}
|
|
4345
|
+
toString() {
|
|
4346
|
+
return this.formatHex();
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
const splitLine = (spec, context)=>{
|
|
4350
|
+
const { advancedVSeed } = context;
|
|
4351
|
+
const { annotation, chartType, datasetReshapeInfo } = advancedVSeed;
|
|
4352
|
+
if (!annotation || !annotation.annotationHorizontalLine) return spec;
|
|
4353
|
+
const baseConfig = advancedVSeed.config[chartType];
|
|
4354
|
+
const splitLineConfig = array_array(annotation.annotationHorizontalLine).find((item)=>!!item.splitLine);
|
|
4355
|
+
const splitValue = +splitLineConfig?.yValue;
|
|
4356
|
+
if (Number.isNaN(splitValue) || !chunk_6GTAPB47_e(splitValue)) return spec;
|
|
4357
|
+
const result = {
|
|
4358
|
+
...spec
|
|
4359
|
+
};
|
|
4360
|
+
const colorTheme = baseConfig?.color ?? {};
|
|
4361
|
+
const colorConfig = {
|
|
4362
|
+
positiveColor: colorTheme.positiveColor || 'red',
|
|
4363
|
+
negativeColor: colorTheme.negativeColor || 'green',
|
|
4364
|
+
...chunk_BZNENX2T_r(splitLineConfig?.splitLine) ? splitLineConfig?.splitLine : {}
|
|
4365
|
+
};
|
|
4366
|
+
const groupMark = {
|
|
4367
|
+
type: 'group',
|
|
4368
|
+
name: 'annotationHorizontalLine-splitLine',
|
|
4369
|
+
zIndex: 300,
|
|
4370
|
+
style: {
|
|
4371
|
+
splitConfig: (datum, ctx)=>{
|
|
4372
|
+
const vchart = ctx.vchart;
|
|
4373
|
+
const chart = vchart.getChart();
|
|
4374
|
+
const lineSeries = chart.getAllSeries().find((s)=>'line' === s.type || 'area' === s.type);
|
|
4375
|
+
if (!lineSeries) return;
|
|
4376
|
+
const lineMark = lineSeries.getMarkInName('line') ?? lineSeries.getMarkInName('area');
|
|
4377
|
+
if (!lineMark) return;
|
|
4378
|
+
const lineGraphics = lineMark.getGraphics();
|
|
4379
|
+
if (!lineGraphics || 1 !== lineGraphics.length || !lineGraphics[0]) return;
|
|
4380
|
+
const points = lineGraphics[0].attribute.points ?? [];
|
|
4381
|
+
if (lineGraphics[0].attribute.segments?.length) lineGraphics[0].attribute.segments.forEach((seg)=>{
|
|
4382
|
+
seg.points.forEach((pt)=>{
|
|
4383
|
+
points.push({
|
|
4384
|
+
x: pt.x,
|
|
4385
|
+
y: pt.y
|
|
4386
|
+
});
|
|
4387
|
+
});
|
|
4388
|
+
});
|
|
4389
|
+
if (!points || !points.length) return;
|
|
4390
|
+
const splitCoordinate = lineSeries.getYAxisHelper().getScale(0).scale(splitValue);
|
|
4391
|
+
const minY = Math.min(...points.map((p)=>p.y));
|
|
4392
|
+
const maxY = Math.max(...points.map((p)=>p.y));
|
|
4393
|
+
const ratio = (splitCoordinate - minY) / (maxY - minY);
|
|
4394
|
+
const lineStroke = {
|
|
4395
|
+
gradient: 'linear',
|
|
4396
|
+
x0: 0,
|
|
4397
|
+
x1: 0,
|
|
4398
|
+
y0: 0,
|
|
4399
|
+
y1: 1,
|
|
4400
|
+
stops: [
|
|
4401
|
+
{
|
|
4402
|
+
color: colorConfig.positiveColor,
|
|
4403
|
+
offset: 0
|
|
4404
|
+
},
|
|
4405
|
+
{
|
|
4406
|
+
color: colorConfig.positiveColor,
|
|
4407
|
+
offset: ratio
|
|
4408
|
+
},
|
|
4409
|
+
{
|
|
4410
|
+
color: colorConfig.negativeColor,
|
|
4411
|
+
offset: ratio + 0.0000001
|
|
4412
|
+
},
|
|
4413
|
+
{
|
|
4414
|
+
color: colorConfig.negativeColor,
|
|
4415
|
+
offset: 1
|
|
4416
|
+
}
|
|
4417
|
+
]
|
|
4418
|
+
};
|
|
4419
|
+
const areaFill = {
|
|
4420
|
+
gradient: 'linear',
|
|
4421
|
+
x0: 0,
|
|
4422
|
+
x1: 0,
|
|
4423
|
+
y0: 0,
|
|
4424
|
+
y1: 1,
|
|
4425
|
+
stops: [
|
|
4426
|
+
{
|
|
4427
|
+
color: colorConfig.positiveColor,
|
|
4428
|
+
offset: 0
|
|
4429
|
+
},
|
|
4430
|
+
{
|
|
4431
|
+
color: new Color(colorConfig.positiveColor).setOpacity(0).toRGBA(),
|
|
4432
|
+
offset: ratio
|
|
4433
|
+
},
|
|
4434
|
+
{
|
|
4435
|
+
offset: ratio + 0.0000001,
|
|
4436
|
+
color: new Color(colorConfig.negativeColor).setOpacity(0).toRGBA()
|
|
4437
|
+
},
|
|
4438
|
+
{
|
|
4439
|
+
color: colorConfig.negativeColor,
|
|
4440
|
+
offset: 1
|
|
4441
|
+
}
|
|
4442
|
+
]
|
|
4443
|
+
};
|
|
4444
|
+
const attrs = {
|
|
4445
|
+
segments: null,
|
|
4446
|
+
points
|
|
4447
|
+
};
|
|
4448
|
+
if ('area' === lineGraphics[0].type) {
|
|
4449
|
+
attrs.stroke = lineStroke;
|
|
4450
|
+
attrs.fill = areaFill;
|
|
4451
|
+
} else attrs.stroke = lineStroke;
|
|
4452
|
+
lineGraphics[0].setAttributes(attrs);
|
|
4453
|
+
lineGraphics[0].setFinalAttributes?.(attrs);
|
|
4454
|
+
const start = lineSeries.getRegion().getLayoutStartPoint();
|
|
4455
|
+
return {
|
|
4456
|
+
points: points.map((entry)=>({
|
|
4457
|
+
x: entry.x + start.x,
|
|
4458
|
+
y: entry.y + start.y
|
|
4459
|
+
})),
|
|
4460
|
+
splitCoordinate,
|
|
4461
|
+
areaFill,
|
|
4462
|
+
lineStroke
|
|
4463
|
+
};
|
|
4464
|
+
}
|
|
4465
|
+
},
|
|
4466
|
+
children: [
|
|
4467
|
+
{
|
|
4468
|
+
type: 'area',
|
|
4469
|
+
interactive: false,
|
|
4470
|
+
zIndex: 500,
|
|
4471
|
+
style: {
|
|
4472
|
+
fillOpacity: 0.5,
|
|
4473
|
+
points: (datum, ctx, opt)=>{
|
|
4474
|
+
const parentNode = opt.mark?._product?.parent;
|
|
4475
|
+
if (parentNode?.attribute?.splitConfig) {
|
|
4476
|
+
const { points, splitCoordinate } = parentNode.attribute.splitConfig;
|
|
4477
|
+
return points.map((entry)=>({
|
|
4478
|
+
...entry,
|
|
4479
|
+
y1: splitCoordinate
|
|
4480
|
+
}));
|
|
4481
|
+
}
|
|
4482
|
+
return [];
|
|
4483
|
+
},
|
|
4484
|
+
fill: (datum, ctx, opt)=>{
|
|
4485
|
+
const parentNode = opt.mark?._product?.parent;
|
|
4486
|
+
if (parentNode?.attribute?.splitConfig) {
|
|
4487
|
+
const { areaFill } = parentNode.attribute.splitConfig;
|
|
4488
|
+
return areaFill;
|
|
4489
|
+
}
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
]
|
|
4494
|
+
};
|
|
4495
|
+
if (!result.customMark) result.customMark = [];
|
|
4496
|
+
result.customMark.push(groupMark);
|
|
4497
|
+
const seriesSpec = 'line' === result.type || 'area' === result.type ? result : result.series?.find((s)=>'line' === s.type || 'area' === s.type);
|
|
4498
|
+
if (seriesSpec) {
|
|
4499
|
+
if (!seriesSpec.point) seriesSpec.point = {};
|
|
4500
|
+
if (!seriesSpec.line) seriesSpec.line = {};
|
|
4501
|
+
if (!seriesSpec.point.style) seriesSpec.point.style = {};
|
|
4502
|
+
if (!seriesSpec.line.style) seriesSpec.line.style = {};
|
|
4503
|
+
const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue;
|
|
4504
|
+
seriesSpec.point.style.fill = (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
|
|
4505
|
+
seriesSpec.line.style.stroke = (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
|
|
4506
|
+
if (seriesSpec.label && seriesSpec.label.visible && chunk_JK3VNB42_n(seriesSpec.label.style?.fill)) seriesSpec.label.style = {
|
|
4507
|
+
...seriesSpec.label.style,
|
|
4508
|
+
fill: (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4511
|
+
return result;
|
|
4512
|
+
};
|
|
3979
4513
|
const initPivot = (spec)=>{
|
|
3980
4514
|
const result = {
|
|
3981
4515
|
...spec
|
|
@@ -4007,7 +4541,7 @@
|
|
|
4007
4541
|
isShowOverflowTextTooltip: true
|
|
4008
4542
|
},
|
|
4009
4543
|
corner: {
|
|
4010
|
-
titleOnDimension: '
|
|
4544
|
+
titleOnDimension: 'row'
|
|
4011
4545
|
},
|
|
4012
4546
|
animationAppear: {
|
|
4013
4547
|
duration: 600,
|
|
@@ -4018,13 +4552,14 @@
|
|
|
4018
4552
|
};
|
|
4019
4553
|
const pivotGridStyle = (spec, context)=>{
|
|
4020
4554
|
const { vseed, advancedVSeed } = context;
|
|
4021
|
-
const { config, chartType } = advancedVSeed;
|
|
4555
|
+
const { config, chartType, dimensions } = advancedVSeed;
|
|
4022
4556
|
const themConfig = config?.[chartType]?.pivotGrid ?? {};
|
|
4023
4557
|
const onlyCombination = !isPivot(vseed) && isCombination(vseed);
|
|
4024
4558
|
const result = {
|
|
4025
4559
|
...spec
|
|
4026
4560
|
};
|
|
4027
4561
|
const transparent = 'rgba(0,0,0,0)';
|
|
4562
|
+
const hasColumnDimension = dimensions.some((dim)=>'column' === dim.encoding);
|
|
4028
4563
|
const borderColor = themConfig.borderColor ?? '#e3e5eb';
|
|
4029
4564
|
const bodyFontColor = themConfig.bodyFontColor ?? '#141414';
|
|
4030
4565
|
const headerFontColor = themConfig.headerFontColor ?? '#21252c';
|
|
@@ -4042,12 +4577,12 @@
|
|
|
4042
4577
|
bodyStyle: {
|
|
4043
4578
|
borderColor,
|
|
4044
4579
|
color: bodyFontColor,
|
|
4045
|
-
borderLineWidth: [
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4580
|
+
borderLineWidth: (arg)=>[
|
|
4581
|
+
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
4582
|
+
outlineBorderLineWidth,
|
|
4583
|
+
0,
|
|
4584
|
+
0 === arg.col ? outlineBorderLineWidth : 1
|
|
4585
|
+
],
|
|
4051
4586
|
bgColor: transparent,
|
|
4052
4587
|
hover: {
|
|
4053
4588
|
cellBgColor: 'transparent'
|
|
@@ -4056,12 +4591,12 @@
|
|
|
4056
4591
|
headerStyle: {
|
|
4057
4592
|
borderColor,
|
|
4058
4593
|
fontSize: 12,
|
|
4059
|
-
borderLineWidth: [
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4594
|
+
borderLineWidth: (arg)=>[
|
|
4595
|
+
outlineBorderLineWidth,
|
|
4596
|
+
outlineBorderLineWidth,
|
|
4597
|
+
1,
|
|
4598
|
+
0 === arg.col ? outlineBorderLineWidth : 1
|
|
4599
|
+
],
|
|
4065
4600
|
color: headerFontColor,
|
|
4066
4601
|
textAlign: 'center',
|
|
4067
4602
|
bgColor: headerBackgroundColor,
|
|
@@ -4081,12 +4616,12 @@
|
|
|
4081
4616
|
0,
|
|
4082
4617
|
4
|
|
4083
4618
|
],
|
|
4084
|
-
borderLineWidth: [
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4619
|
+
borderLineWidth: (arg)=>[
|
|
4620
|
+
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
4621
|
+
1,
|
|
4622
|
+
0,
|
|
4623
|
+
outlineBorderLineWidth
|
|
4624
|
+
],
|
|
4090
4625
|
bgColor: headerBackgroundColor,
|
|
4091
4626
|
hover: {
|
|
4092
4627
|
cellBgColor: hoverHeaderBackgroundColor,
|
|
@@ -4114,13 +4649,7 @@
|
|
|
4114
4649
|
],
|
|
4115
4650
|
bgColor: headerBackgroundColor,
|
|
4116
4651
|
frameStyle: {
|
|
4117
|
-
borderColor
|
|
4118
|
-
borderLineWidth: [
|
|
4119
|
-
outlineBorderLineWidth,
|
|
4120
|
-
0,
|
|
4121
|
-
0,
|
|
4122
|
-
outlineBorderLineWidth
|
|
4123
|
-
]
|
|
4652
|
+
borderColor
|
|
4124
4653
|
},
|
|
4125
4654
|
hover: {
|
|
4126
4655
|
cellBgColor: hoverHeaderBackgroundColor,
|
|
@@ -4134,9 +4663,9 @@
|
|
|
4134
4663
|
frameStyle: {
|
|
4135
4664
|
borderColor,
|
|
4136
4665
|
borderLineWidth: [
|
|
4666
|
+
outlineBorderLineWidth,
|
|
4137
4667
|
outlineBorderLineWidth,
|
|
4138
4668
|
1,
|
|
4139
|
-
0,
|
|
4140
4669
|
1
|
|
4141
4670
|
]
|
|
4142
4671
|
},
|
|
@@ -4148,7 +4677,7 @@
|
|
|
4148
4677
|
cornerLeftBottomCellStyle: {
|
|
4149
4678
|
borderColor,
|
|
4150
4679
|
borderLineWidth: [
|
|
4151
|
-
|
|
4680
|
+
outlineBorderLineWidth,
|
|
4152
4681
|
0,
|
|
4153
4682
|
outlineBorderLineWidth,
|
|
4154
4683
|
outlineBorderLineWidth
|
|
@@ -4169,14 +4698,19 @@
|
|
|
4169
4698
|
},
|
|
4170
4699
|
cornerRightBottomCellStyle: {
|
|
4171
4700
|
borderColor,
|
|
4172
|
-
borderLineWidth: 0,
|
|
4173
4701
|
bgColor: headerBackgroundColor,
|
|
4702
|
+
borderLineWidth: [
|
|
4703
|
+
1,
|
|
4704
|
+
outlineBorderLineWidth,
|
|
4705
|
+
outlineBorderLineWidth,
|
|
4706
|
+
1
|
|
4707
|
+
],
|
|
4174
4708
|
frameStyle: {
|
|
4175
4709
|
borderColor,
|
|
4176
4710
|
borderLineWidth: [
|
|
4177
4711
|
1,
|
|
4178
|
-
|
|
4179
|
-
|
|
4712
|
+
outlineBorderLineWidth,
|
|
4713
|
+
outlineBorderLineWidth,
|
|
4180
4714
|
1
|
|
4181
4715
|
]
|
|
4182
4716
|
},
|
|
@@ -4186,9 +4720,15 @@
|
|
|
4186
4720
|
},
|
|
4187
4721
|
rightFrozenStyle: {
|
|
4188
4722
|
borderColor,
|
|
4189
|
-
borderLineWidth: 1,
|
|
4190
4723
|
bgColor: headerBackgroundColor,
|
|
4724
|
+
borderLineWidth: (arg)=>[
|
|
4725
|
+
0 === arg.row || hasColumnDimension && 1 === arg.row ? outlineBorderLineWidth : 1,
|
|
4726
|
+
outlineBorderLineWidth,
|
|
4727
|
+
0,
|
|
4728
|
+
1
|
|
4729
|
+
],
|
|
4191
4730
|
hover: {
|
|
4731
|
+
borderLineWidth: 0,
|
|
4192
4732
|
cellBgColor: hoverHeaderBackgroundColor
|
|
4193
4733
|
}
|
|
4194
4734
|
},
|
|
@@ -4300,6 +4840,16 @@
|
|
|
4300
4840
|
records: records
|
|
4301
4841
|
};
|
|
4302
4842
|
};
|
|
4843
|
+
const pivotAxisStyle = (axisStyle)=>(spec, context)=>{
|
|
4844
|
+
const result = axisStyle(spec, context);
|
|
4845
|
+
if (result.axes) result.axes.forEach((axis)=>{
|
|
4846
|
+
axis.domainLine = {
|
|
4847
|
+
visible: false
|
|
4848
|
+
};
|
|
4849
|
+
if (axis.grid && axis.grid.visible && axis.grid.style) axis.grid.style.strokeOpacity = 0.3;
|
|
4850
|
+
});
|
|
4851
|
+
return result;
|
|
4852
|
+
};
|
|
4303
4853
|
const pivotRowDimensions = (spec, context)=>{
|
|
4304
4854
|
const result = {
|
|
4305
4855
|
...spec
|
|
@@ -4334,6 +4884,31 @@
|
|
|
4334
4884
|
columns: columns
|
|
4335
4885
|
};
|
|
4336
4886
|
};
|
|
4887
|
+
const pivotTitle = (spec, context)=>{
|
|
4888
|
+
const result = {
|
|
4889
|
+
...spec
|
|
4890
|
+
};
|
|
4891
|
+
const { advancedVSeed } = context;
|
|
4892
|
+
const { config, chartType } = advancedVSeed;
|
|
4893
|
+
const themConfig = config?.[chartType]?.pivotGrid ?? {};
|
|
4894
|
+
if (result.columns && result.columns.length > 0) result.title = {
|
|
4895
|
+
text: spec.columns.map((entry)=>entry.title).join('/'),
|
|
4896
|
+
align: 'center',
|
|
4897
|
+
orient: 'top',
|
|
4898
|
+
padding: [
|
|
4899
|
+
2,
|
|
4900
|
+
0,
|
|
4901
|
+
0,
|
|
4902
|
+
0
|
|
4903
|
+
],
|
|
4904
|
+
textStyle: {
|
|
4905
|
+
fontSize: themConfig.titleFontSize ?? 12,
|
|
4906
|
+
fill: themConfig.titleFontColor ?? '#000',
|
|
4907
|
+
fontWeight: themConfig.titleFontWeight ?? 'bold'
|
|
4908
|
+
}
|
|
4909
|
+
};
|
|
4910
|
+
return result;
|
|
4911
|
+
};
|
|
4337
4912
|
const pivotDiscreteLegend = (spec, context)=>{
|
|
4338
4913
|
const result = {
|
|
4339
4914
|
...spec
|
|
@@ -4427,7 +5002,7 @@
|
|
|
4427
5002
|
}
|
|
4428
5003
|
},
|
|
4429
5004
|
label: {
|
|
4430
|
-
formatMethod: (value)=>colorIdMap[value] ?? value,
|
|
5005
|
+
formatMethod: (value)=>colorIdMap[value]?.alias ?? value,
|
|
4431
5006
|
style: {
|
|
4432
5007
|
fontSize: labelFontSize,
|
|
4433
5008
|
fill: labelColor || labelFontColor,
|
|
@@ -4552,7 +5127,8 @@
|
|
|
4552
5127
|
annotationPoint_annotationPoint,
|
|
4553
5128
|
annotationVerticalLine_annotationVerticalLine,
|
|
4554
5129
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
4555
|
-
annotationArea_annotationArea
|
|
5130
|
+
annotationArea_annotationArea,
|
|
5131
|
+
splitLine
|
|
4556
5132
|
];
|
|
4557
5133
|
const pivotLine = [
|
|
4558
5134
|
initPivot,
|
|
@@ -4566,7 +5142,7 @@
|
|
|
4566
5142
|
datasetXY,
|
|
4567
5143
|
progressive,
|
|
4568
5144
|
xBand,
|
|
4569
|
-
yLinear,
|
|
5145
|
+
pivotAxisStyle(yLinear),
|
|
4570
5146
|
verticalCrosshairLine,
|
|
4571
5147
|
colorPointStyleFill(pointStyle_pointStyle),
|
|
4572
5148
|
pointStateDimensionHover,
|
|
@@ -4576,10 +5152,12 @@
|
|
|
4576
5152
|
annotationPoint_annotationPoint,
|
|
4577
5153
|
annotationVerticalLine_annotationVerticalLine,
|
|
4578
5154
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
4579
|
-
annotationArea_annotationArea
|
|
5155
|
+
annotationArea_annotationArea,
|
|
5156
|
+
splitLine
|
|
4580
5157
|
]),
|
|
4581
5158
|
pivotRowDimensions,
|
|
4582
5159
|
pivotColumnDimensions,
|
|
5160
|
+
pivotTitle,
|
|
4583
5161
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
4584
5162
|
];
|
|
4585
5163
|
const lineSpecPipeline = [
|
|
@@ -4616,12 +5194,12 @@
|
|
|
4616
5194
|
};
|
|
4617
5195
|
};
|
|
4618
5196
|
const column_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
4619
|
-
const
|
|
5197
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
4620
5198
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
4621
5199
|
encoding.x = uniqueDimIds.slice(0, 1);
|
|
4622
|
-
encoding.color = uniqueDimIds.slice(
|
|
5200
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
4623
5201
|
encoding.detail = encoding.color;
|
|
4624
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
5202
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
4625
5203
|
encoding.label = [];
|
|
4626
5204
|
encoding.row = [];
|
|
4627
5205
|
encoding.column = [];
|
|
@@ -4635,9 +5213,9 @@
|
|
|
4635
5213
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
4636
5214
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
|
4637
5215
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
4638
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
5216
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
4639
5217
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
4640
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
5218
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
4641
5219
|
};
|
|
4642
5220
|
const column_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
4643
5221
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -4722,7 +5300,7 @@
|
|
|
4722
5300
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
4723
5301
|
default_defaultMeasures_defaultMeasures,
|
|
4724
5302
|
defaultDimensions_defaultDimensions,
|
|
4725
|
-
|
|
5303
|
+
defaultMeasureId,
|
|
4726
5304
|
encodingAdapter([
|
|
4727
5305
|
defaultEncodingForColumn,
|
|
4728
5306
|
buildMeasures
|
|
@@ -5070,23 +5648,10 @@
|
|
|
5070
5648
|
markArea: markArea
|
|
5071
5649
|
};
|
|
5072
5650
|
};
|
|
5073
|
-
const isType_isType = (value, type)=>Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
5074
|
-
const isType = isType_isType;
|
|
5075
|
-
const isArray_isArray = (value)=>Array.isArray ? Array.isArray(value) : isType(value, "Array");
|
|
5076
|
-
const common_isArray = isArray_isArray;
|
|
5077
|
-
const isValid = (value)=>null != value;
|
|
5078
|
-
const common_isValid = isValid;
|
|
5079
|
-
function array_array(arr) {
|
|
5080
|
-
return common_isValid(arr) ? common_isArray(arr) ? arr : [
|
|
5081
|
-
arr
|
|
5082
|
-
] : [];
|
|
5083
|
-
}
|
|
5084
5651
|
function clamper(a, b) {
|
|
5085
5652
|
let t;
|
|
5086
5653
|
return a > b && (t = a, a = b, b = t), (x)=>Math.max(a, Math.min(b, x));
|
|
5087
5654
|
}
|
|
5088
|
-
const isNil = (value)=>null == value;
|
|
5089
|
-
const common_isNil = isNil;
|
|
5090
5655
|
function invNorm(p) {
|
|
5091
5656
|
if (p <= 0 || p >= 1) return 0;
|
|
5092
5657
|
const c1 = -0.00778489400243029, c2 = -0.322396458041136, c3 = -2.40075827716184, c4 = -2.54973253934373, c5 = 4.37466414146497, c6 = 2.93816398269878, d1 = .00778469570904146, d2 = .32246712907004, d3 = 2.445134137143, d4 = 3.75440866190742;
|
|
@@ -5548,13 +6113,14 @@
|
|
|
5548
6113
|
pivotIndicators_pivotIndicators([
|
|
5549
6114
|
initColumn,
|
|
5550
6115
|
stackCornerRadius_stackCornerRadius,
|
|
6116
|
+
barMaxWidth_barMaxWidth,
|
|
5551
6117
|
stackInverse,
|
|
5552
6118
|
colorAdapter(color_color, linearColor),
|
|
5553
6119
|
background_backgroundColor,
|
|
5554
6120
|
datasetXY,
|
|
5555
6121
|
progressive,
|
|
5556
6122
|
xBand,
|
|
5557
|
-
yLinear,
|
|
6123
|
+
pivotAxisStyle(yLinear),
|
|
5558
6124
|
label_label,
|
|
5559
6125
|
tooltip_tooltip,
|
|
5560
6126
|
verticalCrosshairRect,
|
|
@@ -5567,6 +6133,7 @@
|
|
|
5567
6133
|
]),
|
|
5568
6134
|
pivotRowDimensions,
|
|
5569
6135
|
pivotColumnDimensions,
|
|
6136
|
+
pivotTitle,
|
|
5570
6137
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
5571
6138
|
];
|
|
5572
6139
|
const columnSpecPipeline = [
|
|
@@ -5615,7 +6182,7 @@
|
|
|
5615
6182
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
5616
6183
|
default_defaultMeasures_defaultMeasures,
|
|
5617
6184
|
defaultDimensions_defaultDimensions,
|
|
5618
|
-
|
|
6185
|
+
defaultMeasureId,
|
|
5619
6186
|
encodingAdapter([
|
|
5620
6187
|
defaultEncodingForColumn,
|
|
5621
6188
|
buildMeasures
|
|
@@ -5696,7 +6263,7 @@
|
|
|
5696
6263
|
];
|
|
5697
6264
|
if (!sameDimensionsMode) {
|
|
5698
6265
|
result.xField.push(unfoldInfo.encodingDetail);
|
|
5699
|
-
if (encoding.detail?.[0] ===
|
|
6266
|
+
if (encoding.detail?.[0] === MeasureId && encoding.y?.length === 1) result.xField.pop();
|
|
5700
6267
|
}
|
|
5701
6268
|
result.yField = foldInfo.measureValue;
|
|
5702
6269
|
result.seriesField = unfoldInfo.encodingColorId;
|
|
@@ -5748,12 +6315,13 @@
|
|
|
5748
6315
|
pivotIndicators_pivotIndicators([
|
|
5749
6316
|
initColumnParallel,
|
|
5750
6317
|
stackCornerRadius_stackCornerRadius,
|
|
6318
|
+
barMaxWidth_barMaxWidth,
|
|
5751
6319
|
colorAdapter(color_color, linearColor),
|
|
5752
6320
|
background_backgroundColor,
|
|
5753
6321
|
datasetXY,
|
|
5754
6322
|
progressive,
|
|
5755
6323
|
xBand,
|
|
5756
|
-
yLinear,
|
|
6324
|
+
pivotAxisStyle(yLinear),
|
|
5757
6325
|
label_label,
|
|
5758
6326
|
tooltip_tooltip,
|
|
5759
6327
|
verticalCrosshairRect,
|
|
@@ -5765,6 +6333,7 @@
|
|
|
5765
6333
|
]),
|
|
5766
6334
|
pivotRowDimensions,
|
|
5767
6335
|
pivotColumnDimensions,
|
|
6336
|
+
pivotTitle,
|
|
5768
6337
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
5769
6338
|
];
|
|
5770
6339
|
const columnParallelSpecPipeline = [
|
|
@@ -5778,7 +6347,7 @@
|
|
|
5778
6347
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
5779
6348
|
default_defaultMeasures_defaultMeasures,
|
|
5780
6349
|
defaultDimensions_defaultDimensions,
|
|
5781
|
-
|
|
6350
|
+
defaultMeasureId,
|
|
5782
6351
|
encodingAdapter([
|
|
5783
6352
|
defaultEncodingForColumn,
|
|
5784
6353
|
buildMeasures
|
|
@@ -5842,13 +6411,14 @@
|
|
|
5842
6411
|
initColumn,
|
|
5843
6412
|
stackCornerRadius_stackCornerRadius,
|
|
5844
6413
|
stackInverse,
|
|
6414
|
+
barMaxWidth_barMaxWidth,
|
|
5845
6415
|
colorAdapter(color_color, linearColor),
|
|
5846
6416
|
percent_percent,
|
|
5847
6417
|
background_backgroundColor,
|
|
5848
6418
|
datasetXY,
|
|
5849
6419
|
progressive,
|
|
5850
6420
|
xBand,
|
|
5851
|
-
yLinear,
|
|
6421
|
+
pivotAxisStyle(yLinear),
|
|
5852
6422
|
label_label,
|
|
5853
6423
|
tooltip_tooltip,
|
|
5854
6424
|
verticalCrosshairRect,
|
|
@@ -5860,6 +6430,7 @@
|
|
|
5860
6430
|
]),
|
|
5861
6431
|
pivotRowDimensions,
|
|
5862
6432
|
pivotColumnDimensions,
|
|
6433
|
+
pivotTitle,
|
|
5863
6434
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
5864
6435
|
];
|
|
5865
6436
|
const columnPercentSpecPipeline = [
|
|
@@ -5896,12 +6467,12 @@
|
|
|
5896
6467
|
};
|
|
5897
6468
|
};
|
|
5898
6469
|
const bar_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
5899
|
-
const
|
|
6470
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
5900
6471
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
5901
6472
|
encoding.y = uniqueDimIds.slice(0, 1);
|
|
5902
|
-
encoding.color = uniqueDimIds.slice(
|
|
6473
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
5903
6474
|
encoding.detail = encoding.color;
|
|
5904
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
6475
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
5905
6476
|
encoding.label = [];
|
|
5906
6477
|
encoding.row = [];
|
|
5907
6478
|
encoding.column = [];
|
|
@@ -5915,9 +6486,9 @@
|
|
|
5915
6486
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
5916
6487
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
|
5917
6488
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
5918
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
6489
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
5919
6490
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
5920
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
6491
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
5921
6492
|
};
|
|
5922
6493
|
const bar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
5923
6494
|
encoding.x = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -5958,7 +6529,7 @@
|
|
|
5958
6529
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
5959
6530
|
default_defaultMeasures_defaultMeasures,
|
|
5960
6531
|
defaultDimensions_defaultDimensions,
|
|
5961
|
-
|
|
6532
|
+
defaultMeasureId,
|
|
5962
6533
|
encodingAdapter([
|
|
5963
6534
|
defaultEncodingForBar,
|
|
5964
6535
|
buildMeasures
|
|
@@ -6282,12 +6853,13 @@
|
|
|
6282
6853
|
pivotIndicators_pivotIndicators([
|
|
6283
6854
|
initBar,
|
|
6284
6855
|
stackCornerRadius_stackCornerRadius,
|
|
6856
|
+
barMaxWidth_barMaxWidth,
|
|
6285
6857
|
colorAdapter(color_color, linearColor),
|
|
6286
6858
|
background_backgroundColor,
|
|
6287
6859
|
datasetYX,
|
|
6288
6860
|
progressive,
|
|
6289
6861
|
xLinear,
|
|
6290
|
-
yBand,
|
|
6862
|
+
pivotAxisStyle(yBand),
|
|
6291
6863
|
label_label,
|
|
6292
6864
|
tooltip_tooltip,
|
|
6293
6865
|
colorBarStyleFill(barStyle_barStyle),
|
|
@@ -6299,6 +6871,7 @@
|
|
|
6299
6871
|
]),
|
|
6300
6872
|
pivotRowDimensions,
|
|
6301
6873
|
pivotColumnDimensions,
|
|
6874
|
+
pivotTitle,
|
|
6302
6875
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
6303
6876
|
];
|
|
6304
6877
|
const barSpecPipeline = [
|
|
@@ -6312,7 +6885,7 @@
|
|
|
6312
6885
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
6313
6886
|
default_defaultMeasures_defaultMeasures,
|
|
6314
6887
|
defaultDimensions_defaultDimensions,
|
|
6315
|
-
|
|
6888
|
+
defaultMeasureId,
|
|
6316
6889
|
encodingAdapter([
|
|
6317
6890
|
defaultEncodingForBar,
|
|
6318
6891
|
buildMeasures
|
|
@@ -6353,7 +6926,7 @@
|
|
|
6353
6926
|
];
|
|
6354
6927
|
if (!sameDimensionsMode) {
|
|
6355
6928
|
result.yField.push(unfoldInfo.encodingDetail);
|
|
6356
|
-
if (encoding.detail?.[0] ===
|
|
6929
|
+
if (encoding.detail?.[0] === MeasureId && encoding.x?.length === 1) result.yField.pop();
|
|
6357
6930
|
}
|
|
6358
6931
|
result.xField = foldInfo.measureValue;
|
|
6359
6932
|
result.seriesField = unfoldInfo.encodingColorId;
|
|
@@ -6395,11 +6968,12 @@
|
|
|
6395
6968
|
pivotIndicators_pivotIndicators([
|
|
6396
6969
|
initBarParallel,
|
|
6397
6970
|
stackCornerRadius_stackCornerRadius,
|
|
6971
|
+
barMaxWidth_barMaxWidth,
|
|
6398
6972
|
colorAdapter(color_color, linearColor),
|
|
6399
6973
|
background_backgroundColor,
|
|
6400
6974
|
datasetYX,
|
|
6401
6975
|
xLinear,
|
|
6402
|
-
yBand,
|
|
6976
|
+
pivotAxisStyle(yBand),
|
|
6403
6977
|
label_label,
|
|
6404
6978
|
tooltip_tooltip,
|
|
6405
6979
|
colorBarStyleFill(barStyle_barStyle),
|
|
@@ -6411,6 +6985,7 @@
|
|
|
6411
6985
|
]),
|
|
6412
6986
|
pivotRowDimensions,
|
|
6413
6987
|
pivotColumnDimensions,
|
|
6988
|
+
pivotTitle,
|
|
6414
6989
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
6415
6990
|
];
|
|
6416
6991
|
const barParallelSpecPipeline = [
|
|
@@ -6424,7 +6999,7 @@
|
|
|
6424
6999
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
6425
7000
|
default_defaultMeasures_defaultMeasures,
|
|
6426
7001
|
defaultDimensions_defaultDimensions,
|
|
6427
|
-
|
|
7002
|
+
defaultMeasureId,
|
|
6428
7003
|
encodingAdapter([
|
|
6429
7004
|
defaultEncodingForBar,
|
|
6430
7005
|
buildMeasures
|
|
@@ -6479,12 +7054,13 @@
|
|
|
6479
7054
|
pivotIndicators_pivotIndicators([
|
|
6480
7055
|
initBar,
|
|
6481
7056
|
stackCornerRadius_stackCornerRadius,
|
|
7057
|
+
barMaxWidth_barMaxWidth,
|
|
6482
7058
|
colorAdapter(color_color, linearColor),
|
|
6483
7059
|
background_backgroundColor,
|
|
6484
7060
|
percent_percent,
|
|
6485
7061
|
datasetYX,
|
|
6486
|
-
yBand,
|
|
6487
7062
|
xLinear,
|
|
7063
|
+
pivotAxisStyle(yBand),
|
|
6488
7064
|
label_label,
|
|
6489
7065
|
tooltip_tooltip,
|
|
6490
7066
|
colorBarStyleFill(barStyle_barStyle),
|
|
@@ -6496,6 +7072,7 @@
|
|
|
6496
7072
|
]),
|
|
6497
7073
|
pivotRowDimensions,
|
|
6498
7074
|
pivotColumnDimensions,
|
|
7075
|
+
pivotTitle,
|
|
6499
7076
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
6500
7077
|
];
|
|
6501
7078
|
const barPercentSpecPipeline = [
|
|
@@ -6509,7 +7086,7 @@
|
|
|
6509
7086
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
6510
7087
|
default_defaultMeasures_defaultMeasures,
|
|
6511
7088
|
defaultDimensions_defaultDimensions,
|
|
6512
|
-
|
|
7089
|
+
defaultMeasureId,
|
|
6513
7090
|
encodingAdapter([
|
|
6514
7091
|
defaultEncodingForLine,
|
|
6515
7092
|
buildMeasures
|
|
@@ -6660,7 +7237,8 @@
|
|
|
6660
7237
|
annotationPoint_annotationPoint,
|
|
6661
7238
|
annotationVerticalLine_annotationVerticalLine,
|
|
6662
7239
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
6663
|
-
annotationArea_annotationArea
|
|
7240
|
+
annotationArea_annotationArea,
|
|
7241
|
+
splitLine
|
|
6664
7242
|
];
|
|
6665
7243
|
const pivotArea = [
|
|
6666
7244
|
initPivot,
|
|
@@ -6675,7 +7253,7 @@
|
|
|
6675
7253
|
datasetXY,
|
|
6676
7254
|
progressive,
|
|
6677
7255
|
xBand,
|
|
6678
|
-
yLinear,
|
|
7256
|
+
pivotAxisStyle(yLinear),
|
|
6679
7257
|
label_label,
|
|
6680
7258
|
tooltip_tooltip,
|
|
6681
7259
|
verticalCrosshairLine,
|
|
@@ -6686,10 +7264,12 @@
|
|
|
6686
7264
|
annotationPoint_annotationPoint,
|
|
6687
7265
|
annotationVerticalLine_annotationVerticalLine,
|
|
6688
7266
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
6689
|
-
annotationArea_annotationArea
|
|
7267
|
+
annotationArea_annotationArea,
|
|
7268
|
+
splitLine
|
|
6690
7269
|
]),
|
|
6691
7270
|
pivotRowDimensions,
|
|
6692
7271
|
pivotColumnDimensions,
|
|
7272
|
+
pivotTitle,
|
|
6693
7273
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
6694
7274
|
];
|
|
6695
7275
|
const areaSpecPipeline = [
|
|
@@ -6703,7 +7283,7 @@
|
|
|
6703
7283
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
6704
7284
|
default_defaultMeasures_defaultMeasures,
|
|
6705
7285
|
defaultDimensions_defaultDimensions,
|
|
6706
|
-
|
|
7286
|
+
defaultMeasureId,
|
|
6707
7287
|
encodingAdapter([
|
|
6708
7288
|
defaultEncodingForLine,
|
|
6709
7289
|
buildMeasures
|
|
@@ -6766,7 +7346,7 @@
|
|
|
6766
7346
|
datasetXY,
|
|
6767
7347
|
progressive,
|
|
6768
7348
|
xBand,
|
|
6769
|
-
yLinear,
|
|
7349
|
+
pivotAxisStyle(yLinear),
|
|
6770
7350
|
label_label,
|
|
6771
7351
|
tooltip_tooltip,
|
|
6772
7352
|
verticalCrosshairLine,
|
|
@@ -6781,6 +7361,7 @@
|
|
|
6781
7361
|
]),
|
|
6782
7362
|
pivotRowDimensions,
|
|
6783
7363
|
pivotColumnDimensions,
|
|
7364
|
+
pivotTitle,
|
|
6784
7365
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
6785
7366
|
];
|
|
6786
7367
|
const areaPercentSpecPipeline = [
|
|
@@ -6817,10 +7398,10 @@
|
|
|
6817
7398
|
};
|
|
6818
7399
|
};
|
|
6819
7400
|
const scatter_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
6820
|
-
const
|
|
6821
|
-
const uniqueDimIds = chunk_QJLMYOTX_i(
|
|
7401
|
+
const dimensionsWithoutMeasureId = dimensions.filter((item)=>item.id !== MeasureId);
|
|
7402
|
+
const uniqueDimIds = chunk_QJLMYOTX_i(dimensionsWithoutMeasureId.map((d)=>d.id));
|
|
6822
7403
|
encoding.detail = encoding.color;
|
|
6823
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
7404
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
6824
7405
|
encoding.label = [];
|
|
6825
7406
|
encoding.row = [];
|
|
6826
7407
|
encoding.column = [];
|
|
@@ -6829,12 +7410,12 @@
|
|
|
6829
7410
|
encoding.color = chunk_QJLMYOTX_i(dimensions.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
|
6830
7411
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
6831
7412
|
if (0 === encoding.detail.length) encoding.detail = [
|
|
6832
|
-
|
|
7413
|
+
MeasureId
|
|
6833
7414
|
];
|
|
6834
7415
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
6835
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
7416
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
6836
7417
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
6837
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
7418
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
6838
7419
|
};
|
|
6839
7420
|
const scatter_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
6840
7421
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || 'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -7046,6 +7627,7 @@
|
|
|
7046
7627
|
const { vseed } = context;
|
|
7047
7628
|
const { dataset } = vseed;
|
|
7048
7629
|
const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed;
|
|
7630
|
+
const allMeasures = findAllMeasures(measures);
|
|
7049
7631
|
const measureGroups = [];
|
|
7050
7632
|
const depth = measureDepth(measures);
|
|
7051
7633
|
if (3 === depth) measures.forEach((measure)=>{
|
|
@@ -7065,7 +7647,8 @@
|
|
|
7065
7647
|
const { dataset: newDataset, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, dimensions, xMeasures.children, encoding, {
|
|
7066
7648
|
foldMeasureValue: `${FoldXMeasureValue}${index}`,
|
|
7067
7649
|
colorItemAsId: true,
|
|
7068
|
-
colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
|
|
7650
|
+
colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
|
|
7651
|
+
omitIds: allMeasures.map((item)=>item.id)
|
|
7069
7652
|
});
|
|
7070
7653
|
datasets.push(newDataset);
|
|
7071
7654
|
foldInfoList.push(foldInfo);
|
|
@@ -7075,7 +7658,8 @@
|
|
|
7075
7658
|
const { dataset: newDataset, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, dimensions, yMeasures.children, encoding, {
|
|
7076
7659
|
foldMeasureValue: `${FoldYMeasureValue}${index}`,
|
|
7077
7660
|
colorItemAsId: true,
|
|
7078
|
-
colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
|
|
7661
|
+
colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
|
|
7662
|
+
omitIds: allMeasures.map((item)=>item.id)
|
|
7079
7663
|
});
|
|
7080
7664
|
datasets.push(newDataset);
|
|
7081
7665
|
foldInfoList.push(foldInfo);
|
|
@@ -7112,7 +7696,7 @@
|
|
|
7112
7696
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
7113
7697
|
default_defaultMeasures_defaultMeasures,
|
|
7114
7698
|
defaultDimensions_defaultDimensions,
|
|
7115
|
-
|
|
7699
|
+
defaultMeasureId,
|
|
7116
7700
|
encodingAdapter([
|
|
7117
7701
|
defaultEncodingForScatter,
|
|
7118
7702
|
buildMeasuresForScatter
|
|
@@ -7269,12 +7853,7 @@
|
|
|
7269
7853
|
visible: true,
|
|
7270
7854
|
hasShape: true,
|
|
7271
7855
|
shapeType: 'rectRound',
|
|
7272
|
-
key: (
|
|
7273
|
-
const { measureId, foldMap } = foldInfo;
|
|
7274
|
-
const datum = v;
|
|
7275
|
-
const id = datum[measureId];
|
|
7276
|
-
return foldMap[id] || id;
|
|
7277
|
-
},
|
|
7856
|
+
key: Object.values(foldInfo.foldMap)[0],
|
|
7278
7857
|
value: (v)=>{
|
|
7279
7858
|
const { measureId, measureValue } = foldInfo;
|
|
7280
7859
|
const datum = v;
|
|
@@ -7757,7 +8336,7 @@
|
|
|
7757
8336
|
datasetScatter,
|
|
7758
8337
|
progressive,
|
|
7759
8338
|
xLinear,
|
|
7760
|
-
yLinear,
|
|
8339
|
+
pivotAxisStyle(yLinear),
|
|
7761
8340
|
scatterSize,
|
|
7762
8341
|
labelScatter,
|
|
7763
8342
|
tooltipScatter,
|
|
@@ -7774,6 +8353,7 @@
|
|
|
7774
8353
|
]),
|
|
7775
8354
|
pivotRowDimensions,
|
|
7776
8355
|
pivotColumnDimensions,
|
|
8356
|
+
pivotTitle,
|
|
7777
8357
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
7778
8358
|
];
|
|
7779
8359
|
const scatterSpecPipeline = [
|
|
@@ -7810,12 +8390,12 @@
|
|
|
7810
8390
|
};
|
|
7811
8391
|
};
|
|
7812
8392
|
const dualAxis_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
7813
|
-
const
|
|
8393
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
7814
8394
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
7815
8395
|
encoding.x = uniqueDimIds.slice(0, 1);
|
|
7816
|
-
encoding.color = uniqueDimIds.slice(
|
|
8396
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
7817
8397
|
encoding.detail = encoding.color;
|
|
7818
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
8398
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
7819
8399
|
encoding.label = [];
|
|
7820
8400
|
encoding.row = [];
|
|
7821
8401
|
encoding.column = [];
|
|
@@ -7829,9 +8409,9 @@
|
|
|
7829
8409
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
7830
8410
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
|
7831
8411
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
7832
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
8412
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
7833
8413
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
7834
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
8414
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
7835
8415
|
};
|
|
7836
8416
|
const dualAxis_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
7837
8417
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'primaryYAxis' === item.encoding || 'secondaryYAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -8010,6 +8590,7 @@
|
|
|
8010
8590
|
const { vseed } = context;
|
|
8011
8591
|
const { dataset } = vseed;
|
|
8012
8592
|
const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed;
|
|
8593
|
+
const allMeasures = findAllMeasures(measures);
|
|
8013
8594
|
const datasetList = [];
|
|
8014
8595
|
const datasetReshapeInfo = [];
|
|
8015
8596
|
const measureGroups = [];
|
|
@@ -8029,7 +8610,8 @@
|
|
|
8029
8610
|
const { dataset: newDataset, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), T(primaryMeasures.children, (item)=>item.id), encoding, {
|
|
8030
8611
|
colorItemAsId: false,
|
|
8031
8612
|
foldMeasureValue: `${FoldPrimaryMeasureValue}${index}`,
|
|
8032
|
-
colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
|
|
8613
|
+
colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
|
|
8614
|
+
omitIds: allMeasures.map((item)=>item.id)
|
|
8033
8615
|
});
|
|
8034
8616
|
datasets.push(newDataset);
|
|
8035
8617
|
foldInfoList.push(foldInfo);
|
|
@@ -8039,7 +8621,8 @@
|
|
|
8039
8621
|
const { dataset: newDataset, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), T(secondaryMeasures.children, (item)=>item.id), encoding, {
|
|
8040
8622
|
colorItemAsId: false,
|
|
8041
8623
|
foldMeasureValue: `${FoldSecondaryMeasureValue}${index}`,
|
|
8042
|
-
colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
|
|
8624
|
+
colorMeasureId: getColorMeasureId(advancedVSeed, vseed),
|
|
8625
|
+
omitIds: allMeasures.map((item)=>item.id)
|
|
8043
8626
|
});
|
|
8044
8627
|
datasets.push(newDataset);
|
|
8045
8628
|
foldInfoList.push(foldInfo);
|
|
@@ -8105,7 +8688,7 @@
|
|
|
8105
8688
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
8106
8689
|
default_defaultMeasures_defaultMeasures,
|
|
8107
8690
|
defaultDimensions_defaultDimensions,
|
|
8108
|
-
|
|
8691
|
+
defaultMeasureId,
|
|
8109
8692
|
encodingAdapter([
|
|
8110
8693
|
defaultEncodingForDualAxis,
|
|
8111
8694
|
buildMeasuresForDualAxis
|
|
@@ -8457,7 +9040,7 @@
|
|
|
8457
9040
|
title: {
|
|
8458
9041
|
visible: true
|
|
8459
9042
|
},
|
|
8460
|
-
content: createDimensionContent(measures, foldInfoList[0], unfoldInfo)
|
|
9043
|
+
content: createDimensionContent(dimensions, measures, foldInfoList[0], unfoldInfo)
|
|
8461
9044
|
}
|
|
8462
9045
|
};
|
|
8463
9046
|
return result;
|
|
@@ -8488,7 +9071,7 @@
|
|
|
8488
9071
|
title: {
|
|
8489
9072
|
visible: true
|
|
8490
9073
|
},
|
|
8491
|
-
content: createDimensionContent(measures, foldInfoList[1], unfoldInfo)
|
|
9074
|
+
content: createDimensionContent(dimensions, measures, foldInfoList[1], unfoldInfo)
|
|
8492
9075
|
}
|
|
8493
9076
|
};
|
|
8494
9077
|
return result;
|
|
@@ -8787,7 +9370,7 @@
|
|
|
8787
9370
|
]),
|
|
8788
9371
|
xBand,
|
|
8789
9372
|
yLinearPrimary,
|
|
8790
|
-
yLinearSecondary,
|
|
9373
|
+
pivotAxisStyle(yLinearSecondary),
|
|
8791
9374
|
colorAdapter(color_color, linearColor),
|
|
8792
9375
|
background_backgroundColor,
|
|
8793
9376
|
verticalCrosshairRect,
|
|
@@ -8798,6 +9381,7 @@
|
|
|
8798
9381
|
]),
|
|
8799
9382
|
pivotRowDimensions,
|
|
8800
9383
|
pivotColumnDimensions,
|
|
9384
|
+
pivotTitle,
|
|
8801
9385
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
8802
9386
|
];
|
|
8803
9387
|
const dualAxisSpecPipeline = [
|
|
@@ -8837,7 +9421,7 @@
|
|
|
8837
9421
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
8838
9422
|
encoding.color = uniqueDimIds.slice(0);
|
|
8839
9423
|
encoding.detail = encoding.color;
|
|
8840
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
9424
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
8841
9425
|
encoding.label = [];
|
|
8842
9426
|
encoding.row = [];
|
|
8843
9427
|
encoding.column = [];
|
|
@@ -8846,12 +9430,12 @@
|
|
|
8846
9430
|
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
|
8847
9431
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
8848
9432
|
if (0 === encoding.detail.length) encoding.detail = [
|
|
8849
|
-
|
|
9433
|
+
MeasureId
|
|
8850
9434
|
];
|
|
8851
9435
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
8852
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
9436
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
8853
9437
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
8854
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
9438
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
8855
9439
|
};
|
|
8856
9440
|
const pie_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
8857
9441
|
encoding.angle = chunk_QJLMYOTX_i(measures.filter((item)=>'angle' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -8876,7 +9460,7 @@
|
|
|
8876
9460
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
8877
9461
|
default_defaultMeasures_defaultMeasures,
|
|
8878
9462
|
defaultDimensions_defaultDimensions,
|
|
8879
|
-
|
|
9463
|
+
defaultMeasureId,
|
|
8880
9464
|
encodingAdapter([
|
|
8881
9465
|
defaultEncodingForPie,
|
|
8882
9466
|
buildMeasures
|
|
@@ -8978,6 +9562,13 @@
|
|
|
8978
9562
|
...spec,
|
|
8979
9563
|
hideIndicatorName: true
|
|
8980
9564
|
});
|
|
9565
|
+
const addRegionPadding = (spec)=>{
|
|
9566
|
+
const result = {
|
|
9567
|
+
...spec
|
|
9568
|
+
};
|
|
9569
|
+
if (result.region && result.region.length > 0) result.region[0].padding = 10;
|
|
9570
|
+
return result;
|
|
9571
|
+
};
|
|
8981
9572
|
const pie = [
|
|
8982
9573
|
initPie,
|
|
8983
9574
|
colorAdapter(color_color, linearColor),
|
|
@@ -9011,10 +9602,12 @@
|
|
|
9011
9602
|
annotationPoint_annotationPoint,
|
|
9012
9603
|
annotationVerticalLine_annotationVerticalLine,
|
|
9013
9604
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
9014
|
-
annotationArea_annotationArea
|
|
9605
|
+
annotationArea_annotationArea,
|
|
9606
|
+
addRegionPadding
|
|
9015
9607
|
]),
|
|
9016
9608
|
pivotRowDimensions,
|
|
9017
9609
|
pivotColumnDimensions,
|
|
9610
|
+
pivotTitle,
|
|
9018
9611
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9019
9612
|
];
|
|
9020
9613
|
const pieSpecPipeline = [
|
|
@@ -9028,7 +9621,7 @@
|
|
|
9028
9621
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9029
9622
|
default_defaultMeasures_defaultMeasures,
|
|
9030
9623
|
defaultDimensions_defaultDimensions,
|
|
9031
|
-
|
|
9624
|
+
defaultMeasureId,
|
|
9032
9625
|
encodingAdapter([
|
|
9033
9626
|
defaultEncodingForPie,
|
|
9034
9627
|
buildMeasures
|
|
@@ -9095,6 +9688,7 @@
|
|
|
9095
9688
|
datasetPivot,
|
|
9096
9689
|
pivotIndicators_pivotIndicators([
|
|
9097
9690
|
initDonut,
|
|
9691
|
+
addRegionPadding,
|
|
9098
9692
|
colorAdapter(color_color, linearColor),
|
|
9099
9693
|
background_backgroundColor,
|
|
9100
9694
|
datasetXY,
|
|
@@ -9109,6 +9703,7 @@
|
|
|
9109
9703
|
]),
|
|
9110
9704
|
pivotRowDimensions,
|
|
9111
9705
|
pivotColumnDimensions,
|
|
9706
|
+
pivotTitle,
|
|
9112
9707
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9113
9708
|
];
|
|
9114
9709
|
const donutSpecPipeline = [
|
|
@@ -9145,12 +9740,12 @@
|
|
|
9145
9740
|
};
|
|
9146
9741
|
};
|
|
9147
9742
|
const rose_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
9148
|
-
const
|
|
9743
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
9149
9744
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
9150
9745
|
encoding.angle = uniqueDimIds.slice(0, 1);
|
|
9151
|
-
encoding.color = uniqueDimIds.slice(
|
|
9746
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
9152
9747
|
encoding.detail = encoding.color;
|
|
9153
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
9748
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
9154
9749
|
encoding.label = [];
|
|
9155
9750
|
encoding.row = [];
|
|
9156
9751
|
encoding.column = [];
|
|
@@ -9164,9 +9759,9 @@
|
|
|
9164
9759
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
9165
9760
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
|
9166
9761
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
9167
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
9762
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
9168
9763
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
9169
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
9764
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
9170
9765
|
};
|
|
9171
9766
|
const rose_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
9172
9767
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -9191,7 +9786,7 @@
|
|
|
9191
9786
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9192
9787
|
default_defaultMeasures_defaultMeasures,
|
|
9193
9788
|
defaultDimensions_defaultDimensions,
|
|
9194
|
-
|
|
9789
|
+
defaultMeasureId,
|
|
9195
9790
|
encodingAdapter([
|
|
9196
9791
|
defaultEncodingForRose,
|
|
9197
9792
|
buildMeasures
|
|
@@ -9315,6 +9910,7 @@
|
|
|
9315
9910
|
datasetPivot,
|
|
9316
9911
|
pivotIndicators_pivotIndicators([
|
|
9317
9912
|
initRose,
|
|
9913
|
+
addRegionPadding,
|
|
9318
9914
|
stackCornerRadius_stackCornerRadius,
|
|
9319
9915
|
stackInverse,
|
|
9320
9916
|
colorAdapter(color_color, linearColor),
|
|
@@ -9329,6 +9925,7 @@
|
|
|
9329
9925
|
]),
|
|
9330
9926
|
pivotRowDimensions,
|
|
9331
9927
|
pivotColumnDimensions,
|
|
9928
|
+
pivotTitle,
|
|
9332
9929
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9333
9930
|
];
|
|
9334
9931
|
const roseSpecPipeline = [
|
|
@@ -9342,7 +9939,7 @@
|
|
|
9342
9939
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9343
9940
|
default_defaultMeasures_defaultMeasures,
|
|
9344
9941
|
defaultDimensions_defaultDimensions,
|
|
9345
|
-
|
|
9942
|
+
defaultMeasureId,
|
|
9346
9943
|
encodingAdapter([
|
|
9347
9944
|
defaultEncodingForRose,
|
|
9348
9945
|
buildMeasures
|
|
@@ -9380,7 +9977,7 @@
|
|
|
9380
9977
|
];
|
|
9381
9978
|
if (!sameDimensionsMode) {
|
|
9382
9979
|
result.angleField.push(unfoldInfo.encodingDetail);
|
|
9383
|
-
if (encoding.detail?.[0] ===
|
|
9980
|
+
if (encoding.detail?.[0] === MeasureId && encoding.radius?.length === 1) result.angleField.pop();
|
|
9384
9981
|
}
|
|
9385
9982
|
result.valueField = foldInfo.measureValue;
|
|
9386
9983
|
result.seriesField = unfoldInfo.encodingColorId;
|
|
@@ -9435,6 +10032,7 @@
|
|
|
9435
10032
|
datasetPivot,
|
|
9436
10033
|
pivotIndicators_pivotIndicators([
|
|
9437
10034
|
initRoseParallel,
|
|
10035
|
+
addRegionPadding,
|
|
9438
10036
|
stackCornerRadius_stackCornerRadius,
|
|
9439
10037
|
colorAdapter(color_color, linearColor),
|
|
9440
10038
|
background_backgroundColor,
|
|
@@ -9452,6 +10050,7 @@
|
|
|
9452
10050
|
]),
|
|
9453
10051
|
pivotRowDimensions,
|
|
9454
10052
|
pivotColumnDimensions,
|
|
10053
|
+
pivotTitle,
|
|
9455
10054
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9456
10055
|
];
|
|
9457
10056
|
const roseParallelSpecPipeline = [
|
|
@@ -9491,7 +10090,7 @@
|
|
|
9491
10090
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
9492
10091
|
encoding.angle = uniqueDimIds.slice(0, 1);
|
|
9493
10092
|
encoding.color = uniqueDimIds.slice(1);
|
|
9494
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
10093
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
9495
10094
|
encoding.detail = [];
|
|
9496
10095
|
encoding.label = [];
|
|
9497
10096
|
encoding.row = [];
|
|
@@ -9505,12 +10104,12 @@
|
|
|
9505
10104
|
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
|
9506
10105
|
encoding.detail = [];
|
|
9507
10106
|
if (0 === encoding.detail.length) encoding.detail = [
|
|
9508
|
-
|
|
10107
|
+
MeasureId
|
|
9509
10108
|
];
|
|
9510
10109
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
9511
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
10110
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
9512
10111
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
9513
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
10112
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
9514
10113
|
};
|
|
9515
10114
|
const radar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
9516
10115
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -9535,7 +10134,7 @@
|
|
|
9535
10134
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9536
10135
|
default_defaultMeasures_defaultMeasures,
|
|
9537
10136
|
defaultDimensions_defaultDimensions,
|
|
9538
|
-
|
|
10137
|
+
defaultMeasureId,
|
|
9539
10138
|
encodingAdapter([
|
|
9540
10139
|
defaultEncodingForRadar,
|
|
9541
10140
|
buildMeasures
|
|
@@ -9652,6 +10251,7 @@
|
|
|
9652
10251
|
datasetPivot,
|
|
9653
10252
|
pivotIndicators_pivotIndicators([
|
|
9654
10253
|
initRadar,
|
|
10254
|
+
addRegionPadding,
|
|
9655
10255
|
colorAdapter(color_color, linearColor),
|
|
9656
10256
|
background_backgroundColor,
|
|
9657
10257
|
datasetXY,
|
|
@@ -9668,6 +10268,7 @@
|
|
|
9668
10268
|
]),
|
|
9669
10269
|
pivotRowDimensions,
|
|
9670
10270
|
pivotColumnDimensions,
|
|
10271
|
+
pivotTitle,
|
|
9671
10272
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9672
10273
|
];
|
|
9673
10274
|
const radarSpecPipeline = [
|
|
@@ -9707,7 +10308,7 @@
|
|
|
9707
10308
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
9708
10309
|
encoding.color = uniqueDimIds.slice(0);
|
|
9709
10310
|
encoding.detail = encoding.color;
|
|
9710
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
10311
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
9711
10312
|
encoding.label = [];
|
|
9712
10313
|
encoding.row = [];
|
|
9713
10314
|
encoding.column = [];
|
|
@@ -9716,12 +10317,12 @@
|
|
|
9716
10317
|
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
|
9717
10318
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
9718
10319
|
if (0 === encoding.detail.length) encoding.detail = [
|
|
9719
|
-
|
|
10320
|
+
MeasureId
|
|
9720
10321
|
];
|
|
9721
10322
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
9722
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
10323
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
9723
10324
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
9724
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
10325
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
9725
10326
|
};
|
|
9726
10327
|
const funnel_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
9727
10328
|
encoding.size = chunk_QJLMYOTX_i(measures.filter((item)=>'size' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -9748,7 +10349,7 @@
|
|
|
9748
10349
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9749
10350
|
default_defaultMeasures_defaultMeasures,
|
|
9750
10351
|
defaultDimensions_defaultDimensions,
|
|
9751
|
-
|
|
10352
|
+
defaultMeasureId,
|
|
9752
10353
|
encodingAdapter([
|
|
9753
10354
|
defaultEncodingForFunnel,
|
|
9754
10355
|
buildMeasures
|
|
@@ -9884,6 +10485,7 @@
|
|
|
9884
10485
|
]),
|
|
9885
10486
|
pivotRowDimensions,
|
|
9886
10487
|
pivotColumnDimensions,
|
|
10488
|
+
pivotTitle,
|
|
9887
10489
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
9888
10490
|
];
|
|
9889
10491
|
const funnelSpecPipeline = [
|
|
@@ -9920,13 +10522,13 @@
|
|
|
9920
10522
|
};
|
|
9921
10523
|
};
|
|
9922
10524
|
const heatmap_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
9923
|
-
const
|
|
10525
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
9924
10526
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
9925
10527
|
encoding.x = uniqueDimIds.slice(0, 1);
|
|
9926
|
-
encoding.y = uniqueDimIds.slice(
|
|
9927
|
-
encoding.color = uniqueDimIds.slice(
|
|
10528
|
+
encoding.y = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
10529
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
9928
10530
|
encoding.detail = encoding.color;
|
|
9929
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
10531
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
9930
10532
|
encoding.label = [];
|
|
9931
10533
|
encoding.row = [];
|
|
9932
10534
|
encoding.column = [];
|
|
@@ -9943,9 +10545,9 @@
|
|
|
9943
10545
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
9944
10546
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
|
9945
10547
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
9946
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
10548
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
9947
10549
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
9948
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
10550
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
9949
10551
|
};
|
|
9950
10552
|
const heatmap_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
9951
10553
|
const colorDims = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -9974,7 +10576,7 @@
|
|
|
9974
10576
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
9975
10577
|
default_defaultMeasures_defaultMeasures,
|
|
9976
10578
|
defaultDimensions_defaultDimensions,
|
|
9977
|
-
|
|
10579
|
+
defaultMeasureId,
|
|
9978
10580
|
encodingAdapter([
|
|
9979
10581
|
defaultEncodingForHeatmap,
|
|
9980
10582
|
buildMeasures
|
|
@@ -10190,7 +10792,7 @@
|
|
|
10190
10792
|
pivotIndicatorsAsRow,
|
|
10191
10793
|
datasetPivot,
|
|
10192
10794
|
pivotIndicators_pivotIndicators([
|
|
10193
|
-
initHeatmap,
|
|
10795
|
+
pivotAxisStyle(initHeatmap),
|
|
10194
10796
|
background_backgroundColor,
|
|
10195
10797
|
datasetXY,
|
|
10196
10798
|
colorAdapter(color_color, linearColor),
|
|
@@ -10204,6 +10806,7 @@
|
|
|
10204
10806
|
]),
|
|
10205
10807
|
pivotRowDimensions,
|
|
10206
10808
|
pivotColumnDimensions,
|
|
10809
|
+
pivotTitle,
|
|
10207
10810
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
10208
10811
|
];
|
|
10209
10812
|
const heatmapSpecPipeline = [
|
|
@@ -10260,18 +10863,18 @@
|
|
|
10260
10863
|
else boxplot_generateDefaultDimensionEncoding(dimensions, encoding);
|
|
10261
10864
|
if (hasMeasureEncoding) boxplot_generateMeasureEncoding(measures, encoding);
|
|
10262
10865
|
else boxplot_generateDefaultMeasureEncoding(measures, encoding);
|
|
10263
|
-
if ((!encoding.value || encoding.value.length <= 1) && encoding.color && encoding.color.length > 1) encoding.color = encoding.color.filter((c)=>c !==
|
|
10866
|
+
if ((!encoding.value || encoding.value.length <= 1) && encoding.color && encoding.color.length > 1) encoding.color = encoding.color.filter((c)=>c !== MeasureId);
|
|
10264
10867
|
return {
|
|
10265
10868
|
...advancedVSeed,
|
|
10266
10869
|
encoding
|
|
10267
10870
|
};
|
|
10268
10871
|
};
|
|
10269
10872
|
const boxplot_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
10270
|
-
const
|
|
10873
|
+
const onlyMeasureId = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureId);
|
|
10271
10874
|
const uniqueDimIds = chunk_QJLMYOTX_i(dimensions.map((d)=>d.id));
|
|
10272
10875
|
encoding.x = uniqueDimIds.slice(0, 1);
|
|
10273
|
-
encoding.color = uniqueDimIds.slice(
|
|
10274
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
10876
|
+
encoding.color = uniqueDimIds.slice(onlyMeasureId ? 0 : 1);
|
|
10877
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
10275
10878
|
encoding.label = [];
|
|
10276
10879
|
encoding.row = [];
|
|
10277
10880
|
encoding.column = [];
|
|
@@ -10283,9 +10886,9 @@
|
|
|
10283
10886
|
];
|
|
10284
10887
|
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
|
10285
10888
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
10286
|
-
encoding.tooltip = encoding.tooltip.filter((d)=>d !==
|
|
10889
|
+
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureId);
|
|
10287
10890
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
10288
|
-
encoding.label = encoding.label.filter((d)=>d !==
|
|
10891
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureId);
|
|
10289
10892
|
};
|
|
10290
10893
|
const boxplot_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
10291
10894
|
encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -10312,10 +10915,6 @@
|
|
|
10312
10915
|
...tooltip
|
|
10313
10916
|
]);
|
|
10314
10917
|
};
|
|
10315
|
-
const clamp_clamp = function(input, min, max) {
|
|
10316
|
-
return input < min ? min : input > max ? max : input;
|
|
10317
|
-
};
|
|
10318
|
-
const clamp = clamp_clamp;
|
|
10319
10918
|
function toNumber(a) {
|
|
10320
10919
|
return Number(a);
|
|
10321
10920
|
}
|
|
@@ -10553,7 +11152,7 @@
|
|
|
10553
11152
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
10554
11153
|
default_defaultMeasures_defaultMeasures,
|
|
10555
11154
|
defaultDimensions_defaultDimensions,
|
|
10556
|
-
|
|
11155
|
+
defaultMeasureId,
|
|
10557
11156
|
boxplotConfig,
|
|
10558
11157
|
encodingAdapter([
|
|
10559
11158
|
defaultEncodingForBoxplot,
|
|
@@ -10599,7 +11198,7 @@
|
|
|
10599
11198
|
const sameDimensionsMode = chunk_HGKLN5KY_k(encoding.x, encoding.color);
|
|
10600
11199
|
if (!sameDimensionsMode) {
|
|
10601
11200
|
result.xField.push(unfoldInfo.encodingColor);
|
|
10602
|
-
if (encoding.color?.[0] ===
|
|
11201
|
+
if (encoding.color?.[0] === MeasureId && encoding.value?.length === 1) result.xField.pop();
|
|
10603
11202
|
}
|
|
10604
11203
|
result.padding = 0;
|
|
10605
11204
|
result.region = [
|
|
@@ -10747,7 +11346,7 @@
|
|
|
10747
11346
|
datasetBoxplot,
|
|
10748
11347
|
progressive,
|
|
10749
11348
|
xBand,
|
|
10750
|
-
yLinear,
|
|
11349
|
+
pivotAxisStyle(yLinear),
|
|
10751
11350
|
label_label,
|
|
10752
11351
|
tooltipBoxplot,
|
|
10753
11352
|
colorBarStyleFill(barStyle_barStyle),
|
|
@@ -10759,6 +11358,7 @@
|
|
|
10759
11358
|
]),
|
|
10760
11359
|
pivotRowDimensions,
|
|
10761
11360
|
pivotColumnDimensions,
|
|
11361
|
+
pivotTitle,
|
|
10762
11362
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
10763
11363
|
];
|
|
10764
11364
|
const boxplotSpecPipeline = [
|
|
@@ -10823,10 +11423,10 @@
|
|
|
10823
11423
|
};
|
|
10824
11424
|
};
|
|
10825
11425
|
const histogram_generateDefaultDimensionEncoding = (dimensions, encoding)=>{
|
|
10826
|
-
const
|
|
10827
|
-
const uniqueDimIds = chunk_QJLMYOTX_i(
|
|
11426
|
+
const dimensionsWithoutMeasureId = dimensions.filter((item)=>item.id !== MeasureId);
|
|
11427
|
+
const uniqueDimIds = chunk_QJLMYOTX_i(dimensionsWithoutMeasureId.map((d)=>d.id));
|
|
10828
11428
|
encoding.detail = encoding.color;
|
|
10829
|
-
encoding.tooltip = uniqueDimIds.filter((d)=>d !==
|
|
11429
|
+
encoding.tooltip = uniqueDimIds.filter((d)=>d !== MeasureId);
|
|
10830
11430
|
encoding.label = [];
|
|
10831
11431
|
encoding.row = [];
|
|
10832
11432
|
encoding.column = [];
|
|
@@ -10836,9 +11436,9 @@
|
|
|
10836
11436
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
|
10837
11437
|
if (encoding.detail?.length === 0) encoding.detail = encoding.color;
|
|
10838
11438
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
|
10839
|
-
encoding.tooltip = encoding.tooltip?.filter((d)=>d !==
|
|
11439
|
+
encoding.tooltip = encoding.tooltip?.filter((d)=>d !== MeasureId);
|
|
10840
11440
|
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
|
10841
|
-
encoding.label = encoding.label?.filter((d)=>d !==
|
|
11441
|
+
encoding.label = encoding.label?.filter((d)=>d !== MeasureId);
|
|
10842
11442
|
};
|
|
10843
11443
|
const histogram_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
|
10844
11444
|
encoding.value = chunk_QJLMYOTX_i(measures.filter((item)=>'value' === item.encoding || !item.encoding).map((item)=>item.id));
|
|
@@ -11136,7 +11736,7 @@
|
|
|
11136
11736
|
initAdvancedVSeed_initAdvancedVSeed,
|
|
11137
11737
|
default_defaultMeasures_defaultMeasures,
|
|
11138
11738
|
defaultDimensions_defaultDimensions,
|
|
11139
|
-
|
|
11739
|
+
defaultMeasureId,
|
|
11140
11740
|
histogramConfig,
|
|
11141
11741
|
encodingAdapter([
|
|
11142
11742
|
defaultEncodingForHistogram,
|
|
@@ -11622,7 +12222,7 @@
|
|
|
11622
12222
|
datasetHistogram,
|
|
11623
12223
|
progressive,
|
|
11624
12224
|
xLinear,
|
|
11625
|
-
yLinear,
|
|
12225
|
+
pivotAxisStyle(yLinear),
|
|
11626
12226
|
label_label,
|
|
11627
12227
|
tooltipHistogram,
|
|
11628
12228
|
colorBarStyleFill(barStyle_barStyle),
|
|
@@ -11636,6 +12236,7 @@
|
|
|
11636
12236
|
]),
|
|
11637
12237
|
pivotRowDimensions,
|
|
11638
12238
|
pivotColumnDimensions,
|
|
12239
|
+
pivotTitle,
|
|
11639
12240
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
11640
12241
|
];
|
|
11641
12242
|
const histogramSpecPipeline = [
|
|
@@ -11707,11 +12308,15 @@
|
|
|
11707
12308
|
];
|
|
11708
12309
|
const getLightColor = ()=>({
|
|
11709
12310
|
linearColorScheme: getLightLinearColorScheme(),
|
|
11710
|
-
colorScheme: getLightColorScheme()
|
|
12311
|
+
colorScheme: getLightColorScheme(),
|
|
12312
|
+
positiveColor: '#7E5DFF',
|
|
12313
|
+
negativeColor: '#EB3373'
|
|
11711
12314
|
});
|
|
11712
12315
|
const getDarkColor = ()=>({
|
|
11713
12316
|
linearColorScheme: getDarkLinearColorScheme(),
|
|
11714
|
-
colorScheme: getDarkColorScheme()
|
|
12317
|
+
colorScheme: getDarkColorScheme(),
|
|
12318
|
+
positiveColor: '#7E5DFF',
|
|
12319
|
+
negativeColor: '#EB3373'
|
|
11715
12320
|
});
|
|
11716
12321
|
const getDefaultLabel = ()=>({
|
|
11717
12322
|
enable: true,
|
|
@@ -11779,7 +12384,10 @@
|
|
|
11779
12384
|
headerFontColor: tableConfig.headerFontColor,
|
|
11780
12385
|
headerBackgroundColor: 'transparent',
|
|
11781
12386
|
hoverHeaderBackgroundColor: tableConfig.hoverHeaderBackgroundColor,
|
|
11782
|
-
hoverHeaderInlineBackgroundColor: tableConfig.hoverHeaderInlineBackgroundColor
|
|
12387
|
+
hoverHeaderInlineBackgroundColor: tableConfig.hoverHeaderInlineBackgroundColor,
|
|
12388
|
+
titleFontColor: tableConfig.headerFontColor,
|
|
12389
|
+
titleFontSize: tableConfig.headerFontSize,
|
|
12390
|
+
titleFontWeight: 'bold'
|
|
11783
12391
|
});
|
|
11784
12392
|
const getLightPivotChartGridConfig = ()=>pickPivotChartGridConfig(getLightTableConfig());
|
|
11785
12393
|
const getDarkPivotChartGridConfig = ()=>pickPivotChartGridConfig(getDarkTableConfig());
|
|
@@ -12326,7 +12934,7 @@
|
|
|
12326
12934
|
label: {
|
|
12327
12935
|
...baseConfig.label,
|
|
12328
12936
|
showValuePercent: true,
|
|
12329
|
-
labelLayout: '
|
|
12937
|
+
labelLayout: 'arc',
|
|
12330
12938
|
showDimension: true
|
|
12331
12939
|
},
|
|
12332
12940
|
pivotGrid: getLightPivotChartGridConfig()
|
|
@@ -12336,7 +12944,7 @@
|
|
|
12336
12944
|
label: {
|
|
12337
12945
|
...baseConfig.label,
|
|
12338
12946
|
showValuePercent: true,
|
|
12339
|
-
labelLayout: '
|
|
12947
|
+
labelLayout: 'arc',
|
|
12340
12948
|
showDimension: true
|
|
12341
12949
|
},
|
|
12342
12950
|
pivotGrid: getLightPivotChartGridConfig()
|
|
@@ -12589,7 +13197,7 @@
|
|
|
12589
13197
|
label: {
|
|
12590
13198
|
...baseConfig.label,
|
|
12591
13199
|
showValuePercent: true,
|
|
12592
|
-
labelLayout: '
|
|
13200
|
+
labelLayout: 'arc',
|
|
12593
13201
|
showDimension: true
|
|
12594
13202
|
},
|
|
12595
13203
|
pivotGrid: getDarkPivotChartGridConfig()
|
|
@@ -12599,7 +13207,7 @@
|
|
|
12599
13207
|
label: {
|
|
12600
13208
|
...baseConfig.label,
|
|
12601
13209
|
showValuePercent: true,
|
|
12602
|
-
labelLayout: '
|
|
13210
|
+
labelLayout: 'arc',
|
|
12603
13211
|
showDimension: true
|
|
12604
13212
|
},
|
|
12605
13213
|
pivotGrid: getDarkPivotChartGridConfig()
|
|
@@ -16161,7 +16769,10 @@
|
|
|
16161
16769
|
encodingDetail: schemas_string(),
|
|
16162
16770
|
encodingAngle: schemas_string(),
|
|
16163
16771
|
colorItems: schemas_array(schemas_string()),
|
|
16164
|
-
colorIdMap: record(schemas_string(),
|
|
16772
|
+
colorIdMap: record(schemas_string(), schemas_object({
|
|
16773
|
+
id: schemas_string(),
|
|
16774
|
+
alias: schemas_string()
|
|
16775
|
+
}))
|
|
16165
16776
|
});
|
|
16166
16777
|
const zDatasetReshapeInfo = schemas_array(schemas_object({
|
|
16167
16778
|
id: schemas_string(),
|
|
@@ -16720,7 +17331,10 @@
|
|
|
16720
17331
|
outlineBorderLineWidth: schemas_number().nullish(),
|
|
16721
17332
|
frameCornerRadius: schemas_number().nullish(),
|
|
16722
17333
|
minChartWidth: schemas_number().nullish(),
|
|
16723
|
-
minChartHeight: schemas_number().nullish()
|
|
17334
|
+
minChartHeight: schemas_number().nullish(),
|
|
17335
|
+
titleFontColor: schemas_string().nullish(),
|
|
17336
|
+
titleFontSize: schemas_number().nullish(),
|
|
17337
|
+
titleFontWeight: schemas_string().nullish()
|
|
16724
17338
|
});
|
|
16725
17339
|
const zLineConfig = schemas_object({
|
|
16726
17340
|
backgroundColor: zBackgroundColor.nullish(),
|