@visactor/vseed 0.1.20 → 0.1.21
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 +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +1270 -172
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js +16 -6
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +3 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +8 -11
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js +0 -4
- 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 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js +22 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +474 -180
- package/dist/esm/types/chartType/area/area.d.ts +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +5 -5
- package/dist/esm/types/chartType/area/zArea.js +1 -3
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +1 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +5 -5
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +1 -3
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +1 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +5 -5
- package/dist/esm/types/chartType/bar/zBar.js +1 -3
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +1 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +5 -5
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +1 -3
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +1 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +5 -5
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +1 -3
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +1 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +5 -5
- package/dist/esm/types/chartType/column/zColumn.js +1 -3
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +1 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +5 -5
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +1 -3
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +1 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +5 -5
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +1 -3
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/donut/donut.d.ts +2 -2
- package/dist/esm/types/chartType/donut/zDonut.d.ts +1 -5
- package/dist/esm/types/chartType/donut/zDonut.js +2 -2
- package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
- package/dist/esm/types/chartType/dualAxis/dualAxis.d.ts +1 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +5 -5
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js +1 -3
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js.map +1 -1
- package/dist/esm/types/chartType/funnel/funnel.d.ts +1 -1
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +5 -5
- package/dist/esm/types/chartType/funnel/zFunnel.js +1 -3
- package/dist/esm/types/chartType/funnel/zFunnel.js.map +1 -1
- package/dist/esm/types/chartType/heatmap/heatmap.d.ts +1 -1
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +5 -5
- package/dist/esm/types/chartType/heatmap/zHeatmap.js +1 -3
- package/dist/esm/types/chartType/heatmap/zHeatmap.js.map +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +1 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +5 -5
- package/dist/esm/types/chartType/line/zLine.js +1 -3
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/pie/pie.d.ts +2 -2
- package/dist/esm/types/chartType/pie/zPie.d.ts +1 -5
- package/dist/esm/types/chartType/pie/zPie.js +2 -2
- package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
- package/dist/esm/types/chartType/radar/radar.d.ts +1 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +5 -5
- package/dist/esm/types/chartType/radar/zRadar.js +1 -3
- package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
- package/dist/esm/types/chartType/rose/rose.d.ts +3 -3
- package/dist/esm/types/chartType/rose/zRose.d.ts +5 -5
- package/dist/esm/types/chartType/rose/zRose.js +1 -3
- package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +3 -3
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +5 -5
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +1 -3
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +1 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +5 -5
- package/dist/esm/types/chartType/scatter/zScatter.js +1 -3
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +474 -180
- package/dist/esm/types/properties/config/config.js +5 -5
- package/dist/esm/types/properties/config/config.js.map +1 -1
- package/dist/esm/types/properties/config/label/index.d.ts +2 -0
- package/dist/esm/types/properties/config/label/index.js +1 -0
- package/dist/esm/types/properties/config/label/label.d.ts +0 -7
- package/dist/esm/types/properties/config/label/pieLabel.d.ts +10 -0
- package/dist/esm/types/properties/config/label/pieLabel.js +0 -0
- package/dist/esm/types/properties/config/label/zLabel.d.ts +0 -5
- package/dist/esm/types/properties/config/label/zLabel.js +1 -6
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
- package/dist/esm/types/properties/config/label/zPieLabel.d.ts +46 -0
- package/dist/esm/types/properties/config/label/zPieLabel.js +12 -0
- package/dist/esm/types/properties/config/label/zPieLabel.js.map +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +474 -180
- package/dist/esm/types/zVseed.d.ts +82 -90
- package/dist/umd/index.js +85 -93
- package/dist/umd/index.js.map +1 -1
- package/package.json +7 -3
@@ -1,11 +1,11 @@
|
|
1
|
-
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPieStyleFill, datasetPivot, datasetXY, discreteLegend, initDonut, initPivot,
|
1
|
+
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPieStyleFill, datasetPivot, datasetXY, discreteLegend, initDonut, initPivot, labelPie, linearColor, pieStyle, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, tooltip } from "../pipes/index.js";
|
2
2
|
const donut = [
|
3
3
|
initDonut,
|
4
4
|
colorAdapter(color, linearColor),
|
5
5
|
backgroundColor,
|
6
6
|
datasetXY,
|
7
7
|
progressive,
|
8
|
-
|
8
|
+
labelPie,
|
9
9
|
colorPieStyleFill(pieStyle),
|
10
10
|
colorAdapter(discreteLegend, colorLegend),
|
11
11
|
tooltip,
|
@@ -25,7 +25,7 @@ const pivotDonut = [
|
|
25
25
|
backgroundColor,
|
26
26
|
datasetXY,
|
27
27
|
progressive,
|
28
|
-
|
28
|
+
labelPie,
|
29
29
|
colorPieStyleFill(pieStyle),
|
30
30
|
tooltip,
|
31
31
|
annotationPoint,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/donut.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/donut.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n color,\n datasetXY,\n datasetPivot,\n initDonut,\n initPivot,\n
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/donut.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/donut.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n color,\n datasetXY,\n datasetPivot,\n initDonut,\n initPivot,\n discreteLegend,\n pivotAdapter,\n pivotColumnDimensions,\n pivotGridStyle,\n pivotIndicators,\n pivotIndicatorsAsRow,\n pivotDiscreteLegend,\n pivotRowDimensions,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n pivotColorLegend,\n pieStyle,\n colorPieStyleFill,\n labelPie,\n} from '../pipes'\n\nconst donut: SpecPipeline = [\n initDonut,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n labelPie,\n colorPieStyleFill(pieStyle),\n colorAdapter(discreteLegend, colorLegend),\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotDonut: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initDonut,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n labelPie,\n colorPieStyleFill(pieStyle),\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const donutSpecPipeline: SpecPipeline = [pivotAdapter(donut, pivotDonut)]\n"],"names":["donut","initDonut","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","labelPie","colorPieStyleFill","pieStyle","discreteLegend","colorLegend","tooltip","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotDonut","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","donutSpecPipeline","pivotAdapter"],"mappings":";AA+BA,MAAMA,QAAsB;IAC1BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC,kBAAkBC;IAClBR,aAAaS,gBAAgBC;IAC7BC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,aAA2B;IAC/BC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdtB;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC,kBAAkBC;QAClBG;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAvB,aAAawB,qBAAqBC;CACnC;AAEM,MAAMC,oBAAkC;IAACC,aAAa7B,OAAOkB;CAAY"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, barStyle, color, colorAdapter, colorAreaStyleFill, colorBarStyleFill, colorLegend, colorLineStyleFill, colorPointStyleFill, datasetPivot, datasetPrimary, datasetSecondary, discreteLegend, dualChartTypePrimary, dualChartTypeSecondary, initDualAxisPrimary, initDualAxisSecondary, initPivot, labelPrimary, labelSecondary, lineStyle, linearColor, linearColorForDualAxis, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateDimensionHover, pointStyle, progressive, series, seriesDualAxis, tooltipPrimary, tooltipSecondary, verticalCrosshairRect, xBand, yLinearPrimary, yLinearSecondary } from "../pipes/index.js";
|
2
2
|
const dualAxis = [
|
3
3
|
seriesDualAxis([
|
4
4
|
initDualAxisPrimary,
|
@@ -35,7 +35,7 @@ const dualAxis = [
|
|
35
35
|
annotationPoint,
|
36
36
|
annotationVerticalLine,
|
37
37
|
annotationHorizontalLine,
|
38
|
-
|
38
|
+
annotationAreaBand
|
39
39
|
];
|
40
40
|
const pivotDualAxis = [
|
41
41
|
initPivot,
|
@@ -77,7 +77,7 @@ const pivotDualAxis = [
|
|
77
77
|
annotationPoint,
|
78
78
|
annotationVerticalLine,
|
79
79
|
annotationHorizontalLine,
|
80
|
-
|
80
|
+
annotationAreaBand
|
81
81
|
]),
|
82
82
|
pivotRowDimensions,
|
83
83
|
pivotColumnDimensions,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/dualAxis.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n xBand,\n backgroundColor,\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
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/dualAxis.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n xBand,\n backgroundColor,\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 pointStyle,\n lineStyle,\n pointStateDimensionHover,\n progressive,\n datasetPrimary,\n datasetSecondary,\n areaStyle,\n barStyle,\n verticalCrosshairRect,\n yLinearSecondary,\n initDualAxisPrimary,\n initDualAxisSecondary,\n labelPrimary,\n labelSecondary,\n tooltipPrimary,\n tooltipSecondary,\n yLinearPrimary,\n dualChartTypePrimary,\n dualChartTypeSecondary,\n seriesDualAxis,\n series,\n colorBarStyleFill,\n colorPointStyleFill,\n colorLineStyleFill,\n colorAreaStyleFill,\n linearColor,\n colorAdapter,\n colorLegend,\n pivotColorLegend,\n linearColorForDualAxis,\n annotationAreaBand,\n} from '../pipes'\n\nconst dualAxis: SpecPipeline = [\n seriesDualAxis(\n [\n initDualAxisPrimary,\n dualChartTypePrimary,\n datasetPrimary,\n labelPrimary,\n tooltipPrimary,\n progressive,\n\n colorBarStyleFill(barStyle),\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n ],\n [\n initDualAxisSecondary,\n dualChartTypeSecondary,\n datasetSecondary,\n labelSecondary,\n tooltipSecondary,\n progressive,\n\n colorBarStyleFill(barStyle),\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n ],\n ),\n xBand,\n yLinearPrimary,\n yLinearSecondary,\n\n colorAdapter(color, linearColorForDualAxis),\n colorAdapter(discreteLegend, colorLegend),\n\n backgroundColor,\n\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotDualAxis: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n series(\n [\n initDualAxisPrimary,\n dualChartTypePrimary,\n datasetPrimary,\n labelPrimary,\n tooltipPrimary,\n progressive,\n\n colorBarStyleFill(barStyle),\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n ],\n [\n initDualAxisSecondary,\n dualChartTypeSecondary,\n datasetSecondary,\n labelSecondary,\n tooltipSecondary,\n progressive,\n\n colorBarStyleFill(barStyle),\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n ],\n ),\n xBand,\n yLinearPrimary,\n yLinearSecondary,\n colorAdapter(color, linearColor),\n backgroundColor,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const dualAxisSpecPipeline: SpecPipeline = [pivotAdapter(dualAxis, pivotDualAxis)]\n"],"names":["dualAxis","seriesDualAxis","initDualAxisPrimary","dualChartTypePrimary","datasetPrimary","labelPrimary","tooltipPrimary","progressive","colorBarStyleFill","barStyle","colorPointStyleFill","pointStyle","pointStateDimensionHover","colorLineStyleFill","lineStyle","colorAreaStyleFill","areaStyle","initDualAxisSecondary","dualChartTypeSecondary","datasetSecondary","labelSecondary","tooltipSecondary","xBand","yLinearPrimary","yLinearSecondary","colorAdapter","color","linearColorForDualAxis","discreteLegend","colorLegend","backgroundColor","verticalCrosshairRect","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotDualAxis","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","series","linearColor","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","dualAxisSpecPipeline","pivotAdapter"],"mappings":";AAmDA,MAAMA,WAAyB;IAC7BC,eACE;QACEC;QACAC;QACAC;QACAC;QACAC;QACAC;QAEAC,kBAAkBC;QAClBC,oBAAoBC;QACpBC;QACAC,mBAAmBC;QACnBC,mBAAmBC;KACpB,EACD;QACEC;QACAC;QACAC;QACAC;QACAC;QACAd;QAEAC,kBAAkBC;QAClBC,oBAAoBC;QACpBC;QACAC,mBAAmBC;QACnBC,mBAAmBC;KACpB;IAEHM;IACAC;IACAC;IAEAC,aAAaC,OAAOC;IACpBF,aAAaG,gBAAgBC;IAE7BC;IAEAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,gBAA8B;IAClCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdC,OACE;YACExC;YACAC;YACAC;YACAC;YACAC;YACAC;YAEAC,kBAAkBC;YAClBC,oBAAoBC;YACpBC;YACAC,mBAAmBC;YACnBC,mBAAmBC;SACpB,EACD;YACEC;YACAC;YACAC;YACAC;YACAC;YACAd;YAEAC,kBAAkBC;YAClBC,oBAAoBC;YACpBC;YACAC,mBAAmBC;YACnBC,mBAAmBC;SACpB;QAEHM;QACAC;QACAC;QACAC,aAAaC,OAAOiB;QACpBb;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDS;IACAC;IACApB,aAAaqB,qBAAqBC;CACnC;AAEM,MAAMC,uBAAqC;IAACC,aAAajD,UAAUoC;CAAe"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPieStyleFill, datasetPivot, datasetXY, discreteLegend, initPie, initPivot,
|
1
|
+
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPieStyleFill, datasetPivot, datasetXY, discreteLegend, initPie, initPivot, labelPie, linearColor, pieStyle, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, tooltip } from "../pipes/index.js";
|
2
2
|
const pie = [
|
3
3
|
initPie,
|
4
4
|
colorAdapter(color, linearColor),
|
@@ -7,7 +7,7 @@ const pie = [
|
|
7
7
|
progressive,
|
8
8
|
colorPieStyleFill(pieStyle),
|
9
9
|
colorAdapter(discreteLegend, colorLegend),
|
10
|
-
|
10
|
+
labelPie,
|
11
11
|
tooltip,
|
12
12
|
annotationPoint,
|
13
13
|
annotationVerticalLine,
|
@@ -26,7 +26,7 @@ const pivotPie = [
|
|
26
26
|
datasetXY,
|
27
27
|
progressive,
|
28
28
|
colorPieStyleFill(pieStyle),
|
29
|
-
|
29
|
+
labelPie,
|
30
30
|
tooltip,
|
31
31
|
annotationPoint,
|
32
32
|
annotationVerticalLine,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/pie.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/pie.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n color,\n datasetXY,\n datasetPivot,\n initPie,\n initPivot,\n
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/pie.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/pie.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n color,\n datasetXY,\n datasetPivot,\n initPie,\n initPivot,\n discreteLegend,\n pivotAdapter,\n pivotColumnDimensions,\n pivotGridStyle,\n pivotIndicators,\n pivotIndicatorsAsRow,\n pivotDiscreteLegend,\n pivotRowDimensions,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n progressive,\n pieStyle,\n colorPieStyleFill,\n linearColor,\n colorAdapter,\n colorLegend,\n pivotColorLegend,\n labelPie,\n} from '../pipes'\n\nconst pie: SpecPipeline = [\n initPie,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n colorPieStyleFill(pieStyle),\n colorAdapter(discreteLegend, colorLegend),\n labelPie,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotPie: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initPie,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n colorPieStyleFill(pieStyle),\n labelPie,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const pieSpecPipeline: SpecPipeline = [pivotAdapter(pie, pivotPie)]\n"],"names":["pie","initPie","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","colorPieStyleFill","pieStyle","discreteLegend","colorLegend","labelPie","tooltip","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotPie","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","pieSpecPipeline","pivotAdapter"],"mappings":";AA+BA,MAAMA,MAAoB;IACxBC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC,kBAAkBC;IAClBP,aAAaQ,gBAAgBC;IAC7BC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,WAAyB;IAC7BC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdtB;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC,kBAAkBC;QAClBG;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAvB,aAAawB,qBAAqBC;CACnC;AAEM,MAAMC,kBAAgC;IAACC,aAAa7B,KAAKkB;CAAU"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose,
|
1
|
+
import { backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
2
2
|
const rose = [
|
3
3
|
initRose,
|
4
4
|
stackCornerRadius,
|
@@ -11,7 +11,7 @@ const rose = [
|
|
11
11
|
verticalCrosshairRect,
|
12
12
|
colorRoseStyleFill(roseStyle),
|
13
13
|
colorAdapter(discreteLegend, colorLegend),
|
14
|
-
|
14
|
+
labelPie,
|
15
15
|
tooltip
|
16
16
|
];
|
17
17
|
const pivotRose = [
|
@@ -30,7 +30,7 @@ const pivotRose = [
|
|
30
30
|
radiusAxis,
|
31
31
|
verticalCrosshairRect,
|
32
32
|
colorRoseStyleFill(roseStyle),
|
33
|
-
|
33
|
+
labelPie,
|
34
34
|
tooltip
|
35
35
|
]),
|
36
36
|
pivotRowDimensions,
|
@@ -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
|
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} 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 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","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseSpecPipeline","pivotAdapter"],"mappings":";AA+BA,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,gBAAgB;QACdtB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC,mBAAmBC;QACnBG;QACAC;KACD;IACDO;IACAC;IACArB,aAAasB,qBAAqBC;CACnC;AAEM,MAAMC,mBAAmB;IAACC,aAAa7B,MAAMkB;CAAW"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel,
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel, labelPie, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, tooltip, verticalCrosshairRect } from "../pipes/index.js";
|
2
2
|
const roseParallel = [
|
3
3
|
initRoseParallel,
|
4
4
|
stackCornerRadius,
|
@@ -9,7 +9,7 @@ const roseParallel = [
|
|
9
9
|
radiusAxis,
|
10
10
|
colorRoseStyleFill(roseStyle),
|
11
11
|
colorAdapter(discreteLegend, colorLegend),
|
12
|
-
|
12
|
+
labelPie,
|
13
13
|
tooltip,
|
14
14
|
verticalCrosshairRect,
|
15
15
|
annotationPoint,
|
@@ -32,7 +32,7 @@ const pivotRoseParallel = [
|
|
32
32
|
radiusAxis,
|
33
33
|
verticalCrosshairRect,
|
34
34
|
colorRoseStyleFill(roseStyle),
|
35
|
-
|
35
|
+
labelPie,
|
36
36
|
tooltip,
|
37
37
|
annotationPoint,
|
38
38
|
annotationVerticalLine,
|
@@ -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
|
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} 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 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","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseParallelSpecPipeline","pivotAdapter"],"mappings":";AAkCA,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,gBAAgB;QACdzB;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAO;QACAN,mBAAmBC;QACnBG;QACAC;QACAE;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAzB,aAAa0B,qBAAqBC;CACnC;AAEM,MAAMC,2BAAyC;IAACC,aAAahC,cAAcqB;CAAmB"}
|
@@ -21,6 +21,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
21
21
|
};
|
22
22
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
23
23
|
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', textBackgroundVisible = true, textBackgroundColor = '#191d24', textBackgroundBorderColor = '#191d24', textBackgroundBorderWidth = 1, textBackgroundBorderRadius = 4, textBackgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4 } = annotationArea;
|
24
|
+
const dy = textPosition?.includes('bottom') ? -1 * textFontSize : textFontSize;
|
24
25
|
const dataset = advancedVSeed.dataset.flat();
|
25
26
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector(datum, selectorPoint)) : [];
|
26
27
|
return {
|
@@ -29,14 +30,19 @@ const annotationAreaBand = (spec, context)=>{
|
|
29
30
|
positions: (data, context)=>{
|
30
31
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
31
32
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
33
|
+
const bandPosition = context?._scaleConfig?.bandPosition || 0;
|
32
34
|
const yAxisHelper = context.getYAxisHelper();
|
33
35
|
const xAxisHelper = context.getXAxisHelper();
|
34
36
|
if ('function' == typeof xAxisHelper?.getBandwidth) {
|
35
37
|
const depth = context.fieldX.length ?? 0;
|
36
38
|
const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1);
|
37
39
|
const yScale = yAxisHelper.getScale();
|
38
|
-
const
|
39
|
-
const
|
40
|
+
const startX = Math.min(...xyList.map((item)=>item.x)) - (outerPadding || 4);
|
41
|
+
const endX = Math.max(...xyList.map((item)=>item.x)) + (outerPadding || 4);
|
42
|
+
const width = endX - startX + xBandWidth;
|
43
|
+
const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition);
|
44
|
+
const minX = middleX - width / 2;
|
45
|
+
const maxX = middleX + width / 2;
|
40
46
|
const minY = Math.min(...yScale.range());
|
41
47
|
const maxY = Math.max(...yScale.range());
|
42
48
|
return [
|
@@ -62,8 +68,12 @@ const annotationAreaBand = (spec, context)=>{
|
|
62
68
|
const depth = context.fieldY.length ?? 0;
|
63
69
|
const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1);
|
64
70
|
const xScale = xAxisHelper.getScale();
|
65
|
-
const
|
66
|
-
const
|
71
|
+
const startY = Math.min(...xyList.map((item)=>item.y)) - (outerPadding || 4);
|
72
|
+
const endY = Math.max(...xyList.map((item)=>item.y)) + (outerPadding || 4);
|
73
|
+
const width = endY - startY + yBandWidth;
|
74
|
+
const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition);
|
75
|
+
const minY = middleY - width / 2;
|
76
|
+
const maxY = middleY + width / 2;
|
67
77
|
const minX = Math.min(...xScale.range());
|
68
78
|
const maxX = Math.max(...xScale.range());
|
69
79
|
return [
|
@@ -92,7 +102,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
92
102
|
visible: true,
|
93
103
|
text: text,
|
94
104
|
style: {
|
95
|
-
dy:
|
105
|
+
dy: dy,
|
96
106
|
textAlign: textAlign,
|
97
107
|
textBaseline: textBaseline,
|
98
108
|
stroke: textBackgroundColor,
|
@@ -105,7 +115,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
105
115
|
visible: textBackgroundVisible,
|
106
116
|
padding: textBackgroundPadding,
|
107
117
|
style: {
|
108
|
-
dy:
|
118
|
+
dy: dy,
|
109
119
|
cornerRadius: textBackgroundBorderRadius ?? 4,
|
110
120
|
fill: textBackgroundColor,
|
111
121
|
stroke: textBackgroundBorderColor,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { annotation } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textPosition = 'top',\n textColor = '#ffffff',\n textFontSize = 12,\n textFontWeight = 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n textBackgroundVisible = true,\n textBackgroundColor = '#191d24',\n textBackgroundBorderColor = '#191d24',\n textBackgroundBorderWidth = 1,\n textBackgroundBorderRadius = 4,\n textBackgroundPadding = 4,\n\n areaColor = '#888888',\n areaColorOpacity = 0.15,\n areaBorderColor = '#888888',\n areaBorderRadius = 4,\n areaBorderWidth = 1,\n\n outerPadding = 4,\n } = annotationArea\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n\n const minX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const maxX = Math.max(...xyList.map((item) => item.x)) + xBandWidth + (outerPadding || 4)\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const minY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const maxY = Math.max(...xyList.map((item) => item.y)) + yBandWidth + (outerPadding || 4)\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition || 'top'],\n visible: true,\n text: text,\n style: {\n dy: textFontSize,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: textFontSize,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","annotation","annotationArea","annotationAreaList","Array","positionMap","markArea","selectorPoint","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","outerPadding","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","minX","Math","maxX","minY","maxY","yBandWidth","xScale"],"mappings":";;;AAMO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,UAAU,EAAE,GAAGD;IAEvB,IAAI,CAACC,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOH;IAGT,MAAM,EAAEI,cAAc,EAAE,GAAGD;IAC3B,MAAME,qBAAqBC,MAAM,OAAO,CAACF,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMG,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IAEA,MAAMC,WAAWH,mBAAmB,OAAO,CAAC,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QE;oBACR,WAAW;oBACX,MAAMN;oBACN,UAAUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIT;wBACJ,cAAcQ,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;oBACb;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;gBAChB;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG1B,IAAI;QACP,UAAUQ;IACZ;AACF"}
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { annotation } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textPosition = 'top',\n textColor = '#ffffff',\n textFontSize = 12,\n textFontWeight = 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n textBackgroundVisible = true,\n textBackgroundColor = '#191d24',\n textBackgroundBorderColor = '#191d24',\n textBackgroundBorderWidth = 1,\n textBackgroundBorderRadius = 4,\n textBackgroundPadding = 4,\n\n areaColor = '#888888',\n areaColorOpacity = 0.15,\n areaBorderColor = '#888888',\n areaBorderRadius = 4,\n areaBorderWidth = 1,\n\n outerPadding = 4,\n } = annotationArea\n\n const dy = textPosition?.includes('bottom') ? -1 * textFontSize! : textFontSize\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition || 'top'],\n visible: true,\n text: text,\n style: {\n dy: dy,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: dy,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","annotation","annotationArea","annotationAreaList","Array","positionMap","markArea","selectorPoint","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","outerPadding","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;AAMO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,UAAU,EAAE,GAAGD;IAEvB,IAAI,CAACC,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOH;IAGT,MAAM,EAAEI,cAAc,EAAE,GAAGD;IAC3B,MAAME,qBAAqBC,MAAM,OAAO,CAACF,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMG,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IAEA,MAAMC,WAAWH,mBAAmB,OAAO,CAAC,CAACD;QAC3C,MAAM,EACJ,UAAUK,aAAa,EACvBC,OAAO,EAAE,EACTC,eAAe,KAAK,EACpBC,YAAY,SAAS,EACrBC,eAAe,EAAE,EACjBC,iBAAiB,GAAG,EACpBC,YAAY,QAAQ,EACpBC,eAAe,KAAK,EAEpBC,wBAAwB,IAAI,EAC5BC,sBAAsB,SAAS,EAC/BC,4BAA4B,SAAS,EACrCC,4BAA4B,CAAC,EAC7BC,6BAA6B,CAAC,EAC9BC,wBAAwB,CAAC,EAEzBC,YAAY,SAAS,EACrBC,mBAAmB,IAAI,EACvBC,kBAAkB,SAAS,EAC3BC,mBAAmB,CAAC,EACpBC,kBAAkB,CAAC,EAEnBC,eAAe,CAAC,EACjB,GAAGxB;QAEJ,MAAMyB,KAAKlB,cAAc,SAAS,YAAY,KAAKE,eAAgBA;QAEnE,MAAMiB,UAAU5B,cAAc,OAAO,CAAC,IAAI;QAC1C,MAAM6B,e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OAAO;wBACL,IAAIO;wBACJ,cAAcR,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;oBACb;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;gBAChB;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG1B,IAAI;QACP,UAAUQ;IACZ;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/datasetPivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/datasetPivot.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { SpecPipe } from 'src/types'\n\nexport const datasetPivot: SpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { dataset, datasetReshapeInfo } = advancedVSeed\n const records = dataset.reduce((pre, cur, index) => {\n const id = datasetReshapeInfo[index].id\n pre[id] = cur\n return pre\n }, {})\n return {\n ...result,\n records: records,\n } as PivotChartConstructorOptions\n}\n"],"names":["datasetPivot","spec","context","result","advancedVSeed","dataset","datasetReshapeInfo","records","pre","cur","index","id"],"mappings":"AAGO,MAAMA,eAAyB,CAACC,MAAMC;IAC3C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,OAAO,EAAEC,kBAAkB,EAAE,GAAGF;IACxC,MAAMG,UAAUF,QAAQ,MAAM,CAAC,CAACG,KAAKC,KAAKC;QACxC,MAAMC,KAAKL,kBAAkB,CAACI,MAAM,CAAC,EAAE;QACvCF,GAAG,CAACG,GAAG,GAAGF;QACV,OAAOD;IACT,GAAG,CAAC;IACJ,OAAO;QACL,GAAGL,MAAM;QACT,SAASI;IACX;AACF"}
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/datasetPivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/datasetPivot.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Spec, SpecPipe } from 'src/types'\n\nexport const datasetPivot: SpecPipe = (spec, context): Spec => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { dataset, datasetReshapeInfo } = advancedVSeed\n const records = dataset.reduce((pre, cur, index) => {\n const id = datasetReshapeInfo[index].id\n pre[id] = cur\n return pre\n }, {})\n return {\n ...result,\n records: records,\n } as PivotChartConstructorOptions\n}\n"],"names":["datasetPivot","spec","context","result","advancedVSeed","dataset","datasetReshapeInfo","records","pre","cur","index","id"],"mappings":"AAGO,MAAMA,eAAyB,CAACC,MAAMC;IAC3C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,OAAO,EAAEC,kBAAkB,EAAE,GAAGF;IACxC,MAAMG,UAAUF,QAAQ,MAAM,CAAC,CAACG,KAAKC,KAAKC;QACxC,MAAMC,KAAKL,kBAAkB,CAACI,MAAM,CAAC,EAAE;QACvCF,GAAG,CAACG,GAAG,GAAGF;QACV,OAAOD;IACT,GAAG,CAAC;IACJ,OAAO;QACL,GAAGL,MAAM;QACT,SAASI;IACX;AACF"}
|
@@ -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: 'adaptive',\n heightMode: 'adaptive',\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: 'all',\n },\n animationAppear: {\n duration: 600,\n type: 'all',\n direction: 'row',\n },\n }\n}\n\nexport const pivotIndicatorsAsRow: SpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: false,\n }\n}\n\nexport const pivotIndicatorsAsCol: SpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: true,\n }\n}\n"],"names":["initPivot","spec","result","pivotIndicatorsAsRow","pivotIndicatorsAsCol"],"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,YAAY;QACZ,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;AAEO,MAAMC,uBAAiC,CAACF;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,iBAAiB;IACnB;AACF;AAEO,MAAME,uBAAiC,CAACH;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,iBAAiB;IACnB;AACF"}
|
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 { Spec, 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: 'adaptive',\n heightMode: 'adaptive',\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: 'all',\n },\n animationAppear: {\n duration: 600,\n type: 'all',\n direction: 'row',\n },\n }\n}\n\nexport const pivotIndicatorsAsRow: SpecPipe = (spec): Spec => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: false,\n }\n}\n\nexport const pivotIndicatorsAsCol: SpecPipe = (spec): Spec => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: true,\n }\n}\n"],"names":["initPivot","spec","result","pivotIndicatorsAsRow","pivotIndicatorsAsCol"],"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,YAAY;QACZ,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;AAEO,MAAMC,uBAAiC,CAACF;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,iBAAiB;IACnB;AACF;AAEO,MAAME,uBAAiC,CAACH;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,iBAAiB;IACnB;AACF"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { label } from "./label.js";
|
2
2
|
import { labelPrimary, labelSecondary } from "./labelDualAxis.js";
|
3
3
|
import { labelScatter } from "./labelScatter.js";
|
4
|
-
|
4
|
+
import { labelPie } from "./labelPie.js";
|
5
|
+
export { label, labelPie, labelPrimary, labelScatter, labelSecondary };
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import type { IArcLabelSpec } from '@visactor/vchart';
|
1
2
|
import type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface';
|
2
3
|
import type { Dimensions, Encoding, FoldInfo, Formatter, Label, Measure, Measures, NumFormat, SpecPipe } from '../../../../../types';
|
3
4
|
export declare const label: SpecPipe;
|
4
|
-
export declare const generateMeasureValue: (value: number | string, measure
|
5
|
+
export declare const generateMeasureValue: (value: number | string, measure: Measure, labelAutoFormat?: boolean, numFormat?: NumFormat) => string;
|
5
6
|
export declare const generateMeasurePercent: (value: number | string, sum: number, formatter: Formatter) => string;
|
6
|
-
export declare const buildLabel: (label: Label, vseedMeasures: Measures | undefined, vseedDimensions: Dimensions | undefined, advancedVSeedMeasures: Measures, encoding: Encoding, foldInfoList: FoldInfo[]) =>
|
7
|
+
export declare const buildLabel: <T extends ILineLikeLabelSpec | IArcLabelSpec>(label: Label, vseedMeasures: Measures | undefined, vseedDimensions: Dimensions | undefined, advancedVSeedMeasures: Measures, encoding: Encoding, foldInfoList: FoldInfo[]) => T;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createFormatter, createFormatterByMeasure, findMeasureById } from "../../../../utils/index.js";
|
2
|
-
import {
|
2
|
+
import { merge, uniqueBy } from "remeda";
|
3
3
|
const label_label = (spec, context)=>{
|
4
4
|
const result = {
|
5
5
|
...spec
|
@@ -9,7 +9,6 @@ const label_label = (spec, context)=>{
|
|
9
9
|
const { chartType, encoding } = advancedVSeed;
|
10
10
|
const baseConfig = advancedVSeed.config[chartType];
|
11
11
|
const foldInfo = datasetReshapeInfo[0].foldInfo;
|
12
|
-
if (!baseConfig || isEmpty(baseConfig.label)) return result;
|
13
12
|
const { label } = baseConfig;
|
14
13
|
result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
15
14
|
foldInfo
|
@@ -17,7 +16,6 @@ const label_label = (spec, context)=>{
|
|
17
16
|
return result;
|
18
17
|
};
|
19
18
|
const generateMeasureValue = (value, measure, labelAutoFormat, numFormat = {})=>{
|
20
|
-
if (!measure) return value;
|
21
19
|
const format = merge(numFormat, measure.numFormat || measure.format);
|
22
20
|
const mergedMeasure = {
|
23
21
|
...measure,
|
@@ -35,7 +33,7 @@ const generateMeasurePercent = (value, sum, formatter)=>{
|
|
35
33
|
return formatter(percentValue);
|
36
34
|
};
|
37
35
|
const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSeedMeasures, encoding, foldInfoList)=>{
|
38
|
-
const { enable, wrap, showValue, showValuePercent, labelOverlap, labelColorSmartInvert, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {}
|
36
|
+
const { enable, wrap, showValue, showValuePercent, labelOverlap, labelColorSmartInvert, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat, numFormat = {} } = label;
|
39
37
|
const labelDims = uniqueBy((vseedDimensions || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
40
38
|
const labelMeas = uniqueBy((vseedMeasures || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
41
39
|
const percentFormat = merge(numFormat, {
|
@@ -52,19 +50,18 @@ const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSe
|
|
52
50
|
foldInfoList.forEach((foldInfo)=>{
|
53
51
|
const { measureId, measureValue, statistics } = foldInfo;
|
54
52
|
const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
if (measure) {
|
54
|
+
const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
|
55
|
+
const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
|
56
|
+
if (showValue) result.push(measureValueLabel);
|
57
|
+
if (showValuePercent) result.push(measurePercentLabel);
|
58
|
+
}
|
59
59
|
});
|
60
60
|
result.push(...meaLabels);
|
61
61
|
if (wrap) return result;
|
62
62
|
return result.join(' ');
|
63
63
|
},
|
64
64
|
position: labelPosition,
|
65
|
-
layout: {
|
66
|
-
align: labelLayout
|
67
|
-
},
|
68
65
|
style: {
|
69
66
|
fill: labelColor,
|
70
67
|
fontSize: labelFontSize,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport { createFormatter, createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n SpecPipe,\n} from 'src/types'\nimport {
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { IArcLabelSpec, ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport { createFormatter, createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n SpecPipe,\n} from 'src/types'\nimport { merge, uniqueBy } from 'remeda'\n\nexport const label: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel<ILineLikeLabelSpec>(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n )\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure: Measure,\n labelAutoFormat?: boolean,\n numFormat: NumFormat = {},\n) => {\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = <T extends ILineLikeLabelSpec | IArcLabelSpec>(\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: FoldInfo[],\n): T => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n labelOverlap,\n labelColorSmartInvert,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat,\n numFormat = {},\n } = label\n\n const labelDims = uniqueBy(\n (vseedDimensions || []).filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n const labelMeas = uniqueBy(\n (vseedMeasures || []).filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n formatMethod: (_, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item) => item.alias || item.id)\n const meaLabels = labelMeas.map((item) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n if (measure) {\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n const measurePercentLabel = generateMeasurePercent(\n datum[measureValue] as number | string,\n statistics.sum,\n percentFormatter,\n )\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n result.push(measurePercentLabel)\n }\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n } as T\n\n if (labelOverlap) {\n result.overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","labelOverlap","labelColorSmartInvert","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","labelDims","uniqueBy","item","labelMeas","percentFormat","percentFormatter","createFormatter","_","datum","dimLabels","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","measurePercentLabel"],"mappings":";;AAiBO,MAAM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;YACF;YAEAzD,OAAO,IAAI,IAAImD;YAEf,IAAIrB,MACF,OAAO9B;YAET,OAAOA,OAAO,IAAI,CAAC;QACrB;QACA,UAAUuC;QACV,OAAO;YACL,MAAMJ;YACN,UAAUC;YACV,YAAYC;YACZ,YAAYC;QACd;QACA,aAAaJ;IACf;IAEA,IAAID,cACFjC,OAAO,OAAO,GAAG;QACf,WAAW;QACX,YAAY;IACd;IAGF,OAAOA;AACT"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { isNullish } from "remeda";
|
2
1
|
import { buildLabel } from "./label.js";
|
3
2
|
import { DUAL_AXIS_LABEL_Z_INDEX } from "../../../../utils/constant.js";
|
4
3
|
const labelPrimary = (spec, context)=>{
|
@@ -9,7 +8,6 @@ const labelPrimary = (spec, context)=>{
|
|
9
8
|
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
10
9
|
const { chartType } = advancedVSeed;
|
11
10
|
const baseConfig = advancedVSeed.config[chartType];
|
12
|
-
if (!baseConfig || !baseConfig.label) return result;
|
13
11
|
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
14
12
|
result.label = buildLabel(baseConfig.label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
15
13
|
foldInfoList[0]
|
@@ -25,8 +23,6 @@ const labelSecondary = (spec, context)=>{
|
|
25
23
|
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
26
24
|
const { chartType } = advancedVSeed;
|
27
25
|
const baseConfig = advancedVSeed.config[chartType];
|
28
|
-
if (!baseConfig || !baseConfig.label) return result;
|
29
|
-
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
30
26
|
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
31
27
|
result.label = buildLabel(baseConfig.label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
32
28
|
foldInfoList[1]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { Encoding, FoldInfo, Label, SpecPipe } from 'src/types'\nimport {
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { Encoding, FoldInfo, Label, SpecPipe } from 'src/types'\nimport { buildLabel } from './label'\nimport { DUAL_AXIS_LABEL_Z_INDEX } from 'src/pipeline/utils/constant'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\n\nexport const labelPrimary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n\n const foldInfoList = datasetReshapeInfo[0].foldInfoList as FoldInfo[]\n result.label = buildLabel<ILineLikeLabelSpec>(\n baseConfig.label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfoList[0]],\n )\n result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX\n return result\n}\n\nexport const labelSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n\n const foldInfoList = datasetReshapeInfo[0].foldInfoList as FoldInfo[]\n\n result.label = buildLabel<ILineLikeLabelSpec>(\n baseConfig.label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfoList[1]],\n )\n result.label.zIndex = DUAL_AXIS_LABEL_Z_INDEX\n return result\n}\n"],"names":["labelPrimary","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","encoding","chartType","baseConfig","foldInfoList","buildLabel","DUAL_AXIS_LABEL_Z_INDEX","labelSecondary"],"mappings":";;AAMO,MAAMA,eAAyB,CAACC,MAAMC;IAC3C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,QAAQ,EAAE,GAAGH;IACzC,MAAM,EAAEI,SAAS,EAAE,GAAGJ;IACtB,MAAMK,aAAaL,cAAc,MAAM,CAACI,UAAU;IAElD,MAAME,eAAeJ,kBAAkB,CAAC,EAAE,CAAC,YAAY;IACvDH,OAAO,KAAK,GAAGQ,WACbF,WAAW,KAAK,EAChBJ,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBG,UACA;QAACG,YAAY,CAAC,EAAE;KAAC;IAEnBP,OAAO,KAAK,CAAC,MAAM,GAAGS;IACtB,OAAOT;AACT;AAEO,MAAMU,iBAA2B,CAACZ,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,QAAQ,EAAE,GAAGH;IACzC,MAAM,EAAEI,SAAS,EAAE,GAAGJ;IACtB,MAAMK,aAAaL,cAAc,MAAM,CAACI,UAAU;IAElD,MAAME,eAAeJ,kBAAkB,CAAC,EAAE,CAAC,YAAY;IAEvDH,OAAO,KAAK,GAAGQ,WACbF,WAAW,KAAK,EAChBJ,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBG,UACA;QAACG,YAAY,CAAC,EAAE;KAAC;IAEnBP,OAAO,KAAK,CAAC,MAAM,GAAGS;IACtB,OAAOT;AACT"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { buildLabel } from "./label.js";
|
2
|
+
const labelPie = (spec, context)=>{
|
3
|
+
const result = {
|
4
|
+
...spec
|
5
|
+
};
|
6
|
+
const { advancedVSeed, vseed } = context;
|
7
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
8
|
+
const { chartType, encoding } = advancedVSeed;
|
9
|
+
const baseConfig = advancedVSeed.config[chartType];
|
10
|
+
const foldInfo = datasetReshapeInfo[0].foldInfo;
|
11
|
+
const { label } = baseConfig;
|
12
|
+
result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, [
|
13
|
+
foldInfo
|
14
|
+
]);
|
15
|
+
if (label.labelLayout) result.label.layout = {
|
16
|
+
align: label.labelLayout
|
17
|
+
};
|
18
|
+
return result;
|
19
|
+
};
|
20
|
+
export { labelPie };
|
21
|
+
|
22
|
+
//# sourceMappingURL=labelPie.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/label/labelPie.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelPie.ts"],"sourcesContent":["import type { IArcLabelSpec, IPieChartSpec } from '@visactor/vchart'\nimport type { Encoding, FoldInfo, PieLabel, SpecPipe } from 'src/types'\nimport { buildLabel } from './label'\n\nexport const labelPie: SpecPipe = (spec, context) => {\n const result = { ...spec } as IPieChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: PieLabel }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel<IArcLabelSpec>(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n )\n if (label.labelLayout) {\n result.label.layout = {\n align: label.labelLayout,\n }\n }\n return result\n}\n"],"names":["labelPie","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","label","buildLabel"],"mappings":";AAIO,MAAMA,WAAqB,CAACC,MAAMC;IACvC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAChC,MAAMK,aAAaL,cAAc,MAAM,CAACG,UAAU;IAClD,MAAMG,WAAWJ,kBAAkB,CAAC,EAAE,CAAC,QAAQ;IAE/C,MAAM,EAAEK,KAAK,EAAE,GAAGF;IAElBN,OAAO,KAAK,GAAGS,WACbD,OACAN,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,QAAQ,EACtBI,UACA;QAACE;KAAS;IAEZ,IAAIC,MAAM,WAAW,EACnBR,OAAO,KAAK,CAAC,MAAM,GAAG;QACpB,OAAOQ,MAAM,WAAW;IAC1B;IAEF,OAAOR;AACT"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { isEmpty } from "remeda";
|
2
1
|
import { buildLabel } from "./label.js";
|
3
2
|
const labelScatter = (spec, context)=>{
|
4
3
|
const result = {
|
@@ -8,7 +7,6 @@ const labelScatter = (spec, context)=>{
|
|
8
7
|
const { datasetReshapeInfo } = advancedVSeed;
|
9
8
|
const { chartType, encoding } = advancedVSeed;
|
10
9
|
const baseConfig = advancedVSeed.config[chartType];
|
11
|
-
if (!baseConfig || isEmpty(baseConfig.label)) return result;
|
12
10
|
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
13
11
|
const { label } = baseConfig;
|
14
12
|
result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.measures, encoding, foldInfoList);
|