@visactor/vseed 0.1.43 → 0.1.45
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/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +4620 -0
- 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/histogram.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.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/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/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/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/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.d.ts +1 -2
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js +16 -13
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js +14 -19
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +6 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +5 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js +26 -10
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.d.ts +34 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js +35 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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/backgroundColor/background.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/backgroundColor/background.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/barWidth/barGapInGroup.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/barWidth/barGapInGroup.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/barWidth/barMaxWidth.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/barWidth/barMaxWidth.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/color.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/color.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +3 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/linearColor.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/linearColor.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/linearColorForDualAxis.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/linearColorForDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetDualAxis.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetScatter.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetXY.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetXY.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetYX.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetYX.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/area.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/bar.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/column.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/donut.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/funnel.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.d.ts +2 -2
- 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/line.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pie.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/radar.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/rose.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/scatter.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +7 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +19 -3
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.d.ts +2 -2
- 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/markStyle/cellStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pieStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pieStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/roseStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/roseStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/percent/percent.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/percent/percent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.js +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.d.ts +2 -2
- 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/pivotColumnDimensions.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.d.ts +2 -2
- 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/pivotHideIndicatorName.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.d.ts +4 -4
- 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/pivotChart/pivotRowDimensions.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +6 -6
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/series/series.d.ts +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/series/series.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/stack/stack.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/stack/stack.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.d.ts +2 -2
- 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.d.ts +3 -3
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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.d.ts +2 -2
- 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/columns/dimensionsToColumns.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.js.map +1 -1
- 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/indicators/pivotDataConfig.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/init/table.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/init/table.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.d.ts +2 -2
- 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/spec/table/pipes/theme/bodyStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.d.ts +2 -2
- package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.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/annotaion.js +7 -7
- package/dist/esm/theme/common/annotaion.js.map +1 -1
- package/dist/esm/theme/common/axes.js +18 -18
- package/dist/esm/theme/common/axes.js.map +1 -1
- package/dist/esm/theme/common/legend.d.ts +2 -0
- package/dist/esm/theme/common/legend.js +13 -2
- package/dist/esm/theme/common/legend.js.map +1 -1
- package/dist/esm/theme/common/table.d.ts +30 -22
- package/dist/esm/theme/common/table.js +10 -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 +4 -4
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +4 -4
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +3522 -0
- package/dist/esm/types/advancedVSeed.js +2 -0
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +82 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +82 -0
- package/dist/esm/types/chartType/bar/zBar.d.ts +82 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +82 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +82 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +82 -0
- package/dist/esm/types/chartType/column/zColumn.d.ts +84 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +82 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +82 -0
- package/dist/esm/types/chartType/donut/zDonut.d.ts +82 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +82 -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 +90 -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 +82 -0
- package/dist/esm/types/chartType/pie/zPie.d.ts +82 -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 +82 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +82 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +82 -0
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +90 -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/pipeline/spec/spec.d.ts +11 -2
- 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 +168 -0
- package/dist/esm/types/properties/config/bar.d.ts +252 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +84 -0
- package/dist/esm/types/properties/config/column.d.ts +264 -0
- package/dist/esm/types/properties/config/config.d.ts +1716 -0
- package/dist/esm/types/properties/config/dualAxis.d.ts +84 -0
- package/dist/esm/types/properties/config/funnel.d.ts +84 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +84 -0
- package/dist/esm/types/properties/config/histogram.d.ts +96 -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/legend/legend.d.ts +10 -0
- package/dist/esm/types/properties/config/legend/legend.js +2 -0
- package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +84 -0
- package/dist/esm/types/properties/config/pie.d.ts +252 -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 +168 -0
- package/dist/esm/types/properties/config/scatter.d.ts +96 -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/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 +3432 -0
- package/dist/esm/types/zVseed.d.ts +1926 -124
- package/dist/umd/index.js +884 -439
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureName.js.map +0 -1
|
@@ -1,11 +1,28 @@
|
|
|
1
|
+
import { BAND_AXIS_INNER_OFFSET_IN_PIVOT } from "../../../../utils/constant.js";
|
|
1
2
|
const pivotAxisStyle = (axisStyle)=>(spec, context)=>{
|
|
2
3
|
const result = axisStyle(spec, context);
|
|
3
|
-
if (result.axes)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
if (result.axes) {
|
|
5
|
+
const { advancedVSeed } = context;
|
|
6
|
+
const { config, chartType } = advancedVSeed;
|
|
7
|
+
const themConfig = config?.[chartType]?.pivotGrid ?? {};
|
|
8
|
+
result.axes.forEach((axis)=>{
|
|
9
|
+
axis.domainLine = {
|
|
10
|
+
visible: false
|
|
11
|
+
};
|
|
12
|
+
if (themConfig.chartGridColor && axis.grid && axis.grid.visible && axis.grid.style) axis.grid.style.stroke = themConfig.chartGridColor;
|
|
13
|
+
if (themConfig.axisLabelColor && axis.label && axis.label.visible && axis.label.style) axis.label.style.fill = themConfig.axisLabelColor;
|
|
14
|
+
if ('band' === axis.type) {
|
|
15
|
+
if ('left' === axis.orient || 'right' === axis.orient) axis.innerOffset = {
|
|
16
|
+
top: BAND_AXIS_INNER_OFFSET_IN_PIVOT,
|
|
17
|
+
bottom: BAND_AXIS_INNER_OFFSET_IN_PIVOT
|
|
18
|
+
};
|
|
19
|
+
else if ('top' === axis.orient || 'bottom' === axis.orient) axis.innerOffset = {
|
|
20
|
+
left: BAND_AXIS_INNER_OFFSET_IN_PIVOT,
|
|
21
|
+
right: BAND_AXIS_INNER_OFFSET_IN_PIVOT
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
9
26
|
return result;
|
|
10
27
|
};
|
|
11
28
|
export { pivotAxisStyle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { BAND_AXIS_INNER_OFFSET_IN_PIVOT } from 'src/pipeline/utils/constant'\nimport type { Config, VChartSpecPipe } from 'src/types'\n\nexport const pivotAxisStyle = (axisStyle: VChartSpecPipe): VChartSpecPipe => {\n return (spec, context) => {\n const result = axisStyle(spec, context) as ILineChartSpec\n\n if (result.axes) {\n const { advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n result.axes.forEach((axis: any) => {\n axis.domainLine = {\n visible: false,\n }\n\n if (themConfig.chartGridColor && axis.grid && axis.grid.visible && axis.grid.style) {\n axis.grid.style.stroke = themConfig.chartGridColor\n }\n\n if (themConfig.axisLabelColor && axis.label && axis.label.visible && axis.label.style) {\n axis.label.style.fill = themConfig.axisLabelColor\n }\n\n if (axis.type === 'band') {\n if (axis.orient === 'left' || axis.orient === 'right') {\n axis.innerOffset = {\n top: BAND_AXIS_INNER_OFFSET_IN_PIVOT,\n bottom: BAND_AXIS_INNER_OFFSET_IN_PIVOT,\n }\n } else if (axis.orient === 'top' || axis.orient === 'bottom') {\n axis.innerOffset = {\n left: BAND_AXIS_INNER_OFFSET_IN_PIVOT,\n right: BAND_AXIS_INNER_OFFSET_IN_PIVOT,\n }\n }\n }\n })\n }\n\n return result\n }\n}\n"],"names":["pivotAxisStyle","axisStyle","spec","context","result","advancedVSeed","config","chartType","themConfig","axis","BAND_AXIS_INNER_OFFSET_IN_PIVOT"],"mappings":";AAIO,MAAMA,iBAAiB,CAACC,YACtB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,IAAIC,OAAO,IAAI,EAAE;YACf,MAAM,EAAEC,aAAa,EAAE,GAAGF;YAC1B,MAAM,EAAEG,MAAM,EAAEC,SAAS,EAAE,GAAGF;YAC9B,MAAMG,aAAcF,QAAQ,CAACC,UAAU,EAAqB,aAAa,CAAC;YAE1EH,OAAO,IAAI,CAAC,OAAO,CAAC,CAACK;gBACnBA,KAAK,UAAU,GAAG;oBAChB,SAAS;gBACX;gBAEA,IAAID,WAAW,cAAc,IAAIC,KAAK,IAAI,IAAIA,KAAK,IAAI,CAAC,OAAO,IAAIA,KAAK,IAAI,CAAC,KAAK,EAChFA,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAGD,WAAW,cAAc;gBAGpD,IAAIA,WAAW,cAAc,IAAIC,KAAK,KAAK,IAAIA,KAAK,KAAK,CAAC,OAAO,IAAIA,KAAK,KAAK,CAAC,KAAK,EACnFA,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,GAAGD,WAAW,cAAc;gBAGnD,IAAIC,AAAc,WAAdA,KAAK,IAAI,EACX;oBAAA,IAAIA,AAAgB,WAAhBA,KAAK,MAAM,IAAeA,AAAgB,YAAhBA,KAAK,MAAM,EACvCA,KAAK,WAAW,GAAG;wBACjB,KAAKC;wBACL,QAAQA;oBACV;yBACK,IAAID,AAAgB,UAAhBA,KAAK,MAAM,IAAcA,AAAgB,aAAhBA,KAAK,MAAM,EAC7CA,KAAK,WAAW,GAAG;wBACjB,MAAMC;wBACN,OAAOA;oBACT;gBACF;YAEJ;QACF;QAEA,OAAON;IACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotColumnDimensions:
|
|
1
|
+
import type { PivotChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotColumnDimensions: PivotChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Dimensions,
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Dimensions, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotColumnDimensions: PivotChartSpecPipe = (spec, context): Partial<PivotChartConstructorOptions> => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const dimensions = advancedVSeed.dimensions as Dimensions\n\n if (!dimensions) {\n return result\n }\n const columnDimensions = dimensions.filter((dim) => dim.encoding === 'column')\n const columns = columnDimensions.map((dim) => ({\n dimensionKey: dim.id,\n title: dim.alias || dim.id,\n })) as unknown\n\n return {\n ...result,\n columns: columns,\n } as Partial<PivotChartConstructorOptions>\n}\n"],"names":["pivotColumnDimensions","spec","context","result","advancedVSeed","dimensions","columnDimensions","dim","columns"],"mappings":"AAGO,MAAMA,wBAA4C,CAACC,MAAMC;IAC9D,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAMG,aAAaD,cAAc,UAAU;IAE3C,IAAI,CAACC,YACH,OAAOF;IAET,MAAMG,mBAAmBD,WAAW,MAAM,CAAC,CAACE,MAAQA,AAAiB,aAAjBA,IAAI,QAAQ;IAChE,MAAMC,UAAUF,iBAAiB,GAAG,CAAC,CAACC,MAAS;YAC7C,cAAcA,IAAI,EAAE;YACpB,OAAOA,IAAI,KAAK,IAAIA,IAAI,EAAE;QAC5B;IAEA,OAAO;QACL,GAAGJ,MAAM;QACT,SAASK;IACX;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotGridStyle:
|
|
1
|
+
import type { PivotChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotGridStyle: PivotChartSpecPipe;
|
|
@@ -2,14 +2,13 @@ import { isCombination, isPivot } from "../../../../utils/index.js";
|
|
|
2
2
|
import { isNullish } from "remeda";
|
|
3
3
|
const pivotGridStyle = (spec, context)=>{
|
|
4
4
|
const { vseed, advancedVSeed } = context;
|
|
5
|
-
const { config, chartType
|
|
5
|
+
const { config, chartType } = advancedVSeed;
|
|
6
6
|
const themConfig = config?.[chartType]?.pivotGrid ?? {};
|
|
7
7
|
const onlyCombination = !isPivot(vseed) && isCombination(vseed);
|
|
8
8
|
const result = {
|
|
9
9
|
...spec
|
|
10
10
|
};
|
|
11
11
|
const transparent = 'rgba(0,0,0,0)';
|
|
12
|
-
const hasColumnDimension = dimensions.some((dim)=>'column' === dim.encoding);
|
|
13
12
|
const borderColor = themConfig.borderColor ?? '#e3e5eb';
|
|
14
13
|
const bodyFontColor = themConfig.bodyFontColor ?? '#141414';
|
|
15
14
|
const headerFontColor = themConfig.headerFontColor ?? '#21252c';
|
|
@@ -27,12 +26,15 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
27
26
|
bodyStyle: {
|
|
28
27
|
borderColor,
|
|
29
28
|
color: bodyFontColor,
|
|
30
|
-
borderLineWidth: (arg)=>
|
|
29
|
+
borderLineWidth: (arg)=>{
|
|
30
|
+
const noYAxis = 'pie' === chartType || 'rose' === chartType || 'donut' === chartType || 'funnel' === chartType || 'radar' === chartType || 'roseParallel' === chartType;
|
|
31
|
+
return [
|
|
31
32
|
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
32
33
|
outlineBorderLineWidth,
|
|
33
34
|
0,
|
|
34
|
-
0 === arg.col ? outlineBorderLineWidth : 1
|
|
35
|
-
]
|
|
35
|
+
0 === arg.col || noYAxis && 1 === arg.col ? outlineBorderLineWidth : 1
|
|
36
|
+
];
|
|
37
|
+
},
|
|
36
38
|
bgColor: transparent,
|
|
37
39
|
hover: {
|
|
38
40
|
cellBgColor: 'transparent'
|
|
@@ -62,7 +64,7 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
62
64
|
color: headerFontColor,
|
|
63
65
|
padding: [
|
|
64
66
|
0,
|
|
65
|
-
|
|
67
|
+
12,
|
|
66
68
|
0,
|
|
67
69
|
4
|
|
68
70
|
],
|
|
@@ -86,7 +88,7 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
86
88
|
color: headerFontColor,
|
|
87
89
|
padding: [
|
|
88
90
|
0,
|
|
89
|
-
|
|
91
|
+
12,
|
|
90
92
|
0,
|
|
91
93
|
4
|
|
92
94
|
],
|
|
@@ -107,23 +109,6 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
107
109
|
inlineColumnBgColor: hoverHeaderInlineBackgroundColor || void 0
|
|
108
110
|
}
|
|
109
111
|
},
|
|
110
|
-
cornerRightTopCellStyle: {
|
|
111
|
-
borderColor,
|
|
112
|
-
borderLineWidth: 0,
|
|
113
|
-
frameStyle: {
|
|
114
|
-
borderColor,
|
|
115
|
-
borderLineWidth: [
|
|
116
|
-
outlineBorderLineWidth,
|
|
117
|
-
outlineBorderLineWidth,
|
|
118
|
-
1,
|
|
119
|
-
1
|
|
120
|
-
]
|
|
121
|
-
},
|
|
122
|
-
bgColor: headerBackgroundColor,
|
|
123
|
-
hover: {
|
|
124
|
-
cellBgColor: hoverHeaderBackgroundColor
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
112
|
cornerLeftBottomCellStyle: {
|
|
128
113
|
borderColor,
|
|
129
114
|
borderLineWidth: [
|
|
@@ -146,24 +131,19 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
146
131
|
cellBgColor: hoverHeaderBackgroundColor
|
|
147
132
|
}
|
|
148
133
|
},
|
|
149
|
-
|
|
134
|
+
cornerRightTopCellStyle: {
|
|
150
135
|
borderColor,
|
|
151
|
-
bgColor: headerBackgroundColor,
|
|
152
136
|
borderLineWidth: [
|
|
153
|
-
1,
|
|
154
137
|
outlineBorderLineWidth,
|
|
155
138
|
outlineBorderLineWidth,
|
|
139
|
+
1,
|
|
156
140
|
1
|
|
157
141
|
],
|
|
158
142
|
frameStyle: {
|
|
159
143
|
borderColor,
|
|
160
|
-
borderLineWidth:
|
|
161
|
-
1,
|
|
162
|
-
outlineBorderLineWidth,
|
|
163
|
-
outlineBorderLineWidth,
|
|
164
|
-
1
|
|
165
|
-
]
|
|
144
|
+
borderLineWidth: 0
|
|
166
145
|
},
|
|
146
|
+
bgColor: headerBackgroundColor,
|
|
167
147
|
hover: {
|
|
168
148
|
cellBgColor: hoverHeaderBackgroundColor
|
|
169
149
|
}
|
|
@@ -172,16 +152,41 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
172
152
|
borderColor,
|
|
173
153
|
bgColor: headerBackgroundColor,
|
|
174
154
|
borderLineWidth: (arg)=>[
|
|
175
|
-
0 === arg.row
|
|
155
|
+
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
176
156
|
outlineBorderLineWidth,
|
|
177
157
|
0,
|
|
178
158
|
1
|
|
179
159
|
],
|
|
160
|
+
frameStyle: {
|
|
161
|
+
borderLineWidth: 0
|
|
162
|
+
},
|
|
180
163
|
hover: {
|
|
181
164
|
borderLineWidth: 0,
|
|
182
165
|
cellBgColor: hoverHeaderBackgroundColor
|
|
183
166
|
}
|
|
184
167
|
},
|
|
168
|
+
cornerRightBottomCellStyle: {
|
|
169
|
+
borderColor,
|
|
170
|
+
bgColor: headerBackgroundColor,
|
|
171
|
+
borderLineWidth: [
|
|
172
|
+
1,
|
|
173
|
+
outlineBorderLineWidth,
|
|
174
|
+
outlineBorderLineWidth,
|
|
175
|
+
1
|
|
176
|
+
],
|
|
177
|
+
frameStyle: {
|
|
178
|
+
borderColor,
|
|
179
|
+
borderLineWidth: [
|
|
180
|
+
1,
|
|
181
|
+
outlineBorderLineWidth,
|
|
182
|
+
outlineBorderLineWidth,
|
|
183
|
+
1
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
hover: {
|
|
187
|
+
cellBgColor: hoverHeaderBackgroundColor
|
|
188
|
+
}
|
|
189
|
+
},
|
|
185
190
|
bottomFrozenStyle: {
|
|
186
191
|
borderColor,
|
|
187
192
|
borderLineWidth: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { isCombination, isPivot } from 'src/pipeline/utils'\nimport type { Config,
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { isCombination, isPivot } from 'src/pipeline/utils'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\nimport { isNullish } from 'remeda'\n\nexport const pivotGridStyle: PivotChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n const onlyCombination = !isPivot(vseed) && isCombination(vseed)\n\n const result = { ...spec } as PivotChartConstructorOptions\n const transparent = 'rgba(0,0,0,0)'\n\n const borderColor = themConfig.borderColor ?? '#e3e5eb'\n const bodyFontColor = themConfig.bodyFontColor ?? '#141414'\n const headerFontColor = themConfig.headerFontColor ?? '#21252c'\n const headerBackgroundColor = themConfig.headerBackgroundColor ?? 'rgba(0,0,0,0)'\n const hoverHeaderBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderBackgroundColor ?? '#D9DDE4')\n const hoverHeaderInlineBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderInlineBackgroundColor ?? '#D9DDE455')\n const outlineBorderLineWidth = themConfig.outlineBorderLineWidth ?? 0\n const frameCornerRadius = themConfig.frameCornerRadius ?? 0\n\n if (!isNullish(themConfig.minChartWidth)) {\n result.defaultColWidth = themConfig.minChartWidth\n }\n\n if (!isNullish(themConfig.minChartHeight)) {\n result.defaultRowHeight = themConfig.minChartHeight\n }\n\n return {\n ...result,\n theme: {\n underlayBackgroundColor: transparent,\n bodyStyle: {\n borderColor,\n color: bodyFontColor,\n borderLineWidth: (arg: { row: number; col: number }) => {\n const noYAxis =\n chartType === 'pie' ||\n chartType === 'rose' ||\n chartType === 'donut' ||\n chartType === 'funnel' ||\n chartType === 'radar' ||\n chartType === 'roseParallel'\n\n return [\n arg.row === 0 ? outlineBorderLineWidth : 1,\n outlineBorderLineWidth,\n 0,\n arg.col === 0 || (noYAxis && arg.col === 1) ? outlineBorderLineWidth : 1,\n ]\n },\n bgColor: transparent,\n hover: {\n cellBgColor: 'transparent',\n },\n },\n headerStyle: {\n borderColor,\n fontSize: 12,\n // borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n borderLineWidth: (arg: { row: number; col: number }) => {\n return [outlineBorderLineWidth, outlineBorderLineWidth, 1, arg.col === 0 ? outlineBorderLineWidth : 1]\n },\n color: headerFontColor,\n textAlign: 'center',\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n rowHeaderStyle: {\n borderColor,\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, 1, 0, outlineBorderLineWidth]\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerHeaderStyle: {\n borderColor,\n textAlign: 'center',\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n fontWeight: 'bold',\n borderLineWidth: [outlineBorderLineWidth, 1, 1, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerLeftBottomCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n borderLineWidth: [1, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightTopCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: 0,\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n rightFrozenStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, outlineBorderLineWidth, 0, 1]\n },\n frameStyle: {\n borderLineWidth: 0,\n },\n hover: {\n borderLineWidth: 0,\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightBottomCellStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n\n bottomFrozenStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n selectionStyle: {\n cellBgColor: '',\n cellBorderColor: '',\n },\n frameStyle: {\n borderColor,\n cornerRadius: frameCornerRadius,\n borderLineWidth: outlineBorderLineWidth,\n },\n },\n }\n}\n"],"names":["pivotGridStyle","spec","context","vseed","advancedVSeed","config","chartType","themConfig","onlyCombination","isPivot","isCombination","result","transparent","borderColor","bodyFontColor","headerFontColor","headerBackgroundColor","hoverHeaderBackgroundColor","hoverHeaderInlineBackgroundColor","outlineBorderLineWidth","frameCornerRadius","isNullish","arg","noYAxis","undefined"],"mappings":";;AAKO,MAAMA,iBAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC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L,aAAaC;gBACf;YACF;YACA,kBAAkB;gBAChBJ;gBACA,SAASG;gBACT,iBAAiB,CAACM,MACT;wBAAa,MAAZA,IAAI,GAAG,GAASH,yBAAyB;wBAAGA;wBAAwB;wBAAG;qBAAE;gBAEnF,YAAY;oBACV,iBAAiB;gBACnB;gBACA,OAAO;oBACL,iBAAiB;oBACjB,aAAaF;gBACf;YACF;YACA,4BAA4B;gBAC1BJ;gBACA,SAASG;gBACT,iBAAiB;oBAAC;oBAAGG;oBAAwBA;oBAAwB;iBAAE;gBACvE,YAAY;oBACVN;oBACA,iBAAiB;wBAAC;wBAAGM;wBAAwBA;wBAAwB;qBAAE;gBACzE;gBACA,OAAO;oBACL,aAAaF;gBACf;YACF;YAEA,mBAAmB;gBACjBJ;gBACA,iBAAiB;oBAAC;oBAAGM;oBAAwBA;oBAAwB;iBAAE;gBACvE,SAASH;gBACT,OAAO;oBACL,aAAaC;gBACf;YACF;YACA,gBAAgB;gBACd,aAAa;gBACb,iBAAiB;YACnB;YACA,YAAY;gBACVJ;gBACA,cAAcO;gBACd,iBAAiBD;YACnB;QACF;IACF;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotHideIndicatorName:
|
|
1
|
+
import type { PivotChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotHideIndicatorName: PivotChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.ts"],"sourcesContent":["import type { PivotChartSpecPipe } from 'src/types'\n\nexport const pivotHideIndicatorName: PivotChartSpecPipe = (spec) => {\n return {\n ...spec,\n hideIndicatorName: true,\n }\n}\n"],"names":["pivotHideIndicatorName","spec"],"mappings":"AAEO,MAAMA,yBAA6C,CAACC,OAClD;QACL,GAAGA,IAAI;QACP,mBAAmB;IACrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotIndicators: (chartPipeline:
|
|
3
|
-
export declare const pivotIndicatorsAsRow:
|
|
4
|
-
export declare const pivotIndicatorsAsCol:
|
|
1
|
+
import type { PivotChartSpecPipe, VChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotIndicators: (chartPipeline: VChartSpecPipe[]) => PivotChartSpecPipe;
|
|
3
|
+
export declare const pivotIndicatorsAsRow: PivotChartSpecPipe;
|
|
4
|
+
export declare const pivotIndicatorsAsCol: PivotChartSpecPipe;
|
|
@@ -5,10 +5,13 @@ const pivotIndicators = (chartPipeline)=>(spec, context)=>{
|
|
|
5
5
|
...spec
|
|
6
6
|
};
|
|
7
7
|
const { advancedVSeed } = context;
|
|
8
|
-
const { measures, datasetReshapeInfo, dataset } = advancedVSeed;
|
|
8
|
+
const { measures, datasetReshapeInfo, dataset, encoding } = advancedVSeed;
|
|
9
9
|
const colorItems = unique(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
|
10
|
+
const allMeasureIds = unique(datasetReshapeInfo.flatMap((d)=>Object.keys(d.foldInfo.foldMap || {})));
|
|
10
11
|
const indicators = datasetReshapeInfo.map((reshapeInfo, index)=>{
|
|
11
|
-
const
|
|
12
|
+
const measureGroup = measures?.find((d)=>d.id === reshapeInfo.id);
|
|
13
|
+
const subMeasuresId = (measureGroup?.children || []).map((d)=>d.id);
|
|
14
|
+
const invalideMeasuresIds = allMeasureIds.filter((id)=>!subMeasuresId.includes(id));
|
|
12
15
|
const newDataset = dataset[index];
|
|
13
16
|
const newDatasetReshapeInfo = [
|
|
14
17
|
{
|
|
@@ -24,13 +27,17 @@ const pivotIndicators = (chartPipeline)=>(spec, context)=>{
|
|
|
24
27
|
advancedVSeed: {
|
|
25
28
|
...advancedVSeed,
|
|
26
29
|
datasetReshapeInfo: newDatasetReshapeInfo,
|
|
30
|
+
encoding: Object.keys(encoding).reduce((res, key)=>{
|
|
31
|
+
res[key] = encoding[key]?.filter((e)=>!invalideMeasuresIds.includes(e));
|
|
32
|
+
return res;
|
|
33
|
+
}, {}),
|
|
27
34
|
dataset: newDataset
|
|
28
35
|
}
|
|
29
36
|
};
|
|
30
37
|
const chartSpec = execPipeline(chartPipeline, newContext, {});
|
|
31
38
|
return {
|
|
32
39
|
indicatorKey: reshapeInfo.id,
|
|
33
|
-
title:
|
|
40
|
+
title: measureGroup?.alias,
|
|
34
41
|
cellType: 'chart',
|
|
35
42
|
chartModule: 'vchart',
|
|
36
43
|
chartSpec: chartSpec,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { execPipeline } from '../../../../utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { execPipeline } from '../../../../utils'\nimport type {\n Dataset,\n Encoding,\n MeasureGroup,\n PivotChartSpecPipe,\n SpecPipelineContext,\n VChartSpecPipe,\n} from 'src/types'\nimport { unique } from 'remeda'\n\nexport const pivotIndicators =\n (chartPipeline: VChartSpecPipe[]): PivotChartSpecPipe =>\n (spec, context): Partial<PivotChartConstructorOptions> => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { measures, datasetReshapeInfo, dataset, encoding } = advancedVSeed\n\n const colorItems = unique(datasetReshapeInfo.flatMap((d) => d.unfoldInfo.colorItems))\n const allMeasureIds = unique(datasetReshapeInfo.flatMap((d) => Object.keys(d.foldInfo.foldMap || {})))\n\n const indicators = datasetReshapeInfo.map((reshapeInfo, index) => {\n const measureGroup = measures?.find((d) => d.id === reshapeInfo.id) as MeasureGroup\n const subMeasuresId = (measureGroup?.children || []).map((d) => d.id)\n const invalideMeasuresIds = allMeasureIds.filter((id) => !subMeasuresId.includes(id))\n\n const newDataset = dataset[index] as Dataset\n const newDatasetReshapeInfo = [\n {\n ...reshapeInfo,\n unfoldInfo: { ...reshapeInfo.unfoldInfo, colorItems },\n },\n ]\n const newContext: SpecPipelineContext = {\n ...context,\n advancedVSeed: {\n ...advancedVSeed,\n datasetReshapeInfo: newDatasetReshapeInfo,\n encoding: Object.keys(encoding).reduce((res, key) => {\n res[key as keyof Encoding] = encoding[key as keyof Encoding]?.filter((e) => {\n return !invalideMeasuresIds.includes(e)\n }) as string[]\n\n return res\n }, {} as Encoding),\n dataset: newDataset,\n },\n }\n\n const chartSpec = execPipeline(chartPipeline, newContext, {})\n return {\n indicatorKey: reshapeInfo.id,\n title: measureGroup?.alias,\n cellType: 'chart',\n chartModule: 'vchart',\n chartSpec: chartSpec,\n style: {\n padding: [1, 1, 0, 1],\n },\n }\n })\n\n return {\n ...result,\n indicators: indicators,\n } as Partial<PivotChartConstructorOptions>\n }\n\nexport const pivotIndicatorsAsRow: PivotChartSpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: false,\n }\n}\n\nexport const pivotIndicatorsAsCol: PivotChartSpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: true,\n }\n}\n"],"names":["pivotIndicators","chartPipeline","spec","context","result","advancedVSeed","measures","datasetReshapeInfo","dataset","encoding","colorItems","unique","d","allMeasureIds","Object","indicators","reshapeInfo","index","measureGroup","subMeasuresId","invalideMeasuresIds","id","newDataset","newDatasetReshapeInfo","newContext","res","key","e","chartSpec","execPipeline","pivotIndicatorsAsRow","pivotIndicatorsAsCol"],"mappings":";;AAYO,MAAMA,kBACX,CAACC,gBACD,CAACC,MAAMC;QACL,MAAMC,SAAS;YAAE,GAAGF,IAAI;QAAC;QACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,QAAQ,EAAEC,kBAAkB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGJ;QAE5D,MAAMK,aAAaC,OAAOJ,mBAAmB,OAAO,CAAC,CAACK,IAAMA,EAAE,UAAU,CAAC,UAAU;QACnF,MAAMC,gBAAgBF,OAAOJ,mBAAmB,OAAO,CAAC,CAACK,IAAME,OAAO,IAAI,CAACF,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC;QAElG,MAAMG,aAAaR,mBAAmB,GAAG,CAAC,CAACS,aAAaC;YACtD,MAAMC,eAAeZ,UAAU,KAAK,CAACM,IAAMA,EAAE,EAAE,KAAKI,YAAY,EAAE;YAClE,MAAMG,gBAAiBD,AAAAA,CAAAA,cAAc,YAAY,EAAC,EAAG,GAAG,CAAC,CAACN,IAAMA,EAAE,EAAE;YACpE,MAAMQ,sBAAsBP,cAAc,MAAM,CAAC,CAACQ,KAAO,CAACF,cAAc,QAAQ,CAACE;YAEjF,MAAMC,aAAad,OAAO,CAACS,MAAM;YACjC,MAAMM,wBAAwB;gBAC5B;oBACE,GAAGP,WAAW;oBACd,YAAY;wBAAE,GAAGA,YAAY,UAAU;wBAAEN;oBAAW;gBACtD;aACD;YACD,MAAMc,aAAkC;gBACtC,GAAGrB,OAAO;gBACV,eAAe;oBACb,GAAGE,aAAa;oBAChB,oBAAoBkB;oBACpB,UAAUT,OAAO,IAAI,CAACL,UAAU,MAAM,CAAC,CAACgB,KAAKC;wBAC3CD,GAAG,CAACC,IAAsB,GAAGjB,QAAQ,CAACiB,IAAsB,EAAE,OAAO,CAACC,IAC7D,CAACP,oBAAoB,QAAQ,CAACO;wBAGvC,OAAOF;oBACT,GAAG,CAAC;oBACJ,SAASH;gBACX;YACF;YAEA,MAAMM,YAAYC,aAAa5B,eAAeuB,YAAY,CAAC;YAC3D,OAAO;gBACL,cAAcR,YAAY,EAAE;gBAC5B,OAAOE,cAAc;gBACrB,UAAU;gBACV,aAAa;gBACb,WAAWU;gBACX,OAAO;oBACL,SAAS;wBAAC;wBAAG;wBAAG;wBAAG;qBAAE;gBACvB;YACF;QACF;QAEA,OAAO;YACL,GAAGxB,MAAM;YACT,YAAYW;QACd;IACF;AAEK,MAAMe,uBAA2C,CAAC5B;IACvD,MAAME,SAAS;QAAE,GAAGF,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGE,MAAM;QACT,iBAAiB;IACnB;AACF;AAEO,MAAM2B,uBAA2C,CAAC7B;IACvD,MAAME,SAAS;QAAE,GAAGF,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGE,MAAM;QACT,iBAAiB;IACnB;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotRowDimensions:
|
|
1
|
+
import type { PivotChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotRowDimensions: PivotChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Dimensions,
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Dimensions, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotRowDimensions: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const dimensions = advancedVSeed.dimensions as Dimensions\n if (!dimensions) {\n return result\n }\n const rowDimensions = dimensions.filter((dim) => dim.encoding === 'row')\n const rows = rowDimensions.map((dim) => ({\n dimensionKey: dim.id,\n title: dim.alias || dim.id,\n }))\n return {\n ...result,\n rows: rows,\n } as Partial<PivotChartConstructorOptions>\n}\n"],"names":["pivotRowDimensions","spec","context","result","advancedVSeed","dimensions","rowDimensions","dim","rows"],"mappings":"AAGO,MAAMA,qBAAyC,CAACC,MAAMC;IAC3D,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAMG,aAAaD,cAAc,UAAU;IAC3C,IAAI,CAACC,YACH,OAAOF;IAET,MAAMG,gBAAgBD,WAAW,MAAM,CAAC,CAACE,MAAQA,AAAiB,UAAjBA,IAAI,QAAQ;IAC7D,MAAMC,OAAOF,cAAc,GAAG,CAAC,CAACC,MAAS;YACvC,cAAcA,IAAI,EAAE;YACpB,OAAOA,IAAI,KAAK,IAAIA,IAAI,EAAE;QAC5B;IACA,OAAO;QACL,GAAGJ,MAAM;QACT,MAAMK;IACR;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pivotTitle:
|
|
1
|
+
import type { PivotChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const pivotTitle: PivotChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotTitle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotTitle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotTitle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotTitle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotTitle: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n if (result.columns && result.columns.length > 0) {\n result.title = {\n text: (spec as unknown as { columns: { title: string }[] }).columns.map((entry) => entry.title).join('/'),\n align: 'center',\n orient: 'top',\n padding: [2, 0, 0, 0],\n textStyle: {\n fontSize: themConfig.titleFontSize ?? 12,\n fill: themConfig.titleFontColor ?? '#000',\n fontWeight: themConfig.titleFontWeight ?? 'bold',\n },\n }\n }\n\n return result\n}\n"],"names":["pivotTitle","spec","context","result","advancedVSeed","config","chartType","themConfig","entry"],"mappings":"AAGO,MAAMA,aAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,MAAM,EAAEC,SAAS,EAAE,GAAGF;IAC9B,MAAMG,aAAcF,QAAQ,CAACC,UAAU,EAAqB,aAAa,CAAC;IAE1E,IAAIH,OAAO,OAAO,IAAIA,OAAO,OAAO,CAAC,MAAM,GAAG,GAC5CA,OAAO,KAAK,GAAG;QACb,MAAOF,KAAqD,OAAO,CAAC,GAAG,CAAC,CAACO,QAAUA,MAAM,KAAK,EAAE,IAAI,CAAC;QACrG,OAAO;QACP,QAAQ;QACR,SAAS;YAAC;YAAG;YAAG;YAAG;SAAE;QACrB,WAAW;YACT,UAAUD,WAAW,aAAa,IAAI;YACtC,MAAMA,WAAW,cAAc,IAAI;YACnC,YAAYA,WAAW,eAAe,IAAI;QAC5C;IACF;IAGF,OAAOJ;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const addRegionPadding:
|
|
1
|
+
import type { VChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const addRegionPadding: VChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/region/addRegionPadding.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/region/addRegionPadding.ts"],"sourcesContent":["import type { IPieChartSpec } from '@visactor/vchart'\nimport type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/region/addRegionPadding.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/region/addRegionPadding.ts"],"sourcesContent":["import type { IPieChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const addRegionPadding: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IPieChartSpec\n\n if (result.region && result.region.length > 0) {\n result.region[0].padding = 10\n }\n\n return result\n}\n"],"names":["addRegionPadding","spec","result"],"mappings":"AAGO,MAAMA,mBAAmC,CAACC;IAC/C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAIC,OAAO,MAAM,IAAIA,OAAO,MAAM,CAAC,MAAM,GAAG,GAC1CA,OAAO,MAAM,CAAC,EAAE,CAAC,OAAO,GAAG;IAG7B,OAAOA;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const columnPolynomialRegressionLine:
|
|
1
|
+
import type { VChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const columnPolynomialRegressionLine: VChartSpecPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.ts"],"sourcesContent":["import type { IBarChartSpec, ICartesianSeries, IChart, IVChart } from '@visactor/vchart'\nimport { isNullish } from 'remeda'\nimport { array, clamper, regressionPolynomial } from '@visactor/vutils'\nimport type { Datum, SpecPipe, RegressionLineConfig, LinearRegressionLine, PolynomialRegressionLine } from 'src/types'\nimport { defaultRegressionLineColor } from './common'\n\nexport const columnPolynomialRegressionLine: SpecPipe = (spec, context): Partial<IBarChartSpec> => {\n const result = { ...spec } as Partial<IBarChartSpec>\n const { advancedVSeed } = context\n const { chartType, regressionLine } = advancedVSeed\n const lineTheme = advancedVSeed.config[chartType as 'scatter']?.regressionLine as RegressionLineConfig\n\n if (!regressionLine || !regressionLine.polynomialRegressionLine) {\n return result\n }\n\n const lineList = array(regressionLine.polynomialRegressionLine)\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n lineList.forEach((line, lineIndex) => {\n const theme = (lineTheme.linearRegressionLine ?? {}) as LinearRegressionLine\n const {\n color,\n lineWidth,\n lineDash,\n text,\n textColor,\n textFontSize,\n textFontWeight,\n confidenceIntervalOpacity,\n confidenceIntervalVisible = theme.confidenceIntervalVisible,\n } = line as LinearRegressionLine\n\n const childrenMarks: any[] = []\n\n ;(result.customMark as any[]).push({\n type: 'group',\n interactive: false,\n zIndex: 500,\n name: `polynomialRegressionLine-${lineIndex}`,\n style: {\n data: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const s = chart.getAllSeries()[0] as ICartesianSeries\n\n if (s) {\n const rect = s.getRegion().getLayoutRect()\n\n if (rect.width === 0 || rect.height === 0) {\n return null\n }\n\n const start = s.getRegion().getLayoutStartPoint()\n const yClamper = clamper(start.y, start.y + rect.height)\n const data = s.getViewData()?.latestData as Datum[]\n const fieldX = s.fieldX?.[0]\n const fieldY = s.fieldY?.[0]\n const xValues = s.getRawDataStatisticsByField(fieldX).values as string[]\n\n if (!fieldX || !fieldY || !data || data.length <= 2 || xValues.length <= 2) {\n return null\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { confidenceInterval, evaluateGrid } = regressionPolynomial(\n xValues.map((xVal, index: number) => {\n const filteredData = data.filter((d) => d[fieldX] === xVal)\n\n return {\n x: index,\n y: Math.max(...filteredData.map((d) => d[fieldY] as number)),\n }\n }),\n undefined,\n undefined,\n {\n degree: (line as PolynomialRegressionLine).degree ?? 2,\n },\n )\n const N = xValues.length\n const xAxisHelper = s.getXAxisHelper()\n const halfBandWidth = xAxisHelper ? xAxisHelper.getBandwidth!(0) / 2 : 0\n const lineData = evaluateGrid(N)\n const linePoints = lineData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.y }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n }\n })\n const result: {\n linePoints: { x: number; y: number }[]\n areaPoints?: { x: number; y: number; y1: number }[]\n color: string\n } = {\n linePoints,\n color: s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0]),\n }\n\n if (confidenceIntervalVisible) {\n const intervalData = confidenceInterval(N)\n\n result.areaPoints = intervalData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.lower }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n y1: yClamper(s.dataToPositionY({ [fieldY]: datum.upper })! + start.y),\n }\n })\n }\n\n return result\n }\n return null\n },\n },\n children: childrenMarks,\n })\n\n if (confidenceIntervalVisible) {\n childrenMarks.push({\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n fillOpacity: confidenceIntervalOpacity ?? theme.confidenceIntervalOpacity,\n fill: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.areaPoints\n }\n\n return []\n },\n },\n })\n }\n\n childrenMarks.push({\n type: 'line',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n stroke: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.linePoints\n }\n\n return []\n },\n },\n })\n\n if (!isNullish(text)) {\n childrenMarks.push({\n type: 'text',\n interactive: false,\n zIndex: 500,\n style: {\n textAlign: 'end',\n fill: textColor ?? theme.textColor,\n fontSize: textFontSize ?? theme.textFontSize,\n fontWeight: textFontWeight ?? theme.textFontWeight,\n text: text,\n x: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.x\n }\n\n return undefined\n },\n y: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.y\n }\n\n return undefined\n },\n },\n })\n }\n })\n\n return result\n}\n"],"names":["columnPolynomialRegressionLine","spec","context","result","advancedVSeed","chartType","regressionLine","lineTheme","lineList","array","line","lineIndex","theme","color","lineWidth","lineDash","text","textColor","textFontSize","textFontWeight","confidenceIntervalOpacity","confidenceIntervalVisible","childrenMarks","datum","ctx","vchart","chart","s","rect","start","yClamper","clamper","data","fieldX","fieldY","xValues","confidenceInterval","evaluateGrid","regressionPolynomial","xVal","index","filteredData","d","Math","undefined","N","xAxisHelper","halfBandWidth","lineData","linePoints","intervalData","defaultRegressionLineColor","opt","parentNode","isNullish","points"],"mappings":";;;AAMO,MAAMA,iCAA2C,CAACC,MAAMC;IAC7D,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,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OACbM,cAAc,IAAI,CAAC;YACjB,MAAM;YACN,aAAa;YACb,QAAQ;YACR,OAAO;gBACL,WAAW;gBACX,MAAML,aAAaL,MAAM,SAAS;gBAClC,UAAUM,gBAAgBN,MAAM,YAAY;gBAC5C,YAAYO,kBAAkBP,MAAM,cAAc;gBAClD,MAAMI;gBACN,GAAG,CAACO,OAAYC,KAAU4B;oBACxB,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;oBAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;wBAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;wBACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;oBACpC;gBAGF;gBACA,GAAG,CAAChC,OAAYC,KAAU4B;oBACxB,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;oBAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;wBAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;wBACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;oBACpC;gBAGF;YACF;QACF;IAEJ;IAEA,OAAOpD;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.ts"],"sourcesContent":["import type { IBarChartSpec, ICartesianSeries, IChart, IVChart } from '@visactor/vchart'\nimport { isNullish } from 'remeda'\nimport { array, clamper, regressionPolynomial } from '@visactor/vutils'\nimport type {\n Datum,\n VChartSpecPipe,\n RegressionLineConfig,\n LinearRegressionLine,\n PolynomialRegressionLine,\n} from 'src/types'\nimport { defaultRegressionLineColor } from './common'\n\nexport const columnPolynomialRegressionLine: VChartSpecPipe = (spec, context): Partial<IBarChartSpec> => {\n const result = { ...spec } as Partial<IBarChartSpec>\n const { advancedVSeed } = context\n const { chartType, regressionLine } = advancedVSeed\n const lineTheme = advancedVSeed.config[chartType as 'scatter']?.regressionLine as RegressionLineConfig\n\n if (!regressionLine || !regressionLine.polynomialRegressionLine) {\n return result\n }\n\n const lineList = array(regressionLine.polynomialRegressionLine)\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n lineList.forEach((line, lineIndex) => {\n const theme = (lineTheme.linearRegressionLine ?? {}) as LinearRegressionLine\n const {\n color,\n lineWidth,\n lineDash,\n text,\n textColor,\n textFontSize,\n textFontWeight,\n confidenceIntervalOpacity,\n confidenceIntervalVisible = theme.confidenceIntervalVisible,\n } = line as LinearRegressionLine\n\n const childrenMarks: any[] = []\n\n ;(result.customMark as any[]).push({\n type: 'group',\n interactive: false,\n zIndex: 500,\n name: `polynomialRegressionLine-${lineIndex}`,\n style: {\n data: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const s = chart.getAllSeries()[0] as ICartesianSeries\n\n if (s) {\n const rect = s.getRegion().getLayoutRect()\n\n if (rect.width === 0 || rect.height === 0) {\n return null\n }\n\n const start = s.getRegion().getLayoutStartPoint()\n const yClamper = clamper(start.y, start.y + rect.height)\n const data = s.getViewData()?.latestData as Datum[]\n const fieldX = s.fieldX?.[0]\n const fieldY = s.fieldY?.[0]\n const xValues = s.getRawDataStatisticsByField(fieldX).values as string[]\n\n if (!fieldX || !fieldY || !data || data.length <= 2 || xValues.length <= 2) {\n return null\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { confidenceInterval, evaluateGrid } = regressionPolynomial(\n xValues.map((xVal, index: number) => {\n const filteredData = data.filter((d) => d[fieldX] === xVal)\n\n return {\n x: index,\n y: Math.max(...filteredData.map((d) => d[fieldY] as number)),\n }\n }),\n undefined,\n undefined,\n {\n degree: (line as PolynomialRegressionLine).degree ?? 2,\n },\n )\n const N = xValues.length\n const xAxisHelper = s.getXAxisHelper()\n const halfBandWidth = xAxisHelper ? xAxisHelper.getBandwidth!(0) / 2 : 0\n const lineData = evaluateGrid(N)\n const linePoints = lineData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.y }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n }\n })\n const result: {\n linePoints: { x: number; y: number }[]\n areaPoints?: { x: number; y: number; y1: number }[]\n color: string\n } = {\n linePoints,\n color: s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0]),\n }\n\n if (confidenceIntervalVisible) {\n const intervalData = confidenceInterval(N)\n\n result.areaPoints = intervalData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.lower }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n y1: yClamper(s.dataToPositionY({ [fieldY]: datum.upper })! + start.y),\n }\n })\n }\n\n return result\n }\n return null\n },\n },\n children: childrenMarks,\n })\n\n if (confidenceIntervalVisible) {\n childrenMarks.push({\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n fillOpacity: confidenceIntervalOpacity ?? theme.confidenceIntervalOpacity,\n fill: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.areaPoints\n }\n\n return []\n },\n },\n })\n }\n\n childrenMarks.push({\n type: 'line',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n stroke: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.linePoints\n }\n\n return []\n },\n },\n })\n\n if (!isNullish(text)) {\n childrenMarks.push({\n type: 'text',\n interactive: false,\n zIndex: 500,\n style: {\n textAlign: 'end',\n fill: textColor ?? theme.textColor,\n fontSize: textFontSize ?? theme.textFontSize,\n fontWeight: textFontWeight ?? theme.textFontWeight,\n text: text,\n x: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.x\n }\n\n return undefined\n },\n y: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.y\n }\n\n return undefined\n },\n },\n })\n }\n })\n\n return result\n}\n"],"names":["columnPolynomialRegressionLine","spec","context","result","advancedVSeed","chartType","regressionLine","lineTheme","lineList","array","line","lineIndex","theme","color","lineWidth","lineDash","text","textColor","textFontSize","textFontWeight","confidenceIntervalOpacity","confidenceIntervalVisible","childrenMarks","datum","ctx","vchart","chart","s","rect","start","yClamper","clamper","data","fieldX","fieldY","xValues","confidenceInterval","evaluateGrid","regressionPolynomial","xVal","index","filteredData","d","Math","undefined","N","xAxisHelper","halfBandWidth","lineData","linePoints","intervalData","defaultRegressionLineColor","opt","parentNode","isNullish","points"],"mappings":";;;AAYO,MAAMA,iCAAiD,CAACC,MAAMC;IACnE,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,SAAS,EAAEC,cAAc,EAAE,GAAGF;IACtC,MAAMG,YAAYH,cAAc,MAAM,CAACC,UAAuB,EAAE;IAEhE,IAAI,CAACC,kBAAkB,CAACA,eAAe,wBAAwB,EAC7D,OAAOH;IAGT,MAAMK,WAAWC,MAAMH,eAAe,wBAAwB;IAE9D,IAAI,CAACH,OAAO,UAAU,EACpBA,OAAO,UAAU,GAAG,EAAE;IAGx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IAAI,IAAI,EAAE,UAAU;oBAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;wBAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;wBACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;oBACpC;gBAGF;gBACA,GAAG,CAAChC,OAAYC,KAAU4B;oBACxB,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;oBAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;wBAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;wBACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;oBACpC;gBAGF;YACF;QACF;IAEJ;IAEA,OAAOpD;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const ecdfRegressionLine:
|
|
1
|
+
import type { VChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const ecdfRegressionLine: VChartSpecPipe;
|
|
@@ -11,7 +11,7 @@ const ecdfRegressionLine = (spec, context)=>{
|
|
|
11
11
|
const lineTheme = advancedVSeed.config[chartType]?.regressionLine;
|
|
12
12
|
if (!regressionLine || !regressionLine.ecdfRegressionLine) return result;
|
|
13
13
|
const rowColumnFields = uniqueBy(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
|
|
14
|
-
const lineList = array(regressionLine.ecdfRegressionLine);
|
|
14
|
+
const lineList = array(regressionLine.ecdfRegressionLine).filter((ecdfLine)=>false !== ecdfLine.enable);
|
|
15
15
|
if (!result.customMark) result.customMark = [];
|
|
16
16
|
lineList.forEach((line, lineIndex)=>{
|
|
17
17
|
const theme = lineTheme?.ecdfRegressionLine ?? {};
|
|
@@ -34,7 +34,7 @@ const ecdfRegressionLine = (spec, context)=>{
|
|
|
34
34
|
const scaleY = s.getYAxisHelper().getScale?.(0);
|
|
35
35
|
const viewData = s.getViewData()?.latestData;
|
|
36
36
|
if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return null;
|
|
37
|
-
const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)
|
|
37
|
+
const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)=>+d[encoding.value?.[0]]);
|
|
38
38
|
const res = ecdf(simpleData);
|
|
39
39
|
const N = Math.max(3, Math.floor(simpleData.length / 4));
|
|
40
40
|
const lineData = res.evaluateGrid(N);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, IHistogramChartSpec, IVChart } from '@visactor/vchart'\nimport { isNullish, uniqueBy } from 'remeda'\nimport { ecdf, array } from '@visactor/vutils'\nimport type { Datum, Dimension,
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, IHistogramChartSpec, IVChart } from '@visactor/vchart'\nimport { isNullish, uniqueBy } from 'remeda'\nimport { ecdf, array } from '@visactor/vutils'\nimport type { Datum, Dimension, VChartSpecPipe, Encoding, RegressionLineConfig, EcdfRegressionLine } from 'src/types'\nimport { defaultRegressionLineColor, defaultRegressionLineLabelX, defaultRegressionLineLabelY } from './common'\n\nexport const ecdfRegressionLine: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as IHistogramChartSpec\n const { advancedVSeed, vseed } = context\n const { chartType, encoding = {} as Encoding, dimensions, regressionLine } = advancedVSeed\n const { dataset } = vseed\n const lineTheme = advancedVSeed.config[chartType as 'histogram']?.regressionLine as RegressionLineConfig\n\n if (!regressionLine || !regressionLine.ecdfRegressionLine) {\n return result\n }\n\n const rowColumnFields = uniqueBy(\n dimensions.filter((dim: Dimension) => dim.encoding === 'row' || dim.encoding === 'column'),\n (item: Dimension) => item.id,\n )\n\n const lineList = array(regressionLine.ecdfRegressionLine).filter((ecdfLine) => ecdfLine.enable !== false)\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n lineList.forEach((line, lineIndex) => {\n const theme = (lineTheme?.ecdfRegressionLine ?? {}) as EcdfRegressionLine\n const { color, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight } = line as EcdfRegressionLine\n\n const childrenMarks: any[] = []\n\n ;(result.customMark as any[]).push({\n type: 'group',\n interactive: false,\n zIndex: 500,\n name: `ecdfRegressionLine-${lineIndex}`,\n style: {\n data: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const series = chart.getAllSeries().filter((s: any) => s.type === 'bar')\n\n // 直方图使用的是bar系列\n if (series && series.length) {\n const s = series[0] as ICartesianSeries\n const region = s.getRegion().getLayoutStartPoint()\n\n const fieldX = s.fieldX?.[0]\n const scaleY = s.getYAxisHelper().getScale?.(0)\n const viewData = s.getViewData()?.latestData\n\n if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) {\n return null\n }\n const simpleData = dataset\n .filter((entry: Datum) => {\n return rowColumnFields.length\n ? rowColumnFields.every((dim: Dimension) => {\n return entry[dim.id] === viewData[0][dim.id]\n })\n : true\n })\n .map((d: Datum) => +(d as any)[encoding.value?.[0] as string])\n const res = ecdf(simpleData)\n const N = Math.max(3, Math.floor(simpleData.length / 4))\n const lineData = res.evaluateGrid(N)\n const yRange = scaleY.range()\n const y0 = yRange[0]\n const y1 = yRange[yRange.length - 1]\n const scaleR = (e: number) => {\n return y0 + (y1 - y0) * e\n }\n\n const linePoints = lineData.map((ld: Datum) => {\n const d = { [fieldX]: ld.x }\n return {\n x: s.dataToPositionX(d)! + region.x,\n y: scaleR(ld.y as number) + region.y,\n }\n })\n\n return {\n linePoints,\n color: color ?? s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0]),\n }\n }\n return null\n },\n },\n children: childrenMarks,\n })\n\n childrenMarks.push({\n type: 'line',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n stroke: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.linePoints\n }\n\n return []\n },\n },\n })\n\n if (!isNullish(text)) {\n childrenMarks.push({\n type: 'text',\n interactive: false,\n zIndex: 500,\n style: {\n textAlign: 'end',\n fill: textColor ?? theme.textColor,\n fontSize: textFontSize ?? theme.textFontSize,\n fontWeight: textFontWeight ?? theme.textFontWeight,\n text: text,\n x: defaultRegressionLineLabelX,\n y: defaultRegressionLineLabelY,\n },\n })\n }\n })\n\n return result\n}\n"],"names":["ecdfRegressionLine","spec","context","result","advancedVSeed","vseed","chartType","encoding","dimensions","regressionLine","dataset","lineTheme","rowColumnFields","uniqueBy","dim","item","lineList","array","ecdfLine","line","lineIndex","theme","color","lineWidth","lineDash","text","textColor","textFontSize","textFontWeight","childrenMarks","datum","ctx","vchart","chart","series","s","region","fieldX","scaleY","viewData","simpleData","entry","d","res","ecdf","N","Math","lineData","yRange","y0","y1","scaleR","e","linePoints","ld","defaultRegressionLineColor","opt","parentNode","isNullish","defaultRegressionLineLabelX","defaultRegressionLineLabelY"],"mappings":";;;AAMO,MAAMA,qBAAqC,CAACC,MAAMC;IACvD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAEC,WAAW,CAAC,CAAa,EAAEC,U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BACA,OAAO;gBACT;YACF;YACA,UAAUN;QACZ;QAEAA,cAAc,IAAI,CAAC;YACjB,MAAM;YACN,aAAa;YACb,QAAQ;YACR,OAAO;gBACL,WAAWN,aAAaF,MAAM,SAAS;gBACvC,UAAUG,YAAYH,MAAM,QAAQ;gBACpC,QAAQC,SAASiC;gBACjB,QAAQ,CAACzB,OAAYC,KAAUyB;oBAC7B,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;oBAEvC,IAAIC,YAAY,WAAW,MAEzB,OAAOA,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;oBAG7C,OAAO,EAAE;gBACX;YACF;QACF;QAEA,IAAI,CAACC,UAAUjC,OACbI,cAAc,IAAI,CAAC;YACjB,MAAM;YACN,aAAa;YACb,QAAQ;YACR,OAAO;gBACL,WAAW;gBACX,MAAMH,aAAaL,MAAM,SAAS;gBAClC,UAAUM,gBAAgBN,MAAM,YAAY;gBAC5C,YAAYO,kBAAkBP,MAAM,cAAc;gBAClD,MAAMI;gBACN,GAAGkC;gBACH,GAAGC;YACL;QACF;IAEJ;IAEA,OAAOzD;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const kdeRegressionLine:
|
|
1
|
+
import type { VChartSpecPipe } from '../../../../../types';
|
|
2
|
+
export declare const kdeRegressionLine: VChartSpecPipe;
|
|
@@ -12,7 +12,7 @@ const kdeRegressionLine = (spec, context)=>{
|
|
|
12
12
|
const lineTheme = advancedVSeed.config[chartType]?.regressionLine;
|
|
13
13
|
if (!regressionLine || !regressionLine.kdeRegressionLine) return result;
|
|
14
14
|
const rowColumnFields = uniqueBy(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
|
|
15
|
-
const lineList = array(regressionLine.kdeRegressionLine);
|
|
15
|
+
const lineList = array(regressionLine.kdeRegressionLine).filter((kdeLine)=>false !== kdeLine.enable);
|
|
16
16
|
if (!result.customMark) result.customMark = [];
|
|
17
17
|
lineList.forEach((line, lineIndex)=>{
|
|
18
18
|
const theme = lineTheme.kdeRegressionLine ?? {};
|
|
@@ -35,7 +35,7 @@ const kdeRegressionLine = (spec, context)=>{
|
|
|
35
35
|
const scaleY = s.getYAxisHelper().getScale?.(0);
|
|
36
36
|
const viewData = s.getViewData()?.latestData;
|
|
37
37
|
if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return null;
|
|
38
|
-
const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)
|
|
38
|
+
const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)=>+d[encoding.value?.[0]]);
|
|
39
39
|
const res = kde(simpleData, {
|
|
40
40
|
bandwidth: Math.abs(viewData[0][BinEndMeasureId] - viewData[0][BinStartMeasureId])
|
|
41
41
|
});
|