@visactor/vseed 0.1.37 → 0.1.39
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/buildAdvanced.js +1 -1
- package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +4147 -965
- package/dist/esm/builder/register/all.js +3 -1
- package/dist/esm/builder/register/all.js.map +1 -1
- package/dist/esm/builder/register/chartType/boxplot.d.ts +1 -0
- package/dist/esm/builder/register/chartType/boxplot.js +9 -0
- package/dist/esm/builder/register/chartType/boxplot.js.map +1 -0
- package/dist/esm/builder/register/chartType/histogram.d.ts +1 -0
- package/dist/esm/builder/register/chartType/histogram.js +9 -0
- package/dist/esm/builder/register/chartType/histogram.js.map +1 -0
- package/dist/esm/builder/register/chartType/index.d.ts +2 -0
- package/dist/esm/builder/register/chartType/index.js +3 -1
- package/dist/esm/dataReshape/constant.d.ts +10 -0
- package/dist/esm/dataReshape/constant.js +11 -1
- package/dist/esm/dataReshape/constant.js.map +1 -1
- package/dist/esm/dataReshape/unfoldDimensions.js +2 -2
- package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js +33 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +34 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/index.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/index.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js +31 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +33 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.d.ts +3 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js +80 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.d.ts +3 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js +78 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasures.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/index.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/index.d.ts +4 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/index.js +5 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +96 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +96 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js +84 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +86 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +0 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +52 -0
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +5 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +52 -0
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js +18 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js +18 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/dataset/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js +4 -8
- package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +37 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js +21 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +15 -4
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +49 -14
- 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.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js +126 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/index.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +98 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +69 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js +1 -2
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.js +1 -0
- package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/init/table.js +1 -0
- package/dist/esm/pipeline/spec/table/pipes/init/table.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js +1 -0
- package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/theme/type.d.ts +13 -0
- package/dist/esm/pipeline/spec/table/pipes/theme/type.js +0 -0
- package/dist/esm/pipeline/utils/constant.d.ts +2 -0
- package/dist/esm/pipeline/utils/constant.js +3 -1
- package/dist/esm/pipeline/utils/constant.js.map +1 -1
- package/dist/esm/theme/common/regressionLine.d.ts +4 -0
- package/dist/esm/theme/common/regressionLine.js +16 -0
- package/dist/esm/theme/common/regressionLine.js.map +1 -0
- package/dist/esm/theme/common/table.d.ts +17 -8
- package/dist/esm/theme/common/table.js +11 -8
- package/dist/esm/theme/common/table.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +18 -0
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +18 -0
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +1441 -17
- package/dist/esm/types/advancedVSeed.js +3 -2
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +9 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +9 -0
- package/dist/esm/types/chartType/bar/zBar.d.ts +9 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +9 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +9 -0
- package/dist/esm/types/chartType/boxplot/boxplot.d.ts +144 -0
- package/dist/esm/types/chartType/boxplot/boxplot.js +0 -0
- package/dist/esm/types/chartType/boxplot/index.d.ts +2 -0
- package/dist/esm/types/chartType/boxplot/index.js +1 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +1185 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.js +30 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.js.map +1 -0
- package/dist/esm/types/chartType/column/zColumn.d.ts +25 -0
- package/dist/esm/types/chartType/column/zColumn.js +3 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +9 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +9 -0
- package/dist/esm/types/chartType/donut/zDonut.d.ts +9 -0
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +9 -0
- package/dist/esm/types/chartType/histogram/histogram.d.ts +127 -0
- package/dist/esm/types/chartType/histogram/histogram.js +0 -0
- package/dist/esm/types/chartType/histogram/index.d.ts +2 -0
- package/dist/esm/types/chartType/histogram/index.js +1 -0
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +1377 -0
- package/dist/esm/types/chartType/histogram/zHistogram.js +32 -0
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -0
- package/dist/esm/types/chartType/index.d.ts +3 -0
- package/dist/esm/types/chartType/index.js +2 -0
- package/dist/esm/types/chartType/line/zLine.d.ts +9 -0
- package/dist/esm/types/chartType/pie/zPie.d.ts +9 -0
- package/dist/esm/types/chartType/radar/zRadar.d.ts +9 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +9 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +9 -0
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +9 -0
- package/dist/esm/types/properties/chartType/chartType.d.ts +3 -1
- package/dist/esm/types/properties/chartType/chartType.js +3 -1
- package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +4 -0
- package/dist/esm/types/properties/config/bar.d.ts +6 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +326 -0
- package/dist/esm/types/properties/config/boxplot.js +27 -0
- package/dist/esm/types/properties/config/boxplot.js.map +1 -0
- package/dist/esm/types/properties/config/column.d.ts +6 -0
- package/dist/esm/types/properties/config/config.d.ts +697 -0
- package/dist/esm/types/properties/config/config.js +5 -1
- package/dist/esm/types/properties/config/config.js.map +1 -1
- package/dist/esm/types/properties/config/dualAxis.d.ts +2 -0
- package/dist/esm/types/properties/config/funnel.d.ts +2 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +2 -0
- package/dist/esm/types/properties/config/histogram.d.ts +339 -0
- package/dist/esm/types/properties/config/histogram.js +32 -0
- package/dist/esm/types/properties/config/histogram.js.map +1 -0
- package/dist/esm/types/properties/config/index.d.ts +1 -0
- package/dist/esm/types/properties/config/index.js +1 -0
- package/dist/esm/types/properties/config/line.d.ts +2 -0
- package/dist/esm/types/properties/config/pie.d.ts +6 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +2 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +3 -1
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
- package/dist/esm/types/properties/config/rose.d.ts +4 -0
- package/dist/esm/types/properties/config/scatter.d.ts +2 -0
- package/dist/esm/types/properties/config/whiskers/index.d.ts +3 -0
- package/dist/esm/types/properties/config/whiskers/index.js +5 -0
- package/dist/esm/types/properties/config/whiskers/index.js.map +1 -0
- package/dist/esm/types/properties/encoding/encoding.d.ts +36 -0
- package/dist/esm/types/properties/encoding/measureEncoding.d.ts +1 -1
- package/dist/esm/types/properties/encoding/zEncoding.d.ts +9 -0
- package/dist/esm/types/properties/encoding/zEncoding.js +10 -1
- package/dist/esm/types/properties/encoding/zEncoding.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/regressionLine/histogramRegressionLine.d.ts +45 -0
- package/dist/esm/types/properties/regressionLine/histogramRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/index.d.ts +2 -0
- package/dist/esm/types/properties/regressionLine/index.js +1 -0
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.d.ts +11 -0
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js +17 -0
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js.map +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +1935 -541
- package/dist/esm/types/vseed.d.ts +2 -2
- package/dist/esm/types/zVseed.d.ts +2717 -0
- package/dist/esm/types/zVseed.js +4 -2
- package/dist/esm/types/zVseed.js.map +1 -1
- package/dist/umd/index.js +1748 -140
- package/dist/umd/index.js.map +1 -1
- package/package.json +6 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.ts"],"sourcesContent":["import {\n BinCountMeasureId,\n BinEndMeasureId,\n BinPercentageMeasureId,\n BinStartMeasureId,\n dataReshapeByEncoding,\n FoldMeasureId,\n FoldMeasureName,\n FoldMeasureValue,\n Separator,\n unfoldDimensions,\n} from 'src/dataReshape'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Dataset, Dimension, Encoding } from 'src/types'\nimport { bin } from '@visactor/vdataset'\nimport { uniqueBy } from 'remeda'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes/color/colorAdapter'\n\nexport const reshapeWithHistogramEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed\n const uniqDims = uniqueBy(dimensions, (item) => item.id)\n const chartConfig = config?.[chartType as 'histogram']\n const binCount = chartConfig?.binCount\n const binStep = chartConfig?.binStep\n const binValueType = chartConfig?.binValueType\n\n let newDatasets: any[] = []\n let foldInfo: any = {}\n let unfoldInfo: any = {}\n\n const colorMeasureId = getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed)\n const allMeasures = findAllMeasures(measures)\n\n if (encoding.value?.length) {\n const valueField = encoding.value[0]\n const m = allMeasures.find((m) => m.id === valueField)\n const binData = bin(dataset, {\n field: valueField,\n groupField: [...(encoding.x ?? []), ...(encoding.color ?? [])] as string[],\n bins: binCount,\n step: binStep,\n outputNames: {\n x0: BinStartMeasureId,\n x1: BinEndMeasureId,\n count: BinCountMeasureId,\n percentage: BinPercentageMeasureId,\n },\n }) as Dataset\n\n binData.forEach((datum) => {\n datum[FoldMeasureId] = valueField\n datum[FoldMeasureName] = m?.alias ?? valueField\n datum[FoldMeasureValue] = binValueType === 'percentage' ? datum[BinPercentageMeasureId] : datum[BinCountMeasureId]\n })\n\n const res = unfoldDimensions(binData, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((d) => {\n newDatasets.push(d)\n })\n unfoldInfo = res.unfoldInfo\n } else if (encoding.x0?.length && encoding.x1?.length && encoding.y?.length) {\n const res = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item: Dimension) => item.id),\n findAllMeasures(measures)\n .filter((item) => encoding.y?.includes(item.id))\n .slice(0, 1),\n encoding as Encoding,\n {\n colorItemAsId: false,\n colorMeasureId,\n },\n )\n\n res.dataset.forEach((datum) => {\n datum[BinStartMeasureId] = datum[encoding.x0![0]]\n datum[BinEndMeasureId] = datum[encoding.x1![0]]\n datum[FoldMeasureId] = datum[encoding.y![0]]\n })\n\n newDatasets = res.dataset\n foldInfo = res.foldInfo\n unfoldInfo = res.unfoldInfo\n }\n\n return {\n ...result,\n dataset: newDatasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo,\n unfoldInfo,\n },\n ],\n dimensions,\n measures,\n }\n}\n"],"names":["reshapeWithHistogramEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","config","uniqDims","uniqueBy","item","chartConfig","binCount","binStep","binValueType","newDatasets","foldInfo","unfoldInfo","colorMeasureId","getColorMeasureId","allMeasures","findAllMeasures","valueField","m","binData","bin","BinStartMeasureId","BinEndMeasureId","BinCountMeasureId","BinPercentageMeasureId","datum","FoldMeasureId","Fo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iBAAjBA,eAAgCgB,KAAK,CAACD,uBAAuB,GAAGC,KAAK,CAACF,kBAAkB;QACpH;QAEA,MAAMM,MAAMC,iBAAiBX,SAAShB,UAAUF,UAAsB;YACpE,eAAeyB;YACf,WAAWK;YACX,eAAe;QACjB;QAEAF,IAAI,OAAO,CAAC,OAAO,CAAC,CAACG;YACnBtB,YAAY,IAAI,CAACsB;QACnB;QACApB,aAAaiB,IAAI,UAAU;IAC7B,OAAO,IAAI5B,SAAS,EAAE,EAAE,UAAUA,SAAS,EAAE,EAAE,UAAUA,SAAS,CAAC,EAAE,QAAQ;QAC3E,MAAM4B,MAAMI,sBACVpC,SACAO,SAASL,YAAY,CAACM,OAAoBA,KAAK,EAAE,GACjDW,gBAAgBhB,UACb,MAAM,CAAC,CAACK,OAASJ,SAAS,CAAC,EAAE,SAASI,KAAK,EAAE,GAC7C,KAAK,CAAC,GAAG,IACZJ,UACA;YACE,eAAe;YACfY;QACF;QAGFgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAACJ;YACnBA,KAAK,CAACJ,kBAAkB,GAAGI,KAAK,CAACxB,SAAS,EAAG,CAAC,EAAE,CAAC;YACjDwB,KAAK,CAACH,gBAAgB,GAAGG,KAAK,CAACxB,SAAS,EAAG,CAAC,EAAE,CAAC;YAC/CwB,KAAK,CAACC,cAAc,GAAGD,KAAK,CAACxB,SAAS,CAAE,CAAC,EAAE,CAAC;QAC9C;QAEAS,cAAcmB,IAAI,OAAO;QACzBlB,WAAWkB,IAAI,QAAQ;QACvBjB,aAAaiB,IAAI,UAAU;IAC7B;IAEA,OAAO;QACL,GAAGlC,MAAM;QACT,SAASe;QACT,oBAAoB;YAClB;gBACE,IAAIwB,OAAOpC;gBACX,OAAO;gBACPa;gBACAC;YACF;SACD;QACDb;QACAC;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n} from '../pipes'\n\nconst bar: SpecPipeline = [\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBar: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n initBar,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n} from '../pipes'\n\nconst bar: SpecPipeline = [\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBar: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n initBar,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n tooltip,\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const barSpecPipeline: SpecPipeline = [pivotAdapter(bar, pivotBar)]\n"],"names":["bar","initBar","stackCornerRadius","barMaxWidth","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBar","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","barSpecPipeline","pivotAdapter"],"mappings":";AAoCA,MAAMA,MAAoB;IACxBC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,WAAyB;IAC7BC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd3B;QACAC;QACAE,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA1B,aAAa2B,qBAAqBC;CACnC;AAEM,MAAMC,kBAAgC;IAACC,aAAalC,KAAKuB;CAAU"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetBoxplot, datasetPivot, discreteLegend, initBoxplot, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, progressive, stackCornerRadius, tooltipBoxplot, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
|
|
2
|
+
const boxplot = [
|
|
3
|
+
initBoxplot,
|
|
4
|
+
stackCornerRadius,
|
|
5
|
+
colorAdapter(color, linearColor),
|
|
6
|
+
backgroundColor,
|
|
7
|
+
datasetBoxplot,
|
|
8
|
+
progressive,
|
|
9
|
+
xBand,
|
|
10
|
+
yLinear,
|
|
11
|
+
label,
|
|
12
|
+
tooltipBoxplot,
|
|
13
|
+
colorAdapter(discreteLegend, colorLegend),
|
|
14
|
+
verticalCrosshairRect,
|
|
15
|
+
colorBarStyleFill(barStyle),
|
|
16
|
+
annotationPoint,
|
|
17
|
+
annotationVerticalLine,
|
|
18
|
+
annotationHorizontalLine,
|
|
19
|
+
annotationAreaBand
|
|
20
|
+
];
|
|
21
|
+
const pivotBoxplot = [
|
|
22
|
+
initPivot,
|
|
23
|
+
pivotGridStyle,
|
|
24
|
+
datasetPivot,
|
|
25
|
+
pivotIndicators([
|
|
26
|
+
initBoxplot,
|
|
27
|
+
stackCornerRadius,
|
|
28
|
+
colorAdapter(color, linearColor),
|
|
29
|
+
backgroundColor,
|
|
30
|
+
datasetBoxplot,
|
|
31
|
+
progressive,
|
|
32
|
+
xBand,
|
|
33
|
+
yLinear,
|
|
34
|
+
label,
|
|
35
|
+
tooltipBoxplot,
|
|
36
|
+
colorBarStyleFill(barStyle),
|
|
37
|
+
verticalCrosshairRect,
|
|
38
|
+
annotationPoint,
|
|
39
|
+
annotationVerticalLine,
|
|
40
|
+
annotationHorizontalLine,
|
|
41
|
+
annotationAreaBand
|
|
42
|
+
]),
|
|
43
|
+
pivotRowDimensions,
|
|
44
|
+
pivotColumnDimensions,
|
|
45
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
46
|
+
];
|
|
47
|
+
const boxplotSpecPipeline = [
|
|
48
|
+
pivotAdapter(boxplot, pivotBoxplot)
|
|
49
|
+
];
|
|
50
|
+
export { boxplotSpecPipeline };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=boxplot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/boxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/boxplot.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n label,\n tooltipBoxplot,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n initBoxplot,\n xBand,\n yLinear,\n verticalCrosshairRect,\n datasetBoxplot,\n} from '../pipes'\n\nconst boxplot: SpecPipeline = [\n initBoxplot,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetBoxplot,\n progressive,\n xBand,\n yLinear,\n label,\n tooltipBoxplot,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBoxplot: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initBoxplot,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetBoxplot,\n progressive,\n xBand,\n yLinear,\n label,\n tooltipBoxplot,\n colorBarStyleFill(barStyle),\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const boxplotSpecPipeline: SpecPipeline = [pivotAdapter(boxplot, pivotBoxplot)]\n"],"names":["boxplot","initBoxplot","stackCornerRadius","colorAdapter","color","linearColor","backgroundColor","datasetBoxplot","progressive","xBand","yLinear","label","tooltipBoxplot","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBoxplot","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","boxplotSpecPipeline","pivotAdapter"],"mappings":";AAkCA,MAAMA,UAAwB;IAC5BC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC,gBAAgB;QACdzB;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;KACD;IACDM;IACAC;IACAzB,aAAa0B,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAahC,SAASsB;CAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, barGapInGroup, barMaxWidth, 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";
|
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, barGapInGroup, barMaxWidth, 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, stackCornerRadius, tooltipPrimary, tooltipSecondary, verticalCrosshairRect, xBand, yLinearPrimary, yLinearSecondary } from "../pipes/index.js";
|
|
2
2
|
const dualAxis = [
|
|
3
3
|
seriesDualAxis([
|
|
4
4
|
initDualAxisPrimary,
|
|
@@ -9,6 +9,7 @@ const dualAxis = [
|
|
|
9
9
|
progressive,
|
|
10
10
|
barMaxWidth,
|
|
11
11
|
barGapInGroup,
|
|
12
|
+
stackCornerRadius,
|
|
12
13
|
colorBarStyleFill(barStyle),
|
|
13
14
|
colorPointStyleFill(pointStyle),
|
|
14
15
|
pointStateDimensionHover,
|
|
@@ -23,6 +24,7 @@ const dualAxis = [
|
|
|
23
24
|
progressive,
|
|
24
25
|
barMaxWidth,
|
|
25
26
|
barGapInGroup,
|
|
27
|
+
stackCornerRadius,
|
|
26
28
|
colorBarStyleFill(barStyle),
|
|
27
29
|
colorPointStyleFill(pointStyle),
|
|
28
30
|
pointStateDimensionHover,
|
|
@@ -54,6 +56,7 @@ const pivotDualAxis = [
|
|
|
54
56
|
labelPrimary,
|
|
55
57
|
tooltipPrimary,
|
|
56
58
|
progressive,
|
|
59
|
+
stackCornerRadius,
|
|
57
60
|
barMaxWidth,
|
|
58
61
|
barGapInGroup,
|
|
59
62
|
colorBarStyleFill(barStyle),
|
|
@@ -68,6 +71,7 @@ const pivotDualAxis = [
|
|
|
68
71
|
labelSecondary,
|
|
69
72
|
tooltipSecondary,
|
|
70
73
|
progressive,
|
|
74
|
+
stackCornerRadius,
|
|
71
75
|
barMaxWidth,
|
|
72
76
|
barGapInGroup,
|
|
73
77
|
colorBarStyleFill(barStyle),
|
|
@@ -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 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 barMaxWidth,\n barGapInGroup,\n} from '../pipes'\n\nconst dualAxis: SpecPipeline = [\n seriesDualAxis(\n [\n initDualAxisPrimary,\n dualChartTypePrimary,\n datasetPrimary,\n labelPrimary,\n tooltipPrimary,\n progressive,\n\n barMaxWidth,\n barGapInGroup,\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 barMaxWidth,\n barGapInGroup,\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 barMaxWidth,\n barGapInGroup,\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 barMaxWidth,\n barGapInGroup,\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","barMaxWidth","barGapInGroup","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":";
|
|
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 barMaxWidth,\n barGapInGroup,\n stackCornerRadius,\n} from '../pipes'\n\nconst dualAxis: SpecPipeline = [\n seriesDualAxis(\n [\n initDualAxisPrimary,\n dualChartTypePrimary,\n datasetPrimary,\n labelPrimary,\n tooltipPrimary,\n progressive,\n\n barMaxWidth,\n barGapInGroup,\n stackCornerRadius,\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 barMaxWidth,\n barGapInGroup,\n stackCornerRadius,\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 stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\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 stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\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","barMaxWidth","barGapInGroup","stackCornerRadius","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":";AAsDA,MAAMA,WAAyB;IAC7BC,eACE;QACEC;QACAC;QACAC;QACAC;QACAC;QACAC;QAEAC;QACAC;QACAC;QAEAC,kBAAkBC;QAClBC,oBAAoBC;QACpBC;QACAC,mBAAmBC;QACnBC,mBAAmBC;KACpB,EACD;QACEC;QACAC;QACAC;QACAC;QACAC;QACAjB;QAEAC;QACAC;QACAC;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;YACE3C;YACAC;YACAC;YACAC;YACAC;YACAC;YAEAG;YACAF;YACAC;YAEAE,kBAAkBC;YAClBC,oBAAoBC;YACpBC;YACAC,mBAAmBC;YACnBC,mBAAmBC;SACpB,EACD;YACEC;YACAC;YACAC;YACAC;YACAC;YACAjB;YAEAG;YACAF;YACAC;YAEAE,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,aAAapD,UAAUuC;CAAe"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetHistogram, datasetPivot, discreteLegend, histogramRegressionLine, initHistogram, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, progressive, tooltipHistogram, verticalCrosshairRect, xLinear, yLinear } from "../pipes/index.js";
|
|
2
|
+
const histogram = [
|
|
3
|
+
initHistogram,
|
|
4
|
+
colorAdapter(color, linearColor),
|
|
5
|
+
backgroundColor,
|
|
6
|
+
datasetHistogram,
|
|
7
|
+
progressive,
|
|
8
|
+
xLinear,
|
|
9
|
+
yLinear,
|
|
10
|
+
label,
|
|
11
|
+
tooltipHistogram,
|
|
12
|
+
colorAdapter(discreteLegend, colorLegend),
|
|
13
|
+
verticalCrosshairRect,
|
|
14
|
+
colorBarStyleFill(barStyle),
|
|
15
|
+
annotationPoint,
|
|
16
|
+
annotationVerticalLine,
|
|
17
|
+
annotationHorizontalLine,
|
|
18
|
+
annotationAreaBand,
|
|
19
|
+
histogramRegressionLine
|
|
20
|
+
];
|
|
21
|
+
const pivotHistogram = [
|
|
22
|
+
initPivot,
|
|
23
|
+
pivotGridStyle,
|
|
24
|
+
datasetPivot,
|
|
25
|
+
pivotIndicators([
|
|
26
|
+
initHistogram,
|
|
27
|
+
colorAdapter(color, linearColor),
|
|
28
|
+
backgroundColor,
|
|
29
|
+
datasetHistogram,
|
|
30
|
+
progressive,
|
|
31
|
+
xLinear,
|
|
32
|
+
yLinear,
|
|
33
|
+
label,
|
|
34
|
+
tooltipHistogram,
|
|
35
|
+
colorBarStyleFill(barStyle),
|
|
36
|
+
verticalCrosshairRect,
|
|
37
|
+
annotationPoint,
|
|
38
|
+
annotationVerticalLine,
|
|
39
|
+
annotationHorizontalLine,
|
|
40
|
+
annotationAreaBand,
|
|
41
|
+
histogramRegressionLine
|
|
42
|
+
]),
|
|
43
|
+
pivotRowDimensions,
|
|
44
|
+
pivotColumnDimensions,
|
|
45
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
46
|
+
];
|
|
47
|
+
const histogramSpecPipeline = [
|
|
48
|
+
pivotAdapter(histogram, pivotHistogram)
|
|
49
|
+
];
|
|
50
|
+
export { histogramSpecPipeline };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=histogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/histogram.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n xLinear,\n backgroundColor,\n label,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n datasetHistogram,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n initHistogram,\n yLinear,\n verticalCrosshairRect,\n tooltipHistogram,\n histogramRegressionLine,\n} from '../pipes'\n\nconst histogram: SpecPipeline = [\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n histogramRegressionLine,\n]\n\nconst pivotHistogram: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorBarStyleFill(barStyle),\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n histogramRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const histogramSpecPipeline: SpecPipeline = [pivotAdapter(histogram, pivotHistogram)]\n"],"names":["histogram","initHistogram","colorAdapter","color","linearColor","backgroundColor","datasetHistogram","progressive","xLinear","yLinear","label","tooltipHistogram","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","histogramRegressionLine","pivotHistogram","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","histogramSpecPipeline","pivotAdapter"],"mappings":";AAkCA,MAAMA,YAA0B;IAC9BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,iBAA+B;IACnCC;IACAC;IACAC;IACAC,gBAAgB;QACdzB;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;KACD;IACDM;IACAC;IACA1B,aAAa2B,qBAAqBC;CACnC;AAEM,MAAMC,wBAAsC;IAACC,aAAahC,WAAWsB;CAAgB"}
|
|
@@ -16,3 +16,5 @@ export { roseParallelSpecPipeline } from './roseParallel';
|
|
|
16
16
|
export { radarSpecPipeline } from './radar';
|
|
17
17
|
export { funnelSpecPipeline } from './funnel';
|
|
18
18
|
export { heatmapSpecPipeline } from './heatmap';
|
|
19
|
+
export { boxplotSpecPipeline } from './boxplot';
|
|
20
|
+
export { histogramSpecPipeline } from './histogram';
|
|
@@ -16,4 +16,6 @@ import { roseParallelSpecPipeline } from "./roseParallel.js";
|
|
|
16
16
|
import { radarSpecPipeline } from "./radar.js";
|
|
17
17
|
import { funnelSpecPipeline } from "./funnel.js";
|
|
18
18
|
import { heatmapSpecPipeline } from "./heatmap.js";
|
|
19
|
-
|
|
19
|
+
import { boxplotSpecPipeline } from "./boxplot.js";
|
|
20
|
+
import { histogramSpecPipeline } from "./histogram.js";
|
|
21
|
+
export { areaPercentSpecPipeline, areaSpecPipeline, barParallelSpecPipeline, barPercentSpecPipeline, barSpecPipeline, boxplotSpecPipeline, columnParallelSpecPipeline, columnPercentSpecPipeline, columnSpecPipeline, donutSpecPipeline, dualAxisSpecPipeline, funnelSpecPipeline, heatmapSpecPipeline, histogramSpecPipeline, lineSpecPipeline, pieSpecPipeline, radarSpecPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterSpecPipeline };
|
|
@@ -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'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultOptions = isBarLikeChart(advancedVSeed)\n ? {\n textPosition: 'right',\n textAlign: 'right',\n }\n : {\n textPosition: 'top',\n textAlign: 'center',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultOptions.textAlign,\n textBaseline = 'middle',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultOptions.textPosition\n\n const dy = textPosition.includes('bottom') ? -1 * textFontSize! : 0\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n dy: dy,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: dy,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultOptions","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,U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AS;gBACT,MAAMnB;gBACN,OAAO;oBACL,IAAIoB;oBACJ,WAAWhB;oBACX,cAAcC;oBACd,QAAQE;oBACR,WAAW;oBACX,MAAMN;oBACN,UAAUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIS;wBACJ,cAAcV,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAGhC,IAAI;QACP,UAAUa;IACZ;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import { type ICartesianSeries, type ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultOptions = isBarLikeChart(advancedVSeed as VSeed)\n ? {\n textPosition: 'right',\n textAlign: 'right',\n }\n : {\n textPosition: 'top',\n textAlign: 'center',\n }\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultOptions.textAlign,\n textBaseline = 'middle',\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultOptions.textPosition\n\n const dy = textPosition.includes('bottom') ? -1 * textFontSize! : 0\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const yScale = yAxisHelper.getScale()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const xScale = xAxisHelper.getScale()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n dy: dy,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n dy: dy,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultOptions","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAET,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEI,cAAc,EAAE,GAAGH;IAC3B,MAAM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AAIS;wBACJ,cAAcV,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAGhC,IAAI;QACP,UAAUa;IACZ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPoint.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","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CAACE,QAAUC,SAASD,OAAOjB,kBAAkB,EAAE;QACnG,MAAMmB,KAAK,MAAOvB,CAAAA,kBAAmBO,eAA0B;QAC/D,MAAMiB,KAAKxB,kBAAkB,IAAKO;QAElC,OAAOa,aAAa,GAAG,CAAC,CAACC,QAChB;gBACL,QAAQI;gBACR,gBAAgB;gBAChB,YAAY,CAACC,OACJA,KAAK,IAAI,CAAC,CAACC,OAASC,SAASP,OAAOM;gBAG7C,UAAU;oBACR,SAAS;gBACX;gBACA,aAAa;oBACXT;oBACAD;oBACA,SAAS;oBACT,MAAM;wBACJ,MAAMZ;wBACN,OAAO;4BACL,SAAS;4BACT,WAAWI;4BACX,cAAcC;4BACd,MAAMJ;4BACN,QAAQQ;4BACR,WAAW;4BACX,UAAUP;4BACV,YAAYC;4BACZe;4BACAC;wBACF;wBACA,iBAAiB;4BACf,SAASR;4BACT,SAASD;4BACT,OAAO;gCACL,cAAcH,8BAA8B;gCAC5C,MAAME;gCACN,QAAQH;gCACR,WAAWE;gCACXU;gCACAC;4BACF;wBACF;oBACF;gBACF;YACF;IAEJ;IAEA,OAAO;QACL,GAAGjC,IAAI;QACPY;IACF;AACF"}
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPoint.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","datum","selector","dx","dy","ANNOTATION_Z_INDEX","data","item","isSubset"],"mappings":";;;;AAOO,MAAMA,kCAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,eAAe,EAAE,GAAGK;IAC5B,MAAMG,sBAAsBC,MAAM,OAAO,CAACT,mBAAmBA,kBAAkB;QAACA;KAAgB;IAChG,MAAMU,kBAAkBC,eAAeR;IACvC,MAAMS,eAAeF,kBACjB;QACE,WAAW;QACX,cAAc;IAChB,IACA;QACE,WAAW;QACX,cAAc;IAChB;IAEJ,MAAMG,YAAYL,oBAAoB,OAAO,CAAC,CAACR;QAC7C,MAAM,EACJ,UAAUc,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAYP,aAAa,SAAS,EAClCQ,eAAeR,aAAa,YA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plot = (spec, context)=>{
|
|
3
|
+
const { advancedVSeed, vseed } = context;
|
|
4
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
|
5
|
+
const { id } = datasetReshapeInfo[0];
|
|
6
|
+
const fields = {};
|
|
7
|
+
return {
|
|
8
|
+
...spec,
|
|
9
|
+
data: {
|
|
10
|
+
id,
|
|
11
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
|
|
12
|
+
fields: fields
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { datasetBoxplot };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=datasetBoxplot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/datasetBoxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/datasetBoxplot.ts"],"sourcesContent":["import { isPivotChart } from 'src/pipeline/utils'\nimport type { SpecPipe } from 'src/types'\nimport type { ISpec } from '@visactor/vchart'\n\nexport const datasetBoxplot: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { id } = datasetReshapeInfo[0]\n\n const fields: Record<string, object> = {}\n\n return {\n ...spec,\n data: {\n id,\n // 透视表不使用 dataValues\n values: isPivotChart(vseed) ? undefined : advancedVSeed.dataset.flat(),\n fields: fields,\n },\n } as unknown as ISpec\n}\n"],"names":["datasetBoxplot","spec","context","advancedVSeed","vseed","datasetReshapeInfo","id","fields","isPivotChart","undefined"],"mappings":";AAIO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,EAAE,EAAE,GAAGD,kBAAkB,CAAC,EAAE;IAEpC,MAAME,SAAiC,CAAC;IAExC,OAAO;QACL,GAAGN,IAAI;QACP,MAAM;YACJK;YAEA,QAAQE,aAAaJ,SAASK,SAAYN,cAAc,OAAO,CAAC,IAAI;YACpE,QAAQI;QACV;IACF;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isPivotChart } from "../../../../utils/index.js";
|
|
2
|
+
const datasetHistogram = (spec, context)=>{
|
|
3
|
+
const { advancedVSeed, vseed } = context;
|
|
4
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
|
5
|
+
const { id } = datasetReshapeInfo[0];
|
|
6
|
+
const fields = {};
|
|
7
|
+
return {
|
|
8
|
+
...spec,
|
|
9
|
+
data: {
|
|
10
|
+
id,
|
|
11
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset.flat(),
|
|
12
|
+
fields: fields
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { datasetHistogram };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=datasetHistogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/datasetHistogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/datasetHistogram.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport { isPivotChart } from 'src/pipeline/utils'\nimport type { SpecPipe } from 'src/types'\n\nexport const datasetHistogram: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { id } = datasetReshapeInfo[0]\n\n const fields: Record<string, object> = {}\n\n return {\n ...spec,\n data: {\n id,\n // 透视表不使用 dataValues\n values: isPivotChart(vseed) ? undefined : advancedVSeed.dataset.flat(),\n fields: fields,\n },\n } as unknown as ISpec\n}\n"],"names":["datasetHistogram","spec","context","advancedVSeed","vseed","datasetReshapeInfo","id","fields","isPivotChart","undefined"],"mappings":";AAIO,MAAMA,mBAA6B,CAACC,MAAMC;IAC/C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,EAAE,EAAE,GAAGD,kBAAkB,CAAC,EAAE;IAEpC,MAAME,SAAiC,CAAC;IAExC,OAAO;QACL,GAAGN,IAAI;QACP,MAAM;YACJK;YAEA,QAAQE,aAAaJ,SAASK,SAAYN,cAAc,OAAO,CAAC,IAAI;YACpE,QAAQI;QACV;IACF;AACF"}
|
|
@@ -4,3 +4,5 @@ export { datasetPivot } from './datasetPivot';
|
|
|
4
4
|
export { progressive } from './progressive';
|
|
5
5
|
export { datasetPrimary, datasetSecondary } from './datasetDualAxis';
|
|
6
6
|
export { datasetScatter } from './datasetScatter';
|
|
7
|
+
export { datasetHistogram } from './datasetHistogram';
|
|
8
|
+
export { datasetBoxplot } from './datasetBoxplot';
|
|
@@ -4,4 +4,6 @@ import { datasetPivot } from "./datasetPivot.js";
|
|
|
4
4
|
import { progressive } from "./progressive.js";
|
|
5
5
|
import { datasetPrimary, datasetSecondary } from "./datasetDualAxis.js";
|
|
6
6
|
import { datasetScatter } from "./datasetScatter.js";
|
|
7
|
-
|
|
7
|
+
import { datasetHistogram } from "./datasetHistogram.js";
|
|
8
|
+
import { datasetBoxplot } from "./datasetBoxplot.js";
|
|
9
|
+
export { datasetBoxplot, datasetHistogram, datasetPivot, datasetPrimary, datasetScatter, datasetSecondary, datasetXY, datasetYX, progressive };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
const progressive = (spec
|
|
1
|
+
const progressive = (spec)=>{
|
|
2
2
|
const result = {
|
|
3
3
|
...spec
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const size = dataset.length;
|
|
8
|
-
if (size < 5000) return result;
|
|
9
|
-
result.large = true;
|
|
10
|
-
result.largeThreshold = 5000;
|
|
5
|
+
result.large = false;
|
|
6
|
+
result.largeThreshold = 1 / 0;
|
|
11
7
|
result.progressiveStep = 400;
|
|
12
|
-
result.progressiveThreshold =
|
|
8
|
+
result.progressiveThreshold = 1 / 0;
|
|
13
9
|
return result;
|
|
14
10
|
};
|
|
15
11
|
export { progressive };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/progressive.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/progressive.ts"],"sourcesContent":["import type { ILineSeriesSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const progressive: SpecPipe = (spec
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/dataset/progressive.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/dataset/progressive.ts"],"sourcesContent":["import type { ILineSeriesSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const progressive: SpecPipe = (spec) => {\n const result = { ...spec } as ILineSeriesSpec\n // const { advancedVSeed } = context\n // const { dataset = [] } = advancedVSeed\n // const size = dataset.length\n\n // if (size < 5000) {\n // return result\n // }\n\n result.large = false\n result.largeThreshold = Infinity\n result.progressiveStep = 400\n result.progressiveThreshold = Infinity\n\n return result\n}\n"],"names":["progressive","spec","result","Infinity"],"mappings":"AAGO,MAAMA,cAAwB,CAACC;IACpC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IASzBC,OAAO,KAAK,GAAG;IACfA,OAAO,cAAc,GAAGC;IACxBD,OAAO,eAAe,GAAG;IACzBA,OAAO,oBAAoB,GAAGC;IAE9B,OAAOD;AACT"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isDeepEqual } from "remeda";
|
|
2
|
+
import { MaxMeasureId, MeasureName, MedianMeasureId, MinMeasureId, OutliersMeasureId, Q1MeasureValue, Q3MeasureValue } from "../../../../../dataReshape/constant.js";
|
|
3
|
+
const initBoxplot = (spec, context)=>{
|
|
4
|
+
const result = {
|
|
5
|
+
...spec
|
|
6
|
+
};
|
|
7
|
+
const { advancedVSeed } = context;
|
|
8
|
+
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
|
9
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
10
|
+
result.type = 'boxPlot';
|
|
11
|
+
result.minField = MinMeasureId;
|
|
12
|
+
result.q1Field = Q1MeasureValue;
|
|
13
|
+
result.medianField = MedianMeasureId;
|
|
14
|
+
result.maxField = MaxMeasureId;
|
|
15
|
+
result.q3Field = Q3MeasureValue;
|
|
16
|
+
result.outliersField = OutliersMeasureId;
|
|
17
|
+
result.xField = [
|
|
18
|
+
unfoldInfo.encodingX
|
|
19
|
+
];
|
|
20
|
+
result.seriesField = unfoldInfo.encodingColorId;
|
|
21
|
+
const sameDimensionsMode = isDeepEqual(encoding.x, encoding.color);
|
|
22
|
+
if (!sameDimensionsMode) {
|
|
23
|
+
result.xField.push(unfoldInfo.encodingColor);
|
|
24
|
+
if (encoding.color?.[0] === MeasureName && encoding.value?.length === 1) result.xField.pop();
|
|
25
|
+
}
|
|
26
|
+
result.padding = 0;
|
|
27
|
+
result.region = [
|
|
28
|
+
{
|
|
29
|
+
clip: true
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
result.animation = true;
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
export { initBoxplot };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=boxplot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/init/boxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/boxplot.ts"],"sourcesContent":["import type { IBoxPlotChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isDeepEqual } from 'remeda'\nimport {\n MaxMeasureId,\n MeasureName,\n MedianMeasureId,\n MinMeasureId,\n OutliersMeasureId,\n Q1MeasureValue,\n Q3MeasureValue,\n} from 'src/dataReshape/constant'\n\nexport const initBoxplot: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBoxPlotChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n result.type = 'boxPlot'\n result.minField = MinMeasureId\n result.q1Field = Q1MeasureValue\n result.medianField = MedianMeasureId\n result.maxField = MaxMeasureId\n result.q3Field = Q3MeasureValue\n result.outliersField = OutliersMeasureId\n result.xField = [unfoldInfo.encodingX]\n result.seriesField = unfoldInfo.encodingColorId\n\n const sameDimensionsMode = isDeepEqual(encoding.x, encoding.color)\n\n if (!sameDimensionsMode) {\n result.xField.push(unfoldInfo.encodingColor)\n\n if (encoding.color?.[0] === MeasureName && encoding.value?.length === 1) {\n result.xField.pop()\n }\n }\n\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initBoxplot","spec","context","result","advancedVSeed","datasetReshapeInfo","encoding","unfoldInfo","MinMeasureId","Q1MeasureValue","MedianMeasureId","MaxMeasureId","Q3MeasureValue","OutliersMeasureId","sameDimensionsMode","isDeepEqual","MeasureName"],"mappings":";;AAaO,MAAMA,cAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,QAAQ,EAAE,GAAGF;IACzC,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAE5CF,OAAO,IAAI,GAAG;IACdA,OAAO,QAAQ,GAAGK;IAClBL,OAAO,OAAO,GAAGM;IACjBN,OAAO,WAAW,GAAGO;IACrBP,OAAO,QAAQ,GAAGQ;IAClBR,OAAO,OAAO,GAAGS;IACjBT,OAAO,aAAa,GAAGU;IACvBV,OAAO,MAAM,GAAG;QAACI,WAAW,SAAS;KAAC;IACtCJ,OAAO,WAAW,GAAGI,WAAW,eAAe;IAE/C,MAAMO,qBAAqBC,YAAYT,SAAS,CAAC,EAAEA,SAAS,KAAK;IAEjE,IAAI,CAACQ,oBAAoB;QACvBX,OAAO,MAAM,CAAC,IAAI,CAACI,WAAW,aAAa;QAE3C,IAAID,SAAS,KAAK,EAAE,CAAC,EAAE,KAAKU,eAAeV,SAAS,KAAK,EAAE,WAAW,GACpEH,OAAO,MAAM,CAAC,GAAG;IAErB;IAEAA,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BinEndMeasureId, BinStartMeasureId, FoldMeasureValue } from "../../../../../index.js";
|
|
2
|
+
const initHistogram = (spec)=>{
|
|
3
|
+
const result = {
|
|
4
|
+
...spec
|
|
5
|
+
};
|
|
6
|
+
result.type = 'histogram';
|
|
7
|
+
result.xField = BinStartMeasureId;
|
|
8
|
+
result.x2Field = BinEndMeasureId;
|
|
9
|
+
result.yField = FoldMeasureValue;
|
|
10
|
+
result.padding = 0;
|
|
11
|
+
result.region = [
|
|
12
|
+
{
|
|
13
|
+
clip: true
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
result.animation = true;
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
export { initHistogram };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=histogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/init/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/histogram.ts"],"sourcesContent":["import type { IHistogramChartSpec } from '@visactor/vchart'\nimport { BinEndMeasureId, BinStartMeasureId, FoldMeasureValue } from 'src/index'\nimport type { SpecPipe } from 'src/types'\n\nexport const initHistogram: SpecPipe = (spec) => {\n const result = { ...spec } as IHistogramChartSpec\n\n // 直方图默认支持明细数据\n result.type = 'histogram'\n result.xField = BinStartMeasureId\n result.x2Field = BinEndMeasureId\n result.yField = FoldMeasureValue\n // result.seriesField = unfoldInfo.encodingColorId\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initHistogram","spec","result","BinStartMeasureId","BinEndMeasureId","FoldMeasureValue"],"mappings":";AAIO,MAAMA,gBAA0B,CAACC;IACtC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAGzBC,OAAO,IAAI,GAAG;IACdA,OAAO,MAAM,GAAGC;IAChBD,OAAO,OAAO,GAAGE;IACjBF,OAAO,MAAM,GAAGG;IAEhBH,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
|
|
@@ -13,3 +13,5 @@ export { initRadar } from './radar';
|
|
|
13
13
|
export { initFunnel } from './funnel';
|
|
14
14
|
export { initPivot } from './pivot';
|
|
15
15
|
export { initDualAxisPrimary, initDualAxisSecondary } from './dualAxis';
|
|
16
|
+
export { initHistogram } from './histogram';
|
|
17
|
+
export { initBoxplot } from './boxplot';
|
|
@@ -13,4 +13,6 @@ import { initRadar } from "./radar.js";
|
|
|
13
13
|
import { initFunnel } from "./funnel.js";
|
|
14
14
|
import { initPivot } from "./pivot.js";
|
|
15
15
|
import { initDualAxisPrimary, initDualAxisSecondary } from "./dualAxis.js";
|
|
16
|
-
|
|
16
|
+
import { initHistogram } from "./histogram.js";
|
|
17
|
+
import { initBoxplot } from "./boxplot.js";
|
|
18
|
+
export { initArea, initBar, initBarParallel, initBoxplot, initColumn, initColumnParallel, initDonut, initDualAxisPrimary, initDualAxisSecondary, initFunnel, initHistogram, initLine, initPie, initPivot, initRadar, initRose, initRoseParallel, initScatter };
|
|
@@ -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"],"names":["initPivot","spec","result"],"mappings":"AAGO,MAAMA,YAAsB,CAACC;IAClC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,WAAW;QACX,MAAM,EAAE;QACR,SAAS,EAAE;QACX,YAAY,EAAE;QACd,SAAS,EAAE;QACX,WAAW;QACX,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"}
|
|
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 defaultHeaderColWidth: 'auto',\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"],"names":["initPivot","spec","result"],"mappings":"AAGO,MAAMA,YAAsB,CAACC;IAClC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,OAAO;QACL,GAAGC,MAAM;QACT,WAAW;QACX,MAAM,EAAE;QACR,SAAS,EAAE;QACX,YAAY,EAAE;QACd,SAAS,EAAE;QACX,WAAW;QACX,uBAAuB;QACvB,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"}
|