@visactor/vseed 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +1176 -0
- package/dist/esm/dataReshape/dataReshapeByEncoding.d.ts +1 -1
- package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
- package/dist/esm/dataReshape/foldMeasures.js +12 -11
- package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.js +31 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/heatmap.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +2 -2
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.js +29 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/addPivotDimensionsForScatter.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +2 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +13 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.js +16 -24
- package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +10 -6
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +5 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +4 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +5 -2
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultDimensions.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +8 -5
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.js +37 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/brush.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/brush/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/index.d.ts +0 -1
- package/dist/esm/pipeline/spec/chart/pipes/color/index.js +1 -2
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js +17 -8
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.js +18 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/heatmapColorDomain.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +13 -7
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js +12 -3
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js +12 -3
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js +4 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +8 -7
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +9 -2
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/utils/chatType.js +24 -4
- package/dist/esm/pipeline/utils/chatType.js.map +1 -1
- package/dist/esm/pipeline/utils/measures/typeGuard.d.ts +1 -1
- package/dist/esm/pipeline/utils/measures/typeGuard.js +30 -6
- package/dist/esm/pipeline/utils/measures/typeGuard.js.map +1 -1
- package/dist/esm/theme/common/brush.d.ts +3 -0
- package/dist/esm/theme/common/brush.js +21 -0
- package/dist/esm/theme/common/brush.js.map +1 -0
- package/dist/esm/theme/common/heatmapCell.js +4 -2
- package/dist/esm/theme/common/heatmapCell.js.map +1 -1
- package/dist/esm/theme/common/index.d.ts +1 -0
- package/dist/esm/theme/common/index.js +1 -0
- package/dist/esm/theme/common/label.d.ts +18 -0
- package/dist/esm/theme/common/label.js +9 -1
- package/dist/esm/theme/common/label.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +4 -2
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +4 -2
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +392 -0
- package/dist/esm/types/chartType/area/area.d.ts +6 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +4 -0
- package/dist/esm/types/chartType/area/zArea.js +2 -1
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +4 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +4 -0
- package/dist/esm/types/chartType/bar/zBar.js +2 -1
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +4 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +4 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/boxPlot/boxPlot.d.ts +6 -1
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +4 -0
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.js +2 -1
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +4 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +4 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +4 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/donut/donut.d.ts +6 -0
- package/dist/esm/types/chartType/donut/zDonut.d.ts +4 -0
- package/dist/esm/types/chartType/donut/zDonut.js +2 -1
- package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
- package/dist/esm/types/chartType/dualAxis/dualAxis.d.ts +6 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +4 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js +2 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js.map +1 -1
- package/dist/esm/types/chartType/funnel/funnel.d.ts +6 -0
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +4 -0
- package/dist/esm/types/chartType/funnel/zFunnel.js +2 -1
- package/dist/esm/types/chartType/funnel/zFunnel.js.map +1 -1
- package/dist/esm/types/chartType/heatmap/heatmap.d.ts +6 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +4 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.js +2 -1
- package/dist/esm/types/chartType/heatmap/zHeatmap.js.map +1 -1
- package/dist/esm/types/chartType/histogram/histogram.d.ts +6 -1
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +4 -0
- package/dist/esm/types/chartType/histogram/zHistogram.js +2 -1
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +6 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +4 -0
- package/dist/esm/types/chartType/line/zLine.js +2 -1
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/pie/pie.d.ts +6 -0
- package/dist/esm/types/chartType/pie/zPie.d.ts +4 -0
- package/dist/esm/types/chartType/pie/zPie.js +2 -1
- package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
- package/dist/esm/types/chartType/radar/radar.d.ts +6 -0
- package/dist/esm/types/chartType/radar/zRadar.d.ts +4 -0
- package/dist/esm/types/chartType/radar/zRadar.js +2 -1
- package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
- package/dist/esm/types/chartType/rose/rose.d.ts +6 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +4 -0
- package/dist/esm/types/chartType/rose/zRose.js +2 -1
- package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +6 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +4 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +2 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +4 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/brush/brush.d.ts +13 -0
- package/dist/esm/types/properties/brush/brush.js +0 -0
- package/dist/esm/types/properties/brush/index.d.ts +4 -0
- package/dist/esm/types/properties/brush/index.js +2 -0
- package/dist/esm/types/properties/brush/zBrush.d.ts +19 -0
- package/dist/esm/types/properties/brush/zBrush.js +21 -0
- package/dist/esm/types/properties/brush/zBrush.js.map +1 -0
- package/dist/esm/types/properties/config/area.d.ts +26 -0
- package/dist/esm/types/properties/config/area.js +3 -1
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +39 -0
- package/dist/esm/types/properties/config/bar.js +3 -1
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +39 -0
- package/dist/esm/types/properties/config/column.js +3 -1
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +196 -0
- package/dist/esm/types/properties/config/heatmap/heatmap.d.ts +4 -0
- package/dist/esm/types/properties/config/heatmap/zHeatmap.d.ts +1 -0
- package/dist/esm/types/properties/config/heatmap/zHeatmap.js +2 -1
- package/dist/esm/types/properties/config/heatmap/zHeatmap.js.map +1 -1
- package/dist/esm/types/properties/config/heatmap.d.ts +14 -0
- package/dist/esm/types/properties/config/heatmap.js +3 -1
- package/dist/esm/types/properties/config/heatmap.js.map +1 -1
- package/dist/esm/types/properties/config/histogram.d.ts +13 -0
- package/dist/esm/types/properties/config/histogram.js +3 -1
- package/dist/esm/types/properties/config/histogram.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +13 -0
- package/dist/esm/types/properties/config/line.js +3 -1
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +39 -0
- package/dist/esm/types/properties/config/pie.js +3 -1
- package/dist/esm/types/properties/config/pie.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +13 -0
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/index.d.ts +1 -0
- package/dist/esm/types/properties/index.js +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +392 -0
- package/dist/esm/types/zVseed.d.ts +80 -0
- package/dist/umd/index.js +456 -158
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.d.ts +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js +0 -17
- package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { isCombination, isPivot } from 'src/pipeline/utils'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\nimport { isNullish } from 'remeda'\n\nexport const pivotGridStyle: PivotChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n const onlyCombination = !isPivot(vseed) && isCombination(vseed)\n\n const result = { ...spec } as PivotChartConstructorOptions\n const transparent = 'rgba(0,0,0,0)'\n\n const borderColor = themConfig.borderColor ?? '#e3e5eb'\n const bodyFontColor = themConfig.bodyFontColor ?? '#141414'\n const headerFontColor = themConfig.headerFontColor ?? '#21252c'\n const headerBackgroundColor = themConfig.headerBackgroundColor ?? 'rgba(0,0,0,0)'\n const hoverHeaderBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderBackgroundColor ?? '#D9DDE4')\n const hoverHeaderInlineBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderInlineBackgroundColor ?? '#D9DDE455')\n const outlineBorderLineWidth = themConfig.outlineBorderLineWidth ?? 0\n const frameCornerRadius = themConfig.frameCornerRadius ?? 0\n\n if (!isNullish(themConfig.minChartWidth)) {\n result.defaultColWidth = themConfig.minChartWidth\n }\n\n if (!isNullish(themConfig.minChartHeight)) {\n result.defaultRowHeight = themConfig.minChartHeight\n }\n\n return {\n ...result,\n theme: {\n underlayBackgroundColor: transparent,\n bodyStyle: {\n borderColor,\n color: bodyFontColor,\n borderLineWidth: (arg: { row: number; col: number; table: any }) => {\n const noYAxis =\n chartType === 'pie' ||\n chartType === 'rose' ||\n chartType === 'donut' ||\n chartType === 'funnel' ||\n chartType === 'radar' ||\n chartType === 'roseParallel'\n\n return [\n arg.row === 0 ? outlineBorderLineWidth : 1,\n outlineBorderLineWidth,\n 0,\n arg.col === 0 || (noYAxis && arg.col === 1 && arg.table.colCount <= 2) ? outlineBorderLineWidth : 1,\n ]\n },\n bgColor: transparent,\n hover: {\n cellBgColor: 'transparent',\n },\n },\n headerStyle: {\n borderColor,\n fontSize: 12,\n // borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n borderLineWidth: (arg: { row: number; col: number }) => {\n return [outlineBorderLineWidth, outlineBorderLineWidth, 1, arg.col === 0 ? outlineBorderLineWidth : 1]\n },\n color: headerFontColor,\n textAlign: 'center',\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n rowHeaderStyle: {\n borderColor,\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, 1, 0, outlineBorderLineWidth]\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerHeaderStyle: {\n borderColor,\n textAlign: 'center',\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n fontWeight: 'bold',\n borderLineWidth: [outlineBorderLineWidth, 1, 1, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerLeftBottomCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n borderLineWidth: [1, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightTopCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: 0,\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n rightFrozenStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, outlineBorderLineWidth, 0, 1]\n },\n frameStyle: {\n borderLineWidth: 0,\n },\n hover: {\n borderLineWidth: 0,\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightBottomCellStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n\n bottomFrozenStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n selectionStyle: {\n cellBgColor: '',\n cellBorderColor: '',\n },\n frameStyle: {\n borderColor,\n cornerRadius: frameCornerRadius,\n borderLineWidth: outlineBorderLineWidth,\n },\n\n axisStyle: {\n leftAxisStyle: {\n cellPaddingLeft: 10,\n },\n bottomAxisStyle: {\n cellPaddingBottom: 4,\n },\n rightAxisStyle: {\n cellPaddingRight: 4,\n },\n },\n scrollStyle: {\n visible: 'scrolling',\n hoverOn: false,\n },\n },\n }\n}\n"],"names":["pivotGridStyle","spec","context","vseed","advancedVSeed","config","chartType","themConfig","onlyCombination","isPivot","isCombination","result","transparent","borderColor","bodyFontColor","headerFontColor","headerBackgroundColor","hoverHeaderBackgroundColor","hoverHeaderInlineBackgroundColor","outlineBorderLineWidth","frameCornerRadius","isNullish","arg","noYAxis","undefined"],"mappings":";;AAKO,MAAMA,iBAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGF;IACjC,MAAM,EAAEG,MAAM,EAAEC,SAAS,EAAE,GAAGF;IAC9B,MAAMG,aAAcF,QAAQ,CAACC,UAAU,EAAqB,aAAa,CAAC;IAE1E,MAAME,kBAAkB,CAACC,QAAQN,UAAUO,cAA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gBAEnF,YAAY;oBACV,iBAAiB;gBACnB;gBACA,OAAO;oBACL,iBAAiB;oBACjB,aAAaF;gBACf;YACF;YACA,4BAA4B;gBAC1BJ;gBACA,SAASG;gBACT,iBAAiB;oBAAC;oBAAGG;oBAAwBA;oBAAwB;iBAAE;gBACvE,YAAY;oBACVN;oBACA,iBAAiB;wBAAC;wBAAGM;wBAAwBA;wBAAwB;qBAAE;gBACzE;gBACA,OAAO;oBACL,aAAaF;gBACf;YACF;YAEA,mBAAmB;gBACjBJ;gBACA,iBAAiB;oBAAC;oBAAGM;oBAAwBA;oBAAwB;iBAAE;gBACvE,SAASH;gBACT,OAAO;oBACL,aAAaC;gBACf;YACF;YACA,gBAAgB;gBACd,aAAa;gBACb,iBAAiB;YACnB;YACA,YAAY;gBACVJ;gBACA,cAAcO;gBACd,iBAAiBD;YACnB;YAEA,WAAW;gBACT,eAAe;oBACb,iBAAiB;gBACnB;gBACA,iBAAiB;oBACf,mBAAmB;gBACrB;gBACA,gBAAgB;oBACd,kBAAkB;gBACpB;YACF;YACA,aAAa;gBACX,SAAS;gBACT,SAAS;YACX;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { isCombination, isPivot } from 'src/pipeline/utils'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\nimport { isNullish } from 'remeda'\n\nexport const pivotGridStyle: PivotChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n const onlyCombination = !isPivot(vseed) && isCombination(vseed)\n\n const result = { ...spec } as PivotChartConstructorOptions\n const transparent = 'rgba(0,0,0,0)'\n\n const borderColor = themConfig.borderColor ?? '#e3e5eb'\n const bodyFontColor = themConfig.bodyFontColor ?? '#141414'\n const headerFontColor = themConfig.headerFontColor ?? '#21252c'\n const headerBackgroundColor = themConfig.headerBackgroundColor ?? 'rgba(0,0,0,0)'\n const hoverHeaderBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderBackgroundColor ?? '#D9DDE4')\n const hoverHeaderInlineBackgroundColor = onlyCombination\n ? transparent\n : (themConfig.hoverHeaderInlineBackgroundColor ?? '#D9DDE455')\n const outlineBorderLineWidth = themConfig.outlineBorderLineWidth ?? 0\n const frameCornerRadius = themConfig.frameCornerRadius ?? 0\n\n if (!isNullish(themConfig.minChartWidth)) {\n result.defaultColWidth = themConfig.minChartWidth!\n }\n\n if (!isNullish(themConfig.minChartHeight)) {\n result.defaultRowHeight = themConfig.minChartHeight!\n }\n\n return {\n ...result,\n theme: {\n underlayBackgroundColor: transparent,\n bodyStyle: {\n borderColor,\n color: bodyFontColor,\n borderLineWidth: (arg: { row: number; col: number; table: any }) => {\n const noYAxis =\n chartType === 'pie' ||\n chartType === 'rose' ||\n chartType === 'donut' ||\n chartType === 'radar' ||\n chartType === 'roseParallel'\n\n return [\n arg.row === 0 || (chartType === 'funnel' && arg.row === 1 && arg.table.rowCount <= 2)\n ? outlineBorderLineWidth\n : 1,\n outlineBorderLineWidth,\n 0,\n arg.col === 0 || (noYAxis && arg.col === 1 && arg.table.colCount <= 2) ? outlineBorderLineWidth : 1,\n ]\n },\n bgColor: transparent,\n hover: {\n cellBgColor: 'transparent',\n },\n },\n headerStyle: {\n borderColor,\n fontSize: 12,\n // borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n borderLineWidth: (arg: { row: number; col: number }) => {\n return [outlineBorderLineWidth, outlineBorderLineWidth, 1, arg.col === 0 ? outlineBorderLineWidth : 1]\n },\n color: headerFontColor,\n textAlign: 'center',\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n rowHeaderStyle: {\n borderColor,\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, 1, 0, outlineBorderLineWidth]\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerHeaderStyle: {\n borderColor,\n textAlign: 'center',\n fontSize: 12,\n color: headerFontColor,\n padding: [0, 12, 0, 4],\n fontWeight: 'bold',\n borderLineWidth: [outlineBorderLineWidth, 1, 1, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n inlineRowBgColor: hoverHeaderInlineBackgroundColor || undefined,\n inlineColumnBgColor: hoverHeaderInlineBackgroundColor || undefined,\n },\n },\n cornerLeftBottomCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n bgColor: headerBackgroundColor,\n frameStyle: {\n borderColor,\n borderLineWidth: [1, 0, outlineBorderLineWidth, outlineBorderLineWidth],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightTopCellStyle: {\n borderColor,\n borderLineWidth: [outlineBorderLineWidth, outlineBorderLineWidth, 1, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: 0,\n },\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n rightFrozenStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: (arg: { row: number }) => {\n return [arg.row === 0 ? outlineBorderLineWidth : 1, outlineBorderLineWidth, 0, 1]\n },\n frameStyle: {\n borderLineWidth: 0,\n },\n hover: {\n borderLineWidth: 0,\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n cornerRightBottomCellStyle: {\n borderColor,\n bgColor: headerBackgroundColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n frameStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n },\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n\n bottomFrozenStyle: {\n borderColor,\n borderLineWidth: [1, outlineBorderLineWidth, outlineBorderLineWidth, 1],\n bgColor: headerBackgroundColor,\n hover: {\n cellBgColor: hoverHeaderBackgroundColor,\n },\n },\n selectionStyle: {\n cellBgColor: '',\n cellBorderColor: '',\n },\n frameStyle: {\n borderColor,\n cornerRadius: frameCornerRadius,\n borderLineWidth: outlineBorderLineWidth,\n },\n\n axisStyle: {\n leftAxisStyle: {\n cellPaddingLeft: 10,\n },\n bottomAxisStyle: {\n cellPaddingBottom: 4,\n },\n rightAxisStyle: {\n cellPaddingRight: 4,\n },\n },\n scrollStyle: {\n visible: 'scrolling',\n hoverOn: false,\n },\n },\n }\n}\n"],"names":["pivotGridStyle","spec","context","vseed","advancedVSeed","config","chartType","themConfig","onlyCombination","isPivot","isCombination","result","transparent","borderColor","bodyFontColor","headerFontColor","headerBackgroundColor","hoverHeaderBackgroundColor","hoverHeaderInlineBackgroundColor","outlineBorderLineWidth","frameCornerRadius","isNullish","arg","noYAxis","undefined"],"mappings":";;AAKO,MAAMA,iBAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGF;IACjC,MAAM,EAAEG,MAAM,EAAEC,SAAS,EAAE,GAAGF;IAC9B,MAAMG,aAAcF,QAAQ,CAACC,UAAU,EAAqB,aAAa,CAAC;IAE1E,MAAME,kBAAkB,CAACC,QAAQN,UAAUO,cAAcP;IAEzD,MAAMQ,SAAS;QAAE,GAAGV,IAAI;IAAC;IACz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AAwB;wBAAG;qBAAE;gBAEnF,YAAY;oBACV,iBAAiB;gBACnB;gBACA,OAAO;oBACL,iBAAiB;oBACjB,aAAaF;gBACf;YACF;YACA,4BAA4B;gBAC1BJ;gBACA,SAASG;gBACT,iBAAiB;oBAAC;oBAAGG;oBAAwBA;oBAAwB;iBAAE;gBACvE,YAAY;oBACVN;oBACA,iBAAiB;wBAAC;wBAAGM;wBAAwBA;wBAAwB;qBAAE;gBACzE;gBACA,OAAO;oBACL,aAAaF;gBACf;YACF;YAEA,mBAAmB;gBACjBJ;gBACA,iBAAiB;oBAAC;oBAAGM;oBAAwBA;oBAAwB;iBAAE;gBACvE,SAASH;gBACT,OAAO;oBACL,aAAaC;gBACf;YACF;YACA,gBAAgB;gBACd,aAAa;gBACb,iBAAiB;YACnB;YACA,YAAY;gBACVJ;gBACA,cAAcO;gBACd,iBAAiBD;YACnB;YAEA,WAAW;gBACT,eAAe;oBACb,iBAAiB;gBACnB;gBACA,iBAAiB;oBACf,mBAAmB;gBACrB;gBACA,gBAAgB;oBACd,kBAAkB;gBACpB;YACF;YACA,aAAa;gBACX,SAAS;gBACT,SAAS;YACX;QACF;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { execPipeline, isRectungularCoordinate } from '../../../../utils'\nimport type { Dataset, Encoding, Measures, PivotChartSpecPipe, SpecPipelineContext, VChartSpecPipe } from 'src/types'\nimport { unique } from 'remeda'\n\nexport const pivotIndicators =\n (chartPipeline: VChartSpecPipe[]): PivotChartSpecPipe =>\n (spec, context): Partial<PivotChartConstructorOptions> => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dataset, encoding, reshapeMeasures = [] } = advancedVSeed\n\n const colorItems = unique(datasetReshapeInfo.flatMap((d) => d.unfoldInfo.colorItems))\n const allMeasureIds = unique(datasetReshapeInfo.flatMap((d) => Object.keys(d.foldInfo.foldMap || {})))\n
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { execPipeline, isRectungularCoordinate } from '../../../../utils'\nimport type { Dataset, Encoding, Measures, PivotChartSpecPipe, SpecPipelineContext, VChartSpecPipe } from 'src/types'\nimport { unique } from 'remeda'\n\nexport const pivotIndicators =\n (chartPipeline: VChartSpecPipe[]): PivotChartSpecPipe =>\n (spec, context): Partial<PivotChartConstructorOptions> => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dataset, encoding, reshapeMeasures = [] } = advancedVSeed\n\n const colorItems = unique(datasetReshapeInfo.flatMap((d) => d.unfoldInfo.colorItems))\n const allMeasureIds = unique(datasetReshapeInfo.flatMap((d) => Object.keys(d.foldInfo.foldMap || {})))\n const indicators = datasetReshapeInfo.map((reshapeInfo, index) => {\n const subMeasures = (reshapeMeasures[index] || []) as Measures\n const subMeasuresId = (reshapeMeasures[index] || []).map((d) => d.id)\n const invalideMeasuresIds = allMeasureIds.filter((id: string) => !subMeasuresId.includes(id))\n\n const newDataset = dataset[index] as Dataset\n const newDatasetReshapeInfo = [\n {\n ...reshapeInfo,\n unfoldInfo: { ...reshapeInfo.unfoldInfo, colorItems },\n },\n ]\n const newContext: SpecPipelineContext = {\n ...context,\n advancedVSeed: {\n ...advancedVSeed,\n pivotAllDatasetReshapeInfo: datasetReshapeInfo,\n datasetReshapeInfo: newDatasetReshapeInfo,\n encoding: Object.keys(encoding).reduce((res, key) => {\n res[key as keyof Encoding] = encoding[key as keyof Encoding]?.filter((e) => {\n return !invalideMeasuresIds.includes(e)\n }) as string[]\n\n return res\n }, {} as Encoding),\n dataset: newDataset,\n },\n }\n\n const chartSpec = execPipeline(chartPipeline, newContext, {})\n\n return {\n indicatorKey: `${reshapeInfo.id}`,\n title: isRectungularCoordinate(advancedVSeed.chartType)\n ? ''\n : subMeasures.map((m) => m.alias ?? m.id).join('-'),\n cellType: 'chart',\n chartModule: 'vchart',\n chartSpec: chartSpec,\n style: {\n padding: [1, 1, 0, 1],\n },\n }\n })\n\n return {\n ...result,\n indicators: indicators,\n } as Partial<PivotChartConstructorOptions>\n }\n\nexport const pivotIndicatorsAsRow: PivotChartSpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: false,\n }\n}\n\nexport const pivotIndicatorsAsCol: PivotChartSpecPipe = (spec) => {\n const result = { ...spec } as PivotChartConstructorOptions\n\n return {\n ...result,\n indicatorsAsCol: true,\n }\n}\n"],"names":["pivotIndicators","chartPipeline","spec","context","result","advancedVSeed","datasetReshapeInfo","dataset","encoding","reshapeMeasures","colorItems","unique","d","allMeasureIds","Object","indicators","reshapeInfo","index","subMeasures","subMeasuresId","invalideMeasuresIds","id","newDataset","newDatasetReshapeInfo","newContext","res","key","e","chartSpec","execPipeline","isRectungularCoordinate","m","pivotIndicatorsAsRow","pivotIndicatorsAsCol"],"mappings":";;AAKO,MAAMA,kBACX,CAACC,gBACD,CAACC,MAAMC;QACL,MAAMC,SAAS;YAAE,GAAGF,IAAI;QAAC;QACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE,EAAE,GAAGJ;QAExE,MAAMK,aAAaC,OAAOL,mBAAmB,OAAO,CAAC,CAACM,IAAMA,EAAE,UAAU,CAAC,UAAU;QACnF,MAAMC,gBAAgBF,OAAOL,mBAAmB,OAAO,CAAC,CAACM,IAAME,OAAO,IAAI,CAACF,EAAE,QAAQ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,uBAA2C,CAAC9B;IACvD,MAAME,SAAS;QAAE,GAAGF,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGE,MAAM;QACT,iBAAiB;IACnB;AACF;AAEO,MAAM6B,uBAA2C,CAAC/B;IACvD,MAAME,SAAS;QAAE,GAAGF,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGE,MAAM;QACT,iBAAiB;IACnB;AACF"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
+
import { FoldYMeasureId } from "../../../../../dataReshape/constant.js";
|
|
1
2
|
const pivotRowDimensions = (spec, context)=>{
|
|
2
3
|
const result = {
|
|
3
4
|
...spec
|
|
4
5
|
};
|
|
5
6
|
const { advancedVSeed } = context;
|
|
6
7
|
const dimensions = advancedVSeed.dimensions;
|
|
8
|
+
const measures = advancedVSeed.measures ?? [];
|
|
7
9
|
if (!dimensions) return result;
|
|
8
10
|
const rowDimensions = dimensions.filter((dim)=>'row' === dim.encoding);
|
|
9
|
-
const rows = rowDimensions.map((dim)=>
|
|
11
|
+
const rows = rowDimensions.map((dim)=>{
|
|
12
|
+
const baseConfig = {
|
|
10
13
|
dimensionKey: dim.id,
|
|
11
|
-
title: dim.alias
|
|
12
|
-
}
|
|
14
|
+
title: dim.alias ?? dim.id
|
|
15
|
+
};
|
|
16
|
+
if (dim.id === FoldYMeasureId) baseConfig.headerFormat = (title)=>{
|
|
17
|
+
const measure = measures.find((m)=>m.id === title);
|
|
18
|
+
return measure ? measure.alias ?? measure.id : title;
|
|
19
|
+
};
|
|
20
|
+
return baseConfig;
|
|
21
|
+
});
|
|
13
22
|
return {
|
|
14
23
|
...result,
|
|
15
24
|
rows: rows
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Dimensions, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotRowDimensions: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const dimensions = advancedVSeed.dimensions as Dimensions\n if (!dimensions) {\n return result\n }\n const rowDimensions = dimensions.filter((dim) => dim.encoding === 'row')\n const rows = rowDimensions.map((dim) =>
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { FoldYMeasureId } from 'src/dataReshape/constant'\nimport type { Dimensions, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotRowDimensions: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const dimensions = advancedVSeed.dimensions as Dimensions\n const measures = advancedVSeed.measures ?? []\n if (!dimensions) {\n return result\n }\n const rowDimensions = dimensions.filter((dim) => dim.encoding === 'row')\n const rows = rowDimensions.map((dim) => {\n const baseConfig: any = {\n dimensionKey: dim.id,\n title: dim.alias ?? dim.id,\n }\n\n if (dim.id === FoldYMeasureId) {\n baseConfig.headerFormat = (title: string) => {\n const measure = measures.find((m) => m.id === title)\n\n return measure ? (measure.alias ?? measure.id) : title\n }\n }\n\n return baseConfig\n }) as unknown\n return {\n ...result,\n rows: rows,\n } as Partial<PivotChartConstructorOptions>\n}\n"],"names":["pivotRowDimensions","spec","context","result","advancedVSeed","dimensions","measures","rowDimensions","dim","rows","baseConfig","FoldYMeasureId","title","measure","m"],"mappings":";AAIO,MAAMA,qBAAyC,CAACC,MAAMC;IAC3D,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAMG,aAAaD,cAAc,UAAU;IAC3C,MAAME,WAAWF,cAAc,QAAQ,IAAI,EAAE;IAC7C,IAAI,CAACC,YACH,OAAOF;IAET,MAAMI,gBAAgBF,WAAW,MAAM,CAAC,CAACG,MAAQA,AAAiB,UAAjBA,IAAI,QAAQ;IAC7D,MAAMC,OAAOF,cAAc,GAAG,CAAC,CAACC;QAC9B,MAAME,aAAkB;YACtB,cAAcF,IAAI,EAAE;YACpB,OAAOA,IAAI,KAAK,IAAIA,IAAI,EAAE;QAC5B;QAEA,IAAIA,IAAI,EAAE,KAAKG,gBACbD,WAAW,YAAY,GAAG,CAACE;YACzB,MAAMC,UAAUP,SAAS,IAAI,CAAC,CAACQ,IAAMA,EAAE,EAAE,KAAKF;YAE9C,OAAOC,UAAWA,QAAQ,KAAK,IAAIA,QAAQ,EAAE,GAAID;QACnD;QAGF,OAAOF;IACT;IACA,OAAO;QACL,GAAGP,MAAM;QACT,MAAMM;IACR;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FoldXMeasureId } from "../../../../../dataReshape/index.js";
|
|
1
2
|
const pivotTitle = (spec, context)=>{
|
|
2
3
|
const result = {
|
|
3
4
|
...spec
|
|
@@ -5,8 +6,9 @@ const pivotTitle = (spec, context)=>{
|
|
|
5
6
|
const { advancedVSeed } = context;
|
|
6
7
|
const { config, chartType } = advancedVSeed;
|
|
7
8
|
const themConfig = config?.[chartType]?.pivotGrid ?? {};
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const columns = result.columns?.filter((c)=>c.dimensionKey !== FoldXMeasureId);
|
|
10
|
+
if (columns && columns.length > 0) result.title = {
|
|
11
|
+
text: columns.map((entry)=>entry.title).join('/'),
|
|
10
12
|
align: 'center',
|
|
11
13
|
orient: 'top',
|
|
12
14
|
padding: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotTitle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotTitle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotTitle: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n\n if (
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/pivotChart/pivotTitle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/pivotChart/pivotTitle.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport { FoldXMeasureId } from 'src/dataReshape'\nimport type { Config, PivotChartSpecPipe } from 'src/types'\n\nexport const pivotTitle: PivotChartSpecPipe = (spec, context) => {\n const result = { ...spec } as PivotChartConstructorOptions\n const { advancedVSeed } = context\n const { config, chartType } = advancedVSeed\n const themConfig = (config?.[chartType] as Config['line'])?.pivotGrid ?? {}\n const columns = result.columns?.filter((c) => (c as any).dimensionKey !== FoldXMeasureId)\n\n if (columns && columns.length > 0) {\n result.title = {\n text: columns.map((entry: any) => entry.title).join('/'),\n align: 'center',\n orient: 'top',\n padding: [2, 0, 0, 0],\n textStyle: {\n fontSize: themConfig.titleFontSize ?? 12,\n fill: themConfig.titleFontColor ?? '#000',\n fontWeight: themConfig.titleFontWeight ?? 'bold',\n },\n }\n }\n\n return result\n}\n"],"names":["pivotTitle","spec","context","result","advancedVSeed","config","chartType","themConfig","columns","c","FoldXMeasureId","entry"],"mappings":";AAIO,MAAMA,aAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,MAAM,EAAEC,SAAS,EAAE,GAAGF;IAC9B,MAAMG,aAAcF,QAAQ,CAACC,UAAU,EAAqB,aAAa,CAAC;IAC1E,MAAME,UAAUL,OAAO,OAAO,EAAE,OAAO,CAACM,IAAOA,EAAU,YAAY,KAAKC;IAE1E,IAAIF,WAAWA,QAAQ,MAAM,GAAG,GAC9BL,OAAO,KAAK,GAAG;QACb,MAAMK,QAAQ,GAAG,CAAC,CAACG,QAAeA,MAAM,KAAK,EAAE,IAAI,CAAC;QACpD,OAAO;QACP,QAAQ;QACR,SAAS;YAAC;YAAG;YAAG;YAAG;SAAE;QACrB,WAAW;YACT,UAAUJ,WAAW,aAAa,IAAI;YACtC,MAAMA,WAAW,cAAc,IAAI;YACnC,YAAYA,WAAW,eAAe,IAAI;QAC5C;IACF;IAGF,OAAOJ;AACT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dimensions, FoldInfo, Measures, VChartSpecPipe, UnfoldInfo } from '../../../../../types';
|
|
2
2
|
export declare const tooltip: VChartSpecPipe;
|
|
3
|
-
export declare const createDimensionContent: (
|
|
3
|
+
export declare const createDimensionContent: (tooltip: string[], measures: Measures | undefined, foldInfo: FoldInfo, unfoldInfo: UnfoldInfo, hasMultiMeasureGroup: boolean) => {
|
|
4
4
|
visible: boolean;
|
|
5
5
|
shapeType: string;
|
|
6
6
|
hasShape: boolean;
|
|
@@ -28,21 +28,26 @@ const tooltip_tooltip = (spec, context)=>{
|
|
|
28
28
|
title: {
|
|
29
29
|
visible: true
|
|
30
30
|
},
|
|
31
|
-
content: createDimensionContent(
|
|
31
|
+
content: createDimensionContent(encoding.tooltip || [], measures, foldInfo, unfoldInfo, reshapeMeasures.length > 1)
|
|
32
32
|
},
|
|
33
33
|
updateElement: updateTooltipElement
|
|
34
34
|
};
|
|
35
35
|
return result;
|
|
36
36
|
};
|
|
37
|
-
const createDimensionContent = (
|
|
37
|
+
const createDimensionContent = (tooltip, measures = [], foldInfo, unfoldInfo, hasMultiMeasureGroup)=>{
|
|
38
38
|
const { measureId, measureValue, foldMap } = foldInfo;
|
|
39
39
|
const { encodingColor } = unfoldInfo;
|
|
40
|
+
const hasMeasureTooltip = tooltip.some((d)=>measures.find((item)=>item.id === d));
|
|
40
41
|
return [
|
|
41
42
|
{
|
|
42
43
|
visible: true,
|
|
43
44
|
shapeType: 'rectRound',
|
|
44
45
|
hasShape: true,
|
|
45
|
-
key:
|
|
46
|
+
key: hasMeasureTooltip ? (v)=>{
|
|
47
|
+
const datum = v;
|
|
48
|
+
const key = datum && datum[measureId] || '';
|
|
49
|
+
return foldMap[key] ?? key;
|
|
50
|
+
} : (v)=>{
|
|
46
51
|
const datum = v;
|
|
47
52
|
const key = datum && datum[encodingColor] || '';
|
|
48
53
|
const colorKey = `${unfoldInfo.colorIdMap[key].alias ?? key}`;
|
|
@@ -51,10 +56,6 @@ const createDimensionContent = (dimensions = [], measures = [], foldInfo, unfold
|
|
|
51
56
|
return `${colorKey}-${foldMap[mId] ?? mId}`;
|
|
52
57
|
}
|
|
53
58
|
return colorKey;
|
|
54
|
-
} : (v)=>{
|
|
55
|
-
const datum = v;
|
|
56
|
-
const key = datum && datum[measureId] || '';
|
|
57
|
-
return foldMap[key] ?? key;
|
|
58
59
|
},
|
|
59
60
|
value: (v)=>{
|
|
60
61
|
const datum = v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltip.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltip.ts"],"sourcesContent":["import { pipe, uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n FoldInfo,\n Measures,\n VChartSpecPipe,\n TooltipConfig,\n UnfoldInfo,\n Dimension,\n Measure,\n} from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltip: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType as 'line'] as { tooltip: TooltipConfig }\n const { tooltip = { enable: true } } = baseConfig\n const { enable = true } = tooltip\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: !!enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, foldInfo, unfoldInfo),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltip.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltip.ts"],"sourcesContent":["import { pipe, uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n FoldInfo,\n Measures,\n VChartSpecPipe,\n TooltipConfig,\n UnfoldInfo,\n Dimension,\n Measure,\n} from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltip: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType as 'line'] as { tooltip: TooltipConfig }\n const { tooltip = { enable: true } } = baseConfig\n const { enable = true } = tooltip\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: !!enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, foldInfo, unfoldInfo),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(\n encoding.tooltip || [],\n measures,\n foldInfo,\n unfoldInfo,\n reshapeMeasures.length > 1,\n ),\n },\n\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createDimensionContent = (\n tooltip: string[],\n measures: Measures = [],\n foldInfo: FoldInfo,\n unfoldInfo: UnfoldInfo,\n hasMultiMeasureGroup: boolean,\n) => {\n const { measureId, measureValue, foldMap } = foldInfo\n const { encodingColor } = unfoldInfo\n\n const hasMeasureTooltip = tooltip.some((d) => measures.find((item) => item.id === d))\n\n return [\n {\n visible: true,\n shapeType: 'rectRound',\n hasShape: true,\n key: !hasMeasureTooltip\n ? (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[encodingColor] as string)) || ''\n\n const colorKey = `${unfoldInfo.colorIdMap[key].alias ?? key}`\n\n if (hasMultiMeasureGroup) {\n const mId = (datum && (datum[measureId] as string)) || ''\n\n return `${colorKey}-${foldMap[mId] ?? mId}`\n }\n\n return colorKey\n }\n : (v: unknown) => {\n const datum = v as Datum\n const key = (datum && (datum[measureId] as string)) || ''\n return foldMap[key] ?? key\n },\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n },\n ]\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions = [],\n measures: Measures = [],\n foldInfo: FoldInfo,\n unfoldInfo: UnfoldInfo,\n) => {\n const dims = pipe(\n dimensions.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Dimension) => item.id),\n uniqueBy((item: Dimension) => item.alias),\n )\n const meas = pipe(\n measures.filter((item) => tooltip.includes(item.id)),\n uniqueBy((item: Measure) => item.id),\n uniqueBy((item: Measure) => item.alias),\n )\n\n const dimContent = dims.map((item: Dimension) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item: Measure) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const defaultContent = {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureName } = foldInfo\n const { encodingColor: colorName } = unfoldInfo\n\n const datum = v as Datum\n return (datum && (datum[measureName || colorName] as string)) || ''\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n\n return [...dimContent, defaultContent, ...meaContent]\n}\n"],"names":["tooltip","spec","context","result","advancedVSeed","vseed","measures","datasetReshapeInfo","chartType","dimensions","encoding","reshapeMeasures","baseConfig","enable","foldInfo","unfoldInfo","getTooltipStyle","createMarkContent","createDimensionContent","updateTooltipElement","hasMultiMeasureGroup","measureId","measureValue","foldMap","encodingColor","hasMeasureTooltip","d","item","v","datum","key","colorKey","mId","value","id","measure","findMeasureById","formatter","createFormatterByMeasure","dims","pipe","uniqueBy","meas","dimContent","meaContent","ORIGINAL_DATA","originalData","defaultContent","measureName","colorName","String"],"mappings":";;;;;AAiBO,MAAMA,kBAA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K,CAACR,UAAU;YAC3B,MAAMc,UAAUC,gBAAgB9B,UAAU4B;YAC1C,IAAI,CAACC,SACH,OAAOe,OAAOjB;YAGhB,MAAMI,YAAYC,yBAAyBH;YAC3C,OAAOE,UAAUJ;QACnB;IACF;IAEA,OAAO;WAAIU;QAAYI;WAAmBH;KAAW;AACvD"}
|
|
@@ -25,7 +25,7 @@ const tooltipOfDualAxisSeries = (options)=>(spec, context)=>{
|
|
|
25
25
|
title: {
|
|
26
26
|
visible: true
|
|
27
27
|
},
|
|
28
|
-
content: createDimensionContent(
|
|
28
|
+
content: createDimensionContent(encoding.tooltip || [], measures, options.foldInfo, unfoldInfo, reshapeMeasures.length > 1)
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.ts"],"sourcesContent":["import { createDimensionContent, createMarkContent } from './tooltip'\nimport type { VChartSpecPipe, Tooltip, Measures, DualAxisOptions } from 'src/types'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipOfDualAxisSeries = (options: DualAxisOptions): VChartSpecPipe => {\n return (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n\n const unfoldInfo = datasetReshapeInfo[0].unfoldInfo\n\n result.tooltip = {\n visible: enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(\n encoding.tooltip || [],\n dimensions,\n vseed.measures as Measures,\n options.foldInfo,\n unfoldInfo,\n ),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.ts"],"sourcesContent":["import { createDimensionContent, createMarkContent } from './tooltip'\nimport type { VChartSpecPipe, Tooltip, Measures, DualAxisOptions } from 'src/types'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipOfDualAxisSeries = (options: DualAxisOptions): VChartSpecPipe => {\n return (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const {\n measures = [],\n datasetReshapeInfo,\n chartType,\n dimensions = [],\n encoding,\n reshapeMeasures = [],\n } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n\n const unfoldInfo = datasetReshapeInfo[0].unfoldInfo\n\n result.tooltip = {\n visible: enable,\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(\n encoding.tooltip || [],\n dimensions,\n vseed.measures as Measures,\n options.foldInfo,\n unfoldInfo,\n ),\n },\n dimension: {\n title: {\n visible: true,\n },\n content: createDimensionContent(\n encoding.tooltip || [],\n measures,\n options.foldInfo,\n unfoldInfo,\n reshapeMeasures.length > 1,\n ),\n },\n }\n return result\n }\n}\n\nexport const tooltipDualAxis: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n updateElement: updateTooltipElement,\n }\n return result\n}\n"],"names":["tooltipOfDualAxisSeries","options","spec","context","result","advancedVSeed","vseed","measures","datasetReshapeInfo","chartType","dimensions","encoding","reshapeMeasures","baseConfig","tooltip","enable","unfoldInfo","createMarkContent","createD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B;AACT"}
|
|
@@ -22,7 +22,8 @@ const tooltipScatter = (spec, context)=>{
|
|
|
22
22
|
title: {
|
|
23
23
|
visible: false
|
|
24
24
|
},
|
|
25
|
-
content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, locale, foldInfoList)
|
|
25
|
+
content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures, locale, foldInfoList),
|
|
26
|
+
updateContent: (prev = [])=>uniqueBy(prev, (entry)=>`${String(entry.key)}::${String(entry.value)}`)
|
|
26
27
|
},
|
|
27
28
|
dimension: {
|
|
28
29
|
visible: false
|
|
@@ -69,7 +70,13 @@ const createMarkContent = (tooltip, dimensions, measures = [], locale, foldInfoL
|
|
|
69
70
|
visible: true,
|
|
70
71
|
hasShape: true,
|
|
71
72
|
shapeType: 'rectRound',
|
|
72
|
-
key:
|
|
73
|
+
key: (v)=>{
|
|
74
|
+
const { measureId, foldMap } = foldInfo;
|
|
75
|
+
const datum = v;
|
|
76
|
+
if (!datum) return '';
|
|
77
|
+
const id = datum[measureId];
|
|
78
|
+
return foldMap[id] ?? id;
|
|
79
|
+
},
|
|
73
80
|
value: (v)=>{
|
|
74
81
|
const { measureId, measureValue } = foldInfo;
|
|
75
82
|
const datum = v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, VChartSpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipScatter: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions = [], encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, locale, foldInfoList),\n },\n dimension: {\n visible: false,\n },\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures = [],\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: Object.values(foldInfo.foldMap)[0],\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","getTooltipStyle","createMarkContent","updateTooltipElement","measures","dims","
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, VChartSpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\nimport { getTooltipStyle } from './tooltipStyle'\nimport { updateTooltipElement } from './tooltipElement'\n\nexport const tooltipScatter: VChartSpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions = [], encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n style: getTooltipStyle(tooltip),\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, vseed.measures as Measures, locale, foldInfoList),\n updateContent: (prev: Datum[] = []) => {\n return uniqueBy(prev, (entry) => `${String(entry.key)}::${String(entry.value)}`)\n },\n },\n dimension: {\n visible: false,\n },\n updateElement: updateTooltipElement,\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures = [],\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = datum[measureId] as string\n\n return foldMap[id] ?? id\n },\n // key: Object.values(foldInfo.foldMap)[0],\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","getTooltipStyle","createMarkContent","prev","uniqueBy","entry","String","updateTooltipElement","measures","dims","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","formatter","createFormatterByMeasure","foldMeaContent","foldInfo","measureId","foldMap","measureValue"],"mappings":";;;;;AAOO,MAAMA,iBAAiC,CAACC,MAAMC;IACnD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,aAAa,EAAE,EAAEC,QAAQ,EAAE,GAAGN;IAC7E,MAAMO,aAAaP,cAAc,MAAM,CAACG,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,YAAY,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAK9CH,OAAO,OAAO,GAAG;QACf,OAAOY,gBAAgBH;QACvB,SAASC;QAET,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASG,kBAAkBN,SAAS,OAAO,IAAI,EAAE,EAAED,YAAYJ,MAAM,QAAQ,EAAcG,QAAQM;YACnG,eAAe,CAACG,OAAgB,EAAE,GACzBC,SAASD,MAAM,CAACE,QAAU,GAAGC,OAAOD,MAAM,GAAG,EAAE,EAAE,EAAEC,OAAOD,MAAM,KAAK,GAAG;QAEnF;QACA,WAAW;YACT,SAAS;QACX;QACA,eAAeE;IACjB;IACA,OAAOlB;AACT;AAEO,MAAMa,oBAAoB,CAC/BJ,SACAH,YACAa,WAAqB,EAAE,EACvBd,QACAM;IAEA,MAAMS,OAAOL,SACXT,WAAW,MAAM,CAAC,CAACe,OAASZ,QAAQ,QAAQ,CAACY,KAAK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AACC,OACH,OAAO;gBAET,MAAME,KAAKF,KAAK,CAACY,UAAU;gBAE3B,OAAOC,OAAO,CAACX,GAAG,IAAIA;YACxB;YAEA,OAAO,CAACH;gBACN,MAAM,EAAEa,SAAS,EAAEE,YAAY,EAAE,GAAGH;gBAEpC,MAAMX,QAAQD;gBACd,IAAI,CAACC,OACH,OAAO;gBAET,MAAMK,QAAQL,KAAK,CAACc,aAAa;gBACjC,MAAMZ,KAAKF,KAAK,CAACY,UAAU;gBAC3B,MAAMN,UAAUC,gBAAgBb,UAAUQ;gBAC1C,MAAMM,YAAYC,yBAAyBH;gBAC3C,OAAOE,UAAUH;YACnB;QACF;IAEF,OAAO;WAAIP;WAAeY;WAAmBT;KAAW;AAC1D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPositionMeasure } from "./measures/index.js";
|
|
2
|
-
import { isMeasureTreeWithParentId } from "../advanced/chart/pipes/measures/utils.js";
|
|
2
|
+
import { isCommonMeasureEncoding, isMeasureTreeWithParentId } from "../advanced/chart/pipes/measures/utils.js";
|
|
3
3
|
import { unique } from "remeda";
|
|
4
4
|
import { ChartTypeEnum, DEFAULT_PARENT_ID } from "./constant.js";
|
|
5
5
|
const isTable = (vseed)=>vseed.chartType === ChartTypeEnum.Table;
|
|
@@ -20,12 +20,32 @@ const isPivotChart = (vseed)=>{
|
|
|
20
20
|
return isCombination(vseed);
|
|
21
21
|
};
|
|
22
22
|
const isPivot = (vseed)=>{
|
|
23
|
-
const { dimensions = [] } = vseed;
|
|
24
|
-
|
|
23
|
+
const { dimensions = [], measures = [] } = vseed;
|
|
24
|
+
if (dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding)) return true;
|
|
25
|
+
if (vseed.chartType === ChartTypeEnum.Scatter) {
|
|
26
|
+
const xCount = measures.filter((m)=>'xAxis' === m.encoding).length;
|
|
27
|
+
const yCount = measures.filter((m)=>'yAxis' === m.encoding).length;
|
|
28
|
+
const otherCount = measures.filter((m)=>![
|
|
29
|
+
'size',
|
|
30
|
+
'xAxis',
|
|
31
|
+
'yAxis'
|
|
32
|
+
].includes(m.encoding) && !isCommonMeasureEncoding(m.encoding)).length;
|
|
33
|
+
let finalXCount;
|
|
34
|
+
let finalYCount;
|
|
35
|
+
if (xCount > 0) {
|
|
36
|
+
finalXCount = xCount;
|
|
37
|
+
finalYCount = yCount + otherCount;
|
|
38
|
+
} else {
|
|
39
|
+
finalXCount = otherCount > 0 ? 1 : 0;
|
|
40
|
+
finalYCount = yCount + Math.max(otherCount - 1, 0);
|
|
41
|
+
}
|
|
42
|
+
if (finalXCount > 1 || finalYCount > 1) return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
25
45
|
};
|
|
26
46
|
const isCombination = (vseed)=>{
|
|
27
47
|
if (isMeasureTreeWithParentId(vseed.measures)) {
|
|
28
|
-
const parentIds = vseed.measures?.filter(isPositionMeasure).map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
|
48
|
+
const parentIds = vseed.measures?.filter((m)=>isPositionMeasure(m, vseed.chartType)).map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
|
29
49
|
return parentIds && unique(parentIds).length > 1;
|
|
30
50
|
}
|
|
31
51
|
const { measures = [] } = vseed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/utils/chatType.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/chatType.ts"],"sourcesContent":["import type { Measures } from 'src/types'\nimport { type Dimensions, type DimensionGroup, type VSeed, type Measure } from 'src/types'\nimport { isPositionMeasure } from './measures'\nimport { isMeasureTreeWithParentId } from '../advanced/chart/pipes/measures/utils'\nimport { unique } from 'remeda'\nimport { ChartTypeEnum, DEFAULT_PARENT_ID } from './constant'\n\nexport const isTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Table\n}\nexport const isPivotTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.PivotTable\n}\nexport const isRadar = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Radar\n}\nexport const isAreaPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.AreaPercent\n}\nexport const isColumnPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.ColumnPercent\n}\nexport const isBarPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.BarPercent\n}\n\nexport const isBarLikeChart = (vseed: VSeed) => {\n return (\n vseed.chartType === ChartTypeEnum.Bar ||\n vseed.chartType === ChartTypeEnum.BarPercent ||\n vseed.chartType === ChartTypeEnum.BarParallel\n )\n}\n\nexport const isVTable = (vseed: VSeed) => {\n return ['table', 'pivotTable'].includes(vseed.chartType)\n}\nexport const isVChart = (vseed: VSeed): boolean => {\n return !isVTable(vseed)\n}\n\n/**\n * @description 透视图表或组合图\n * - 透视图表定义: 存在 column 或 row的 encoding\n * - 组合图表定义: 存在多组指标的情况\n * - 透视组合图表: 存在 column 或 row的 encoding 且 存在多组指标的情况\n * 上述三者都只能使用 VTable.PivotChart 绘制\n */\nexport const isPivotChart = (vseed: VSeed) => {\n if (isVTable(vseed)) {\n return false\n }\n\n if (isPivot(vseed)) {\n return true\n }\n\n return isCombination(vseed)\n}\n\n/**\n * @description 存在column 或 row的encoding\n */\nexport const isPivot = (vseed: VSeed) => {\n const { dimensions = [] } = vseed as {\n dimensions: Dimensions\n }\n\n
|
|
1
|
+
{"version":3,"file":"pipeline/utils/chatType.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/chatType.ts"],"sourcesContent":["import type { MeasureEncoding, Measures } from 'src/types'\nimport { type Dimensions, type DimensionGroup, type VSeed, type Measure } from 'src/types'\nimport { isPositionMeasure } from './measures'\nimport { isCommonMeasureEncoding, isMeasureTreeWithParentId } from '../advanced/chart/pipes/measures/utils'\nimport { unique } from 'remeda'\nimport { ChartTypeEnum, DEFAULT_PARENT_ID } from './constant'\n\nexport const isTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Table\n}\nexport const isPivotTable = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.PivotTable\n}\nexport const isRadar = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.Radar\n}\nexport const isAreaPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.AreaPercent\n}\nexport const isColumnPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.ColumnPercent\n}\nexport const isBarPercent = (vseed: VSeed) => {\n return vseed.chartType === ChartTypeEnum.BarPercent\n}\n\nexport const isBarLikeChart = (vseed: VSeed) => {\n return (\n vseed.chartType === ChartTypeEnum.Bar ||\n vseed.chartType === ChartTypeEnum.BarPercent ||\n vseed.chartType === ChartTypeEnum.BarParallel\n )\n}\n\nexport const isVTable = (vseed: VSeed) => {\n return ['table', 'pivotTable'].includes(vseed.chartType)\n}\nexport const isVChart = (vseed: VSeed): boolean => {\n return !isVTable(vseed)\n}\n\n/**\n * @description 透视图表或组合图\n * - 透视图表定义: 存在 column 或 row的 encoding\n * - 组合图表定义: 存在多组指标的情况\n * - 透视组合图表: 存在 column 或 row的 encoding 且 存在多组指标的情况\n * 上述三者都只能使用 VTable.PivotChart 绘制\n */\nexport const isPivotChart = (vseed: VSeed) => {\n if (isVTable(vseed)) {\n return false\n }\n\n if (isPivot(vseed)) {\n return true\n }\n\n return isCombination(vseed)\n}\n\n/**\n * @description 存在column 或 row的encoding\n */\nexport const isPivot = (vseed: VSeed) => {\n const { dimensions = [], measures = [] } = vseed as {\n dimensions: Dimensions\n measures: Measures\n }\n\n if (dimensions && dimensions.some((dimension) => dimension.encoding === 'row' || dimension.encoding === 'column')) {\n return true\n }\n\n if (vseed.chartType === ChartTypeEnum.Scatter) {\n const xCount = measures.filter((m: Measure) => m.encoding === 'xAxis').length\n const yCount = measures.filter((m: Measure) => m.encoding === 'yAxis').length\n const otherCount = measures.filter(\n (m: Measure) =>\n !['size', 'xAxis', 'yAxis'].includes(m.encoding as string) &&\n !isCommonMeasureEncoding(m.encoding as MeasureEncoding),\n ).length\n\n /**\n * Scatter \"matrix\" detection logic\n *\n * xCount: number of measures explicitly encoded on the x-axis\n * yCount: number of measures explicitly encoded on the y-axis\n * otherCount: measures that are not size/xAxis/yAxis and are not common encodings\n *\n * When there is at least one explicit x-axis measure (xCount > 0):\n * - All x-encoded measures are counted as X.\n * - Remaining measures (y-encoded + \"other\") are treated as Y variants.\n *\n * When there is no explicit x-axis measure (xCount === 0):\n * - If there is at least one \"other\" measure, we treat exactly one of them as the X measure\n * (so finalXCount = 1), and the remaining \"other\" measures contribute to Y alongside\n * the explicit y-encoded measures.\n * - Since we conceptually \"promote\" one of the other measures to X, only (otherCount - 1)\n * are left to be counted towards Y. Math.max(..., 0) protects against negative values\n * when otherCount is 0.\n */\n let finalXCount: number\n let finalYCount: number\n\n if (xCount > 0) {\n // Explicit x-axis measures exist: X is fixed, Y aggregates y-encoded + other measures.\n finalXCount = xCount\n finalYCount = yCount + otherCount\n } else {\n // No explicit x-axis measure:\n // - If there are \"other\" measures, treat one as X.\n // - Remaining \"other\" measures contribute to Y, together with any y-encoded measures.\n finalXCount = otherCount > 0 ? 1 : 0\n finalYCount = yCount + Math.max(otherCount - 1, 0)\n }\n if (finalXCount > 1 || finalYCount > 1) return true\n }\n\n return false\n}\n\n/**\n * @description 不存在column 或 row的encoding, 但是有多组指标的情况\n */\nexport const isCombination = (vseed: VSeed) => {\n if (isMeasureTreeWithParentId(vseed.measures)) {\n const parentIds = vseed.measures\n ?.filter((m: Measure) => isPositionMeasure(m, vseed.chartType))\n .map((measure: Measure) => measure.parentId || DEFAULT_PARENT_ID)\n return parentIds && unique(parentIds).length > 1\n }\n\n const { measures = [] } = vseed as {\n measures: Measures\n dimensions: Dimensions\n }\n\n const hasMeasureGroup = measures && measures.some((measure: DimensionGroup) => measure && measure.children)\n\n return hasMeasureGroup\n}\n\nexport const isRectungularCoordinate = (chartType: string) => {\n return (\n [\n ChartTypeEnum.Bar,\n ChartTypeEnum.BarPercent,\n ChartTypeEnum.BarParallel,\n ChartTypeEnum.Column,\n ChartTypeEnum.ColumnPercent,\n ChartTypeEnum.ColumnParallel,\n ChartTypeEnum.Line,\n ChartTypeEnum.Area,\n ChartTypeEnum.AreaPercent,\n ChartTypeEnum.DualAxis,\n ChartTypeEnum.Boxplot,\n ChartTypeEnum.DualAxis,\n ChartTypeEnum.Scatter,\n ChartTypeEnum.Heatmap,\n ChartTypeEnum.Boxplot,\n ] as string[]\n ).includes(chartType)\n}\n\n/**\n * 默认的双轴图图表类型配置\n */\nexport const DEFAULT_DUAL_CHART_TYPE = {\n primary: 'column',\n secondary: 'line',\n}\n\nexport const isDualAxisChartType = (chartType: string | undefined) => {\n return (\n chartType &&\n ['column', 'columnParallel', 'columnPercent', 'line', 'area', 'areaPercent', 'scatter'].includes(chartType)\n )\n}\n"],"names":["isTable","vseed","ChartTypeEnum","isPivotTable","isRadar","isAreaPercent","isColumnPercent","isBarPercent","isBarLikeChart","isVTable","isVChart","isPivotChart","isPivot","isCombination","dimensions","measures","dimension","xCount","m","yCount","otherCount","isCommonMeasureEncoding","finalXCount","finalYCount","Math","isMeasureTreeWithParentId","parentIds","isPositionMeasure","measure","DEFAULT_PARENT_ID","unique","hasMeasureGroup","isRectungularCoordinate","chartType","DEFAULT_DUAL_CHART_TYPE","isDualAxisChartType"],"mappings":";;;;AAOO,MAAMA,UAAU,CAACC,QACfA,MAAM,SAAS,KAAKC,cAAc,KAAK;AAEzC,MAAMC,eAAe,CAACF,QACpBA,MAAM,SAAS,KAAKC,cAAc,UAAU;AAE9C,MAAME,UAAU,CAACH,QACfA,MAAM,SAAS,KAAKC,cAAc,KAAK;AAEzC,MAAMG,gBAAgB,CAACJ,QACrBA,MAAM,SAAS,KAAKC,cAAc,WAAW;AAE/C,MAAMI,kBAAkB,CAACL,QACvBA,MAAM,SAAS,KAAKC,cAAc,aAAa;AAEjD,MAAMK,eAAe,CAACN,QACpBA,MAAM,SAAS,KAAKC,cAAc,UAAU;AAG9C,MAAM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jD;IAEA,OAAO;AACT;AAKO,MAAMV,gBAAgB,CAACZ;IAC5B,IAAIwB,0BAA0BxB,MAAM,QAAQ,GAAG;QAC7C,MAAMyB,YAAYzB,MAAM,QAAQ,EAC5B,OAAO,CAACiB,IAAeS,kBAAkBT,GAAGjB,MAAM,SAAS,GAC5D,IAAI,CAAC2B,UAAqBA,QAAQ,QAAQ,IAAIC;QACjD,OAAOH,aAAaI,OAAOJ,WAAW,MAAM,GAAG;IACjD;IAEA,MAAM,EAAEX,WAAW,EAAE,EAAE,GAAGd;IAK1B,MAAM8B,kBAAkBhB,YAAYA,SAAS,IAAI,CAAC,CAACa,UAA4BA,WAAWA,QAAQ,QAAQ;IAE1G,OAAOG;AACT;AAEO,MAAMC,0BAA0B,CAACC,YAEpC;QACE/B,cAAc,GAAG;QACjBA,cAAc,UAAU;QACxBA,cAAc,WAAW;QACzBA,cAAc,MAAM;QACpBA,cAAc,aAAa;QAC3BA,cAAc,cAAc;QAC5BA,cAAc,IAAI;QAClBA,cAAc,IAAI;QAClBA,cAAc,WAAW;QACzBA,cAAc,QAAQ;QACtBA,cAAc,OAAO;QACrBA,cAAc,QAAQ;QACtBA,cAAc,OAAO;QACrBA,cAAc,OAAO;QACrBA,cAAc,OAAO;KACtB,CACD,QAAQ,CAAC+B;AAMN,MAAMC,0BAA0B;IACrC,SAAS;IACT,WAAW;AACb;AAEO,MAAMC,sBAAsB,CAACF,YAEhCA,aACA;QAAC;QAAU;QAAkB;QAAiB;QAAQ;QAAQ;QAAe;KAAU,CAAC,QAAQ,CAACA"}
|
|
@@ -2,4 +2,4 @@ import type { Measure, MeasureGroup } from '../../../types';
|
|
|
2
2
|
export declare const isMeasure: (measure: Measure | MeasureGroup) => measure is Measure;
|
|
3
3
|
export declare const isMeasureGroup: (measure: Measure | MeasureGroup) => measure is MeasureGroup;
|
|
4
4
|
export declare const isMeasures: (measures: Measure[] | MeasureGroup[]) => measures is Measure[];
|
|
5
|
-
export declare const isPositionMeasure: (measure: Measure) => boolean;
|
|
5
|
+
export declare const isPositionMeasure: (measure: Measure, chartType: string) => boolean;
|
|
@@ -1,13 +1,37 @@
|
|
|
1
|
+
import { ChartTypeEnum } from "../constant.js";
|
|
1
2
|
const isMeasure = (measure)=>!('children' in measure);
|
|
2
3
|
const isMeasureGroup = (measure)=>'children' in measure;
|
|
3
4
|
const isMeasures = (measures)=>measures.every(isMeasure);
|
|
4
|
-
const isPositionMeasure = (measure)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const isPositionMeasure = (measure, chartType)=>{
|
|
6
|
+
if (!measure.encoding) return true;
|
|
7
|
+
if (chartType === ChartTypeEnum.Funnel) return 'size' === measure.encoding;
|
|
8
|
+
if (chartType === ChartTypeEnum.Heatmap) return 'color' === measure.encoding;
|
|
9
|
+
if ([
|
|
10
|
+
ChartTypeEnum.Pie,
|
|
11
|
+
ChartTypeEnum.Donut,
|
|
12
|
+
ChartTypeEnum.Rose,
|
|
13
|
+
ChartTypeEnum.RoseParallel
|
|
14
|
+
].includes(chartType)) return 'angle' === measure.encoding;
|
|
15
|
+
if (chartType === ChartTypeEnum.DualAxis) return [
|
|
16
|
+
'primaryYAxis',
|
|
17
|
+
'secondaryYAxis'
|
|
10
18
|
].includes(measure.encoding);
|
|
19
|
+
if (ChartTypeEnum.Radar === chartType) return 'radius' === measure.encoding;
|
|
20
|
+
if ([
|
|
21
|
+
ChartTypeEnum.Line,
|
|
22
|
+
ChartTypeEnum.Area,
|
|
23
|
+
ChartTypeEnum.AreaPercent,
|
|
24
|
+
ChartTypeEnum.Column,
|
|
25
|
+
ChartTypeEnum.ColumnParallel,
|
|
26
|
+
ChartTypeEnum.ColumnPercent
|
|
27
|
+
].includes(chartType)) return 'yAxis' === measure.encoding;
|
|
28
|
+
if ([
|
|
29
|
+
ChartTypeEnum.Bar,
|
|
30
|
+
ChartTypeEnum.BarParallel,
|
|
31
|
+
ChartTypeEnum.BarPercent
|
|
32
|
+
].includes(chartType)) return 'xAxis' === measure.encoding;
|
|
33
|
+
return chartType === ChartTypeEnum.Boxplot && 'value' === measure.encoding;
|
|
34
|
+
};
|
|
11
35
|
export { isMeasure, isMeasureGroup, isMeasures, isPositionMeasure };
|
|
12
36
|
|
|
13
37
|
//# sourceMappingURL=typeGuard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/utils/measures/typeGuard.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/measures/typeGuard.ts"],"sourcesContent":["import type { Measure, MeasureGroup } from 'src/types'\n\nexport const isMeasure = (measure: Measure | MeasureGroup): measure is Measure => {\n return !('children' in measure)\n}\n\nexport const isMeasureGroup = (measure: Measure | MeasureGroup): measure is MeasureGroup => {\n return 'children' in measure\n}\n\nexport const isMeasures = (measures: Measure[] | MeasureGroup[]): measures is Measure[] => {\n return measures.every(isMeasure)\n}\n\nexport const isPositionMeasure = (measure: Measure): boolean => {\n
|
|
1
|
+
{"version":3,"file":"pipeline/utils/measures/typeGuard.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/measures/typeGuard.ts"],"sourcesContent":["import type { Measure, MeasureGroup } from 'src/types'\nimport { ChartTypeEnum } from '../constant'\n\nexport const isMeasure = (measure: Measure | MeasureGroup): measure is Measure => {\n return !('children' in measure)\n}\n\nexport const isMeasureGroup = (measure: Measure | MeasureGroup): measure is MeasureGroup => {\n return 'children' in measure\n}\n\nexport const isMeasures = (measures: Measure[] | MeasureGroup[]): measures is Measure[] => {\n return measures.every(isMeasure)\n}\n\nexport const isPositionMeasure = (measure: Measure, chartType: string): boolean => {\n if (!measure.encoding) {\n return true\n }\n\n if (chartType === ChartTypeEnum.Funnel) {\n return measure.encoding === 'size'\n }\n\n if (chartType === ChartTypeEnum.Heatmap) {\n return measure.encoding === 'color'\n }\n\n if (\n ([ChartTypeEnum.Pie, ChartTypeEnum.Donut, ChartTypeEnum.Rose, ChartTypeEnum.RoseParallel] as string[]).includes(\n chartType,\n )\n ) {\n return measure.encoding === 'angle'\n }\n\n if (chartType === ChartTypeEnum.DualAxis) {\n return ['primaryYAxis', 'secondaryYAxis'].includes(measure.encoding as string)\n }\n\n if (ChartTypeEnum.Radar === chartType) {\n return measure.encoding === 'radius'\n }\n\n if (\n (\n [\n ChartTypeEnum.Line,\n ChartTypeEnum.Area,\n ChartTypeEnum.AreaPercent,\n ChartTypeEnum.Column,\n ChartTypeEnum.ColumnParallel,\n ChartTypeEnum.ColumnPercent,\n ] as string[]\n ).includes(chartType)\n ) {\n return measure.encoding === 'yAxis'\n }\n\n if (([ChartTypeEnum.Bar, ChartTypeEnum.BarParallel, ChartTypeEnum.BarPercent] as string[]).includes(chartType)) {\n return measure.encoding === 'xAxis'\n }\n\n return chartType === ChartTypeEnum.Boxplot && measure.encoding === 'value'\n}\n"],"names":["isMeasure","measure","isMeasureGroup","isMeasures","measures","isPositionMeasure","chartType","ChartTypeEnum"],"mappings":";AAGO,MAAMA,YAAY,CAACC,UACjB,CAAE,eAAcA,OAAM;AAGxB,MAAMC,iBAAiB,CAACD,UACtB,cAAcA;AAGhB,MAAME,aAAa,CAACC,WAClBA,SAAS,KAAK,CAACJ;AAGjB,MAAMK,oBAAoB,CAACJ,SAAkBK;IAClD,IAAI,CAACL,QAAQ,QAAQ,EACnB,OAAO;IAGT,IAAIK,cAAcC,cAAc,MAAM,EACpC,OAAON,AAAqB,WAArBA,QAAQ,QAAQ;IAGzB,IAAIK,cAAcC,cAAc,OAAO,EACrC,OAAON,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IACG;QAACM,cAAc,GAAG;QAAEA,cAAc,KAAK;QAAEA,cAAc,IAAI;QAAEA,cAAc,YAAY;KAAC,CAAc,QAAQ,CAC7GD,YAGF,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IAAIK,cAAcC,cAAc,QAAQ,EACtC,OAAO;QAAC;QAAgB;KAAiB,CAAC,QAAQ,CAACN,QAAQ,QAAQ;IAGrE,IAAIM,cAAc,KAAK,KAAKD,WAC1B,OAAOL,AAAqB,aAArBA,QAAQ,QAAQ;IAGzB,IAEI;QACEM,cAAc,IAAI;QAClBA,cAAc,IAAI;QAClBA,cAAc,WAAW;QACzBA,cAAc,MAAM;QACpBA,cAAc,cAAc;QAC5BA,cAAc,aAAa;KAC5B,CACD,QAAQ,CAACD,YAEX,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,IAAK;QAACM,cAAc,GAAG;QAAEA,cAAc,WAAW;QAAEA,cAAc,UAAU;KAAC,CAAc,QAAQ,CAACD,YAClG,OAAOL,AAAqB,YAArBA,QAAQ,QAAQ;IAGzB,OAAOK,cAAcC,cAAc,OAAO,IAAIN,AAAqB,YAArBA,QAAQ,QAAQ;AAChE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const getLightBrushConfig = ()=>({
|
|
2
|
+
enable: false,
|
|
3
|
+
inBrushStyle: {
|
|
4
|
+
opacity: 1
|
|
5
|
+
},
|
|
6
|
+
outOfBrushStyle: {
|
|
7
|
+
opacity: 0.2
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
const getDarkBrushConfig = ()=>({
|
|
11
|
+
enable: false,
|
|
12
|
+
inBrushStyle: {
|
|
13
|
+
opacity: 1
|
|
14
|
+
},
|
|
15
|
+
outOfBrushStyle: {
|
|
16
|
+
opacity: 0.25
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export { getDarkBrushConfig, getLightBrushConfig };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=brush.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme/common/brush.js","sources":["webpack://@visactor/vseed/./src/theme/common/brush.ts"],"sourcesContent":["import type { BrushConfig } from 'src/types'\n\nexport const getLightBrushConfig = (): BrushConfig => ({\n enable: false,\n inBrushStyle: {\n opacity: 1,\n },\n outOfBrushStyle: {\n opacity: 0.2,\n },\n})\n\nexport const getDarkBrushConfig = (): BrushConfig => ({\n enable: false,\n inBrushStyle: {\n opacity: 1,\n },\n outOfBrushStyle: {\n opacity: 0.25,\n },\n})\n"],"names":["getLightBrushConfig","getDarkBrushConfig"],"mappings":"AAEO,MAAMA,sBAAsB,IAAoB;QACrD,QAAQ;QACR,cAAc;YACZ,SAAS;QACX;QACA,iBAAiB;YACf,SAAS;QACX;IACF;AAEO,MAAMC,qBAAqB,IAAoB;QACpD,QAAQ;QACR,cAAc;YACZ,SAAS;QACX;QACA,iBAAiB;YACf,SAAS;QACX;IACF"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const getLightHeatmapCellTheme = ()=>({
|
|
2
|
-
stroke: '#fff'
|
|
2
|
+
stroke: '#fff',
|
|
3
|
+
hoverShadowColor: '#404349'
|
|
3
4
|
});
|
|
4
5
|
const getDarkHeatmapCellTheme = ()=>({
|
|
5
|
-
stroke: '#404349'
|
|
6
|
+
stroke: '#404349',
|
|
7
|
+
hoverShadowColor: '#404349'
|
|
6
8
|
});
|
|
7
9
|
export { getDarkHeatmapCellTheme, getLightHeatmapCellTheme };
|
|
8
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme/common/heatmapCell.js","sources":["webpack://@visactor/vseed/./src/theme/common/heatmapCell.ts"],"sourcesContent":["import type { HeatmapCell } from 'src/types/properties/config/heatmap/heatmap'\n\nexport const getLightHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#fff',\n }\n}\n\nexport const getDarkHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#404349',\n }\n}\n"],"names":["getLightHeatmapCellTheme","getDarkHeatmapCellTheme"],"mappings":"AAEO,MAAMA,2BAA2B,IAC/B;QACL,QAAQ;
|
|
1
|
+
{"version":3,"file":"theme/common/heatmapCell.js","sources":["webpack://@visactor/vseed/./src/theme/common/heatmapCell.ts"],"sourcesContent":["import type { HeatmapCell } from 'src/types/properties/config/heatmap/heatmap'\n\nexport const getLightHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#fff',\n hoverShadowColor: '#404349',\n }\n}\n\nexport const getDarkHeatmapCellTheme = (): HeatmapCell => {\n return {\n stroke: '#404349',\n hoverShadowColor: '#404349',\n }\n}\n"],"names":["getLightHeatmapCellTheme","getDarkHeatmapCellTheme"],"mappings":"AAEO,MAAMA,2BAA2B,IAC/B;QACL,QAAQ;QACR,kBAAkB;IACpB;AAGK,MAAMC,0BAA0B,IAC9B;QACL,QAAQ;QACR,kBAAkB;IACpB"}
|