@visactor/vseed 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +1176 -0
- 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 -1
- package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
- package/dist/esm/dataReshape/foldMeasures.js +12 -11
- package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.js +31 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +2 -2
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.js +29 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +2 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +14 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.js +16 -24
- package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +7 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +10 -6
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +12 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +4 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +5 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultDimensions.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
- 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 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +8 -5
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.js +37 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/index.d.ts +0 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/index.js +1 -2
- package/dist/esm/pipeline/spec/chart/pipes/dual/adjustXField.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/dual/adjustXField.js +17 -0
- package/dist/esm/pipeline/spec/chart/pipes/dual/adjustXField.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js +3 -5
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dual/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/dual/index.js +2 -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/label/label.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js +17 -8
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.js +18 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +13 -7
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js +12 -3
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js +12 -3
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +14 -8
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +8 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.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 +9 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/utils/chatType.js +24 -4
- package/dist/esm/pipeline/utils/chatType.js.map +1 -1
- package/dist/esm/pipeline/utils/measures/typeGuard.d.ts +1 -1
- package/dist/esm/pipeline/utils/measures/typeGuard.js +30 -6
- package/dist/esm/pipeline/utils/measures/typeGuard.js.map +1 -1
- package/dist/esm/theme/common/axes.js +0 -4
- package/dist/esm/theme/common/axes.js.map +1 -1
- package/dist/esm/theme/common/brush.d.ts +3 -0
- package/dist/esm/theme/common/brush.js +21 -0
- package/dist/esm/theme/common/brush.js.map +1 -0
- package/dist/esm/theme/common/heatmapCell.js +4 -2
- package/dist/esm/theme/common/heatmapCell.js.map +1 -1
- package/dist/esm/theme/common/index.d.ts +1 -0
- package/dist/esm/theme/common/index.js +1 -0
- package/dist/esm/theme/common/label.d.ts +18 -0
- package/dist/esm/theme/common/label.js +9 -1
- package/dist/esm/theme/common/label.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +4 -2
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +4 -2
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +392 -0
- package/dist/esm/types/chartType/area/area.d.ts +6 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +4 -0
- package/dist/esm/types/chartType/area/zArea.js +2 -1
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +4 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +4 -0
- package/dist/esm/types/chartType/bar/zBar.js +2 -1
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +4 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +4 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/boxPlot/boxPlot.d.ts +6 -1
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +4 -0
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.js +2 -1
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +4 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +4 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +4 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/donut/donut.d.ts +6 -0
- package/dist/esm/types/chartType/donut/zDonut.d.ts +4 -0
- package/dist/esm/types/chartType/donut/zDonut.js +2 -1
- package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
- package/dist/esm/types/chartType/dualAxis/dualAxis.d.ts +6 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +4 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js +2 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js.map +1 -1
- package/dist/esm/types/chartType/funnel/funnel.d.ts +6 -0
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +4 -0
- package/dist/esm/types/chartType/funnel/zFunnel.js +2 -1
- package/dist/esm/types/chartType/funnel/zFunnel.js.map +1 -1
- package/dist/esm/types/chartType/heatmap/heatmap.d.ts +6 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +4 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.js +2 -1
- package/dist/esm/types/chartType/heatmap/zHeatmap.js.map +1 -1
- package/dist/esm/types/chartType/histogram/histogram.d.ts +6 -1
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +4 -0
- package/dist/esm/types/chartType/histogram/zHistogram.js +2 -1
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +6 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +4 -0
- package/dist/esm/types/chartType/line/zLine.js +2 -1
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/pie/pie.d.ts +6 -0
- package/dist/esm/types/chartType/pie/zPie.d.ts +4 -0
- package/dist/esm/types/chartType/pie/zPie.js +2 -1
- package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
- package/dist/esm/types/chartType/radar/radar.d.ts +6 -0
- package/dist/esm/types/chartType/radar/zRadar.d.ts +4 -0
- package/dist/esm/types/chartType/radar/zRadar.js +2 -1
- package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
- package/dist/esm/types/chartType/rose/rose.d.ts +6 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +4 -0
- package/dist/esm/types/chartType/rose/zRose.js +2 -1
- package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +6 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +4 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +2 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +4 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/brush/brush.d.ts +13 -0
- package/dist/esm/types/properties/brush/brush.js +0 -0
- package/dist/esm/types/properties/brush/index.d.ts +4 -0
- package/dist/esm/types/properties/brush/index.js +2 -0
- package/dist/esm/types/properties/brush/zBrush.d.ts +19 -0
- package/dist/esm/types/properties/brush/zBrush.js +21 -0
- package/dist/esm/types/properties/brush/zBrush.js.map +1 -0
- package/dist/esm/types/properties/config/area.d.ts +26 -0
- package/dist/esm/types/properties/config/area.js +3 -1
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +39 -0
- package/dist/esm/types/properties/config/bar.js +3 -1
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +39 -0
- package/dist/esm/types/properties/config/column.js +3 -1
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +196 -0
- package/dist/esm/types/properties/config/heatmap/heatmap.d.ts +4 -0
- package/dist/esm/types/properties/config/heatmap/zHeatmap.d.ts +1 -0
- package/dist/esm/types/properties/config/heatmap/zHeatmap.js +2 -1
- package/dist/esm/types/properties/config/heatmap/zHeatmap.js.map +1 -1
- package/dist/esm/types/properties/config/heatmap.d.ts +14 -0
- package/dist/esm/types/properties/config/heatmap.js +3 -1
- package/dist/esm/types/properties/config/heatmap.js.map +1 -1
- package/dist/esm/types/properties/config/histogram.d.ts +13 -0
- package/dist/esm/types/properties/config/histogram.js +3 -1
- package/dist/esm/types/properties/config/histogram.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +13 -0
- package/dist/esm/types/properties/config/line.js +3 -1
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +39 -0
- package/dist/esm/types/properties/config/pie.js +3 -1
- package/dist/esm/types/properties/config/pie.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +13 -0
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/index.d.ts +1 -0
- package/dist/esm/types/properties/index.js +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +392 -0
- package/dist/esm/types/zVseed.d.ts +80 -0
- package/dist/umd/index.js +528 -187
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.d.ts +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js +0 -17
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltip.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltip.ts"],"sourcesContent":["import { pipe, uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n FoldInfo,\n Measures,\n VChartSpecPipe,\n TooltipConfig,\n UnfoldInfo,\n Dimension,\n Measure,\n} from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltip: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltip.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltip.ts"],"sourcesContent":["import { pipe, uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n FoldInfo,\n Measures,\n VChartSpecPipe,\n TooltipConfig,\n UnfoldInfo,\n Dimension,\n Measure,\n} from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltip: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType as 'line'] as { tooltip: TooltipConfig }\n const { tooltip = { enable: true } } = baseConfig\n const { enable = true } = tooltip\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: !!enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, foldInfo, unfoldInfo),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(\n encoding.tooltip || [],\n measures,\n foldInfo,\n unfoldInfo,\n reshapeMeasures.length > 1,\n ),\n },\n\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createDimensionContent = (\n tooltip: string[],\n measures: Measures = [],\n foldInfo: FoldInfo,\n unfoldInfo: UnfoldInfo,\n hasMultiMeasureGroup: boolean,\n) => {\n const { measureId, measureValue, foldMap } = foldInfo\n const { encodingColor } = unfoldInfo\n\n const hasMeasureTooltip = tooltip.some((d) => measures.find((item) => item.id === d))\n\n return [\n {\n visible: true,\n shapeType: 'rectRound',\n hasShape: true,\n key: !hasMeasureTooltip\n ? (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[encodingColor] as string)) || ''\n\n const colorKey = `${unfoldInfo.colorIdMap[key].alias ?? key}`\n\n if (hasMultiMeasureGroup) {\n const mId = (datum && (datum[measureId] as string)) || ''\n\n return `${colorKey}-${foldMap[mId] ?? mId}`\n }\n\n return colorKey\n }\n : (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[measureId] as string)) || ''\n return foldMap[key] ?? key\n },\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n },\n ]\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions = [],\n measures: Measures = [],\n foldInfo: FoldInfo,\n unfoldInfo: UnfoldInfo,\n) => {\n const dims = pipe(\n dimensions.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Dimension) => item.id),\n uniqueBy((item: Dimension) => item.alias),\n )\n const meas = pipe(\n measures.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Measure) => item.id),\n uniqueBy((item: Measure) => item.alias),\n )\n\n const dimContent = dims.map((item: Dimension) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item: Measure) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const defaultContent = {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureName } = foldInfo\n const { encodingColor: colorName } = unfoldInfo\n\n const datum = v as Datum\n return (datum && (datum[measureName || colorName] as string)) || ''\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n\n return [...dimContent, defaultContent, ...meaContent]\n}\n"],"names":["tooltip","spec","context","result","advancedVSeed","vseed","measures","datasetReshapeInfo","chartType","dimensions","encoding","reshapeMeasures","baseConfig","enable","foldInfo","unfoldInfo","getTooltipStyle","createMarkContent","createDimensionContent","updateTooltipElement","hasMultiMeasureGroup","measureId","measureValue","foldMap","encodingColor","hasMeasureTooltip","d","item","v","datum","key","colorKey","mId","value","id","measure","findMeasureById","formatter","createFormatterByMeasure","dims","pipe","uniqueBy","meas","dimContent","meaContent","ORIGINAL_DATA","originalData","defaultContent","measureName","colorName","String"],"mappings":";;;;;AAiBO,MAAMA,kBAA0B,CAACC,MAAMC;IAC5C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EACJI,WAAW,EAAE,EACbC,kBAAkB,EAClBC,SAAS,EACTC,aAAa,EAAE,EACfC,QAAQ,EACRC,kBAAkB,EAAE,EACrB,GAAGP;IACJ,MAAMQ,aAAaR,cAAc,MAAM,CAACI,UAAoB;IAC5D,MAAM,EAAER,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGY;IACvC,MAAM,EAAEC,SAAS,IAAI,EAAE,GAAGb;IAC1B,MAAM,EAAEc,QAAQ,EAAEC,UAAU,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAKtDJ,OAAO,OAAO,GAAG;QACf,OAAOa,gBAAgBhB;QACvB,SAAS,CAAC,CAACa;QACX,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASI,kBAAkBP,SAAS,OAAO,IAAI,EAAE,EAAED,YAAYJ,MAAM,QAAQ,EAAcS,UAAUC;QACvG;QACA,WAAW;YACT,OAAO;gBACL,SAAS;YACX;YACA,SAASG,uBACPR,SAAS,OAAO,IAAI,EAAE,EACtBJ,UAC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C,yBAAyBH;gBAC3C,OAAOE,UAAUJ;YACnB;QACF;IAEA,MAAMc,iBAAiB;QACrB,SAAS;QACT,UAAU;QACV,WAAW;QACX,KAAK,CAACnB;YACJ,MAAM,EAAEoB,WAAW,EAAE,GAAGlC;YACxB,MAAM,EAAE,eAAemC,SAAS,EAAE,GAAGlC;YAErC,MAAMc,QAAQD;YACd,OAAQC,SAAUA,KAAK,CAACmB,eAAeC,UAAU,IAAgB;QACnE;QACA,OAAO,CAACrB;YACN,MAAM,EAAEP,SAAS,EAAEC,YAAY,EAAE,GAAGR;YAEpC,MAAMe,QAAQD;YACd,IAAI,CAACC,OACH,OAAO;YAET,MAAMI,QAAQJ,KAAK,CAACP,aAAa;YACjC,MAAMY,KAAKL,KAAK,CAACR,UAAU;YAC3B,MAAMc,UAAUC,gBAAgB9B,UAAU4B;YAC1C,IAAI,CAACC,SACH,OAAOe,OAAOjB;YAGhB,MAAMI,YAAYC,yBAAyBH;YAC3C,OAAOE,UAAUJ;QACnB;IACF;IAEA,OAAO;WAAIU;QAAYI;WAAmBH;KAAW;AACvD"}
|
|
@@ -110,7 +110,7 @@ const createMarkContent = (tooltip, dimensions, encoding)=>{
|
|
|
110
110
|
defaultContent
|
|
111
111
|
];
|
|
112
112
|
};
|
|
113
|
-
const createDimensionContent = (dimensions, measures, unfoldInfo, medianAlias)=>{
|
|
113
|
+
const createDimensionContent = (dimensions, measures, unfoldInfo, medianAlias, hasMultiMeasureGroup)=>{
|
|
114
114
|
const { encodingColor } = unfoldInfo;
|
|
115
115
|
return [
|
|
116
116
|
{
|
|
@@ -120,7 +120,13 @@ const createDimensionContent = (dimensions, measures, unfoldInfo, medianAlias)=>
|
|
|
120
120
|
key: dimensions.some((d)=>'color' === d.encoding) ? (v)=>{
|
|
121
121
|
const datum = v;
|
|
122
122
|
const key = datum && datum[encodingColor] || '';
|
|
123
|
-
|
|
123
|
+
const colorKey = `${unfoldInfo.colorIdMap[key].alias ?? key}(${medianAlias})`;
|
|
124
|
+
if (hasMultiMeasureGroup) {
|
|
125
|
+
const id = datum[MeasureId];
|
|
126
|
+
const measure = findMeasureById(measures, id);
|
|
127
|
+
return measure ? `${colorKey}-${measure.alias ?? id}` : colorKey;
|
|
128
|
+
}
|
|
129
|
+
return colorKey;
|
|
124
130
|
} : (v)=>{
|
|
125
131
|
const datum = v;
|
|
126
132
|
return `${datum[MeasureName] ?? datum[MeasureId]}(${medianAlias})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.ts"],"sourcesContent":["import { pipe, uniqueBy, isNullish } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Dimension,\n Dimensions,\n Encoding,\n VChartSpecPipe,\n Tooltip,\n Measures,\n FoldInfo,\n UnfoldInfo,\n} from 'src/types'\nimport type { Datum, ISpec, ITooltipLinePattern, ITooltipLineActual, TooltipData } from '@visactor/vchart'\nimport {\n ColorEncoding,\n LowerWhisker,\n MeasureId,\n MeasureName,\n MedianMeasureId,\n OutliersMeasureId,\n Q1MeasureValue,\n Q3MeasureValue,\n UpperWhisker,\n XEncoding,\n} from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { intl } from 'src/i18n'\nimport { updateTooltipElement } from './tooltipElement'\n\nconst boxPlotMeasureKeys = [UpperWhisker, Q3MeasureValue, MedianMeasureId, Q1MeasureValue, LowerWhisker]\nconst VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE'\n\nexport const tooltipBoxplot: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { chartType, dimensions = [], encoding, datasetReshapeInfo } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType as 'boxPlot'] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const meas = (vseed.measures ?? []) as Measures\n const valueMeasure = meas.find((item) => item.encoding === 'value' || isNullish(item.encoding))\n const defaultFormatter = valueMeasure ? createFormatterByMeasure(valueMeasure) : (v: unknown) => v\n const measureAliasMapping: Record<string, string> = {\n [OutliersMeasureId]: intl.i18n`异常点`,\n [UpperWhisker]: intl.i18n`上边界`,\n [Q3MeasureValue]: intl.i18n`上四分位数`,\n [MedianMeasureId]: intl.i18n`中位数`,\n [Q1MeasureValue]: intl.i18n`下四分位数`,\n [LowerWhisker]: intl.i18n`下边界`,\n }\n const { unfoldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n style: getTooltipStyle(tooltip),\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, encoding as Encoding),\n updateContent: (prev: ITooltipLineActual[] | undefined, data: TooltipData | undefined) => {\n const datum = (data as any)?.[0]?.datum?.[0]\n\n if (!isNullish(datum?.[VCHART_OUTLIER_KEY])) {\n const tooltipItems: ITooltipLineActual[] = (prev ?? []).filter(\n (item: any) => !boxPlotMeasureKeys.includes(item.key as string),\n )\n const outerlierMeasure = meas.find((item) => item.id === OutliersMeasureId)\n const formatter = outerlierMeasure ? createFormatterByMeasure(outerlierMeasure) : defaultFormatter\n\n tooltipItems.push({\n ...(tooltipItems[0] as any),\n key: outerlierMeasure?.alias ?? measureAliasMapping[OutliersMeasureId],\n value: formatter(datum?.[VCHART_OUTLIER_KEY] as number) as string,\n } as ITooltipLineActual)\n\n return tooltipItems\n }\n\n return (prev ?? []).map((entry) => {\n if (boxPlotMeasureKeys.includes((entry as any).key as string)) {\n const mea = meas.find((item) => item.id === (entry as any).key)\n const formatter = mea ? createFormatterByMeasure(mea) : defaultFormatter\n\n return {\n ...(entry as any),\n value: formatter(datum?.[(entry as any).key] as number) as string,\n key: mea?.alias ?? measureAliasMapping[entry?.key as string] ?? (entry as any).key,\n }\n }\n\n return entry\n }) as ITooltipLineActual[]\n },\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(dimensions, meas, unfoldInfo, measureAliasMapping[MedianMeasureId]),\n },\n updateElement: updateTooltipElement,\n }\n return result as unknown as ISpec\n}\n\nconst createMarkContent = (tooltip: string[], dimensions: Dimensions, encoding: Encoding) => {\n const dims = pipe(\n dimensions.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Dimension) => item.id),\n uniqueBy((item: Dimension) => item.alias),\n )\n\n const dimContent = dims.map((item: Dimension) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias ?? item.id,\n value: (datum: Datum | undefined) => {\n if (!isNullish(datum?.[VCHART_OUTLIER_KEY])) {\n if (encoding.color?.includes(item.id)) {\n return datum?.[ColorEncoding] as string\n }\n if (encoding.x?.includes(item.id)) {\n return datum?.[XEncoding] as string\n }\n }\n\n return datum?.[item.id] as string\n },\n }))\n\n const defaultContent = boxPlotMeasureKeys.map((key: string) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key,\n value: (datum: Datum | undefined) => {\n if (!datum) {\n return ''\n }\n return datum[key] as string | number\n },\n }\n })\n\n return [...dimContent, defaultContent] as ITooltipLinePattern[]\n}\n\nconst createDimensionContent = (\n dimensions: Dimensions,\n measures: Measures,\n unfoldInfo: UnfoldInfo,\n medianAlias: string,\n) => {\n const { encodingColor } = unfoldInfo\n\n return [\n {\n visible: true,\n shapeType: 'rectRound',\n hasShape: true,\n key: dimensions.some((d) => d.encoding === 'color')\n ? (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[encodingColor] as string)) || ''\n return `${unfoldInfo.colorIdMap[key].alias ?? key}(${medianAlias})`\n }\n : (v: unknown) => {\n const datum = v as Datum\n return `${datum[MeasureName] ?? datum[MeasureId]}(${medianAlias})`\n },\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[MedianMeasureId] as string | number // dimension tooltip 中默认显示中位数\n const id = datum[MeasureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n },\n ]\n}\n"],"names":["boxPlotMeasureKeys","UpperWhisker","Q3MeasureValue","MedianMeasureId","Q1MeasureValue","LowerWhisker","VCHART_OUTLIER_KEY","tooltipBoxplot","spec","context","result","advancedVSeed","vseed","chartType","dimensions","encoding","datasetReshapeInfo","baseConfig","tooltip","enable","meas","valueMeasure","item","isNullish","defaultFormatter","createFormatterByMeasure","v","measureAliasMapping","OutliersMeasureId","intl","unfoldInfo","getTooltipStyle","createMarkContent","prev","data","datum","tooltipItems","outerlierMeasure","formatter","entry","mea","createDimensionContent","updateTooltipElement","dims","pipe","uniqueBy","dimContent","ColorEncoding","XEncoding","defaultContent","key","measures","medianAlias","encodingColor","d","MeasureName","MeasureId","value","id","measure","findMeasureById"],"mappings":";;;;;;AA6BA,MAAMA,qBAAqB;IAACC;IAAcC;IAAgBC;IAAiBC;IAAgBC;CAAa;AACxG,MAAMC,qBAAqB;AAEpB,MAAMC,iBAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAEC,aAAa,EAAE,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE,GAAGL;IACrE,MAAMM,aAAaN,cAAc,MAAM,CAACE,UAAuB;IAC/D,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAME,OAAQR,MAAM,QAAQ,IAAI,EAAE;IAClC,MAAMS,eAAeD,KAAK,IAAI,CAAC,CAACE,OAASA,AAAkB,YAAlBA,KAAK,QAAQ,IAAgBC,UAAUD,KAAK,QAAQ;IAC7F,MAAME,mBAAmBH,eAAeI,yBAAyBJ,gBAAgB,C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;QACF;IAEA,MAAM2B,iBAAiBjD,mBAAmB,GAAG,CAAC,CAACkD,MACtC;YACL,SAAS;YACT,UAAU;YACV,WAAW;YACXA;YACA,OAAO,CAACf;gBACN,IAAI,CAACA,OACH,OAAO;gBAET,OAAOA,KAAK,CAACe,IAAI;YACnB;QACF;IAGF,OAAO;WAAIJ;QAAYG;KAAe;AACxC;AAEA,MAAMR,yBAAyB,CAC7B3B,YACAqC,UACArB,YACAsB;IAEA,MAAM,EAAEC,aAAa,EAAE,GAAGvB;IAE1B,OAAO;QACL;YACE,SAAS;YACT,WAAW;YACX,UAAU;YACV,KAAKhB,WAAW,IAAI,CAAC,CAACwC,IAAMA,AAAe,YAAfA,EAAE,QAAQ,IAClC,CAAC5B;gBACC,MAAMS,QAAQT;gBACd,MAAMwB,MAAOf,SAAUA,KAAK,CAACkB,cAAc,IAAgB;gBAC3D,OAAO,GAAGvB,WAAW,UAAU,CAACoB,IAAI,CAAC,KAAK,IAAIA,IAAI,CAAC,EAAEE,YAAY,CAAC,CAAC;YACrE,IACA,CAAC1B;gBACC,MAAMS,QAAQT;gBACd,OAAO,GAAGS,KAAK,CAACoB,YAAY,IAAIpB,KAAK,CAACqB,UAAU,CAAC,CAAC,EAAEJ,YAAY,CAAC,CAAC;YACpE;YACJ,OAAO,CAAC1B;gBACN,MAAMS,QAAQT;gBACd,IAAI,CAACS,OACH,OAAO;gBAET,MAAMsB,QAAQtB,KAAK,CAAChC,gBAAoC;gBACxD,MAAMuD,KAAKvB,KAAK,CAACqB,UAAU;gBAC3B,MAAMG,UAAUC,gBAAgBT,UAAUO;gBAC1C,MAAMpB,YAAYb,yBAAyBkC;gBAC3C,OAAOrB,UAAUmB;YACnB;QACF;KACD;AACH"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.ts"],"sourcesContent":["import { pipe, uniqueBy, isNullish } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Dimension,\n Dimensions,\n Encoding,\n VChartSpecPipe,\n Tooltip,\n Measures,\n FoldInfo,\n UnfoldInfo,\n} from 'src/types'\nimport type { Datum, ISpec, ITooltipLinePattern, ITooltipLineActual, TooltipData } from '@visactor/vchart'\nimport {\n ColorEncoding,\n LowerWhisker,\n MeasureId,\n MeasureName,\n MedianMeasureId,\n OutliersMeasureId,\n Q1MeasureValue,\n Q3MeasureValue,\n UpperWhisker,\n XEncoding,\n} from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { intl } from 'src/i18n'\nimport { updateTooltipElement } from './tooltipElement'\n\nconst boxPlotMeasureKeys = [UpperWhisker, Q3MeasureValue, MedianMeasureId, Q1MeasureValue, LowerWhisker]\nconst VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE'\n\nexport const tooltipBoxplot: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { chartType, dimensions = [], encoding, datasetReshapeInfo } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType as 'boxPlot'] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const meas = (vseed.measures ?? []) as Measures\n const valueMeasure = meas.find((item) => item.encoding === 'value' || isNullish(item.encoding))\n const defaultFormatter = valueMeasure ? createFormatterByMeasure(valueMeasure) : (v: unknown) => v\n const measureAliasMapping: Record<string, string> = {\n [OutliersMeasureId]: intl.i18n`异常点`,\n [UpperWhisker]: intl.i18n`上边界`,\n [Q3MeasureValue]: intl.i18n`上四分位数`,\n [MedianMeasureId]: intl.i18n`中位数`,\n [Q1MeasureValue]: intl.i18n`下四分位数`,\n [LowerWhisker]: intl.i18n`下边界`,\n }\n const { unfoldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n style: getTooltipStyle(tooltip),\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, encoding as Encoding),\n updateContent: (prev: ITooltipLineActual[] | undefined, data: TooltipData | undefined) => {\n const datum = (data as any)?.[0]?.datum?.[0]\n\n if (!isNullish(datum?.[VCHART_OUTLIER_KEY])) {\n const tooltipItems: ITooltipLineActual[] = (prev ?? []).filter(\n (item: any) => !boxPlotMeasureKeys.includes(item.key as string),\n )\n const outerlierMeasure = meas.find((item) => item.id === OutliersMeasureId)\n const formatter = outerlierMeasure ? createFormatterByMeasure(outerlierMeasure) : defaultFormatter\n\n tooltipItems.push({\n ...(tooltipItems[0] as any),\n key: outerlierMeasure?.alias ?? measureAliasMapping[OutliersMeasureId],\n value: formatter(datum?.[VCHART_OUTLIER_KEY] as number) as string,\n } as ITooltipLineActual)\n\n return tooltipItems\n }\n\n return (prev ?? []).map((entry) => {\n if (boxPlotMeasureKeys.includes((entry as any).key as string)) {\n const mea = meas.find((item) => item.id === (entry as any).key)\n const formatter = mea ? createFormatterByMeasure(mea) : defaultFormatter\n\n return {\n ...(entry as any),\n value: formatter(datum?.[(entry as any).key] as number) as string,\n key: mea?.alias ?? measureAliasMapping[entry?.key as string] ?? (entry as any).key,\n }\n }\n\n return entry\n }) as ITooltipLineActual[]\n },\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(dimensions, meas, unfoldInfo, measureAliasMapping[MedianMeasureId]),\n },\n updateElement: updateTooltipElement,\n }\n return result as unknown as ISpec\n}\n\nconst createMarkContent = (tooltip: string[], dimensions: Dimensions, encoding: Encoding) => {\n const dims = pipe(\n dimensions.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Dimension) => item.id),\n uniqueBy((item: Dimension) => item.alias),\n )\n\n const dimContent = dims.map((item: Dimension) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias ?? item.id,\n value: (datum: Datum | undefined) => {\n if (!isNullish(datum?.[VCHART_OUTLIER_KEY])) {\n if (encoding.color?.includes(item.id)) {\n return datum?.[ColorEncoding] as string\n }\n if (encoding.x?.includes(item.id)) {\n return datum?.[XEncoding] as string\n }\n }\n\n return datum?.[item.id] as string\n },\n }))\n\n const defaultContent = boxPlotMeasureKeys.map((key: string) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key,\n value: (datum: Datum | undefined) => {\n if (!datum) {\n return ''\n }\n return datum[key] as string | number\n },\n }\n })\n\n return [...dimContent, defaultContent] as ITooltipLinePattern[]\n}\n\nconst createDimensionContent = (\n dimensions: Dimensions,\n measures: Measures,\n unfoldInfo: UnfoldInfo,\n medianAlias: string,\n hasMultiMeasureGroup?: boolean,\n) => {\n const { encodingColor } = unfoldInfo\n\n return [\n {\n visible: true,\n shapeType: 'rectRound',\n hasShape: true,\n key: dimensions.some((d) => d.encoding === 'color')\n ? (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[encodingColor] as string)) || ''\n const colorKey = `${unfoldInfo.colorIdMap[key].alias ?? key}(${medianAlias})`\n\n if (hasMultiMeasureGroup) {\n const id = datum[MeasureId] as string\n const measure = findMeasureById(measures, id)\n\n return measure ? `${colorKey}-${measure.alias ?? id}` : colorKey\n }\n\n return colorKey\n }\n : (v: unknown) => {\n const datum = v as Datum\n return `${datum[MeasureName] ?? datum[MeasureId]}(${medianAlias})`\n },\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[MedianMeasureId] as string | number // dimension tooltip 中默认显示中位数\n const id = datum[MeasureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n },\n ]\n}\n"],"names":["boxPlotMeasureKeys","UpperWhisker","Q3MeasureValue","MedianMeasureId","Q1MeasureValue","LowerWhisker","VCHART_OUTLIER_KEY","tooltipBoxplot","spec","context","result","advancedVSeed","vseed","chartType","dimensions","encoding","datasetReshapeInfo","baseConfig","tooltip","enable","meas","valueMeasure","item","isNullish","defaultFormatter","createFormatterByMeasure","v","measureAliasMapping","OutliersMeasureId","intl","unfoldInfo","getTooltipStyle","createMarkContent","prev","data","datum","tooltipItems","outerlierMeasure","formatter","entry","mea","createDimensionContent","updateTooltipElement","dims","pipe","uniqueBy","dimContent","ColorEncoding","XEncoding","defaultContent","key","measures","medianAlias","hasMultiMeasureGroup","encodingColor","d","colorKey","id","MeasureId","measure","findMeasureById","MeasureName","value"],"mappings":";;;;;;AA6BA,MAAMA,qBAAqB;IAACC;IAAcC;IAAgBC;IAAiBC;IAAgBC;CAAa;AACxG,MAAMC,qBAAqB;AAEpB,MAAMC,iBAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAEC,aAAa,EAAE,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE,GAAGL;IACrE,MAAMM,aAAaN,cAAc,MAAM,CAACE,UAAuB;IAC/D,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAME,OAAQR,MAAM,QAAQ,IAAI,EAAE;IAClC,MAAMS,eAAeD,KAAK,IAAI,CAAC,CAACE,OAASA,AAAkB,YAAlBA,KAAK,QAAQ,IAAgBC,UAAUD,KAAK,QAAQ;IAC7F,MAAME,mBAAmBH,eAAeI,yBAAyBJ,gBAAgB,CAACK,IAAeA;IACjG,MAAMC,sBAA8C;QAClD,CAACC,kBAAkB,EAAEC,KAAK,IAAI,CAAC,GAAG,CAAC;QACnC,CAAC5B,aAAa,EAAE4B,KAAK,IAAI,CAAC,GAAG,CAAC;QAC9B,CAAC3B,eAAe,EAAE2B,KAAK,IAAI,CAAC,KAAK,CAAC;QAClC,CAAC1B,gBAAgB,EAAE0B,KAAK,IAAI,CAAC,GAAG,CAAC;QACjC,C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sB,aACAC;IAEA,MAAM,EAAEC,aAAa,EAAE,GAAGxB;IAE1B,OAAO;QACL;YACE,SAAS;YACT,WAAW;YACX,UAAU;YACV,KAAKhB,WAAW,IAAI,CAAC,CAACyC,IAAMA,AAAe,YAAfA,EAAE,QAAQ,IAClC,CAAC7B;gBACC,MAAMS,QAAQT;gBACd,MAAMwB,MAAOf,SAAUA,KAAK,CAACmB,cAAc,IAAgB;gBAC3D,MAAME,WAAW,GAAG1B,WAAW,UAAU,CAACoB,IAAI,CAAC,KAAK,IAAIA,IAAI,CAAC,EAAEE,YAAY,CAAC,CAAC;gBAE7E,IAAIC,sBAAsB;oBACxB,MAAMI,KAAKtB,KAAK,CAACuB,UAAU;oBAC3B,MAAMC,UAAUC,gBAAgBT,UAAUM;oBAE1C,OAAOE,UAAU,GAAGH,SAAS,CAAC,EAAEG,QAAQ,KAAK,IAAIF,IAAI,GAAGD;gBAC1D;gBAEA,OAAOA;YACT,IACA,CAAC9B;gBACC,MAAMS,QAAQT;gBACd,OAAO,GAAGS,KAAK,CAAC0B,YAAY,IAAI1B,KAAK,CAACuB,UAAU,CAAC,CAAC,EAAEN,YAAY,CAAC,CAAC;YACpE;YACJ,OAAO,CAAC1B;gBACN,MAAMS,QAAQT;gBACd,IAAI,CAACS,OACH,OAAO;gBAET,MAAM2B,QAAQ3B,KAAK,CAAChC,gBAAoC;gBACxD,MAAMsD,KAAKtB,KAAK,CAACuB,UAAU;gBAC3B,MAAMC,UAAUC,gBAAgBT,UAAUM;gBAC1C,MAAMnB,YAAYb,yBAAyBkC;gBAC3C,OAAOrB,UAAUwB;YACnB;QACF;KACD;AACH"}
|
|
@@ -6,7 +6,7 @@ const tooltipOfDualAxisSeries = (options)=>(spec, context)=>{
|
|
|
6
6
|
...spec
|
|
7
7
|
};
|
|
8
8
|
const { advancedVSeed, vseed } = context;
|
|
9
|
-
const { measures = [], datasetReshapeInfo, chartType, dimensions = [], encoding } = advancedVSeed;
|
|
9
|
+
const { measures = [], datasetReshapeInfo, chartType, dimensions = [], encoding, reshapeMeasures = [] } = advancedVSeed;
|
|
10
10
|
const baseConfig = advancedVSeed.config[chartType];
|
|
11
11
|
const { tooltip = {
|
|
12
12
|
enable: true
|
|
@@ -25,7 +25,7 @@ const tooltipOfDualAxisSeries = (options)=>(spec, context)=>{
|
|
|
25
25
|
title: {
|
|
26
26
|
visible: true
|
|
27
27
|
},
|
|
28
|
-
content: createDimensionContent(
|
|
28
|
+
content: createDimensionContent(encoding.tooltip || [], measures, options.foldInfo, unfoldInfo, reshapeMeasures.length > 1)
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.ts"],"sourcesContent":["import { createDimensionContent, createMarkContent } from './tooltip'\nimport type { VChartSpecPipe, Tooltip, Measures, DualAxisOptions } from 'src/types'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipOfDualAxisSeries = (options: DualAxisOptions): VChartSpecPipe => {\n return (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.ts"],"sourcesContent":["import { createDimensionContent, createMarkContent } from './tooltip'\nimport type { VChartSpecPipe, Tooltip, Measures, DualAxisOptions } from 'src/types'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipOfDualAxisSeries = (options: DualAxisOptions): VChartSpecPipe => {\n return (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n\n const unfoldInfo = datasetReshapeInfo[0].unfoldInfo\n\n result.tooltip = {\n visible: enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(\n encoding.tooltip || [],\n dimensions,\n vseed.measures as Measures,\n options.foldInfo,\n unfoldInfo,\n ),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(\n encoding.tooltip || [],\n measures,\n options.foldInfo,\n unfoldInfo,\n reshapeMeasures.length > 1,\n ),\n },\n }\n return result\n }\n}\n\nexport const tooltipDualAxis: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n updateElement: updateTooltipElement,\n }\n return result\n}\n"],"names":["tooltipOfDualAxisSeries","options","spec","context","result","advancedVSeed","vseed","measures","datasetReshapeInfo","chartType","dimensions","encoding","reshapeMeasures","baseConfig","tooltip","enable","unfoldInfo","createMarkContent","createDimensionContent","tooltipDualAxis","getTooltipStyle","updateTooltipElement"],"mappings":";;;AAKO,MAAMA,0BAA0B,CAACC,UAC/B,CAACC,MAAMC;QACZ,MAAMC,SAAS;YAAE,GAAGF,IAAI;QAAC;QACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EACJI,WAAW,EAAE,EACbC,kBAAkB,EAClBC,SAAS,EACTC,aAAa,EAAE,EACfC,QAAQ,EACRC,kBAAkB,EAAE,EACrB,GAAGP;QACJ,MAAMQ,aAAaR,cAAc,MAAM,CAACI,UAAU;QAClD,MAAM,EAAEK,UAAU;YAAE,QAAQ;QAAK,CAAC,EAAE,GAAGD;QACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;QAEnB,MAAME,aAAaR,kBAAkB,CAAC,EAAE,CAAC,UAAU;QAEnDJ,OAAO,OAAO,GAAG;YACf,SAASW;YACT,MAAM;gBACJ,OAAO;oBACL,SAAS;gBACX;gBACA,SAASE,kBACPN,SAAS,OAAO,IAAI,EAAE,EACtBD,YACAJ,MAAM,QAAQ,EACdL,QAAQ,QAAQ,EAChBe;YAEJ;YACA,WAAW;gBACT,OAAO;oBACL,SAAS;gBACX;gBACA,SAASE,uBACPP,SAAS,OAAO,IAAI,EAAE,EACtBJ,UACAN,QAAQ,QAAQ,EAChBe,YACAJ,gBAAgB,MAAM,GAAG;YAE7B;QACF;QACA,OAAOR;IACT;AAGK,MAAMe,kBAAkC,CAACjB,MAAMC;IACpD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEM,SAAS,EAAE,GAAGJ;IACtB,MAAMQ,aAAaR,cAAc,MAAM,CAACI,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IAEvCT,OAAO,OAAO,GAAG;QACf,OAAOgB,gBAAgBN;QACvB,eAAeO;IACjB;IACA,OAAOjB;AACT"}
|
|
@@ -22,7 +22,8 @@ const tooltipScatter = (spec, context)=>{
|
|
|
22
22
|
title: {
|
|
23
23
|
visible: false
|
|
24
24
|
},
|
|
25
|
-
content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, locale, foldInfoList)
|
|
25
|
+
content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, locale, foldInfoList),
|
|
26
|
+
updateContent: (prev = [])=>uniqueBy(prev, (entry)=>`${String(entry.key)}::${String(entry.value)}`)
|
|
26
27
|
},
|
|
27
28
|
dimension: {
|
|
28
29
|
visible: false
|
|
@@ -69,7 +70,13 @@ const createMarkContent = (tooltip, dimensions, measures = [], locale, foldInfoL
|
|
|
69
70
|
visible: true,
|
|
70
71
|
hasShape: true,
|
|
71
72
|
shapeType: 'rectRound',
|
|
72
|
-
key:
|
|
73
|
+
key: (v)=>{
|
|
74
|
+
const { measureId, foldMap } = foldInfo;
|
|
75
|
+
const datum = v;
|
|
76
|
+
if (!datum) return '';
|
|
77
|
+
const id = datum[measureId];
|
|
78
|
+
return foldMap[id] ?? id;
|
|
79
|
+
},
|
|
73
80
|
value: (v)=>{
|
|
74
81
|
const { measureId, measureValue } = foldInfo;
|
|
75
82
|
const datum = v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, VChartSpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipScatter: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions = [], encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, locale, foldInfoList),\n },\n dimension: {\n visible: false,\n },\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures = [],\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: Object.values(foldInfo.foldMap)[0],\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","getTooltipStyle","createMarkContent","updateTooltipElement","measures","dims","
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, VChartSpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipScatter: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions = [], encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, locale, foldInfoList),\n updateContent: (prev: Datum[] = []) => {\n return uniqueBy(prev, (entry) => `${String(entry.key)}::${String(entry.value)}`)\n },\n },\n dimension: {\n visible: false,\n },\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures = [],\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = datum[measureId] as string\n\n return foldMap[id] ?? id\n },\n // key: Object.values(foldInfo.foldMap)[0],\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","getTooltipStyle","createMarkContent","prev","uniqueBy","entry","String","updateTooltipElement","measures","dims","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","formatter","createFormatterByMeasure","foldMeaContent","foldInfo","measureId","foldMap","measureValue"],"mappings":";;;;;AAOO,MAAMA,iBAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,aAAa,EAAE,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPositionMeasure } from "./measures/index.js";
|
|
2
|
-
import { isMeasureTreeWithParentId } from "../advanced/chart/pipes/measures/utils.js";
|
|
2
|
+
import { isCommonMeasureEncoding, isMeasureTreeWithParentId } from "../advanced/chart/pipes/measures/utils.js";
|
|
3
3
|
import { unique } from "remeda";
|
|
4
4
|
import { ChartTypeEnum, DEFAULT_PARENT_ID } from "./constant.js";
|
|
5
5
|
const isTable = (vseed)=>vseed.chartType === ChartTypeEnum.Table;
|
|
@@ -20,12 +20,32 @@ const isPivotChart = (vseed)=>{
|
|
|
20
20
|
return isCombination(vseed);
|
|
21
21
|
};
|
|
22
22
|
const isPivot = (vseed)=>{
|
|
23
|
-
const { dimensions = [] } = vseed;
|
|
24
|
-
|
|
23
|
+
const { dimensions = [], measures = [] } = vseed;
|
|
24
|
+
if (dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding)) return true;
|
|
25
|
+
if (vseed.chartType === ChartTypeEnum.Scatter) {
|
|
26
|
+
const xCount = measures.filter((m)=>'xAxis' === m.encoding).length;
|
|
27
|
+
const yCount = measures.filter((m)=>'yAxis' === m.encoding).length;
|
|
28
|
+
const otherCount = measures.filter((m)=>![
|
|
29
|
+
'size',
|
|
30
|
+
'xAxis',
|
|
31
|
+
'yAxis'
|
|
32
|
+
].includes(m.encoding) && !isCommonMeasureEncoding(m.encoding)).length;
|
|
33
|
+
let finalXCount;
|
|
34
|
+
let finalYCount;
|
|
35
|
+
if (xCount > 0) {
|
|
36
|
+
finalXCount = xCount;
|
|
37
|
+
finalYCount = yCount + otherCount;
|
|
38
|
+
} else {
|
|
39
|
+
finalXCount = otherCount > 0 ? 1 : 0;
|
|
40
|
+
finalYCount = yCount + Math.max(otherCount - 1, 0);
|
|
41
|
+
}
|
|
42
|
+
if (finalXCount > 1 || finalYCount > 1) return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
25
45
|
};
|
|
26
46
|
const isCombination = (vseed)=>{
|
|
27
47
|
if (isMeasureTreeWithParentId(vseed.measures)) {
|
|
28
|
-
const parentIds = vseed.measures?.filter(isPositionMeasure).map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
|
48
|
+
const parentIds = vseed.measures?.filter((m)=>isPositionMeasure(m, vseed.chartType)).map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
|
29
49
|
return parentIds && unique(parentIds).length > 1;
|
|
30
50
|
}
|
|
31
51
|
const { measures = [] } = vseed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/utils/chatType.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/chatType.ts"],"sourcesContent":["import type { Measures } from 'src/types'\nimport { type Dimensions, type DimensionGroup, type VSeed, type Measure } from 'src/types'\nimport { isPositionMeasure } from './measures'\nimport { isMeasureTreeWithParentId } from '../advanced/chart/pipes/measures/utils'\nimport { unique } from 'remeda'\nimport { ChartTypeEnum, DEFAULT_PARENT_ID } from './constant'\n\nexport const isTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Table\n}\nexport const isPivotTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.PivotTable\n}\nexport const isRadar = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Radar\n}\nexport const isAreaPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.AreaPercent\n}\nexport const isColumnPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.ColumnPercent\n}\nexport const isBarPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.BarPercent\n}\n\nexport const isBarLikeChart = (vseed: VSeed) => {\n return (\n vseed.chartType === ChartTypeEnum.Bar ||\n vseed.chartType === ChartTypeEnum.BarPercent ||\n vseed.chartType === ChartTypeEnum.BarParallel\n )\n}\n\nexport const isVTable = (vseed: VSeed) => {\n return ['table', 'pivotTable'].includes(vseed.chartType)\n}\nexport const isVChart = (vseed: VSeed): boolean => {\n return !isVTable(vseed)\n}\n\n/**\n * @description 透视图表或组合图\n * - 透视图表定义: 存在 column 或 row的 encoding\n * - 组合图表定义: 存在多组指标的情况\n * - 透视组合图表: 存在 column 或 row的 encoding 且 存在多组指标的情况\n * 上述三者都只能使用 VTable.PivotChart 绘制\n */\nexport const isPivotChart = (vseed: VSeed) => {\n if (isVTable(vseed)) {\n return false\n }\n\n if (isPivot(vseed)) {\n return true\n }\n\n return isCombination(vseed)\n}\n\n/**\n * @description 存在column 或 row的encoding\n */\nexport const isPivot = (vseed: VSeed) => {\n const { dimensions = [] } = vseed as {\n dimensions: Dimensions\n }\n\n
|
|
1
|
+
{"version":3,"file":"pipeline/utils/chatType.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/chatType.ts"],"sourcesContent":["import type { MeasureEncoding, Measures } from 'src/types'\nimport { type Dimensions, type DimensionGroup, type VSeed, type Measure } from 'src/types'\nimport { isPositionMeasure } from './measures'\nimport { isCommonMeasureEncoding, isMeasureTreeWithParentId } from '../advanced/chart/pipes/measures/utils'\nimport { unique } from 'remeda'\nimport { ChartTypeEnum, DEFAULT_PARENT_ID } from './constant'\n\nexport const isTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Table\n}\nexport const isPivotTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.PivotTable\n}\nexport const isRadar = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Radar\n}\nexport const isAreaPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.AreaPercent\n}\nexport const isColumnPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.ColumnPercent\n}\nexport const isBarPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.BarPercent\n}\n\nexport const isBarLikeChart = (vseed: VSeed) => {\n return (\n vseed.chartType === ChartTypeEnum.Bar ||\n vseed.chartType === ChartTypeEnum.BarPercent ||\n vseed.chartType === ChartTypeEnum.BarParallel\n )\n}\n\nexport const isVTable = (vseed: VSeed) => {\n return ['table', 'pivotTable'].includes(vseed.chartType)\n}\nexport const isVChart = (vseed: VSeed): boolean => {\n return !isVTable(vseed)\n}\n\n/**\n * @description 透视图表或组合图\n * - 透视图表定义: 存在 column 或 row的 encoding\n * - 组合图表定义: 存在多组指标的情况\n * - 透视组合图表: 存在 column 或 row的 encoding 且 存在多组指标的情况\n * 上述三者都只能使用 VTable.PivotChart 绘制\n */\nexport const isPivotChart = (vseed: VSeed) => {\n if (isVTable(vseed)) {\n return false\n }\n\n if (isPivot(vseed)) {\n return true\n }\n\n return isCombination(vseed)\n}\n\n/**\n * @description 存在column 或 row的encoding\n */\nexport const isPivot = (vseed: VSeed) => {\n const { dimensions = [], measures = [] } = vseed as {\n dimensions: Dimensions\n measures: Measures\n }\n\n if (dimensions && dimensions.some((dimension) => dimension.encoding === 'row' || dimension.encoding === 'column')) {\n return true\n }\n\n if (vseed.chartType === ChartTypeEnum.Scatter) {\n const xCount = measures.filter((m: Measure) => m.encoding === 'xAxis').length\n const yCount = measures.filter((m: Measure) => m.encoding === 'yAxis').length\n const otherCount = measures.filter(\n (m: Measure) =>\n !['size', 'xAxis', 'yAxis'].includes(m.encoding as string) &&\n !isCommonMeasureEncoding(m.encoding as MeasureEncoding),\n ).length\n\n /**\n * Scatter \"matrix\" detection logic\n *\n * xCount: number of measures explicitly encoded on the x-axis\n * yCount: number of measures explicitly encoded on the y-axis\n * otherCount: measures that are not size/xAxis/yAxis and are not common encodings\n *\n * When there is at least one explicit x-axis measure (xCount > 0):\n * - All x-encoded measures are counted as X.\n * - Remaining measures (y-encoded + \"other\") are treated as Y variants.\n *\n * When there is no explicit x-axis measure (xCount === 0):\n * - If there is at least one \"other\" measure, we treat exactly one of them as the X measure\n * (so finalXCount = 1), and the remaining \"other\" measures contribute to Y alongside\n * the explicit y-encoded measures.\n * - Since we conceptually \"promote\" one of the other measures to X, only (otherCount - 1)\n * are left to be counted towards Y. Math.max(..., 0) protects against negative values\n * when otherCount is 0.\n */\n let finalXCount: number\n let finalYCount: number\n\n if (xCount > 0) {\n // Explicit x-axis measures exist: X is fixed, Y aggregates y-encoded + other measures.\n finalXCount = xCount\n finalYCount = yCount + otherCount\n } else {\n // No explicit x-axis measure:\n // - If there are \"other\" measures, treat one as X.\n // - Remaining \"other\" measures contribute to Y, together with any y-encoded measures.\n finalXCount = otherCount > 0 ? 1 : 0\n finalYCount = yCount + Math.max(otherCount - 1, 0)\n }\n if (finalXCount > 1 || finalYCount > 1) return true\n }\n\n return false\n}\n\n/**\n * @description 不存在column 或 row的encoding, 但是有多组指标的情况\n */\nexport const isCombination = (vseed: VSeed) => {\n if (isMeasureTreeWithParentId(vseed.measures)) {\n const parentIds = vseed.measures\n ?.filter((m: Measure) => isPositionMeasure(m, vseed.chartType))\n .map((measure: Measure) => measure.parentId || DEFAULT_PARENT_ID)\n return parentIds && unique(parentIds).length > 1\n }\n\n const { measures = [] } = vseed as {\n measures: Measures\n dimensions: Dimensions\n }\n\n const hasMeasureGroup = measures && measures.some((measure: DimensionGroup) => measure && measure.children)\n\n return hasMeasureGroup\n}\n\nexport const isRectungularCoordinate = (chartType: string) => {\n return (\n [\n ChartTypeEnum.Bar,\n ChartTypeEnum.BarPercent,\n ChartTypeEnum.BarParallel,\n ChartTypeEnum.Column,\n ChartTypeEnum.ColumnPercent,\n ChartTypeEnum.ColumnParallel,\n ChartTypeEnum.Line,\n ChartTypeEnum.Area,\n ChartTypeEnum.AreaPercent,\n ChartTypeEnum.DualAxis,\n ChartTypeEnum.Boxplot,\n ChartTypeEnum.DualAxis,\n ChartTypeEnum.Scatter,\n ChartTypeEnum.Heatmap,\n ChartTypeEnum.Boxplot,\n ] as string[]\n ).includes(chartType)\n}\n\n/**\n * 默认的双轴图图表类型配置\n */\nexport const DEFAULT_DUAL_CHART_TYPE = {\n primary: 'column',\n secondary: 'line',\n}\n\nexport const isDualAxisChartType = (chartType: string | undefined) => {\n return (\n chartType &&\n ['column', 'columnParallel', 'columnPercent', 'line', 'area', 'areaPercent', 'scatter'].includes(chartType)\n )\n}\n"],"names":["isTable","vseed","ChartTypeEnum","isPivotTable","isRadar","isAreaPercent","isColumnPercent","isBarPercent","isBarLikeChart","isVTable","isVChart","isPivotChart","isPivot","isCombination","dimensions","measures","dimension","xCount","m","yCount","otherCount","isCommonMeasureEncoding","finalXCount","finalYCount","Math","isMeasureTreeWithParentId","parentIds","isPositionMeasure","measure","DEFAULT_PARENT_ID","unique","hasMeasureGroup","isRectungularCoordinate","chartType","DEFAULT_DUAL_CHART_TYPE","isDualAxisChartType"],"mappings":";;;;AAOO,MAAMA,UAAU,CAACC,QACfA,MAAM,SAAS,KAAKC,cAAc,KAAK;AAEzC,MAAMC,eAAe,CAACF,QACpBA,MAAM,SAAS,KAAKC,cAAc,UAAU;AAE9C,MAAME,UAAU,CAACH,QACfA,MAAM,SAAS,KAAKC,cAAc,KAAK;AAEzC,MAAMG,gBAAgB,CAACJ,QACrBA,MAAM,SAAS,KAAKC,cAAc,WAAW;AAE/C,MAAMI,kBAAkB,CAACL,QACvBA,MAAM,SAAS,KAAKC,cAAc,aAAa;AAEjD,MAAMK,eAAe,CAACN,QACpBA,MAAM,SAAS,KAAKC,cAAc,UAAU;AAG9C,MAAMM,iBAAiB,CAACP,QAE3BA,MAAM,SAAS,KAAKC,cAAc,GAAG,IACrCD,MAAM,SAAS,KAAKC,cAAc,UAAU,IAC5CD,MAAM,SAAS,KAAKC,cAAc,WAAW;AAI1C,MAAMO,WAAW,CAACR,QAChB;QAAC;QAAS;KAAa,CAAC,QAAQ,CAACA,MAAM,SAAS;AAElD,MAAMS,WAAW,CAACT,QAChB,CAACQ,SAASR;AAUZ,MAAMU,eAAe,CAACV;IAC3B,IAAIQ,SAASR,QACX,OAAO;IAGT,IAAIW,QAAQX,QACV,OAAO;IAGT,OAAOY,cAAcZ;AACvB;AAKO,MAAMW,UAAU,CAACX;IACtB,MAAM,EAAEa,aAAa,EAAE,EAAEC,WAAW,EAAE,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AMC,0BAA0B,CAACC,YAEpC;QACE/B,cAAc,GAAG;QACjBA,cAAc,UAAU;QACxBA,cAAc,WAAW;QACzBA,cAAc,MAAM;QACpBA,cAAc,aAAa;QAC3BA,cAAc,cAAc;QAC5BA,cAAc,IAAI;QAClBA,cAAc,IAAI;QAClBA,cAAc,WAAW;QACzBA,cAAc,QAAQ;QACtBA,cAAc,OAAO;QACrBA,cAAc,QAAQ;QACtBA,cAAc,OAAO;QACrBA,cAAc,OAAO;QACrBA,cAAc,OAAO;KACtB,CACD,QAAQ,CAAC+B;AAMN,MAAMC,0BAA0B;IACrC,SAAS;IACT,WAAW;AACb;AAEO,MAAMC,sBAAsB,CAACF,YAEhCA,aACA;QAAC;QAAU;QAAkB;QAAiB;QAAQ;QAAQ;QAAe;KAAU,CAAC,QAAQ,CAACA"}
|
|
@@ -2,4 +2,4 @@ import type { Measure, MeasureGroup } from '../../../types';
|
|
|
2
2
|
export declare const isMeasure: (measure: Measure | MeasureGroup) => measure is Measure;
|
|
3
3
|
export declare const isMeasureGroup: (measure: Measure | MeasureGroup) => measure is MeasureGroup;
|
|
4
4
|
export declare const isMeasures: (measures: Measure[] | MeasureGroup[]) => measures is Measure[];
|
|
5
|
-
export declare const isPositionMeasure: (measure: Measure) => boolean;
|
|
5
|
+
export declare const isPositionMeasure: (measure: Measure, chartType: string) => boolean;
|
|
@@ -1,13 +1,37 @@
|
|
|
1
|
+
import { ChartTypeEnum } from "../constant.js";
|
|
1
2
|
const isMeasure = (measure)=>!('children' in measure);
|
|
2
3
|
const isMeasureGroup = (measure)=>'children' in measure;
|
|
3
4
|
const isMeasures = (measures)=>measures.every(isMeasure);
|
|
4
|
-
const isPositionMeasure = (measure)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const isPositionMeasure = (measure, chartType)=>{
|
|
6
|
+
if (!measure.encoding) return true;
|
|
7
|
+
if (chartType === ChartTypeEnum.Funnel) return 'size' === measure.encoding;
|
|
8
|
+
if (chartType === ChartTypeEnum.Heatmap) return 'color' === measure.encoding;
|
|
9
|
+
if ([
|
|
10
|
+
ChartTypeEnum.Pie,
|
|
11
|
+
ChartTypeEnum.Donut,
|
|
12
|
+
ChartTypeEnum.Rose,
|
|
13
|
+
ChartTypeEnum.RoseParallel
|
|
14
|
+
].includes(chartType)) return 'angle' === measure.encoding;
|
|
15
|
+
if (chartType === ChartTypeEnum.DualAxis) return [
|
|
16
|
+
'primaryYAxis',
|
|
17
|
+
'secondaryYAxis'
|
|
10
18
|
].includes(measure.encoding);
|
|
19
|
+
if (ChartTypeEnum.Radar === chartType) return 'radius' === measure.encoding;
|
|
20
|
+
if ([
|
|
21
|
+
ChartTypeEnum.Line,
|
|
22
|
+
ChartTypeEnum.Area,
|
|
23
|
+
ChartTypeEnum.AreaPercent,
|
|
24
|
+
ChartTypeEnum.Column,
|
|
25
|
+
ChartTypeEnum.ColumnParallel,
|
|
26
|
+
ChartTypeEnum.ColumnPercent
|
|
27
|
+
].includes(chartType)) return 'yAxis' === measure.encoding;
|
|
28
|
+
if ([
|
|
29
|
+
ChartTypeEnum.Bar,
|
|
30
|
+
ChartTypeEnum.BarParallel,
|
|
31
|
+
ChartTypeEnum.BarPercent
|
|
32
|
+
].includes(chartType)) return 'xAxis' === measure.encoding;
|
|
33
|
+
return chartType === ChartTypeEnum.Boxplot && 'value' === measure.encoding;
|
|
34
|
+
};
|
|
11
35
|
export { isMeasure, isMeasureGroup, isMeasures, isPositionMeasure };
|
|
12
36
|
|
|
13
37
|
//# sourceMappingURL=typeGuard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/utils/measures/typeGuard.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/measures/typeGuard.ts"],"sourcesContent":["import type { Measure, MeasureGroup } from 'src/types'\n\nexport const isMeasure = (measure: Measure | MeasureGroup): measure is Measure => {\n return !('children' in measure)\n}\n\nexport const isMeasureGroup = (measure: Measure | MeasureGroup): measure is MeasureGroup => {\n return 'children' in measure\n}\n\nexport const isMeasures = (measures: Measure[] | MeasureGroup[]): measures is Measure[] => {\n return measures.every(isMeasure)\n}\n\nexport const isPositionMeasure = (measure: Measure): boolean => {\n
|
|
1
|
+
{"version":3,"file":"pipeline/utils/measures/typeGuard.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/measures/typeGuard.ts"],"sourcesContent":["import type { Measure, MeasureGroup } from 'src/types'\nimport { ChartTypeEnum } from '../constant'\n\nexport const isMeasure = (measure: Measure | MeasureGroup): measure is Measure => {\n return !('children' in measure)\n}\n\nexport const isMeasureGroup = (measure: Measure | MeasureGroup): measure is MeasureGroup => {\n return 'children' in measure\n}\n\nexport const isMeasures = (measures: Measure[] | MeasureGroup[]): measures is Measure[] => {\n return measures.every(isMeasure)\n}\n\nexport const isPositionMeasure = (measure: Measure, chartType: string): boolean => {\n if (!measure.encoding) {\n return true\n }\n\n if (chartType === ChartTypeEnum.Funnel) {\n return measure.encoding === 'size'\n }\n\n if (chartType === ChartTypeEnum.Heatmap) {\n return measure.encoding === 'color'\n }\n\n if (\n ([ChartTypeEnum.Pie, ChartTypeEnum.Donut, ChartTypeEnum.Rose, ChartTypeEnum.RoseParallel] as string[]).includes(\n chartType,\n )\n ) {\n return measure.encoding === 'angle'\n }\n\n if (chartType === ChartTypeEnum.DualAxis) {\n return ['primaryYAxis', 'secondaryYAxis'].includes(measure.encoding as string)\n }\n\n if (ChartTypeEnum.Radar === chartType) {\n return measure.encoding === 'radius'\n }\n\n if (\n (\n [\n ChartTypeEnum.Line,\n ChartTypeEnum.Area,\n ChartTypeEnum.AreaPercent,\n ChartTypeEnum.Column,\n ChartTypeEnum.ColumnParallel,\n ChartTypeEnum.ColumnPercent,\n ] as string[]\n ).includes(chartType)\n ) {\n return measure.encoding === 'yAxis'\n }\n\n if (([ChartTypeEnum.Bar, ChartTypeEnum.BarParallel, ChartTypeEnum.BarPercent] as string[]).includes(chartType)) {\n return measure.encoding === 'xAxis'\n }\n\n return chartType === ChartTypeEnum.Boxplot && measure.encoding === 'value'\n}\n"],"names":["isMeasure","measure","isMeasureGroup","isMeasures","measures","isPositionMeasure","chartType","ChartTypeEnum"],"mappings":";AAGO,MAAMA,YAAY,CAACC,UACjB,CAAE,eAAcA,OAAM;AAGxB,MAAMC,iBAAiB,CAACD,UACtB,cAAcA;AAGhB,MAAME,aAAa,CAACC,WAClBA,SAAS,KAAK,CAACJ;AAGjB,MAAMK,oBAAoB,CAACJ,SAAkBK;IAClD,IAAI,CAACL,QAAQ,QAAQ,EACnB,OAAO;IAGT,IAAIK,cAAcC,cAAc,MAAM,EACpC,OAAON,AAAqB,WAArBA,QAAQ,QAAQ;IAGzB,IAAIK,cAAcC,cAAc,OAAO,EACrC,OAAON,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IACG;QAACM,cAAc,GAAG;QAAEA,cAAc,KAAK;QAAEA,cAAc,IAAI;QAAEA,cAAc,YAAY;KAAC,CAAc,QAAQ,CAC7GD,YAGF,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IAAIK,cAAcC,cAAc,QAAQ,EACtC,OAAO;QAAC;QAAgB;KAAiB,CAAC,QAAQ,CAACN,QAAQ,QAAQ;IAGrE,IAAIM,cAAc,KAAK,KAAKD,WAC1B,OAAOL,AAAqB,aAArBA,QAAQ,QAAQ;IAGzB,IAEI;QACEM,cAAc,IAAI;QAClBA,cAAc,IAAI;QAClBA,cAAc,WAAW;QACzBA,cAAc,MAAM;QACpBA,cAAc,cAAc;QAC5BA,cAAc,aAAa;KAC5B,CACD,QAAQ,CAACD,YAEX,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IAAK;QAACM,cAAc,GAAG;QAAEA,cAAc,WAAW;QAAEA,cAAc,UAAU;KAAC,CAAc,QAAQ,CAACD,YAClG,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,OAAOK,cAAcC,cAAc,OAAO,IAAIN,AAAqB,YAArBA,QAAQ,QAAQ;AAChE"}
|
|
@@ -11,7 +11,6 @@ const getLightLinearAxis = ()=>({
|
|
|
11
11
|
},
|
|
12
12
|
title: {
|
|
13
13
|
visible: false,
|
|
14
|
-
titleText: '',
|
|
15
14
|
titleColor: '#606773',
|
|
16
15
|
titleFontSize: 12,
|
|
17
16
|
titleFontWeight: 400
|
|
@@ -57,7 +56,6 @@ const getLightBandAxis = ()=>({
|
|
|
57
56
|
},
|
|
58
57
|
title: {
|
|
59
58
|
visible: false,
|
|
60
|
-
titleText: '',
|
|
61
59
|
titleColor: '#606773',
|
|
62
60
|
titleFontSize: 12,
|
|
63
61
|
titleFontWeight: 400
|
|
@@ -95,7 +93,6 @@ const getDarkLinearAxis = ()=>({
|
|
|
95
93
|
},
|
|
96
94
|
title: {
|
|
97
95
|
visible: false,
|
|
98
|
-
titleText: '',
|
|
99
96
|
titleColor: '#BBBDC3',
|
|
100
97
|
titleFontSize: 12,
|
|
101
98
|
titleFontWeight: 400
|
|
@@ -141,7 +138,6 @@ const getDarkBandAxis = ()=>({
|
|
|
141
138
|
},
|
|
142
139
|
title: {
|
|
143
140
|
visible: false,
|
|
144
|
-
titleText: '',
|
|
145
141
|
titleColor: '#BBBDC3',
|
|
146
142
|
titleFontSize: 12,
|
|
147
143
|
titleFontWeight: 400
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme/common/axes.js","sources":["webpack://@visactor/vseed/./src/theme/common/axes.ts"],"sourcesContent":["import type { YBandAxis, YLinearAxis } from 'src/types'\n\nexport const getLightLinearAxis = (): YLinearAxis => ({\n nice: true,\n zero: true,\n inverse: false,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#8F959E',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n
|
|
1
|
+
{"version":3,"file":"theme/common/axes.js","sources":["webpack://@visactor/vseed/./src/theme/common/axes.ts"],"sourcesContent":["import type { YBandAxis, YLinearAxis } from 'src/types'\n\nexport const getLightLinearAxis = (): YLinearAxis => ({\n nice: true,\n zero: true,\n inverse: false,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#8F959E',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleColor: '#606773',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#E3E5EB',\n gridWidth: 0.5,\n gridLineDash: [4, 2],\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#E3E5EB',\n },\n line: {\n visible: false,\n lineColor: '#E3E5EB',\n lineWidth: 1,\n },\n})\n\nexport const getLightBandAxis = (): YBandAxis => ({\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#8F959E',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleColor: '#606773',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#E3E5EB',\n gridWidth: 0.5,\n gridLineDash: [4, 2],\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#E3E5EB',\n },\n line: {\n visible: true,\n lineColor: '#E3E5EB',\n lineWidth: 1,\n },\n})\n\nexport const getDarkLinearAxis = (): YLinearAxis => ({\n nice: true,\n zero: true,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#888C93',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleColor: '#BBBDC3',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#303339',\n gridWidth: 0.5,\n gridLineDash: [4, 2],\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#303339',\n },\n line: {\n visible: false,\n lineColor: '#303339',\n lineWidth: 1,\n },\n})\n\nexport const getDarkBandAxis = (): YBandAxis => ({\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#888C93',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleColor: '#BBBDC3',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#303339',\n gridWidth: 0.5,\n gridLineDash: [4, 2],\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#303339',\n },\n line: {\n visible: true,\n lineColor: '#303339',\n lineWidth: 1,\n },\n})\n"],"names":["getLightLinearAxis","getLightBandAxis","getDarkLinearAxis","getDarkBandAxis"],"mappings":"AAEO,MAAMA,qBAAqB,IAAoB;QACpD,MAAM;QACN,MAAM;QACN,SAAS;QACT,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;YACX,cAAc;gBAAC;gBAAG;aAAE;QACtB;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;AAEO,MAAMC,mBAAmB,IAAkB;QAChD,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;SAAI;QACxC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;YACX,cAAc;gBAAC;gBAAG;aAAE;QACtB;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;AAEO,MAAMC,oBAAoB,IAAoB;QACnD,MAAM;QACN,MAAM;QACN,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;YACX,cAAc;gBAAC;gBAAG;aAAE;QACtB;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;AAEO,MAAMC,kBAAkB,IAAkB;QAC/C,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;SAAI;QACxC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;YACX,cAAc;gBAAC;gBAAG;aAAE;QACtB;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const getLightBrushConfig = ()=>({
|
|
2
|
+
enable: false,
|
|
3
|
+
inBrushStyle: {
|
|
4
|
+
opacity: 1
|
|
5
|
+
},
|
|
6
|
+
outOfBrushStyle: {
|
|
7
|
+
opacity: 0.2
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
const getDarkBrushConfig = ()=>({
|
|
11
|
+
enable: false,
|
|
12
|
+
inBrushStyle: {
|
|
13
|
+
opacity: 1
|
|
14
|
+
},
|
|
15
|
+
outOfBrushStyle: {
|
|
16
|
+
opacity: 0.25
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export { getDarkBrushConfig, getLightBrushConfig };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=brush.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme/common/brush.js","sources":["webpack://@visactor/vseed/./src/theme/common/brush.ts"],"sourcesContent":["import type { BrushConfig } from 'src/types'\n\nexport const getLightBrushConfig = (): BrushConfig => ({\n enable: false,\n inBrushStyle: {\n opacity: 1,\n },\n outOfBrushStyle: {\n opacity: 0.2,\n },\n})\n\nexport const getDarkBrushConfig = (): BrushConfig => ({\n enable: false,\n inBrushStyle: {\n opacity: 1,\n },\n outOfBrushStyle: {\n opacity: 0.25,\n },\n})\n"],"names":["getLightBrushConfig","getDarkBrushConfig"],"mappings":"AAEO,MAAMA,sBAAsB,IAAoB;QACrD,QAAQ;QACR,cAAc;YACZ,SAAS;QACX;QACA,iBAAiB;YACf,SAAS;QACX;IACF;AAEO,MAAMC,qBAAqB,IAAoB;QACpD,QAAQ;QACR,cAAc;YACZ,SAAS;QACX;QACA,iBAAiB;YACf,SAAS;QACX;IACF"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const getLightHeatmapCellTheme = ()=>({
|
|
2
|
-
stroke: '#fff'
|
|
2
|
+
stroke: '#fff',
|
|
3
|
+
hoverShadowColor: '#404349'
|
|
3
4
|
});
|
|
4
5
|
const getDarkHeatmapCellTheme = ()=>({
|
|
5
|
-
stroke: '#404349'
|
|
6
|
+
stroke: '#404349',
|
|
7
|
+
hoverShadowColor: '#404349'
|
|
6
8
|
});
|
|
7
9
|
export { getDarkHeatmapCellTheme, getLightHeatmapCellTheme };
|
|
8
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme/common/heatmapCell.js","sources":["webpack://@visactor/vseed/./src/theme/common/heatmapCell.ts"],"sourcesContent":["import type { HeatmapCell } from 'src/types/properties/config/heatmap/heatmap'\n\nexport const getLightHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#fff',\n }\n}\n\nexport const getDarkHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#404349',\n }\n}\n"],"names":["getLightHeatmapCellTheme","getDarkHeatmapCellTheme"],"mappings":"AAEO,MAAMA,2BAA2B,IAC/B;QACL,QAAQ;
|
|
1
|
+
{"version":3,"file":"theme/common/heatmapCell.js","sources":["webpack://@visactor/vseed/./src/theme/common/heatmapCell.ts"],"sourcesContent":["import type { HeatmapCell } from 'src/types/properties/config/heatmap/heatmap'\n\nexport const getLightHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#fff',\n hoverShadowColor: '#404349',\n }\n}\n\nexport const getDarkHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#404349',\n hoverShadowColor: '#404349',\n }\n}\n"],"names":["getLightHeatmapCellTheme","getDarkHeatmapCellTheme"],"mappings":"AAEO,MAAMA,2BAA2B,IAC/B;QACL,QAAQ;QACR,kBAAkB;IACpB;AAGK,MAAMC,0BAA0B,IAC9B;QACL,QAAQ;QACR,kBAAkB;IACpB"}
|
|
@@ -24,3 +24,21 @@ export declare const getLightLabel: () => {
|
|
|
24
24
|
labelColorSmartInvert: boolean;
|
|
25
25
|
labelOverlap: boolean;
|
|
26
26
|
};
|
|
27
|
+
export declare const getFunnelDarkLabel: () => {
|
|
28
|
+
labelColor: string;
|
|
29
|
+
enable: boolean;
|
|
30
|
+
wrap: boolean;
|
|
31
|
+
showValue: boolean;
|
|
32
|
+
showValuePercent: boolean;
|
|
33
|
+
labelColorSmartInvert: boolean;
|
|
34
|
+
labelOverlap: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare const getFunnelLightLabel: () => {
|
|
37
|
+
labelColor: string;
|
|
38
|
+
enable: boolean;
|
|
39
|
+
wrap: boolean;
|
|
40
|
+
showValue: boolean;
|
|
41
|
+
showValuePercent: boolean;
|
|
42
|
+
labelColorSmartInvert: boolean;
|
|
43
|
+
labelOverlap: boolean;
|
|
44
|
+
};
|
|
@@ -14,6 +14,14 @@ const getLightLabel = ()=>({
|
|
|
14
14
|
...getDefaultLabel(),
|
|
15
15
|
labelStroke: '#fff'
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
const getFunnelDarkLabel = ()=>({
|
|
18
|
+
...getDefaultLabel(),
|
|
19
|
+
labelColor: '#fff'
|
|
20
|
+
});
|
|
21
|
+
const getFunnelLightLabel = ()=>({
|
|
22
|
+
...getDefaultLabel(),
|
|
23
|
+
labelColor: '#fff'
|
|
24
|
+
});
|
|
25
|
+
export { getDarkLabel, getDefaultLabel, getFunnelDarkLabel, getFunnelLightLabel, getLightLabel };
|
|
18
26
|
|
|
19
27
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme/common/label.js","sources":["webpack://@visactor/vseed/./src/theme/common/label.ts"],"sourcesContent":["export const getDefaultLabel = () => ({\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n})\n\nexport const getDarkLabel = () => ({\n ...getDefaultLabel(),\n labelStroke: '#21252C',\n})\n\nexport const getLightLabel = () => ({\n ...getDefaultLabel(),\n labelStroke: '#fff',\n})\n"],"names":["getDefaultLabel","getDarkLabel","getLightLabel"],"mappings":"AAAO,MAAMA,kBAAkB,IAAO;QACpC,QAAQ;QACR,MAAM;QACN,WAAW;QACX,kBAAkB;QAClB,uBAAuB;QACvB,cAAc;IAChB;AAEO,MAAMC,eAAe,IAAO;QACjC,GAAGD,iBAAiB;QACpB,aAAa;IACf;AAEO,MAAME,gBAAgB,IAAO;QAClC,GAAGF,iBAAiB;QACpB,aAAa;IACf"}
|
|
1
|
+
{"version":3,"file":"theme/common/label.js","sources":["webpack://@visactor/vseed/./src/theme/common/label.ts"],"sourcesContent":["export const getDefaultLabel = () => ({\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n})\n\nexport const getDarkLabel = () => ({\n ...getDefaultLabel(),\n labelStroke: '#21252C',\n})\n\nexport const getLightLabel = () => ({\n ...getDefaultLabel(),\n labelStroke: '#fff',\n})\n\nexport const getFunnelDarkLabel = () => ({\n ...getDefaultLabel(),\n labelColor: '#fff',\n})\n\nexport const getFunnelLightLabel = () => ({\n ...getDefaultLabel(),\n labelColor: '#fff',\n})\n"],"names":["getDefaultLabel","getDarkLabel","getLightLabel","getFunnelDarkLabel","getFunnelLightLabel"],"mappings":"AAAO,MAAMA,kBAAkB,IAAO;QACpC,QAAQ;QACR,MAAM;QACN,WAAW;QACX,kBAAkB;QAClB,uBAAuB;QACvB,cAAc;IAChB;AAEO,MAAMC,eAAe,IAAO;QACjC,GAAGD,iBAAiB;QACpB,aAAa;IACf;AAEO,MAAME,gBAAgB,IAAO;QAClC,GAAGF,iBAAiB;QACpB,aAAa;IACf;AAEO,MAAMG,qBAAqB,IAAO;QACvC,GAAGH,iBAAiB;QACpB,YAAY;IACd;AAEO,MAAMI,sBAAsB,IAAO;QACxC,GAAGJ,iBAAiB;QACpB,YAAY;IACd"}
|