@visactor/vseed 0.1.40 → 0.1.42
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/builder.d.ts +3211 -349
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.d.ts +3 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.js +22 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js +1 -19
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.d.ts +1 -2
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.js +2 -20
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortYBand.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortYBand.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +28 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +0 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +7 -4
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +8 -4
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +7 -4
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +7 -4
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +11 -4
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js +172 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +13 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +38 -32
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js +28 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js +10 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/region/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js +150 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.d.ts +4 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js +21 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +98 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.d.ts +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.js +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +98 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +16 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +159 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +5 -5
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +1 -6
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/theme/common/color.d.ts +4 -0
- package/dist/esm/theme/common/color.js +6 -2
- package/dist/esm/theme/common/color.js.map +1 -1
- package/dist/esm/theme/common/regressionLine.d.ts +8 -4
- package/dist/esm/theme/common/regressionLine.js +60 -8
- package/dist/esm/theme/common/regressionLine.js.map +1 -1
- package/dist/esm/theme/common/table.d.ts +6 -0
- package/dist/esm/theme/common/table.js +4 -1
- package/dist/esm/theme/common/table.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +8 -6
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +8 -6
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +1028 -37
- package/dist/esm/types/advancedVSeed.js +2 -2
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +25 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/histogram/histogram.d.ts +7 -3
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +19 -4
- package/dist/esm/types/chartType/histogram/zHistogram.js +3 -2
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +21 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +94 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +5 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotationHorizontalLine.d.ts +13 -0
- package/dist/esm/types/properties/config/area.d.ts +6 -0
- package/dist/esm/types/properties/config/bar.d.ts +9 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +3 -0
- package/dist/esm/types/properties/config/color/color.d.ts +8 -0
- package/dist/esm/types/properties/config/color/color.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +141 -2
- package/dist/esm/types/properties/config/column.js +6 -3
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +449 -9
- package/dist/esm/types/properties/config/dualAxis.d.ts +3 -0
- package/dist/esm/types/properties/config/funnel.d.ts +3 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +3 -0
- package/dist/esm/types/properties/config/histogram.d.ts +132 -9
- package/dist/esm/types/properties/config/histogram.js +2 -2
- package/dist/esm/types/properties/config/histogram.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +3 -0
- package/dist/esm/types/properties/config/pie.d.ts +9 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +3 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +4 -1
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
- package/dist/esm/types/properties/config/rose.d.ts +6 -0
- package/dist/esm/types/properties/config/scatter.d.ts +133 -0
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.d.ts → ecdfRegressionLine.d.ts} +2 -7
- package/dist/esm/types/properties/regressionLine/index.d.ts +7 -2
- package/dist/esm/types/properties/regressionLine/index.js +1 -1
- package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +40 -0
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +57 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.d.ts +199 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js +32 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +898 -18
- package/dist/esm/types/zVseed.d.ts +138 -4
- package/dist/umd/index.js +1889 -279
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.d.ts +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js +0 -126
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js.map +0 -1
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.d.ts +0 -11
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js +0 -17
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js.map +0 -1
- /package/dist/esm/{pipeline/advanced/chart/pipes/analysis/sort.d.ts → types/properties/regressionLine/ecdfRegressionLine.js} +0 -0
- /package/dist/esm/{pipeline/advanced/chart/pipes/analysis/sort.js → types/properties/regressionLine/kdeRegressionLine.js} +0 -0
- /package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.js → linearRegressionLine.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
|
1
|
+
import { addRegionPadding, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, radiusAxis, roseStyle, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
|
2
2
|
const rose = [
|
|
3
3
|
initRose,
|
|
4
4
|
stackCornerRadius,
|
|
@@ -22,6 +22,7 @@ const pivotRose = [
|
|
|
22
22
|
datasetPivot,
|
|
23
23
|
pivotIndicators([
|
|
24
24
|
initRose,
|
|
25
|
+
addRegionPadding,
|
|
25
26
|
stackCornerRadius,
|
|
26
27
|
stackInverse,
|
|
27
28
|
colorAdapter(color, linearColor),
|
|
@@ -36,6 +37,7 @@ const pivotRose = [
|
|
|
36
37
|
]),
|
|
37
38
|
pivotRowDimensions,
|
|
38
39
|
pivotColumnDimensions,
|
|
40
|
+
pivotTitle,
|
|
39
41
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
40
42
|
];
|
|
41
43
|
const roseSpecPipeline = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/rose.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/rose.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n verticalCrosshairRect,\n stackCornerRadius,\n initRose,\n radiusAxis,\n progressive,\n linearColor,\n colorAdapter,\n pivotColorLegend,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n labelPie,\n pivotHideIndicatorName,\n} from '../pipes'\n\nconst rose: SpecPipeline = [\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n labelPie,\n tooltip,\n]\n\nconst pivotRose: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n labelPie,\n tooltip,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseSpecPipeline = [pivotAdapter(rose, pivotRose)]\n"],"names":["rose","initRose","stackCornerRadius","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","verticalCrosshairRect","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","labelPie","tooltip","pivotRose","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/rose.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/rose.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n verticalCrosshairRect,\n stackCornerRadius,\n initRose,\n radiusAxis,\n progressive,\n linearColor,\n colorAdapter,\n pivotColorLegend,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n labelPie,\n pivotHideIndicatorName,\n pivotTitle,\n addRegionPadding,\n} from '../pipes'\n\nconst rose: SpecPipeline = [\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n labelPie,\n tooltip,\n]\n\nconst pivotRose: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initRose,\n addRegionPadding,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n labelPie,\n tooltip,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseSpecPipeline = [pivotAdapter(rose, pivotRose)]\n"],"names":["rose","initRose","stackCornerRadius","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","verticalCrosshairRect","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","labelPie","tooltip","pivotRose","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","addRegionPadding","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","roseSpecPipeline","pivotAdapter"],"mappings":";AAkCA,MAAMA,OAAqB;IACzBC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBT,aAAaU,gBAAgBC;IAC7BC;IACAC;CACD;AAED,MAAMC,YAA0B;IAC9BC;IACAC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdvB;QACAwB;QACAvB;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC,mBAAmBC;QACnBG;QACAC;KACD;IACDS;IACAC;IACAC;IACAxB,aAAayB,qBAAqBC;CACnC;AAEM,MAAMC,mBAAmB;IAACC,aAAahC,MAAMkB;CAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
|
1
|
+
import { addRegionPadding, annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, radiusAxis, roseStyle, stackCornerRadius, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
|
2
2
|
const roseParallel = [
|
|
3
3
|
initRoseParallel,
|
|
4
4
|
stackCornerRadius,
|
|
@@ -25,6 +25,7 @@ const pivotRoseParallel = [
|
|
|
25
25
|
datasetPivot,
|
|
26
26
|
pivotIndicators([
|
|
27
27
|
initRoseParallel,
|
|
28
|
+
addRegionPadding,
|
|
28
29
|
stackCornerRadius,
|
|
29
30
|
colorAdapter(color, linearColor),
|
|
30
31
|
backgroundColor,
|
|
@@ -42,6 +43,7 @@ const pivotRoseParallel = [
|
|
|
42
43
|
]),
|
|
43
44
|
pivotRowDimensions,
|
|
44
45
|
pivotColumnDimensions,
|
|
46
|
+
pivotTitle,
|
|
45
47
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
46
48
|
];
|
|
47
49
|
const roseParallelSpecPipeline = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/roseParallel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n initRoseParallel,\n radiusAxis,\n progressive,\n pivotColorLegend,\n colorAdapter,\n linearColor,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n labelPie,\n pivotHideIndicatorName,\n} from '../pipes'\n\nconst roseParallel: SpecPipeline = [\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n labelPie,\n tooltip,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotRoseParallel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n labelPie,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseParallelSpecPipeline: SpecPipeline = [pivotAdapter(roseParallel, pivotRoseParallel)]\n"],"names":["roseParallel","initRoseParallel","stackCornerRadius","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","labelPie","tooltip","verticalCrosshairRect","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotRoseParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseParallelSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/roseParallel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n initRoseParallel,\n radiusAxis,\n progressive,\n pivotColorLegend,\n colorAdapter,\n linearColor,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n labelPie,\n pivotHideIndicatorName,\n pivotTitle,\n addRegionPadding,\n} from '../pipes'\n\nconst roseParallel: SpecPipeline = [\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n labelPie,\n tooltip,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotRoseParallel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initRoseParallel,\n addRegionPadding,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n labelPie,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseParallelSpecPipeline: SpecPipeline = [pivotAdapter(roseParallel, pivotRoseParallel)]\n"],"names":["roseParallel","initRoseParallel","stackCornerRadius","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","labelPie","tooltip","verticalCrosshairRect","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotRoseParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","addRegionPadding","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","roseParallelSpecPipeline","pivotAdapter"],"mappings":";AAqCA,MAAMA,eAA6B;IACjCC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBR,aAAaS,gBAAgBC;IAC7BC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,oBAAkC;IACtCC;IACAC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd1B;QACA2B;QACA1B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAO;QACAN,mBAAmBC;QACnBG;QACAC;QACAE;QACAC;QACAC;QACAC;KACD;IACDS;IACAC;IACAC;IACA5B,aAAa6B,qBAAqBC;CACnC;AAEM,MAAMC,2BAAyC;IAACC,aAAanC,cAAcqB;CAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateHover, pointStyle, progressive, scatterSize, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
|
|
1
|
+
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, linearRegressionLine, logisticRegressionLine, lowessRegressionLine, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, pointStateHover, pointStyle, polynomialRegressionLine, progressive, scatterSize, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
|
|
2
2
|
const scatter = [
|
|
3
3
|
initScatter,
|
|
4
4
|
colorAdapter(color, linearColor),
|
|
@@ -18,7 +18,11 @@ const scatter = [
|
|
|
18
18
|
annotationPoint,
|
|
19
19
|
annotationVerticalLine,
|
|
20
20
|
annotationHorizontalLine,
|
|
21
|
-
annotationArea
|
|
21
|
+
annotationArea,
|
|
22
|
+
linearRegressionLine,
|
|
23
|
+
lowessRegressionLine,
|
|
24
|
+
polynomialRegressionLine,
|
|
25
|
+
logisticRegressionLine
|
|
22
26
|
];
|
|
23
27
|
const pivotScatter = [
|
|
24
28
|
initPivot,
|
|
@@ -32,7 +36,7 @@ const pivotScatter = [
|
|
|
32
36
|
datasetScatter,
|
|
33
37
|
progressive,
|
|
34
38
|
xLinear,
|
|
35
|
-
yLinear,
|
|
39
|
+
pivotAxisStyle(yLinear),
|
|
36
40
|
scatterSize,
|
|
37
41
|
labelScatter,
|
|
38
42
|
tooltipScatter,
|
|
@@ -43,10 +47,13 @@ const pivotScatter = [
|
|
|
43
47
|
annotationPoint,
|
|
44
48
|
annotationVerticalLine,
|
|
45
49
|
annotationHorizontalLine,
|
|
46
|
-
annotationArea
|
|
50
|
+
annotationArea,
|
|
51
|
+
linearRegressionLine,
|
|
52
|
+
lowessRegressionLine
|
|
47
53
|
]),
|
|
48
54
|
pivotRowDimensions,
|
|
49
55
|
pivotColumnDimensions,
|
|
56
|
+
pivotTitle,
|
|
50
57
|
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
51
58
|
];
|
|
52
59
|
const scatterSpecPipeline = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n pivotAxisStyle,\n pivotTitle,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n pivotAxisStyle(yLinear),\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","linearRegressionLine","lowessRegressionLine","polynomialRegressionLine","logisticRegressionLine","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";AA2CA,MAAMA,UAAwB;IAC5BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACA0B,eAAezB;QACfC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDU;IACAC;IACAC;IACAnC,aAAaoC,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAazC,SAAS4B;CAAc"}
|
|
@@ -3,3 +3,4 @@ export { annotationVerticalLine } from './annotationVerticalLine';
|
|
|
3
3
|
export { annotationHorizontalLine } from './annotationHorizontalLine';
|
|
4
4
|
export { annotationArea } from './annotationArea';
|
|
5
5
|
export { annotationAreaBand } from './annotationAreaBand';
|
|
6
|
+
export { splitLine } from './splitLine';
|
|
@@ -3,4 +3,5 @@ import { annotationVerticalLine } from "./annotationVerticalLine.js";
|
|
|
3
3
|
import { annotationHorizontalLine } from "./annotationHorizontalLine.js";
|
|
4
4
|
import { annotationArea } from "./annotationArea.js";
|
|
5
5
|
import { annotationAreaBand } from "./annotationAreaBand.js";
|
|
6
|
-
|
|
6
|
+
import { splitLine } from "./splitLine.js";
|
|
7
|
+
export { annotationArea, annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, splitLine };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Color, array } from "@visactor/vutils";
|
|
2
|
+
import { isNullish, isNumber, isPlainObject } from "remeda";
|
|
3
|
+
const splitLine = (spec, context)=>{
|
|
4
|
+
const { advancedVSeed } = context;
|
|
5
|
+
const { annotation, chartType, datasetReshapeInfo } = advancedVSeed;
|
|
6
|
+
if (!annotation || !annotation.annotationHorizontalLine) return spec;
|
|
7
|
+
const baseConfig = advancedVSeed.config[chartType];
|
|
8
|
+
const splitLineConfig = array(annotation.annotationHorizontalLine).find((item)=>!!item.splitLine);
|
|
9
|
+
const splitValue = +splitLineConfig?.yValue;
|
|
10
|
+
if (Number.isNaN(splitValue) || !isNumber(splitValue)) return spec;
|
|
11
|
+
const result = {
|
|
12
|
+
...spec
|
|
13
|
+
};
|
|
14
|
+
const colorTheme = baseConfig?.color ?? {};
|
|
15
|
+
const colorConfig = {
|
|
16
|
+
positiveColor: colorTheme.positiveColor || 'red',
|
|
17
|
+
negativeColor: colorTheme.negativeColor || 'green',
|
|
18
|
+
...isPlainObject(splitLineConfig?.splitLine) ? splitLineConfig?.splitLine : {}
|
|
19
|
+
};
|
|
20
|
+
const groupMark = {
|
|
21
|
+
type: 'group',
|
|
22
|
+
name: 'annotationHorizontalLine-splitLine',
|
|
23
|
+
zIndex: 300,
|
|
24
|
+
style: {
|
|
25
|
+
splitConfig: (datum, ctx)=>{
|
|
26
|
+
const vchart = ctx.vchart;
|
|
27
|
+
const chart = vchart.getChart();
|
|
28
|
+
const lineSeries = chart.getAllSeries().find((s)=>'line' === s.type || 'area' === s.type);
|
|
29
|
+
if (!lineSeries) return;
|
|
30
|
+
const lineMark = lineSeries.getMarkInName('line') ?? lineSeries.getMarkInName('area');
|
|
31
|
+
if (!lineMark) return;
|
|
32
|
+
const lineGraphics = lineMark.getGraphics();
|
|
33
|
+
if (!lineGraphics || 1 !== lineGraphics.length || !lineGraphics[0]) return;
|
|
34
|
+
const points = lineGraphics[0].attribute.points ?? [];
|
|
35
|
+
if (lineGraphics[0].attribute.segments?.length) lineGraphics[0].attribute.segments.forEach((seg)=>{
|
|
36
|
+
seg.points.forEach((pt)=>{
|
|
37
|
+
points.push({
|
|
38
|
+
x: pt.x,
|
|
39
|
+
y: pt.y
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
if (!points || !points.length) return;
|
|
44
|
+
const splitCoordinate = lineSeries.getYAxisHelper().getScale(0).scale(splitValue);
|
|
45
|
+
const minY = Math.min(...points.map((p)=>p.y));
|
|
46
|
+
const maxY = Math.max(...points.map((p)=>p.y));
|
|
47
|
+
const ratio = (splitCoordinate - minY) / (maxY - minY);
|
|
48
|
+
const lineStroke = {
|
|
49
|
+
gradient: 'linear',
|
|
50
|
+
x0: 0,
|
|
51
|
+
x1: 0,
|
|
52
|
+
y0: 0,
|
|
53
|
+
y1: 1,
|
|
54
|
+
stops: [
|
|
55
|
+
{
|
|
56
|
+
color: colorConfig.positiveColor,
|
|
57
|
+
offset: 0
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
color: colorConfig.positiveColor,
|
|
61
|
+
offset: ratio
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
color: colorConfig.negativeColor,
|
|
65
|
+
offset: ratio + 0.0000001
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
color: colorConfig.negativeColor,
|
|
69
|
+
offset: 1
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
const areaFill = {
|
|
74
|
+
gradient: 'linear',
|
|
75
|
+
x0: 0,
|
|
76
|
+
x1: 0,
|
|
77
|
+
y0: 0,
|
|
78
|
+
y1: 1,
|
|
79
|
+
stops: [
|
|
80
|
+
{
|
|
81
|
+
color: colorConfig.positiveColor,
|
|
82
|
+
offset: 0
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
color: new Color(colorConfig.positiveColor).setOpacity(0).toRGBA(),
|
|
86
|
+
offset: ratio
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
offset: ratio + 0.0000001,
|
|
90
|
+
color: new Color(colorConfig.negativeColor).setOpacity(0).toRGBA()
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
color: colorConfig.negativeColor,
|
|
94
|
+
offset: 1
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
const attrs = {
|
|
99
|
+
segments: null,
|
|
100
|
+
points
|
|
101
|
+
};
|
|
102
|
+
if ('area' === lineGraphics[0].type) {
|
|
103
|
+
attrs.stroke = lineStroke;
|
|
104
|
+
attrs.fill = areaFill;
|
|
105
|
+
} else attrs.stroke = lineStroke;
|
|
106
|
+
lineGraphics[0].setAttributes(attrs);
|
|
107
|
+
lineGraphics[0].setFinalAttributes?.(attrs);
|
|
108
|
+
const start = lineSeries.getRegion().getLayoutStartPoint();
|
|
109
|
+
return {
|
|
110
|
+
points: points.map((entry)=>({
|
|
111
|
+
x: entry.x + start.x,
|
|
112
|
+
y: entry.y + start.y
|
|
113
|
+
})),
|
|
114
|
+
splitCoordinate,
|
|
115
|
+
areaFill,
|
|
116
|
+
lineStroke
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
children: [
|
|
121
|
+
{
|
|
122
|
+
type: 'area',
|
|
123
|
+
interactive: false,
|
|
124
|
+
zIndex: 500,
|
|
125
|
+
style: {
|
|
126
|
+
fillOpacity: 0.5,
|
|
127
|
+
points: (datum, ctx, opt)=>{
|
|
128
|
+
const parentNode = opt.mark?._product?.parent;
|
|
129
|
+
if (parentNode?.attribute?.splitConfig) {
|
|
130
|
+
const { points, splitCoordinate } = parentNode.attribute.splitConfig;
|
|
131
|
+
return points.map((entry)=>({
|
|
132
|
+
...entry,
|
|
133
|
+
y1: splitCoordinate
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
return [];
|
|
137
|
+
},
|
|
138
|
+
fill: (datum, ctx, opt)=>{
|
|
139
|
+
const parentNode = opt.mark?._product?.parent;
|
|
140
|
+
if (parentNode?.attribute?.splitConfig) {
|
|
141
|
+
const { areaFill } = parentNode.attribute.splitConfig;
|
|
142
|
+
return areaFill;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
if (!result.customMark) result.customMark = [];
|
|
150
|
+
result.customMark.push(groupMark);
|
|
151
|
+
const seriesSpec = 'line' === result.type || 'area' === result.type ? result : result.series?.find((s)=>'line' === s.type || 'area' === s.type);
|
|
152
|
+
if (seriesSpec) {
|
|
153
|
+
if (!seriesSpec.point) seriesSpec.point = {};
|
|
154
|
+
if (!seriesSpec.line) seriesSpec.line = {};
|
|
155
|
+
if (!seriesSpec.point.style) seriesSpec.point.style = {};
|
|
156
|
+
if (!seriesSpec.line.style) seriesSpec.line.style = {};
|
|
157
|
+
const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue;
|
|
158
|
+
seriesSpec.point.style.fill = (datum)=>{
|
|
159
|
+
console.log(datum);
|
|
160
|
+
return datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
|
|
161
|
+
};
|
|
162
|
+
seriesSpec.line.style.stroke = (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
|
|
163
|
+
if (seriesSpec.label && seriesSpec.label.visible && isNullish(seriesSpec.label.style?.fill)) seriesSpec.label.style = {
|
|
164
|
+
...seriesSpec.label.style,
|
|
165
|
+
fill: (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
};
|
|
170
|
+
export { splitLine };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=splitLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/splitLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/splitLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, ILineChartSpec, IVChart } from '@visactor/vchart'\nimport { array, Color as VUtilColor } from '@visactor/vutils'\nimport { isNullish, isNumber, isPlainObject } from 'remeda'\nimport type { AnnotationHorizontalLine, SpecPipe, Color } from 'src/types'\n\ninterface SplitConfig {\n points: { x: number; y: number }[]\n splitCoordinate: number\n lineStroke: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n areaFill: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n}\n\nexport const splitLine: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { annotation, chartType, datasetReshapeInfo } = advancedVSeed\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const baseConfig = advancedVSeed.config[chartType] as { color: Color }\n\n const splitLineConfig = array(annotation.annotationHorizontalLine).find(\n (item) => !!(item as AnnotationHorizontalLine).splitLine,\n ) as AnnotationHorizontalLine | undefined\n\n const splitValue = +(splitLineConfig?.yValue as number | string)\n\n if (Number.isNaN(splitValue) || !isNumber(splitValue)) {\n return spec\n }\n const result = { ...spec } as Partial<ILineChartSpec>\n const colorTheme = baseConfig?.color ?? {}\n const colorConfig = {\n positiveColor: colorTheme.positiveColor || 'red',\n negativeColor: colorTheme.negativeColor || 'green',\n ...(isPlainObject(splitLineConfig?.splitLine) ? splitLineConfig?.splitLine : {}),\n }\n\n const groupMark = {\n type: 'group',\n name: 'annotationHorizontalLine-splitLine',\n zIndex: 300,\n style: {\n splitConfig: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const lineSeries = chart.getAllSeries().find((s) => s.type === 'line' || s.type === 'area') as ICartesianSeries\n\n if (!lineSeries) {\n return\n }\n const lineMark = lineSeries.getMarkInName('line') ?? lineSeries.getMarkInName('area')\n\n if (!lineMark) {\n return\n }\n const lineGraphics = lineMark.getGraphics()\n\n if (!lineGraphics || lineGraphics.length !== 1 || !lineGraphics[0]) {\n return\n }\n const points = ((lineGraphics[0].attribute as any).points ?? []) as { x: number; y: number }[]\n\n if ((lineGraphics[0].attribute as any).segments?.length) {\n ;((lineGraphics[0].attribute as any).segments as any[]).forEach(\n (seg: { points: { x: number; y: number }[] }) => {\n seg.points.forEach((pt: { x: number; y: number }) => {\n points.push({ x: pt.x, y: pt.y })\n })\n },\n )\n }\n\n if (!points || !points.length) {\n return\n }\n const splitCoordinate = lineSeries.getYAxisHelper().getScale!(0).scale(splitValue)\n const minY = Math.min(...points.map((p) => p.y))\n const maxY = Math.max(...points.map((p) => p.y))\n const ratio = (splitCoordinate - minY) / (maxY - minY)\n const lineStroke = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: [\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: colorConfig.positiveColor,\n offset: ratio,\n },\n {\n color: colorConfig.negativeColor,\n offset: ratio + 0.0000001,\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ],\n }\n const areaFill = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: [\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: new VUtilColor(colorConfig.positiveColor).setOpacity(0).toRGBA(),\n offset: ratio,\n },\n {\n offset: ratio + 0.0000001,\n color: new VUtilColor(colorConfig.negativeColor).setOpacity(0).toRGBA(),\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ],\n }\n const attrs: any = {\n segments: null,\n points,\n }\n\n if (lineGraphics[0].type === 'area') {\n attrs.stroke = lineStroke\n attrs.fill = areaFill\n } else {\n attrs.stroke = lineStroke\n }\n\n lineGraphics[0].setAttributes(attrs as unknown as Record<string, any>)\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n lineGraphics[0].setFinalAttributes?.(attrs)\n const start = lineSeries.getRegion().getLayoutStartPoint()\n\n return {\n points: points.map((entry) => ({ x: entry.x + start.x, y: entry.y + start.y })),\n splitCoordinate,\n areaFill,\n lineStroke,\n } as SplitConfig\n },\n },\n children: [\n {\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n fillOpacity: 0.5,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { points, splitCoordinate } = parentNode.attribute.splitConfig as SplitConfig\n\n return points.map((entry: { x: number; y: number }) => {\n return {\n ...entry,\n y1: splitCoordinate,\n }\n })\n }\n\n return []\n },\n fill: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { areaFill } = parentNode.attribute.splitConfig as SplitConfig\n\n return areaFill\n }\n\n return\n },\n },\n },\n ],\n }\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n ;(result.customMark as any[]).push(groupMark)\n\n const seriesSpec =\n result.type === 'line' || result.type === 'area'\n ? result\n : result.series?.find((s) => s.type === 'line' || s.type === 'area')\n\n if (seriesSpec) {\n if (!seriesSpec.point) {\n seriesSpec.point = {}\n }\n if (!seriesSpec.line) {\n seriesSpec.line = {}\n }\n\n if (!seriesSpec.point.style) {\n seriesSpec.point.style = {}\n }\n if (!seriesSpec.line.style) {\n seriesSpec.line.style = {}\n }\n\n const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue\n\n seriesSpec.point.style.fill = (datum) => {\n console.log(datum)\n return datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor\n }\n seriesSpec.line.style.stroke = (datum) => {\n return datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor\n }\n if (seriesSpec.label && (seriesSpec.label as any).visible && isNullish((seriesSpec.label as any).style?.fill)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ;(seriesSpec.label as any).style = {\n ...(seriesSpec.label as any).style,\n fill: (datum: any) => {\n return datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor\n },\n }\n }\n }\n\n return result\n}\n"],"names":["splitLine","spec","context","advancedVSeed","annotation","chartType","datasetReshapeInfo","baseConfig","splitLineConfig","array","item","splitValue","Number","isNumber","result","colorTheme","colorConfig","isPlainObject","groupMark","datum","ctx","vchart","chart","lineSeries","s","lineMark","lineGraphics","points","seg","pt","splitCoordinate","minY","Math","p","maxY","ratio","lineStroke","areaFill","VUtilColor","attrs","start","entry","opt","parentNode","seriesSpec","measureValueKey","console","isNullish"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AK,CAAS,KAAK,EAAE,OAEpGA,WAAW,KAAK,CAAS,KAAK,GAAG;YACjC,GAAIA,WAAW,KAAK,CAAS,KAAK;YAClC,MAAM,CAACzB,QACEA,OAAO,CAAC0B,gBAAgB,IAAIlC,aAAaK,YAAY,aAAa,GAAGA,YAAY,aAAa;QAEzG;IAEJ;IAEA,OAAOF;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/init/pivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/pivot.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { SpecPipe } from 'src/types'\n\nexport const initPivot: SpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n animation: true,\n rows: [],\n columns: [],\n indicators: [],\n records: [],\n widthMode: 'standard',\n autoFillWidth: true,\n defaultHeaderColWidth: 'auto',\n defaultColWidth: 200,\n\n heightMode: 'standard',\n autoFillHeight: true,\n defaultRowHeight: 100,\n defaultHeaderRowHeight: 'auto',\n\n indicatorsAsCol: false,\n select: {\n highlightMode: 'cell',\n headerSelectMode: 'inline',\n },\n hover: {\n highlightMode: 'cross',\n },\n tooltip: {\n isShowOverflowTextTooltip: true,\n },\n corner: {\n titleOnDimension: '
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/init/pivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/pivot.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { SpecPipe } from 'src/types'\n\nexport const initPivot: SpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n animation: true,\n rows: [],\n columns: [],\n indicators: [],\n records: [],\n widthMode: 'standard',\n autoFillWidth: true,\n defaultHeaderColWidth: 'auto',\n defaultColWidth: 200,\n\n heightMode: 'standard',\n autoFillHeight: true,\n defaultRowHeight: 100,\n defaultHeaderRowHeight: 'auto',\n\n indicatorsAsCol: false,\n select: {\n highlightMode: 'cell',\n headerSelectMode: 'inline',\n },\n hover: {\n highlightMode: 'cross',\n },\n tooltip: {\n isShowOverflowTextTooltip: true,\n },\n corner: {\n titleOnDimension: 'row',\n },\n animationAppear: {\n duration: 600,\n type: 'all',\n direction: 'row',\n },\n }\n}\n"],"names":["initPivot","spec","result"],"mappings":"AAGO,MAAMA,YAAsB,CAACC;IAClC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,WAAW;QACX,MAAM,EAAE;QACR,SAAS,EAAE;QACX,YAAY,EAAE;QACd,SAAS,EAAE;QACX,WAAW;QACX,eAAe;QACf,uBAAuB;QACvB,iBAAiB;QAEjB,YAAY;QACZ,gBAAgB;QAChB,kBAAkB;QAClB,wBAAwB;QAExB,iBAAiB;QACjB,QAAQ;YACN,eAAe;YACf,kBAAkB;QACpB;QACA,OAAO;YACL,eAAe;QACjB;QACA,SAAS;YACP,2BAA2B;QAC7B;QACA,QAAQ;YACN,kBAAkB;QACpB;QACA,iBAAiB;YACf,UAAU;YACV,MAAM;YACN,WAAW;QACb;IACF;AACF"}
|
|
@@ -4,3 +4,5 @@ export { pivotGridStyle } from './pivotGridStyle';
|
|
|
4
4
|
export { pivotColumnDimensions } from './pivotColumnDimensions';
|
|
5
5
|
export { pivotRowDimensions } from './pivotRowDimensions';
|
|
6
6
|
export { pivotHideIndicatorName } from './pivotHideIndicatorName';
|
|
7
|
+
export { pivotAxisStyle } from './pivotAxisStyle';
|
|
8
|
+
export { pivotTitle } from './pivotTitle';
|
|
@@ -4,4 +4,6 @@ import { pivotGridStyle } from "./pivotGridStyle.js";
|
|
|
4
4
|
import { pivotColumnDimensions } from "./pivotColumnDimensions.js";
|
|
5
5
|
import { pivotRowDimensions } from "./pivotRowDimensions.js";
|
|
6
6
|
import { pivotHideIndicatorName } from "./pivotHideIndicatorName.js";
|
|
7
|
-
|
|
7
|
+
import { pivotAxisStyle } from "./pivotAxisStyle.js";
|
|
8
|
+
import { pivotTitle } from "./pivotTitle.js";
|
|
9
|
+
export { pivotAdapter, pivotAxisStyle, pivotColumnDimensions, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsCol, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const pivotAxisStyle = (axisStyle)=>(spec, context)=>{
|
|
2
|
+
const result = axisStyle(spec, context);
|
|
3
|
+
if (result.axes) result.axes.forEach((axis)=>{
|
|
4
|
+
axis.domainLine = {
|
|
5
|
+
visible: false
|
|
6
|
+
};
|
|
7
|
+
if (axis.grid && axis.grid.visible && axis.grid.style) axis.grid.style.strokeOpacity = 0.3;
|
|
8
|
+
});
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
export { pivotAxisStyle };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=pivotAxisStyle.js.map
|
|
@@ -0,0 +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 { SpecPipe } from 'src/types'\n\nexport const pivotAxisStyle = (axisStyle: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = axisStyle(spec, context) as ILineChartSpec\n\n if (result.axes) {\n result.axes.forEach((axis: any) => {\n axis.domainLine = {\n visible: false,\n }\n\n if (axis.grid && axis.grid.visible && axis.grid.style) {\n axis.grid.style.strokeOpacity = 0.3\n }\n })\n }\n\n return result\n }\n}\n"],"names":["pivotAxisStyle","axisStyle","spec","context","result","axis"],"mappings":"AAGO,MAAMA,iBAAiB,CAACC,YACtB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,IAAIC,OAAO,IAAI,EACbA,OAAO,IAAI,CAAC,OAAO,CAAC,CAACC;YACnBA,KAAK,UAAU,GAAG;gBAChB,SAAS;YACX;YAEA,IAAIA,KAAK,IAAI,IAAIA,KAAK,IAAI,CAAC,OAAO,IAAIA,KAAK,IAAI,CAAC,KAAK,EACnDA,KAAK,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG;QAEpC;QAGF,OAAOD;IACT"}
|
|
@@ -2,13 +2,14 @@ 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 } = advancedVSeed;
|
|
5
|
+
const { config, chartType, dimensions } = 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);
|
|
12
13
|
const borderColor = themConfig.borderColor ?? '#e3e5eb';
|
|
13
14
|
const bodyFontColor = themConfig.bodyFontColor ?? '#141414';
|
|
14
15
|
const headerFontColor = themConfig.headerFontColor ?? '#21252c';
|
|
@@ -26,12 +27,12 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
26
27
|
bodyStyle: {
|
|
27
28
|
borderColor,
|
|
28
29
|
color: bodyFontColor,
|
|
29
|
-
borderLineWidth: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
borderLineWidth: (arg)=>[
|
|
31
|
+
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
32
|
+
outlineBorderLineWidth,
|
|
33
|
+
0,
|
|
34
|
+
0 === arg.col ? outlineBorderLineWidth : 1
|
|
35
|
+
],
|
|
35
36
|
bgColor: transparent,
|
|
36
37
|
hover: {
|
|
37
38
|
cellBgColor: 'transparent'
|
|
@@ -40,12 +41,12 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
40
41
|
headerStyle: {
|
|
41
42
|
borderColor,
|
|
42
43
|
fontSize: 12,
|
|
43
|
-
borderLineWidth: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
borderLineWidth: (arg)=>[
|
|
45
|
+
outlineBorderLineWidth,
|
|
46
|
+
outlineBorderLineWidth,
|
|
47
|
+
1,
|
|
48
|
+
0 === arg.col ? outlineBorderLineWidth : 1
|
|
49
|
+
],
|
|
49
50
|
color: headerFontColor,
|
|
50
51
|
textAlign: 'center',
|
|
51
52
|
bgColor: headerBackgroundColor,
|
|
@@ -65,12 +66,12 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
65
66
|
0,
|
|
66
67
|
4
|
|
67
68
|
],
|
|
68
|
-
borderLineWidth: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
borderLineWidth: (arg)=>[
|
|
70
|
+
0 === arg.row ? outlineBorderLineWidth : 1,
|
|
71
|
+
1,
|
|
72
|
+
0,
|
|
73
|
+
outlineBorderLineWidth
|
|
74
|
+
],
|
|
74
75
|
bgColor: headerBackgroundColor,
|
|
75
76
|
hover: {
|
|
76
77
|
cellBgColor: hoverHeaderBackgroundColor,
|
|
@@ -98,13 +99,7 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
98
99
|
],
|
|
99
100
|
bgColor: headerBackgroundColor,
|
|
100
101
|
frameStyle: {
|
|
101
|
-
borderColor
|
|
102
|
-
borderLineWidth: [
|
|
103
|
-
outlineBorderLineWidth,
|
|
104
|
-
0,
|
|
105
|
-
0,
|
|
106
|
-
outlineBorderLineWidth
|
|
107
|
-
]
|
|
102
|
+
borderColor
|
|
108
103
|
},
|
|
109
104
|
hover: {
|
|
110
105
|
cellBgColor: hoverHeaderBackgroundColor,
|
|
@@ -118,9 +113,9 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
118
113
|
frameStyle: {
|
|
119
114
|
borderColor,
|
|
120
115
|
borderLineWidth: [
|
|
116
|
+
outlineBorderLineWidth,
|
|
121
117
|
outlineBorderLineWidth,
|
|
122
118
|
1,
|
|
123
|
-
0,
|
|
124
119
|
1
|
|
125
120
|
]
|
|
126
121
|
},
|
|
@@ -132,7 +127,7 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
132
127
|
cornerLeftBottomCellStyle: {
|
|
133
128
|
borderColor,
|
|
134
129
|
borderLineWidth: [
|
|
135
|
-
|
|
130
|
+
outlineBorderLineWidth,
|
|
136
131
|
0,
|
|
137
132
|
outlineBorderLineWidth,
|
|
138
133
|
outlineBorderLineWidth
|
|
@@ -153,14 +148,19 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
153
148
|
},
|
|
154
149
|
cornerRightBottomCellStyle: {
|
|
155
150
|
borderColor,
|
|
156
|
-
borderLineWidth: 0,
|
|
157
151
|
bgColor: headerBackgroundColor,
|
|
152
|
+
borderLineWidth: [
|
|
153
|
+
1,
|
|
154
|
+
outlineBorderLineWidth,
|
|
155
|
+
outlineBorderLineWidth,
|
|
156
|
+
1
|
|
157
|
+
],
|
|
158
158
|
frameStyle: {
|
|
159
159
|
borderColor,
|
|
160
160
|
borderLineWidth: [
|
|
161
161
|
1,
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
outlineBorderLineWidth,
|
|
163
|
+
outlineBorderLineWidth,
|
|
164
164
|
1
|
|
165
165
|
]
|
|
166
166
|
},
|
|
@@ -170,9 +170,15 @@ const pivotGridStyle = (spec, context)=>{
|
|
|
170
170
|
},
|
|
171
171
|
rightFrozenStyle: {
|
|
172
172
|
borderColor,
|
|
173
|
-
borderLineWidth: 1,
|
|
174
173
|
bgColor: headerBackgroundColor,
|
|
174
|
+
borderLineWidth: (arg)=>[
|
|
175
|
+
0 === arg.row || hasColumnDimension && 1 === arg.row ? outlineBorderLineWidth : 1,
|
|
176
|
+
outlineBorderLineWidth,
|
|
177
|
+
0,
|
|
178
|
+
1
|
|
179
|
+
],
|
|
175
180
|
hover: {
|
|
181
|
+
borderLineWidth: 0,
|
|
176
182
|
cellBgColor: hoverHeaderBackgroundColor
|
|
177
183
|
}
|
|
178
184
|
},
|