@visactor/vseed 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/advanced/colorItems.d.ts +4 -1
- package/dist/esm/builder/builder/advanced/colorItems.js +1 -1
- package/dist/esm/builder/builder/advanced/colorItems.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +4392 -3
- package/dist/esm/dataReshape/constant.d.ts +1 -0
- package/dist/esm/dataReshape/constant.js +2 -1
- package/dist/esm/dataReshape/constant.js.map +1 -1
- package/dist/esm/dataReshape/dataReshapeByEncoding.d.ts +1 -0
- package/dist/esm/dataReshape/dataReshapeByEncoding.js +3 -2
- package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
- package/dist/esm/dataReshape/foldMeasures.d.ts +1 -0
- package/dist/esm/dataReshape/foldMeasures.js +5 -2
- package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
- package/dist/esm/dataReshape/unfoldDimensions.js +14 -9
- package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
- package/dist/esm/dataSelector/selector.d.ts +1 -1
- package/dist/esm/dataSelector/selector.js +1 -2
- package/dist/esm/dataSelector/selector.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +4 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js +3 -6
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +35 -2
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/{defaultMeasureName.d.ts → defaultMeasureId.d.ts} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureId.js +16 -0
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureId.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/default/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/index.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js +4 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +5 -5
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +6 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +7 -7
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +6 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +4 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +22 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +6 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +22 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipeline/pivotTable.js +3 -2
- package/dist/esm/pipeline/advanced/table/pipeline/pivotTable.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipeline/table.js +2 -1
- package/dist/esm/pipeline/advanced/table/pipeline/table.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/{default/defaultMeasureName.d.ts → cellStyle/cellStyle.d.ts} +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/cellStyle/cellStyle.js +16 -0
- package/dist/esm/pipeline/advanced/table/pipes/cellStyle/cellStyle.js.map +1 -0
- package/dist/esm/pipeline/advanced/table/pipes/cellStyle/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/table/pipes/cellStyle/index.js +2 -0
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureId.d.ts +2 -0
- package/dist/esm/pipeline/advanced/table/pipes/default/{defaultMeasureName.js → defaultMeasureId.js} +5 -5
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureId.js.map +1 -0
- package/dist/esm/pipeline/advanced/table/pipes/default/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/index.js +2 -2
- package/dist/esm/pipeline/advanced/table/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/table/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +22 -3
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +20 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js +24 -11
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/color.d.ts +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/color.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/color.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js +4 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +4 -3
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js +5 -7
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +23 -6
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +39 -34
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js +10 -3
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +6 -3
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.d.ts +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.js +31 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipeline/pivotTable.js +3 -2
- package/dist/esm/pipeline/spec/table/pipeline/pivotTable.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipeline/table.js +3 -2
- package/dist/esm/pipeline/spec/table/pipeline/table.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.d.ts +2 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js +14 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/index.js +2 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.d.ts +2 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js +49 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.d.ts +2 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js +41 -0
- package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/table/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js +13 -3
- package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js.map +1 -1
- package/dist/esm/pipeline/utils/constant.d.ts +3 -1
- package/dist/esm/pipeline/utils/constant.js +4 -2
- package/dist/esm/pipeline/utils/constant.js.map +1 -1
- package/dist/esm/pipeline/utils/measures/depth.js.map +1 -1
- package/dist/esm/pipeline/utils/measures/find.js.map +1 -1
- package/dist/esm/pipeline/utils/tree/traverse.d.ts +1 -11
- package/dist/esm/pipeline/utils/tree/traverse.js +3 -4
- package/dist/esm/pipeline/utils/tree/traverse.js.map +1 -1
- package/dist/esm/theme/common/axes.js +2 -2
- package/dist/esm/theme/common/axes.js.map +1 -1
- package/dist/esm/theme/common/table.d.ts +30 -22
- package/dist/esm/theme/common/table.js +12 -2
- package/dist/esm/theme/common/table.js.map +1 -1
- package/dist/esm/theme/common/tooltip.d.ts +3 -2
- package/dist/esm/theme/common/tooltip.js +24 -2
- package/dist/esm/theme/common/tooltip.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +2 -2
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +2 -2
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +3446 -1
- package/dist/esm/types/advancedVSeed.js +2 -0
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/builder/builder.d.ts +4 -1
- package/dist/esm/types/builder/builder.js.map +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +80 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +80 -0
- package/dist/esm/types/chartType/bar/zBar.d.ts +80 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +80 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +80 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +80 -0
- package/dist/esm/types/chartType/column/zColumn.d.ts +82 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +80 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +80 -0
- package/dist/esm/types/chartType/donut/zDonut.d.ts +80 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +80 -0
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +80 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +80 -0
- package/dist/esm/types/chartType/histogram/histogram.d.ts +2 -2
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +88 -4
- package/dist/esm/types/chartType/histogram/zHistogram.js +2 -2
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +80 -0
- package/dist/esm/types/chartType/pie/zPie.d.ts +80 -0
- package/dist/esm/types/chartType/pivotTable/pivotTable.d.ts +5 -1
- package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +76 -0
- package/dist/esm/types/chartType/pivotTable/zPivotTable.js +2 -1
- package/dist/esm/types/chartType/pivotTable/zPivotTable.js.map +1 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +80 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +80 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +80 -0
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +88 -0
- package/dist/esm/types/chartType/table/table.d.ts +5 -1
- package/dist/esm/types/chartType/table/zTable.d.ts +76 -0
- package/dist/esm/types/chartType/table/zTable.js +2 -1
- package/dist/esm/types/chartType/table/zTable.js.map +1 -1
- package/dist/esm/types/properties/cellStyle/bodyCellStyle.d.ts +138 -0
- package/dist/esm/types/properties/cellStyle/bodyCellStyle.js +16 -0
- package/dist/esm/types/properties/cellStyle/bodyCellStyle.js.map +1 -0
- package/dist/esm/types/properties/cellStyle/cellStyle.d.ts +80 -0
- package/dist/esm/types/properties/cellStyle/cellStyle.js +8 -0
- package/dist/esm/types/properties/cellStyle/cellStyle.js.map +1 -0
- package/dist/esm/types/properties/cellStyle/index.d.ts +1 -0
- package/dist/esm/types/properties/cellStyle/index.js +1 -0
- package/dist/esm/types/properties/config/area.d.ts +164 -0
- package/dist/esm/types/properties/config/bar.d.ts +246 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +82 -0
- package/dist/esm/types/properties/config/column.d.ts +258 -0
- package/dist/esm/types/properties/config/config.d.ts +1676 -0
- package/dist/esm/types/properties/config/dualAxis.d.ts +82 -0
- package/dist/esm/types/properties/config/funnel.d.ts +82 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +82 -0
- package/dist/esm/types/properties/config/histogram.d.ts +94 -0
- package/dist/esm/types/properties/config/label/label.d.ts +5 -0
- package/dist/esm/types/properties/config/label/zLabel.d.ts +69 -0
- package/dist/esm/types/properties/config/label/zLabel.js +6 -1
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
- package/dist/esm/types/properties/config/label/zPieLabel.d.ts +69 -0
- package/dist/esm/types/properties/config/line.d.ts +82 -0
- package/dist/esm/types/properties/config/pie.d.ts +246 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +2 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +3 -1
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
- package/dist/esm/types/properties/config/rose.d.ts +164 -0
- package/dist/esm/types/properties/config/scatter.d.ts +94 -0
- package/dist/esm/types/properties/config/tooltip/tooltip.d.ts +12 -0
- package/dist/esm/types/properties/config/tooltip/tooltip.js +12 -1
- package/dist/esm/types/properties/config/tooltip/tooltip.js.map +1 -1
- package/dist/esm/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +4 -1
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +8 -2
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js +4 -1
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js.map +1 -1
- package/dist/esm/types/properties/index.d.ts +1 -0
- package/dist/esm/types/properties/index.js +1 -0
- package/dist/esm/types/properties/markStyle/barStyle.d.ts +5 -0
- package/dist/esm/types/properties/markStyle/barStyle.js.map +1 -1
- package/dist/esm/types/properties/regressionLine/ecdfRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.d.ts +18 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js +1 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +3352 -0
- package/dist/esm/types/zVseed.d.ts +1890 -124
- package/dist/umd/index.js +840 -446
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureName.js +0 -16
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureName.js.map +0 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureName.js.map +0 -1
|
@@ -16,7 +16,20 @@ const reshapeWithHistogramEncoding = (advancedVSeed, context)=>{
|
|
|
16
16
|
const binStep = chartConfig?.binStep;
|
|
17
17
|
const binValueType = chartConfig?.binValueType;
|
|
18
18
|
let newDatasets = [];
|
|
19
|
-
let foldInfo = {
|
|
19
|
+
let foldInfo = {
|
|
20
|
+
foldMap: {},
|
|
21
|
+
measureId: FoldMeasureId,
|
|
22
|
+
measureName: FoldMeasureName,
|
|
23
|
+
measureValue: FoldMeasureValue,
|
|
24
|
+
statistics: {
|
|
25
|
+
max: -1 / 0,
|
|
26
|
+
min: 1 / 0,
|
|
27
|
+
sum: 0,
|
|
28
|
+
count: 0,
|
|
29
|
+
colorMin: 1 / 0,
|
|
30
|
+
colorMax: -1 / 0
|
|
31
|
+
}
|
|
32
|
+
};
|
|
20
33
|
let unfoldInfo = {};
|
|
21
34
|
const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
|
|
22
35
|
const allMeasures = findAllMeasures(measures);
|
|
@@ -41,8 +54,15 @@ const reshapeWithHistogramEncoding = (advancedVSeed, context)=>{
|
|
|
41
54
|
binData.forEach((datum)=>{
|
|
42
55
|
datum[FoldMeasureId] = valueField;
|
|
43
56
|
datum[FoldMeasureName] = m?.alias ?? valueField;
|
|
44
|
-
|
|
57
|
+
const valueNumber = 'percentage' === binValueType ? +datum[BinPercentageMeasureId] : +datum[BinCountMeasureId];
|
|
58
|
+
datum[FoldMeasureValue] = valueNumber;
|
|
59
|
+
datum[valueField] = valueNumber;
|
|
60
|
+
foldInfo.statistics.min = Math.min(foldInfo.statistics.min, valueNumber);
|
|
61
|
+
foldInfo.statistics.max = Math.max(foldInfo.statistics.max, valueNumber);
|
|
62
|
+
foldInfo.statistics.sum += valueNumber;
|
|
63
|
+
foldInfo.statistics.count++;
|
|
45
64
|
});
|
|
65
|
+
if (m?.id) foldInfo.foldMap[m?.id] = m?.alias;
|
|
46
66
|
const res = unfoldDimensions(binData, uniqDims, encoding, {
|
|
47
67
|
foldMeasureId: FoldMeasureId,
|
|
48
68
|
separator: Separator,
|
|
@@ -60,7 +80,6 @@ const reshapeWithHistogramEncoding = (advancedVSeed, context)=>{
|
|
|
60
80
|
res.dataset.forEach((datum)=>{
|
|
61
81
|
datum[BinStartMeasureId] = datum[encoding.x0[0]];
|
|
62
82
|
datum[BinEndMeasureId] = datum[encoding.x1[0]];
|
|
63
|
-
datum[FoldMeasureId] = datum[encoding.y[0]];
|
|
64
83
|
});
|
|
65
84
|
newDatasets = res.dataset;
|
|
66
85
|
foldInfo = res.foldInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.ts"],"sourcesContent":["import {\n BinCountMeasureId,\n BinEndMeasureId,\n BinPercentageMeasureId,\n BinStartMeasureId,\n dataReshapeByEncoding,\n FoldMeasureId,\n FoldMeasureName,\n FoldMeasureValue,\n Separator,\n unfoldDimensions,\n} from 'src/dataReshape'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Dataset, Dimension, Encoding } from 'src/types'\nimport { bin } from '@visactor/vdataset'\nimport { uniqueBy } from 'remeda'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes/color/colorAdapter'\n\nexport const reshapeWithHistogramEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed\n const uniqDims = uniqueBy(dimensions, (item) => item.id)\n const chartConfig = config?.[chartType as 'histogram']\n const binCount = chartConfig?.binCount\n const binStep = chartConfig?.binStep\n const binValueType = chartConfig?.binValueType\n\n let newDatasets: any[] = []\n let foldInfo:
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.ts"],"sourcesContent":["import {\n BinCountMeasureId,\n BinEndMeasureId,\n BinPercentageMeasureId,\n BinStartMeasureId,\n dataReshapeByEncoding,\n FoldMeasureId,\n FoldMeasureName,\n FoldMeasureValue,\n Separator,\n unfoldDimensions,\n} from 'src/dataReshape'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Dataset, Dimension, Encoding, FoldInfo } from 'src/types'\nimport { bin } from '@visactor/vdataset'\nimport { uniqueBy } from 'remeda'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes/color/colorAdapter'\n\nexport const reshapeWithHistogramEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed\n const uniqDims = uniqueBy(dimensions, (item) => item.id)\n const chartConfig = config?.[chartType as 'histogram']\n const binCount = chartConfig?.binCount\n const binStep = chartConfig?.binStep\n const binValueType = chartConfig?.binValueType\n\n let newDatasets: any[] = []\n let foldInfo: FoldInfo = {\n foldMap: {},\n measureId: FoldMeasureId,\n measureName: FoldMeasureName,\n measureValue: FoldMeasureValue,\n statistics: {\n max: -Infinity,\n min: Infinity,\n sum: 0,\n count: 0,\n colorMin: Infinity,\n colorMax: -Infinity,\n },\n }\n let unfoldInfo: any = {}\n\n const colorMeasureId = getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed)\n const allMeasures = findAllMeasures(measures)\n\n if (encoding.value?.length) {\n const valueField = encoding.value[0]\n const m = allMeasures.find((m) => m.id === valueField)\n const binData = bin(dataset, {\n field: valueField,\n groupField: [...(encoding.x ?? []), ...(encoding.color ?? [])] as string[],\n bins: binCount,\n step: binStep,\n outputNames: {\n x0: BinStartMeasureId,\n x1: BinEndMeasureId,\n count: BinCountMeasureId,\n percentage: BinPercentageMeasureId,\n },\n }) as Dataset\n\n binData.forEach((datum) => {\n datum[FoldMeasureId] = valueField\n datum[FoldMeasureName] = m?.alias ?? valueField\n const valueNumber = binValueType === 'percentage' ? +datum[BinPercentageMeasureId] : +datum[BinCountMeasureId]\n datum[FoldMeasureValue] = valueNumber\n datum[valueField] = valueNumber\n foldInfo.statistics.min = Math.min(foldInfo.statistics.min, valueNumber)\n foldInfo.statistics.max = Math.max(foldInfo.statistics.max, valueNumber)\n foldInfo.statistics.sum += valueNumber\n foldInfo.statistics.count++\n })\n if (m?.id) {\n foldInfo.foldMap[m?.id] = m?.alias\n }\n\n const res = unfoldDimensions(binData, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((d) => {\n newDatasets.push(d)\n })\n unfoldInfo = res.unfoldInfo\n } else if (encoding.x0?.length && encoding.x1?.length && encoding.y?.length) {\n const res = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item: Dimension) => item.id),\n findAllMeasures(measures)\n .filter((item) => encoding.y?.includes(item.id))\n .slice(0, 1),\n encoding as Encoding,\n {\n colorItemAsId: false,\n colorMeasureId,\n },\n )\n\n res.dataset.forEach((datum) => {\n datum[BinStartMeasureId] = datum[encoding.x0![0]]\n datum[BinEndMeasureId] = datum[encoding.x1![0]]\n })\n\n newDatasets = res.dataset\n foldInfo = res.foldInfo\n unfoldInfo = res.unfoldInfo\n }\n\n return {\n ...result,\n dataset: newDatasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo,\n unfoldInfo,\n },\n ],\n dimensions,\n measures,\n }\n}\n"],"names":["reshapeWithHistogramEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","config","uniqDims","uniqueBy","item","chartConfig","binCount","binStep","binValueType","newDatasets","foldInfo","FoldMeasureId","FoldMeasureName","FoldMeasureValue","Infinity","unfoldInfo","colorMeasureId","getColorMeasureId","allMeasures","findAllMeasures","valueField","m","binData","bin","BinStartMeasureId","BinEndMeasureId","BinCountMeasureId","BinPercentageMeasureId","datum","valueNumber","Math","res","unfoldDimensions","Separator","d","dataReshapeByEncoding","String"],"mappings":";;;;;AAkBO,MAAMA,+BAA6C,CAACC,eAAeC;IACxE,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,WAAW,CAAC,CAAC,EAAEC,MAAM,EAAE,GAAGT;IAClE,MAAMU,WAAWC,SAASL,YAAY,CAACM,OAASA,KAAK,EAAE;IACvD,MAAMC,cAAcJ,QAAQ,CAACJ,UAAyB;IACtD,MAAMS,WAAWD,aAAa;IAC9B,MAAME,UAAUF,aAAa;IAC7B,MAAMG,eAAeH,aAAa;IAElC,IAAII,cAAqB,EAAE;IAC3B,IAAIC,WAAqB;QACvB,SAAS,CAAC;QACV,WAAWC;QACX,aAAaC;QACb,cAAcC;QACd,YAAY;YACV,KAAK,CAACC;YACN,KAAKA;YACL,KAAK;YACL,OAAO;YACP,UAAUA;YACV,UAAU,CAACA;QACb;IACF;IACA,IAAIC,aAAkB,CAAC;IAEvB,MAAMC,iBAAiBC,kBAAkBzB,eAAgCG;IACzE,MAAMuB,cAAcC,gBAAgBpB;IAEpC,IAAIC,SAAS,KAAK,EAAE,QAAQ;QAC1B,MAAMoB,aAAapB,SAAS,KAAK,CAAC,EAAE;QACpC,MAAMqB,IAAIH,YAAY,IAAI,CAAC,CAACG,IAAMA,EAAE,EAAE,KAAKD;QAC3C,MAAME,UAAUC,IAAI3B,SAAS;YAC3B,O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K,OAASJ,SAAS,CAAC,EAAE,SAASI,KAAK,EAAE,GAC7C,KAAK,CAAC,GAAG,IACZJ,UACA;YACE,eAAe;YACfgB;QACF;QAGFe,IAAI,OAAO,CAAC,OAAO,CAAC,CAACH;YACnBA,KAAK,CAACJ,kBAAkB,GAAGI,KAAK,CAAC5B,SAAS,EAAG,CAAC,EAAE,CAAC;YACjD4B,KAAK,CAACH,gBAAgB,GAAGG,KAAK,CAAC5B,SAAS,EAAG,CAAC,EAAE,CAAC;QACjD;QAEAS,cAAcsB,IAAI,OAAO;QACzBrB,WAAWqB,IAAI,QAAQ;QACvBhB,aAAagB,IAAI,UAAU;IAC7B;IAEA,OAAO;QACL,GAAGrC,MAAM;QACT,SAASe;QACT,oBAAoB;YAClB;gBACE,IAAI2B,OAAOvC;gBACX,OAAO;gBACPa;gBACAK;YACF;SACD;QACDjB;QACAC;IACF;AACF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { theme } from "../../chart/pipes/index.js";
|
|
2
|
-
import { defaultDimensions,
|
|
2
|
+
import { cellStyle, defaultDimensions, defaultMeasureId, defaultMeasures, encodingForPivotTable, initAdvancedVSeed, pivotTableConfig, reshapePivotTable } from "../pipes/index.js";
|
|
3
3
|
const pivotTableAdvancedPipeline = [
|
|
4
4
|
initAdvancedVSeed,
|
|
5
5
|
defaultMeasures,
|
|
6
6
|
defaultDimensions,
|
|
7
|
-
|
|
7
|
+
defaultMeasureId,
|
|
8
|
+
cellStyle,
|
|
8
9
|
encodingForPivotTable,
|
|
9
10
|
reshapePivotTable,
|
|
10
11
|
pivotTableConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/table/pipeline/pivotTable.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipeline/pivotTable.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport { theme } from '../../chart/pipes'\nimport {\n defaultDimensions,\n
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/table/pipeline/pivotTable.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipeline/pivotTable.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport { theme } from '../../chart/pipes'\nimport {\n cellStyle,\n defaultDimensions,\n defaultMeasureId,\n defaultMeasures,\n encodingForPivotTable,\n initAdvancedVSeed,\n pivotTableConfig,\n reshapePivotTable,\n} from '../pipes'\n\nexport const pivotTableAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureId,\n cellStyle,\n\n encodingForPivotTable,\n reshapePivotTable,\n pivotTableConfig,\n theme,\n]\n"],"names":["pivotTableAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","defaultMeasureId","cellStyle","encodingForPivotTable","reshapePivotTable","pivotTableConfig","theme"],"mappings":";;AAaO,MAAMA,6BAA+C;IAC1DC;IACAC;IACAC;IACAC;IACAC;IAEAC;IACAC;IACAC;IACAC;CACD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defaultDimensions, defaultMeasures, initAdvancedVSeed, records, tableConfig } from "../pipes/index.js";
|
|
1
|
+
import { cellStyle, defaultDimensions, defaultMeasures, initAdvancedVSeed, records, tableConfig } from "../pipes/index.js";
|
|
2
2
|
import { theme } from "../../chart/pipes/index.js";
|
|
3
3
|
const tableAdvancedPipeline = [
|
|
4
4
|
initAdvancedVSeed,
|
|
5
5
|
defaultMeasures,
|
|
6
6
|
defaultDimensions,
|
|
7
|
+
cellStyle,
|
|
7
8
|
records,
|
|
8
9
|
tableConfig,
|
|
9
10
|
theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/table/pipeline/table.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipeline/table.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport { initAdvancedVSeed, records, tableConfig, defaultMeasures, defaultDimensions } from '../pipes'\nimport { theme } from '../../chart/pipes'\n\nexport const tableAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n\n records,\n tableConfig,\n theme,\n]\n"],"names":["tableAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","records","tableConfig","theme"],"mappings":";;AAIO,MAAMA,wBAA0C;IACrDC;IACAC;IACAC;IAEAC;IACAC;IACAC;CACD"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/table/pipeline/table.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipeline/table.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport { initAdvancedVSeed, records, tableConfig, defaultMeasures, defaultDimensions, cellStyle } from '../pipes'\nimport { theme } from '../../chart/pipes'\n\nexport const tableAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n cellStyle,\n\n records,\n tableConfig,\n theme,\n]\n"],"names":["tableAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","cellStyle","records","tableConfig","theme"],"mappings":";;AAIO,MAAMA,wBAA0C;IACrDC;IACAC;IACAC;IACAC;IAEAC;IACAC;IACAC;CACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AdvancedPipe } from '../../../../../types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const cellStyle: AdvancedPipe;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pick } from "remeda";
|
|
2
|
+
import { replaceNullToUndefined } from "../../../../utils/index.js";
|
|
3
|
+
const cellStyle = (advancedVSeed, context)=>{
|
|
4
|
+
const { vseed } = context;
|
|
5
|
+
const pickedCellStyle = pick(vseed, [
|
|
6
|
+
'bodyCellStyle'
|
|
7
|
+
]);
|
|
8
|
+
const style = replaceNullToUndefined(pickedCellStyle);
|
|
9
|
+
return {
|
|
10
|
+
...advancedVSeed,
|
|
11
|
+
cellStyle: style
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export { cellStyle };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=cellStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/table/pipes/cellStyle/cellStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipes/cellStyle/cellStyle.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed } from 'src/types'\n\nexport const cellStyle: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n\n const pickedCellStyle = pick(vseed, ['bodyCellStyle']) as AdvancedVSeed['cellStyle']\n\n const style = replaceNullToUndefined(pickedCellStyle)\n\n return { ...advancedVSeed, cellStyle: style }\n}\n"],"names":["cellStyle","advancedVSeed","context","vseed","pickedCellStyle","pick","style","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,YAA0B,CAACC,eAAeC;IACrD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAElB,MAAME,kBAAkBC,KAAKF,OAAO;QAAC;KAAgB;IAErD,MAAMG,QAAQC,uBAAuBH;IAErC,OAAO;QAAE,GAAGH,aAAa;QAAE,WAAWK;IAAM;AAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cellStyle } from './cellStyle';
|
package/dist/esm/pipeline/advanced/table/pipes/default/{defaultMeasureName.js → defaultMeasureId.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { MeasureName } from "../../../../../dataReshape/index.js";
|
|
1
|
+
import { MeasureId, MeasureName } from "../../../../../dataReshape/index.js";
|
|
2
2
|
import { intl } from "../../../../../i18n/index.js";
|
|
3
3
|
import { findAllMeasures } from "../../../../utils/measures/find.js";
|
|
4
|
-
const
|
|
4
|
+
const defaultMeasureId = (advancedVSeed)=>{
|
|
5
5
|
const result = {
|
|
6
6
|
...advancedVSeed
|
|
7
7
|
};
|
|
8
8
|
const measures = findAllMeasures(advancedVSeed.measures);
|
|
9
9
|
if (measures.length > 1 && !result.dimensions?.some((dim)=>dim.id === MeasureName)) result.dimensions?.push({
|
|
10
|
-
id:
|
|
10
|
+
id: MeasureId,
|
|
11
11
|
alias: intl.i18n`指标名称`,
|
|
12
12
|
encoding: 'row'
|
|
13
13
|
});
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
|
-
export {
|
|
16
|
+
export { defaultMeasureId };
|
|
17
17
|
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=defaultMeasureId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/table/pipes/default/defaultMeasureId.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/table/pipes/default/defaultMeasureId.ts"],"sourcesContent":["import { MeasureId, MeasureName } from 'src/dataReshape'\nimport { intl } from 'src/i18n'\nimport { findAllMeasures } from 'src/pipeline/utils/measures/find'\nimport type { AdvancedPipe, Dimension, DimensionTree } from 'src/types'\n\nexport const defaultMeasureId: AdvancedPipe = (advancedVSeed) => {\n const result = { ...advancedVSeed }\n const measures = findAllMeasures(advancedVSeed.measures as DimensionTree)\n\n // 如果没有指标名称维度,则默认添加指标名称维度\n if (measures.length > 1 && !result.dimensions?.some((dim) => dim.id === MeasureName)) {\n result.dimensions?.push({\n id: MeasureId,\n alias: intl.i18n`指标名称`,\n encoding: 'row',\n } as Dimension)\n }\n\n return result\n}\n"],"names":["defaultMeasureId","advancedVSeed","result","measures","findAllMeasures","dim","MeasureName","MeasureId","intl"],"mappings":";;;AAKO,MAAMA,mBAAiC,CAACC;IAC7C,MAAMC,SAAS;QAAE,GAAGD,aAAa;IAAC;IAClC,MAAME,WAAWC,gBAAgBH,cAAc,QAAQ;IAGvD,IAAIE,SAAS,MAAM,GAAG,KAAK,CAACD,OAAO,UAAU,EAAE,KAAK,CAACG,MAAQA,IAAI,EAAE,KAAKC,cACtEJ,OAAO,UAAU,EAAE,KAAK;QACtB,IAAIK;QACJ,OAAOC,KAAK,IAAI,CAAC,IAAI,CAAC;QACtB,UAAU;IACZ;IAGF,OAAON;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defaultMeasures } from "./defaultMeasures.js";
|
|
2
|
-
import {
|
|
2
|
+
import { defaultMeasureId } from "./defaultMeasureId.js";
|
|
3
3
|
import { defaultDimensions } from "./defaultDimensions.js";
|
|
4
|
-
export { defaultDimensions,
|
|
4
|
+
export { defaultDimensions, defaultMeasureId, defaultMeasures };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/histogram.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/histogram.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n label,\n xLinear,\n backgroundColor,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n datasetHistogram,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n initHistogram,\n yLinear,\n verticalCrosshairRect,\n tooltipHistogram,\n kdeRegressionLine,\n ecdfRegressionLine,\n pivotTitle,\n pivotAxisStyle,\n} from '../pipes'\n\nconst histogram: SpecPipeline = [\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n kdeRegressionLine,\n ecdfRegressionLine,\n]\n\nconst pivotHistogram: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n pivotAxisStyle(yLinear),\n label,\n tooltipHistogram,\n colorBarStyleFill(barStyle),\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n kdeRegressionLine,\n ecdfRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const histogramSpecPipeline: SpecPipeline = [pivotAdapter(histogram, pivotHistogram)]\n"],"names":["histogram","initHistogram","colorAdapter","color","linearColor","backgroundColor","datasetHistogram","progressive","xLinear","yLinear","label","tooltipHistogram","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","kdeRegressionLine","ecdfRegressionLine","pivotHistogram","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","histogramSpecPipeline","pivotAdapter"],"mappings":";AAqCA,MAAMA,YAA0B;IAC9BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,iBAA+B;IACnCC;IACAC;IACAC;IACAC,gBAAgB;QACd1B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAoB,eAAenB;QACfC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAC;IACA7B,aAAa8B,qBAAqBC;CACnC;AAEM,MAAMC,wBAAsC;IAACC,aAAanC,WAAWuB;CAAgB"}
|
|
@@ -91,6 +91,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
|
91
91
|
visible: true,
|
|
92
92
|
text: text,
|
|
93
93
|
style: {
|
|
94
|
+
opacity: 0.95,
|
|
94
95
|
dy: isBottom ? 2 * -(textFontSize || 12) : 0,
|
|
95
96
|
textAlign: textAlign,
|
|
96
97
|
textBaseline: textBaseline,
|
|
@@ -104,6 +105,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
|
104
105
|
visible: textBackgroundVisible,
|
|
105
106
|
padding: textBackgroundPadding,
|
|
106
107
|
style: {
|
|
108
|
+
opacity: 0.95,
|
|
107
109
|
dy: isBottom ? 2 * -(textFontSize || 12) : 0,
|
|
108
110
|
cornerRadius: textBackgroundBorderRadius ?? 4,
|
|
109
111
|
fill: textBackgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationArea.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationArea.ts"],"sourcesContent":["import type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationArea: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textPosition = 'top',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n const labelPosition = positionMap[textPosition || 'top']\n const isBottom = labelPosition.toLocaleLowerCase().includes('bottom')\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const yScale = yAxisHelper.getScale()\n\n const minX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const maxX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const xScale = xAxisHelper.getScale()\n\n const minY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const maxY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: labelPosition,\n visible: true,\n text: text,\n style: {\n dy: isBottom ? -(textFontSize || 12) * 2 : 0,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: isBottom ? -(textFontSize || 12) * 2 : 0,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationArea","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationAreaList","Array","positionMap","markArea","selectorPoint","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","dataset","selectedData","datum","selector","labelPosition","isBottom","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","yAxisHelper","xAxisHelper","yScale","minX","Math","maxX","minY","maxY","xScale"],"mappings":";;;AAMO,MAAMA,gCAA2B,CAACC,MAAMC;IAC7C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,cAAc,EAAE,GAAGK;IAC3B,MAAMG,qBAAqBC,MAAM,OAAO,CAACT,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMU,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IAEA,MAAMC,WAAWH,mBAAmB,OAAO,CAAC,CAACR;QAC3C,MAAM,EACJ,UAAUY,aAAa,EACvBC,OAAO,EAAE,EACTC,eAAe,KAAK,EACpBC,YAAYR,OAAO,aAAa,SAAS,EACzCS,eAAeT,OAAO,gBAAgB,EAAE,EACxCU,iBAAiBV,OAAO,kBAAkB,GAAG,EAC7CW,YAAY,QAAQ,EACpBC,eAAe,KAAK,EAEpBC,wBAAwBb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X,UAAUL;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIa,WAAW,AAAwB,IAAxB,CAAEtB,CAAAA,gBAAgB,EAAC,IAAS;wBAC3C,cAAcQ,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG9B,IAAI;QACP,UAAUU;IACZ;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationArea.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationArea.ts"],"sourcesContent":["import type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationArea: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textPosition = 'top',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n const labelPosition = positionMap[textPosition || 'top']\n const isBottom = labelPosition.toLocaleLowerCase().includes('bottom')\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const yScale = yAxisHelper.getScale()\n\n const minX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const maxX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const xScale = xAxisHelper.getScale()\n\n const minY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const maxY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: labelPosition,\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n dy: isBottom ? -(textFontSize || 12) * 2 : 0,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dy: isBottom ? -(textFontSize || 12) * 2 : 0,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationArea","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationAreaList","Array","positionMap","markArea","selectorPoint","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","dataset","selectedData","datum","selector","labelPosition","isBottom","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","yAxisHelper","xAxisHelper","yScale","minX","Math","maxX","minY","maxY","xScale"],"mappings":";;;AAMO,MAAMA,gCAA2B,CAACC,MAAMC;IAC7C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,cAAc,EAAE,GAAGK;IAC3B,MAAMG,qBAAqBC,MAAM,OAAO,CAACT,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMU,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IAEA,MAAMC,WAAWH,mBAAmB,OAAO,CAAC,CAACR;QAC3C,MAAM,EACJ,UAAUY,aAAa,EACvBC,OAAO,EAAE,EACTC,eAAe,KAAK,EACpBC,YAAYR,OAAO,aAAa,SAAS,EACzCS,eAAeT,OAAO,gBAAgB,EAAE,EACxCU,iBAAiBV,OAAO,kBAAkB,GAAG,EAC7CW,YAAY,QAAQ,EACpBC,eAAe,KAAK,EAEpBC,wBAAwBb,OAAO,yBAAyB,IAAI,EAC5Dc,sBAAsBd,OAAO,uBAAuB,SAAS,EAC7De,4BAA4Bf,OAAO,6BAA6B,SAAS,EACzEgB,4BAA4BhB,OAAO,6BAA6B,CAAC,EACjEiB,6BAA6BjB,OAAO,8BAA8B,CAAC,EACnE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AAcQ,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG9B,IAAI;QACP,UAAUU;IACZ;AACF"}
|
|
@@ -112,6 +112,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
|
112
112
|
visible: true,
|
|
113
113
|
text: text,
|
|
114
114
|
style: {
|
|
115
|
+
opacity: 0.95,
|
|
115
116
|
dy: dy,
|
|
116
117
|
textAlign: textAlign,
|
|
117
118
|
textBaseline: textBaseline,
|
|
@@ -125,6 +126,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
|
125
126
|
visible: textBackgroundVisible,
|
|
126
127
|
padding: textBackgroundPadding,
|
|
127
128
|
style: {
|
|
129
|
+
opacity: 0.95,
|
|
128
130
|
dy: dy,
|
|
129
131
|
cornerRadius: textBackgroundBorderRadius ?? 4,
|
|
130
132
|
fill: textBackgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import { type ICartesianSeries, type ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultOptions = isBarLikeChart(advancedVSeed as VSeed)\n ? {\n textPosition: 'right',\n textAlign: 'right',\n }\n : {\n textPosition: 'top',\n textAlign: 'center',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultOptions.textAlign,\n textBaseline = 'middle',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultOptions.textPosition\n\n const dy = textPosition.includes('bottom') ? -1 * textFontSize! : 0\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n dy: dy,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: dy,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultOptions","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EA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BACL,UAAUlD,WAAW,CAACwB,aAAyB;gBAC/C,SAAS;gBACT,MAAMnB;gBACN,OAAO;oBACL,IAAIoB;oBACJ,WAAWhB;oBACX,cAAcC;oBACd,QAAQE;oBACR,WAAW;oBACX,MAAMN;oBACN,UAAUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIS;wBACJ,cAAcV,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAGhC,IAAI;QACP,UAAUa;IACZ;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import { type ICartesianSeries, type ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultOptions = isBarLikeChart(advancedVSeed as VSeed)\n ? {\n textPosition: 'right',\n textAlign: 'right',\n }\n : {\n textPosition: 'top',\n textAlign: 'center',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultOptions.textAlign,\n textBaseline = 'middle',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultOptions.textPosition\n\n const dy = textPosition.includes('bottom') ? -1 * textFontSize! : 0\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n dy: dy,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dy: dy,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultOptions","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAET,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAA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AUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,SAAS;wBACT,IAAIS;wBACJ,cAAcV,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAGhC,IAAI;QACP,UAAUa;IACZ;AACF"}
|
|
@@ -23,7 +23,23 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
|
23
23
|
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = 'right', textBaseline = 'bottom', lineColor = theme?.lineColor ?? '#212121', lineStyle = theme?.lineStyle ?? 'dashed', lineVisible = theme?.lineStyle ?? true, lineWidth = theme?.lineWidth ?? 1, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121', textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundPadding = theme?.textBackgroundPadding ?? 2 } = annotationHorizontalLine;
|
|
24
24
|
const dataset = advancedVSeed.dataset.flat();
|
|
25
25
|
const generateOneMarkLine = (y)=>({
|
|
26
|
-
|
|
26
|
+
positions: (datum, series)=>{
|
|
27
|
+
const regionStart = series.getRegion()?.getLayoutStartPoint();
|
|
28
|
+
const xAxisHelper = series.getXAxisHelper();
|
|
29
|
+
const yAxisHelper = series.getYAxisHelper();
|
|
30
|
+
const yPos = yAxisHelper.getScale(0).scale(y) + regionStart.y;
|
|
31
|
+
const xRange = xAxisHelper.getScale(0).range();
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
x: xRange ? xRange[0] + regionStart.x : 0,
|
|
35
|
+
y: yPos
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
x: xRange ? xRange[1] + regionStart.x : 0,
|
|
39
|
+
y: yPos
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
},
|
|
27
43
|
zIndex: ANNOTATION_Z_INDEX,
|
|
28
44
|
line: {
|
|
29
45
|
style: {
|
|
@@ -42,9 +58,11 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
|
42
58
|
}
|
|
43
59
|
},
|
|
44
60
|
label: {
|
|
61
|
+
confine: true,
|
|
45
62
|
text: text,
|
|
46
63
|
position: positionMap[textPosition || 'insideEnd'],
|
|
47
64
|
style: {
|
|
65
|
+
opacity: 0.95,
|
|
48
66
|
visible: true,
|
|
49
67
|
dy: 4,
|
|
50
68
|
stroke: textBackgroundColor,
|
|
@@ -59,6 +77,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
|
59
77
|
visible: textBackgroundVisible,
|
|
60
78
|
padding: textBackgroundPadding,
|
|
61
79
|
style: {
|
|
80
|
+
opacity: 0.95,
|
|
62
81
|
dy: 4,
|
|
63
82
|
cornerRadius: textBackgroundBorderRadius,
|
|
64
83
|
fill: textBackgroundColor,
|
|
@@ -71,9 +90,9 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
|
71
90
|
startSymbol: {
|
|
72
91
|
visible: theme?.startSymbolVisible ?? true,
|
|
73
92
|
symbolType: theme?.startSymbolType ?? 'triangleDown',
|
|
74
|
-
size: 5,
|
|
93
|
+
size: 5 + (lineWidth || 1),
|
|
75
94
|
style: {
|
|
76
|
-
dx:
|
|
95
|
+
dx: 3,
|
|
77
96
|
fill: lineColor
|
|
78
97
|
}
|
|
79
98
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { SpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationHorizontalLine: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationHorizontalLine\n const { annotationHorizontalLine } = annotation\n const annotationHorizontalLineList = Array.isArray(annotationHorizontalLine)\n ? annotationHorizontalLine\n : [annotationHorizontalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n\n const markLine = annotationHorizontalLineList.flatMap((annotationHorizontalLine) => {\n const {\n selector: selectorPoint,\n yValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'right',\n textBaseline = 'bottom',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationHorizontalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (y: string | number) => {\n return {\n y,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n text: text,\n position: positionMap[textPosition || 'insideEnd'],\n style: {\n visible: true,\n dy: 4,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: 4,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5,\n style: {\n dx:
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.ts"],"sourcesContent":["import type { Datum, ICartesianSeries, ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { SpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationHorizontalLine: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationHorizontalLine\n const { annotationHorizontalLine } = annotation\n const annotationHorizontalLineList = Array.isArray(annotationHorizontalLine)\n ? annotationHorizontalLine\n : [annotationHorizontalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n\n const markLine = annotationHorizontalLineList.flatMap((annotationHorizontalLine) => {\n const {\n selector: selectorPoint,\n yValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'right',\n textBaseline = 'bottom',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationHorizontalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (y: string | number) => {\n return {\n positions: (datum: Datum[], series: ICartesianSeries) => {\n const regionStart = series.getRegion()?.getLayoutStartPoint()\n const xAxisHelper = series.getXAxisHelper()\n const yAxisHelper = series.getYAxisHelper()\n const yPos = yAxisHelper.getScale!(0).scale(y) + regionStart.y\n const xRange = xAxisHelper.getScale!(0).range()\n\n return [\n { x: xRange ? xRange[0] + regionStart.x : 0, y: yPos },\n {\n x: xRange ? xRange[1] + regionStart.x : 0,\n y: yPos,\n },\n ]\n },\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: positionMap[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n visible: true,\n dy: 4,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dy: 4,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dx: 3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dx: -4,\n fill: lineColor,\n },\n },\n }\n }\n if ((!selectorPoint && isArray(yValue)) || isString(yValue) || isNumber(yValue)) {\n const yValueArr = Array.isArray(yValue) ? yValue : [yValue]\n return yValueArr.map(generateOneMarkLine)\n }\n\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return selectedData.map((datum) => {\n if (datum[unfoldInfo.encodingY]) {\n return generateOneMarkLine(datum[unfoldInfo.encodingY] as string)\n }\n if (datum[foldInfo.measureValue]) {\n return generateOneMarkLine(datum[foldInfo.measureValue] as string)\n }\n return {}\n })\n }) as IMarkLineSpec[]\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationHorizontalLine","spec","context","advancedVSeed","vseed","annotation","datasetReshapeInfo","config","foldInfo","unfoldInfo","theme","annotationHorizontalLineList","Array","positionMap","markLine","selectorPoint","yValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","dataset","generateOneMarkLine","y","datum","series","regionStart","xAxisHelper","yAxisHelper","yPos","xRange","ANNOTATION_Z_INDEX","isArray","isString","isNumber","yValueArr","selectedData","selector","specMarkLine","newMarkLine"],"mappings":";;;AAMO,MAAMA,oDAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGJ;IACnD,MAAM,EAAEK,QAAQ,EAAEC,UAAU,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,IAAI,CAACD,cAAc,CAACA,WAAW,wBAAwB,EACrD,OAAOJ;IAET,MAAMS,QAAQH,QAAQ,CAACH,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,wBAAwB,EAAE,GAAGK;IACrC,MAAMM,+BAA+BC,MAAM,OAAO,CAACZ,4BAC/CA,2BACA;QAACA;KAAyB;IAE9B,MAAMa,cAAc;QAClB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,aAAa;QACb,cAAc;QACd,WAAW;IACb;IAEA,MAAMC,WAAWH,6BAA6B,OAAO,CAAC,CAACX;QACrD,MAAM,EACJ,UAAUe,aAAa,EACvBC,MAAM,EACNC,OAAO,EAAE,EACTC,eAAe,WAAW,EAC1BC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAA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B,SAAS,YAAY,CAAC;YAEzD,OAAO,CAAC;QACV;IACF;IACA,MAAM2C,eAAiBlD,KAAwB,QAAQ,IAAwB,EAAE;IACjF,MAAMmD,cAAc;WAAID;WAAkBrC,YAAY,EAAE;KAAE;IAC1D,OAAO;QACL,GAAGb,IAAI;QACP,UAAUmD;IACZ;AACF"}
|
|
@@ -39,6 +39,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
|
39
39
|
text: {
|
|
40
40
|
text: text,
|
|
41
41
|
style: {
|
|
42
|
+
opacity: 0.95,
|
|
42
43
|
visible: true,
|
|
43
44
|
textAlign: textAlign,
|
|
44
45
|
textBaseline: textBaseline,
|
|
@@ -54,6 +55,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
|
54
55
|
visible: textBackgroundVisible,
|
|
55
56
|
padding: textBackgroundPadding,
|
|
56
57
|
style: {
|
|
58
|
+
opacity: 0.95,
|
|
57
59
|
cornerRadius: textBackgroundBorderRadius ?? 4,
|
|
58
60
|
fill: textBackgroundColor,
|
|
59
61
|
stroke: textBackgroundBorderColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPoint.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","datum","selector","dx","dy","ANNOTATION_Z_INDEX","data","item","isSubset"],"mappings":";;;;AAOO,MAAMA,kCAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,eAAe,EAAE,GAAGK;IAC5B,MAAMG,sBAAsBC,MAAM,OAAO,CAACT,mBAAmBA,kBAAkB;QAACA;KAAgB;IAChG,MAAMU,kBAAkBC,eAAeR;IACvC,MAAMS,eAAeF,kBACjB;QACE,WAAW;QACX,cAAc;IAChB,IACA;QACE,WAAW;QACX,cAAc;IAChB;IAEJ,MAAMG,YAAYL,oBAAoB,OAAO,CAAC,CAACR;QAC7C,MAAM,EACJ,UAAUc,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAYP,aAAa,SAAS,EAClCQ,eAAeR,aAAa,YAAY,EACxCS,4BAA4Bd,OAAO,yBAAyB,EAC5De,6BAA6Bf,OAAO,8BAA8B,CAAC,EACnEgB,4BAA4BhB,OAAO,6BAA6B,CAAC,EACjEiB,sBAAsBjB,OAAO,uBAAuB,SAAS,EAC7DkB,wBAAwBlB,OAAO,yBAAyB,CAAC,EACzDmB,wBAAwBnB,OAAO,yBAAyB,IAAI,EAC5DoB,UAAUpB,OAAO,WAAW,CAAC,EAC7BqB,UAAUrB,OAAO,WAAW,CAAC,EAC9B,GAAGP;QAEJ,MAAM6B,UAAU1B,cAAc,OAAO,CAAC,IAAI;QAC1C,MAAM2B,eAAehB,gBAAgBe,QAAQ,MAAM,CAAC,CAACE,QAAUC,SAASD,OAAOjB,kBAAkB,EAAE;QACnG,MAAMmB,KAAK,MAAOvB,CAAAA,kBAAmBO,eAA0B;QAC/D,MAAMiB,KAAKxB,kBAAkB,IAAKO;QAElC,OAAOa,aAAa,GAAG,CAAC,CAACC,QAChB;gBACL,QAAQI;gBACR,gBAAgB;gBAChB,YAAY,CAACC,OACJA,KAAK,IAAI,CAAC,CAACC,OAASC,SAASP,OAAOM;gBAG7C,UAAU;oBACR,SAAS;gBACX;gBACA,aAAa;oBACXT;oBACAD;oBACA,SAAS;oBACT,MAAM;wBACJ,MAAMZ;wBACN,OAAO;4BACL,SAAS;4BACT,WAAWI;4BACX,cAAcC;4BACd,MAAMJ;4BACN,QAAQQ;4BACR,WAAW;4BACX,UAAUP;4BACV,YAAYC;4BACZe;4BACAC;wBACF;wBACA,iBAAiB;4BACf,SAASR;4BACT,SAASD;4BACT,OAAO;gCACL,cAAcH,8BAA8B;gCAC5C,MAAME;gCACN,QAAQH;gCACR,WAAWE;gCACXU;gCACAC;4BACF;wBACF;oBACF;gBACF;YACF;IAEJ;IAEA,OAAO;QACL,GAAGjC,IAAI;QACPY;IACF;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPoint.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","datum","selector","dx","dy","ANNOTATION_Z_INDEX","data","item","isSubset"],"mappings":";;;;AAOO,MAAMA,kCAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,eAAe,EAAE,GAAGK;IAC5B,MAAMG,sBAAsBC,MA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