@visactor/vseed 0.2.8 → 0.2.9

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.
Files changed (32) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/builder.d.ts +10 -10
  4. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +3 -3
  5. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
  6. package/dist/esm/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
  7. package/dist/esm/pipeline/spec/chart/pipes/label/index.js +2 -1
  8. package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +1 -1
  9. package/dist/esm/pipeline/spec/chart/pipes/label/label.js +4 -2
  10. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  11. package/dist/esm/pipeline/spec/chart/pipes/label/labelBoxPlot.d.ts +2 -0
  12. package/dist/esm/pipeline/spec/chart/pipes/label/labelBoxPlot.js +21 -0
  13. package/dist/esm/pipeline/spec/chart/pipes/label/labelBoxPlot.js.map +1 -0
  14. package/dist/esm/pipeline/spec/chart/pipes/markStyle/boxPlotStyle.js +7 -5
  15. package/dist/esm/pipeline/spec/chart/pipes/markStyle/boxPlotStyle.js.map +1 -1
  16. package/dist/esm/pipeline/spec/chart/pipes/markStyle/outlierStyle.js +3 -6
  17. package/dist/esm/pipeline/spec/chart/pipes/markStyle/outlierStyle.js.map +1 -1
  18. package/dist/esm/theme/common/boxPlot.js +10 -7
  19. package/dist/esm/theme/common/boxPlot.js.map +1 -1
  20. package/dist/esm/types/advancedVSeed.d.ts +4 -4
  21. package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +2 -2
  22. package/dist/esm/types/properties/config/boxplot.d.ts +1 -1
  23. package/dist/esm/types/properties/config/config.d.ts +1 -1
  24. package/dist/esm/types/properties/markStyle/boxPlotStyle.d.ts +5 -5
  25. package/dist/esm/types/properties/markStyle/boxPlotStyle.js +2 -2
  26. package/dist/esm/types/properties/markStyle/boxPlotStyle.js.map +1 -1
  27. package/dist/esm/types/properties/markStyle/markStyle.d.ts +2 -2
  28. package/dist/esm/types/properties/theme/customTheme.d.ts +2 -2
  29. package/dist/esm/types/zVseed.d.ts +2 -2
  30. package/dist/umd/index.js +44 -24
  31. package/dist/umd/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -4949,8 +4949,8 @@ export declare class Builder implements VSeedBuilder {
4949
4949
  boxBorderWidth?: number | null | undefined;
4950
4950
  boxBorderOpacity?: number | null | undefined;
4951
4951
  boxCornerRadius?: number | null | undefined;
4952
- whiskerBorderColor?: string | null | undefined;
4953
4952
  medianBorderColor?: string | null | undefined;
4953
+ whiskerBorderColor?: string | null | undefined;
4954
4954
  } | null | undefined;
4955
4955
  outlierStyle?: {
4956
4956
  pointVisible?: boolean | undefined;
@@ -5684,8 +5684,8 @@ export declare class Builder implements VSeedBuilder {
5684
5684
  boxBorderWidth?: number | null | undefined;
5685
5685
  boxBorderOpacity?: number | null | undefined;
5686
5686
  boxCornerRadius?: number | null | undefined;
5687
- whiskerBorderColor?: string | null | undefined;
5688
5687
  medianBorderColor?: string | null | undefined;
5688
+ whiskerBorderColor?: string | null | undefined;
5689
5689
  } | {
5690
5690
  selector?: string | number | {
5691
5691
  field: string;
@@ -5715,8 +5715,8 @@ export declare class Builder implements VSeedBuilder {
5715
5715
  boxBorderWidth?: number | null | undefined;
5716
5716
  boxBorderOpacity?: number | null | undefined;
5717
5717
  boxCornerRadius?: number | null | undefined;
5718
- whiskerBorderColor?: string | null | undefined;
5719
5718
  medianBorderColor?: string | null | undefined;
5719
+ whiskerBorderColor?: string | null | undefined;
5720
5720
  }[] | null | undefined;
5721
5721
  outlierStyle?: {
5722
5722
  selector?: string | number | {
@@ -10553,8 +10553,8 @@ export declare class Builder implements VSeedBuilder {
10553
10553
  boxBorderWidth?: number | null | undefined;
10554
10554
  boxBorderOpacity?: number | null | undefined;
10555
10555
  boxCornerRadius?: number | null | undefined;
10556
- whiskerBorderColor?: string | null | undefined;
10557
10556
  medianBorderColor?: string | null | undefined;
10557
+ whiskerBorderColor?: string | null | undefined;
10558
10558
  } | null | undefined;
10559
10559
  outlierStyle?: {
10560
10560
  pointVisible?: boolean | undefined;
@@ -16380,8 +16380,8 @@ export declare class Builder implements VSeedBuilder {
16380
16380
  boxBorderWidth?: number | null | undefined;
16381
16381
  boxBorderOpacity?: number | null | undefined;
16382
16382
  boxCornerRadius?: number | null | undefined;
16383
- whiskerBorderColor?: string | null | undefined;
16384
16383
  medianBorderColor?: string | null | undefined;
16384
+ whiskerBorderColor?: string | null | undefined;
16385
16385
  } | null | undefined;
16386
16386
  outlierStyle?: {
16387
16387
  pointVisible?: boolean | undefined;
@@ -17115,8 +17115,8 @@ export declare class Builder implements VSeedBuilder {
17115
17115
  boxBorderWidth?: number | null | undefined;
17116
17116
  boxBorderOpacity?: number | null | undefined;
17117
17117
  boxCornerRadius?: number | null | undefined;
17118
- whiskerBorderColor?: string | null | undefined;
17119
17118
  medianBorderColor?: string | null | undefined;
17119
+ whiskerBorderColor?: string | null | undefined;
17120
17120
  } | {
17121
17121
  selector?: string | number | {
17122
17122
  field: string;
@@ -17146,8 +17146,8 @@ export declare class Builder implements VSeedBuilder {
17146
17146
  boxBorderWidth?: number | null | undefined;
17147
17147
  boxBorderOpacity?: number | null | undefined;
17148
17148
  boxCornerRadius?: number | null | undefined;
17149
- whiskerBorderColor?: string | null | undefined;
17150
17149
  medianBorderColor?: string | null | undefined;
17150
+ whiskerBorderColor?: string | null | undefined;
17151
17151
  }[] | null | undefined;
17152
17152
  outlierStyle?: {
17153
17153
  selector?: string | number | {
@@ -21984,8 +21984,8 @@ export declare class Builder implements VSeedBuilder {
21984
21984
  boxBorderWidth?: number | null | undefined;
21985
21985
  boxBorderOpacity?: number | null | undefined;
21986
21986
  boxCornerRadius?: number | null | undefined;
21987
- whiskerBorderColor?: string | null | undefined;
21988
21987
  medianBorderColor?: string | null | undefined;
21988
+ whiskerBorderColor?: string | null | undefined;
21989
21989
  } | null | undefined;
21990
21990
  outlierStyle?: {
21991
21991
  pointVisible?: boolean | undefined;
@@ -27693,8 +27693,8 @@ export declare class Builder implements VSeedBuilder {
27693
27693
  boxBorderWidth?: number | null | undefined;
27694
27694
  boxBorderOpacity?: number | null | undefined;
27695
27695
  boxCornerRadius?: number | null | undefined;
27696
- whiskerBorderColor?: string | null | undefined;
27697
27696
  medianBorderColor?: string | null | undefined;
27697
+ whiskerBorderColor?: string | null | undefined;
27698
27698
  } | null | undefined;
27699
27699
  outlierStyle?: {
27700
27700
  pointVisible?: boolean | undefined;
@@ -32919,8 +32919,8 @@ export declare class Builder implements VSeedBuilder {
32919
32919
  boxBorderWidth?: number | null | undefined;
32920
32920
  boxBorderOpacity?: number | null | undefined;
32921
32921
  boxCornerRadius?: number | null | undefined;
32922
- whiskerBorderColor?: string | null | undefined;
32923
32922
  medianBorderColor?: string | null | undefined;
32923
+ whiskerBorderColor?: string | null | undefined;
32924
32924
  } | null | undefined;
32925
32925
  outlierStyle?: {
32926
32926
  pointVisible?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, boxGapInGroup, boxMaxWidth, boxPlotStyle, color, colorAdapter, colorBoxPlotStyleFill, colorLegend, datasetBoxplot, datasetPivot, dimensionLinkage, discreteLegend, initBoxplot, initPivot, label, linearColor, outlierStyle, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltipBoxplot, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, boxGapInGroup, boxMaxWidth, boxPlotStyle, color, colorAdapter, colorBoxPlotStyleFill, colorLegend, datasetBoxplot, datasetPivot, dimensionLinkage, discreteLegend, initBoxplot, initPivot, labelBoxPlot, linearColor, outlierStyle, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltipBoxplot, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
2
2
  const boxplot = [
3
3
  initBoxplot,
4
4
  stackCornerRadius,
@@ -10,7 +10,7 @@ const boxplot = [
10
10
  progressive,
11
11
  xBand,
12
12
  yLinear,
13
- label,
13
+ labelBoxPlot,
14
14
  tooltipBoxplot,
15
15
  colorAdapter(discreteLegend, colorLegend),
16
16
  verticalCrosshairRect,
@@ -36,7 +36,7 @@ const pivotBoxplot = [
36
36
  progressive,
37
37
  xBand,
38
38
  pivotAxisStyle(yLinear),
39
- label,
39
+ labelBoxPlot,
40
40
  tooltipBoxplot,
41
41
  colorBoxPlotStyleFill(boxPlotStyle),
42
42
  outlierStyle,
@@ -1 +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 { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n label,\n tooltipBoxplot,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n pivotColorLegend,\n initBoxplot,\n xBand,\n yLinear,\n verticalCrosshairRect,\n datasetBoxplot,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n boxPlotStyle,\n colorBoxPlotStyleFill,\n outlierStyle,\n discreteLegend,\n} from '../pipes'\n\nconst boxplot: VChartSpecPipeline = [\n initBoxplot,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\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 colorBoxPlotStyleFill(boxPlotStyle),\n outlierStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBoxplot: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initBoxplot,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetBoxplot,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n label,\n tooltipBoxplot,\n colorBoxPlotStyleFill(boxPlotStyle),\n outlierStyle,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const boxplotSpecPipeline = [pivotAdapter(boxplot, pivotBoxplot)]\n"],"names":["boxplot","initBoxplot","stackCornerRadius","boxMaxWidth","boxGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetBoxplot","progressive","xBand","yLinear","label","tooltipBoxplot","discreteLegend","colorLegend","verticalCrosshairRect","colorBoxPlotStyleFill","boxPlotStyle","outlierStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBoxplot","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","boxplotSpecPipeline","pivotAdapter"],"mappings":";AAwCA,MAAMA,UAA8B;IAClCC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,sBAAsBC;IACtBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAAuC;IAC3CC;IACAC;IACAC;IACAC,gBAAgB;QACd5B;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAmB,eAAelB;QACfC;QACAC;QACAI,sBAAsBC;QACtBC;QACAH;QACAI;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAC;IACA5B,aAAa6B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,sBAAsB;IAACC,aAAatC,SAASyB;CAAc"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/boxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/boxplot.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n labelBoxPlot,\n tooltipBoxplot,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n pivotColorLegend,\n initBoxplot,\n xBand,\n yLinear,\n verticalCrosshairRect,\n datasetBoxplot,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n boxPlotStyle,\n colorBoxPlotStyleFill,\n outlierStyle,\n discreteLegend,\n} from '../pipes'\n\nconst boxplot: VChartSpecPipeline = [\n initBoxplot,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetBoxplot,\n progressive,\n xBand,\n yLinear,\n labelBoxPlot,\n tooltipBoxplot,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBoxPlotStyleFill(boxPlotStyle),\n outlierStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBoxplot: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initBoxplot,\n stackCornerRadius,\n boxMaxWidth,\n boxGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetBoxplot,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n labelBoxPlot,\n tooltipBoxplot,\n colorBoxPlotStyleFill(boxPlotStyle),\n outlierStyle,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const boxplotSpecPipeline = [pivotAdapter(boxplot, pivotBoxplot)]\n"],"names":["boxplot","initBoxplot","stackCornerRadius","boxMaxWidth","boxGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetBoxplot","progressive","xBand","yLinear","labelBoxPlot","tooltipBoxplot","discreteLegend","colorLegend","verticalCrosshairRect","colorBoxPlotStyleFill","boxPlotStyle","outlierStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBoxplot","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","boxplotSpecPipeline","pivotAdapter"],"mappings":";AAwCA,MAAMA,UAA8B;IAClCC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,sBAAsBC;IACtBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAAuC;IAC3CC;IACAC;IACAC;IACAC,gBAAgB;QACd5B;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAmB,eAAelB;QACfC;QACAC;QACAI,sBAAsBC;QACtBC;QACAH;QACAI;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAC;IACA5B,aAAa6B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,sBAAsB;IAACC,aAAatC,SAASyB;CAAc"}
@@ -2,3 +2,4 @@ export { label } from './label';
2
2
  export { labelPrimary, labelSecondary } from './labelDualAxis';
3
3
  export { labelScatter } from './labelScatter';
4
4
  export { labelPie } from './labelPie';
5
+ export { labelBoxPlot } from './labelBoxPlot';
@@ -2,4 +2,5 @@ import { label } from "./label.js";
2
2
  import { labelPrimary, labelSecondary } from "./labelDualAxis.js";
3
3
  import { labelScatter } from "./labelScatter.js";
4
4
  import { labelPie } from "./labelPie.js";
5
- export { label, labelPie, labelPrimary, labelScatter, labelSecondary };
5
+ import { labelBoxPlot } from "./labelBoxPlot.js";
6
+ export { label, labelBoxPlot, labelPie, labelPrimary, labelScatter, labelSecondary };
@@ -2,7 +2,7 @@ import type { Datum, Dimensions, Encoding, FoldInfo, Formatter, Label, Measure,
2
2
  export declare const label: VChartSpecPipe;
3
3
  export declare const generateMeasureValue: (value: number | string, measure: Measure, labelAutoFormat?: boolean, numFormat?: NumFormat) => string;
4
4
  export declare const generateMeasurePercent: (value: number | string, sum: number, formatter: Formatter) => string;
5
- export declare const buildLabel: (label: Label, vseedMeasures: Measures | undefined, vseedDimensions: Dimensions | undefined, advancedVSeedDimensions: Dimensions, advancedVSeedMeasures: Measures, encoding: Encoding, foldInfoList: FoldInfo[]) => {
5
+ export declare const buildLabel: (label: Label, vseedMeasures: Measures | undefined, vseedDimensions: Dimensions | undefined, advancedVSeedDimensions: Dimensions, advancedVSeedMeasures: Measures, encoding: Encoding, foldInfoList: (Pick<FoldInfo, "measureId" | "measureValue"> & Partial<Pick<FoldInfo, "statistics">>)[]) => {
6
6
  visible: boolean;
7
7
  dataFilter: (data: Datum[]) => Record<string | number, any>[];
8
8
  formatMethod: (_: unknown, datum: Datum) => string | (string | number)[];
@@ -59,9 +59,11 @@ const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSe
59
59
  const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
60
60
  if (measure) {
61
61
  const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
62
- const measurePercentLabel = isNumber(datum['__VCHART_ARC_RATIO']) ? generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter) : generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
63
62
  if (showValue) result.push(measureValueLabel);
64
- if (showValuePercent) result.push(measurePercentLabel);
63
+ if (showValuePercent) {
64
+ if (isNumber(datum['__VCHART_ARC_RATIO'])) result.push(generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter));
65
+ else if (statistics && isNumber(statistics.sum)) result.push(generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter));
66
+ }
65
67
  }
66
68
  });
67
69
  result.push(...meaLabels);
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { createFormatter, createFormatterByMeasure, DATUM_HIDE_KEY, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimension,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n VChartSpecPipe,\n} from 'src/types'\nimport { isNumber, merge, uniqueBy } from 'remeda'\nimport { selector } from 'src/dataSelector'\nimport { MeasureId } from 'src/dataReshape/constant'\n\nexport const label: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n ) as unknown as ILineChartSpec['label']\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure: Measure,\n labelAutoFormat?: boolean,\n numFormat: NumFormat = {},\n) => {\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = (\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedDimensions: Dimensions,\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: FoldInfo[],\n) => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n showDimension,\n labelOverlap,\n labelColorSmartInvert,\n labelStroke,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat,\n numFormat = {},\n } = label\n\n const hasDimLabelEncoding = vseedDimensions.some((item) => encoding.label?.includes(item.id))\n\n const labelDims = uniqueBy(\n hasDimLabelEncoding\n ? vseedDimensions.filter((item) => encoding.label?.includes(item.id))\n : showDimension\n ? advancedVSeedDimensions.filter((d) => d.id !== MeasureId && d.encoding !== 'row' && d.encoding !== 'column')\n : [],\n (item: Dimension) => item.id,\n )\n\n const labelMeas = uniqueBy(\n vseedMeasures.filter((item) => encoding.label?.includes(item.id)),\n (item: Measure) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n dataFilter: (data: Datum[]) => {\n return data.filter((entry) => {\n return entry.data?.[DATUM_HIDE_KEY] !== true && selector(entry.data as Datum, label.selector, 'Or')\n })\n },\n formatMethod: (_: unknown, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item: Dimension) => {\n const id = item.id\n return datum[id] as number | string\n })\n\n const meaLabels = labelMeas.map((item: Measure) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n if (measure) {\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n // 饼图/环图需要使用实际占比数据\n const measurePercentLabel = isNumber(datum['__VCHART_ARC_RATIO'])\n ? generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter)\n : generateMeasurePercent(datum[measureValue] as number | string, statistics.sum, percentFormatter)\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n result.push(measurePercentLabel)\n }\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n stroke: labelStroke,\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n }\n\n if (labelOverlap) {\n ;(result as any).overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","showDimension","labelOverlap","labelColorSmartInvert","labelStroke","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","hasDimLabelEncoding","item","labelDims","uniqueBy","d","MeasureId","labelMeas","percentFormat","percentFormatter","createFormatter","data","entry","DATUM_HIDE_KEY","selector","_","datum","dimLabels","id","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","measurePercentLabel","isNumber"],"mappings":"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"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { createFormatter, createFormatterByMeasure, DATUM_HIDE_KEY, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimension,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n VChartSpecPipe,\n} from 'src/types'\nimport { isNumber, merge, uniqueBy } from 'remeda'\nimport { selector } from 'src/dataSelector'\nimport { MeasureId } from 'src/dataReshape/constant'\n\nexport const label: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n ) as unknown as ILineChartSpec['label']\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure: Measure,\n labelAutoFormat?: boolean,\n numFormat: NumFormat = {},\n) => {\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = (\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedDimensions: Dimensions,\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: (Pick<FoldInfo, 'measureId' | 'measureValue'> & Partial<Pick<FoldInfo, 'statistics'>>)[],\n) => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n showDimension,\n labelOverlap,\n labelColorSmartInvert,\n labelStroke,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat,\n numFormat = {},\n } = label\n\n const hasDimLabelEncoding = vseedDimensions.some((item) => encoding.label?.includes(item.id))\n\n const labelDims = uniqueBy(\n hasDimLabelEncoding\n ? vseedDimensions.filter((item) => encoding.label?.includes(item.id))\n : showDimension\n ? advancedVSeedDimensions.filter((d) => d.id !== MeasureId && d.encoding !== 'row' && d.encoding !== 'column')\n : [],\n (item: Dimension) => item.id,\n )\n\n const labelMeas = uniqueBy(\n vseedMeasures.filter((item) => encoding.label?.includes(item.id)),\n (item: Measure) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n dataFilter: (data: Datum[]) => {\n return data.filter((entry) => {\n return entry.data?.[DATUM_HIDE_KEY] !== true && selector(entry.data as Datum, label.selector, 'Or')\n })\n },\n formatMethod: (_: unknown, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item: Dimension) => {\n const id = item.id\n return datum[id] as number | string\n })\n\n const meaLabels = labelMeas.map((item: Measure) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n if (measure) {\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n if (isNumber(datum['__VCHART_ARC_RATIO'])) {\n // 饼图/环图需要使用实际占比数据\n result.push(generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter))\n } else if (statistics && isNumber(statistics.sum)) {\n result.push(\n generateMeasurePercent(datum[measureValue] as number | string, statistics.sum, percentFormatter),\n )\n }\n }\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n stroke: labelStroke,\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n }\n\n if (labelOverlap) {\n ;(result as any).overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","showDimension","labelOverlap","labelColorSmartInvert","labelStroke","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","hasDimLabelEncoding","item","labelDims","uniqueBy","d","MeasureId","labelMeas","percentFormat","percentFormatter","createFormatter","data","entry","DATUM_HIDE_KEY","selector","_","datum","dimLabels","id","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","isNumber"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const labelBoxPlot: VChartSpecPipe;
@@ -0,0 +1,21 @@
1
+ import { buildLabel } from "./label.js";
2
+ import { FoldMeasureId, MedianMeasureId } from "../../../../../dataReshape/constant.js";
3
+ const labelBoxPlot = (spec, context)=>{
4
+ const result = {
5
+ ...spec
6
+ };
7
+ const { advancedVSeed, vseed } = context;
8
+ const { chartType, encoding } = advancedVSeed;
9
+ const baseConfig = advancedVSeed.config[chartType];
10
+ const { label } = baseConfig;
11
+ result.label = buildLabel(label, vseed.measures, vseed.dimensions, advancedVSeed.dimensions, advancedVSeed.measures, encoding, [
12
+ {
13
+ measureId: FoldMeasureId,
14
+ measureValue: MedianMeasureId
15
+ }
16
+ ]);
17
+ return result;
18
+ };
19
+ export { labelBoxPlot };
20
+
21
+ //# sourceMappingURL=labelBoxPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/label/labelBoxPlot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/labelBoxPlot.ts"],"sourcesContent":["import type { IPieChartSpec } from '@visactor/vchart'\nimport type { Encoding, PieLabel, VChartSpecPipe } from 'src/types'\nimport { buildLabel } from './label'\nimport { FoldMeasureId, MedianMeasureId } from 'src/dataReshape/constant'\n\nexport const labelBoxPlot: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as IPieChartSpec\n const { advancedVSeed, vseed } = context\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: PieLabel }\n\n const { label } = baseConfig\n\n result.label = buildLabel(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [\n {\n measureId: FoldMeasureId,\n measureValue: MedianMeasureId,\n },\n ],\n ) as unknown as IPieChartSpec['label']\n\n return result\n}\n"],"names":["labelBoxPlot","spec","context","result","advancedVSeed","vseed","chartType","encoding","baseConfig","label","buildLabel","FoldMeasureId","MedianMeasureId"],"mappings":";;AAKO,MAAMA,eAA+B,CAACC,MAAMC;IACjD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IAChC,MAAMI,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAElD,MAAM,EAAEG,KAAK,EAAE,GAAGD;IAElBL,OAAO,KAAK,GAAGO,WACbD,OACAJ,MAAM,QAAQ,EACdA,MAAM,UAAU,EAChBD,cAAc,UAAU,EACxBA,cAAc,QAAQ,EACtBG,UACA;QACE;YACE,WAAWI;YACX,cAAcC;QAChB;KACD;IAGH,OAAOT;AACT"}
@@ -12,9 +12,8 @@ const boxPlotStyle_boxPlotStyle = (spec, context)=>{
12
12
  shaftShape: 'filled-line',
13
13
  visible: true,
14
14
  shaftWidth: '50%',
15
- stroke: theme?.boxBorderColor,
15
+ stroke: theme?.whiskerBorderColor,
16
16
  boxStroke: theme?.boxBorderColor,
17
- whiskerStroke: theme?.whiskerBorderColor,
18
17
  boxCornerRadius: theme?.boxCornerRadius,
19
18
  medianStroke: theme?.medianBorderColor ?? theme?.boxBorderColor
20
19
  }
@@ -25,7 +24,7 @@ const boxPlotStyle_boxPlotStyle = (spec, context)=>{
25
24
  boxPlotStyle
26
25
  ];
27
26
  const customMap = boxPlotStyles.reduce((result, style, index)=>{
28
- const { boxColor, boxColorOpacity, boxBorderColor, boxBorderWidth = 1, boxVisible = true, boxBorderOpacity } = style;
27
+ const { boxColor, boxColorOpacity, boxBorderColor, boxBorderWidth = 1, boxVisible = true, boxBorderOpacity, medianBorderColor, whiskerBorderColor, boxCornerRadius } = style;
29
28
  return {
30
29
  ...result,
31
30
  [`custom${index + 1}`]: {
@@ -39,8 +38,11 @@ const boxPlotStyle_boxPlotStyle = (spec, context)=>{
39
38
  fill: boxColor,
40
39
  fillOpacity: boxColorOpacity,
41
40
  lineWidth: boxBorderWidth,
42
- stroke: boxBorderColor,
43
- strokeOpacity: boxBorderOpacity
41
+ stroke: whiskerBorderColor,
42
+ boxStroke: boxBorderColor,
43
+ boxCornerRadius: boxCornerRadius,
44
+ strokeOpacity: boxBorderOpacity,
45
+ medianStroke: medianBorderColor ?? boxBorderColor
44
46
  }
45
47
  }
46
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/boxPlotStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/boxPlotStyle.ts"],"sourcesContent":["import type { IBoxPlotChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { BoxPlotStyle, Datum, VChartSpecPipe } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const boxPlotStyle: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { markStyle, config } = advancedVSeed\n const { boxPlotStyle } = markStyle\n const theme = config?.[vseed.chartType as 'boxPlot']?.boxPlotStyle\n\n const result = {\n ...spec,\n boxPlot: {\n style: {\n shaftShape: 'filled-line',\n visible: true,\n shaftWidth: '50%',\n stroke: theme?.boxBorderColor,\n boxStroke: theme?.boxBorderColor,\n whiskerStroke: theme?.whiskerBorderColor,\n boxCornerRadius: theme?.boxCornerRadius,\n medianStroke: theme?.medianBorderColor ?? theme?.boxBorderColor,\n },\n },\n } as IBoxPlotChartSpec\n\n if (isNullish(boxPlotStyle) || isEmpty(boxPlotStyle)) {\n return result\n }\n\n const boxPlotStyles = (Array.isArray(boxPlotStyle) ? boxPlotStyle : [boxPlotStyle]) as BoxPlotStyle[]\n\n const customMap = boxPlotStyles.reduce<object>((result, style, index) => {\n const { boxColor, boxColorOpacity, boxBorderColor, boxBorderWidth = 1, boxVisible = true, boxBorderOpacity } = style\n\n return {\n ...result,\n [`custom${index + 1}`]: {\n // 优先级: 后者覆盖前者\n level: index + 1,\n filter: (datum: Datum) => {\n if (selector(datum, style.selector)) {\n return true\n }\n return false\n },\n style: {\n visible: boxVisible,\n fill: boxColor,\n fillOpacity: boxColorOpacity,\n lineWidth: boxBorderWidth,\n stroke: boxBorderColor,\n strokeOpacity: boxBorderOpacity,\n },\n },\n }\n }, {})\n\n result.boxPlot!.state = {\n ...result.boxPlot!.state,\n ...customMap,\n }\n\n return result\n}\n"],"names":["boxPlotStyle","spec","context","advancedVSeed","vseed","markStyle","config","theme","result","isNullish","isEmpty","boxPlotStyles","Array","customMap","style","index","boxColor","boxColorOpacity","boxBorderColor","boxBorderWidth","boxVisible","boxBorderOpacity","datum","selector"],"mappings":";;AAKO,MAAMA,4BAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC9B,MAAM,EAAEH,YAAY,EAAE,GAAGK;IACzB,MAAME,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAc,EAAE;IAEtD,MAAMI,SAAS;QACb,GAAGP,IAAI;QACP,SAAS;YACP,OAAO;gBACL,YAAY;gBACZ,SAAS;gBACT,YAAY;gBACZ,QAAQM,OAAO;gBACf,WAAWA,OAAO;gBAClB,eAAeA,OAAO;gBACtB,iBAAiBA,OAAO;gBACxB,cAAcA,OAAO,qBAAqBA,OAAO;YACnD;QACF;IACF;IAEA,IAAIE,UAAUT,iBAAiBU,QAAQV,eACrC,OAAOQ;IAGT,MAAMG,gBAAiBC,MAAM,OAAO,CAACZ,gBAAgBA,eAAe;QAACA;KAAa;IAElF,MAAMa,YAAYF,cAAc,MAAM,CAAS,CAACH,QAAQM,OAAOC;QAC7D,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAEC,cAAc,EAAEC,iBAAiB,CAAC,EAAEC,aAAa,IAAI,EAAEC,gBAAgB,EAAE,GAAGP;QAE/G,OAAO;YACL,GAAGN,MAAM;YACT,CAAC,CAAC,MAAM,EAAEO,QAAQ,GAAG,CAAC,EAAE;gBAEtB,OAAOA,QAAQ;gBACf,QAAQ,CAACO;oBACP,IAAIC,SAASD,OAAOR,MAAM,QAAQ,GAChC,OAAO;oBAET,OAAO;gBACT;gBACA,OAAO;oBACL,SAASM;oBACT,MAAMJ;oBACN,aAAaC;oBACb,WAAWE;oBACX,QAAQD;oBACR,eAAeG;gBACjB;YACF;QACF;IACF,GAAG,CAAC;IAEJb,OAAO,OAAO,CAAE,KAAK,GAAG;QACtB,GAAGA,OAAO,OAAO,CAAE,KAAK;QACxB,GAAGK,SAAS;IACd;IAEA,OAAOL;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/boxPlotStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/boxPlotStyle.ts"],"sourcesContent":["import type { IBoxPlotChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { BoxPlotStyle, Datum, VChartSpecPipe } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const boxPlotStyle: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { markStyle, config } = advancedVSeed\n const { boxPlotStyle } = markStyle\n const theme = config?.[vseed.chartType as 'boxPlot']?.boxPlotStyle\n\n const result = {\n ...spec,\n boxPlot: {\n style: {\n shaftShape: 'filled-line',\n visible: true,\n shaftWidth: '50%',\n stroke: theme?.whiskerBorderColor,\n boxStroke: theme?.boxBorderColor,\n boxCornerRadius: theme?.boxCornerRadius,\n medianStroke: theme?.medianBorderColor ?? theme?.boxBorderColor,\n },\n },\n } as IBoxPlotChartSpec\n\n if (isNullish(boxPlotStyle) || isEmpty(boxPlotStyle)) {\n return result\n }\n\n const boxPlotStyles = (Array.isArray(boxPlotStyle) ? boxPlotStyle : [boxPlotStyle]) as BoxPlotStyle[]\n\n const customMap = boxPlotStyles.reduce<object>((result, style, index) => {\n const {\n boxColor,\n boxColorOpacity,\n boxBorderColor,\n boxBorderWidth = 1,\n boxVisible = true,\n boxBorderOpacity,\n medianBorderColor,\n whiskerBorderColor,\n boxCornerRadius,\n } = style\n\n return {\n ...result,\n [`custom${index + 1}`]: {\n // 优先级: 后者覆盖前者\n level: index + 1,\n filter: (datum: Datum) => {\n if (selector(datum, style.selector)) {\n return true\n }\n return false\n },\n style: {\n visible: boxVisible,\n fill: boxColor,\n fillOpacity: boxColorOpacity,\n lineWidth: boxBorderWidth,\n stroke: whiskerBorderColor,\n boxStroke: boxBorderColor,\n boxCornerRadius: boxCornerRadius,\n strokeOpacity: boxBorderOpacity,\n medianStroke: medianBorderColor ?? boxBorderColor,\n },\n },\n }\n }, {})\n\n result.boxPlot!.state = {\n ...result.boxPlot!.state,\n ...customMap,\n }\n\n return result\n}\n"],"names":["boxPlotStyle","spec","context","advancedVSeed","vseed","markStyle","config","theme","result","isNullish","isEmpty","boxPlotStyles","Array","customMap","style","index","boxColor","boxColorOpacity","boxBorderColor","boxBorderWidth","boxVisible","boxBorderOpacity","medianBorderColor","whiskerBorderColor","boxCornerRadius","datum","selector"],"mappings":";;AAKO,MAAMA,4BAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC9B,MAAM,EAAEH,YAAY,EAAE,GAAGK;IACzB,MAAME,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAc,EAAE;IAEtD,MAAMI,SAAS;QACb,GAAGP,IAAI;QACP,SAAS;YACP,OAAO;gBACL,YAAY;gBACZ,SAAS;gBACT,YAAY;gBACZ,QAAQM,OAAO;gBACf,WAAWA,OAAO;gBAClB,iBAAiBA,OAAO;gBACxB,cAAcA,OAAO,qBAAqBA,OAAO;YACnD;QACF;IACF;IAEA,IAAIE,UAAUT,iBAAiBU,QAAQV,eACrC,OAAOQ;IAGT,MAAMG,gBAAiBC,MAAM,OAAO,CAACZ,gBAAgBA,eAAe;QAACA;KAAa;IAElF,MAAMa,YAAYF,cAAc,MAAM,CAAS,CAACH,QAAQM,OAAOC;QAC7D,MAAM,EACJC,QAAQ,EACRC,eAAe,EACfC,cAAc,EACdC,iBAAiB,CAAC,EAClBC,aAAa,IAAI,EACjBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,eAAe,EAChB,GAAGV;QAEJ,OAAO;YACL,GAAGN,MAAM;YACT,CAAC,CAAC,MAAM,EAAEO,QAAQ,GAAG,CAAC,EAAE;gBAEtB,OAAOA,QAAQ;gBACf,QAAQ,CAACU;oBACP,IAAIC,SAASD,OAAOX,MAAM,QAAQ,GAChC,OAAO;oBAET,OAAO;gBACT;gBACA,OAAO;oBACL,SAASM;oBACT,MAAMJ;oBACN,aAAaC;oBACb,WAAWE;oBACX,QAAQI;oBACR,WAAWL;oBACX,iBAAiBM;oBACjB,eAAeH;oBACf,cAAcC,qBAAqBJ;gBACrC;YACF;QACF;IACF,GAAG,CAAC;IAEJV,OAAO,OAAO,CAAE,KAAK,GAAG;QACtB,GAAGA,OAAO,OAAO,CAAE,KAAK;QACxB,GAAGK,SAAS;IACd;IAEA,OAAOL;AACT"}
@@ -44,12 +44,9 @@ const outlierStyle_outlierStyle = (spec, context)=>{
44
44
  size: pointSize,
45
45
  fill: pointColor,
46
46
  fillOpacity: pointColorOpacity,
47
- innerBorder: {
48
- stroke: pointBorderColor,
49
- lineWidth: pointBorderWidth,
50
- distance: (pointBorderWidth || 0) / 2,
51
- lineDash: lineDash
52
- }
47
+ stroke: pointBorderColor,
48
+ lineWidth: pointBorderWidth,
49
+ lineDash: lineDash
53
50
  }
54
51
  }
55
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/outlierStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/outlierStyle.ts"],"sourcesContent":["import type { IBoxPlotChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, OutlierStyle, VChartSpecPipe } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const outlierStyle: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { markStyle, config } = advancedVSeed\n const { outlierStyle } = markStyle\n const theme = config?.[vseed.chartType as 'boxPlot']?.outlierStyle\n const result = {\n ...spec,\n outlier: {\n style: {\n // stroke: theme?.pointColor,\n fill: theme?.pointColor,\n lineWidth: theme?.pointBorderWidth,\n stroke: theme?.pointBorderColor,\n },\n },\n } as IBoxPlotChartSpec\n\n if (isNullish(outlierStyle) || isEmpty(outlierStyle)) {\n return result\n }\n\n const outlierStyles = (Array.isArray(outlierStyle) ? outlierStyle : [outlierStyle]) as OutlierStyle[]\n\n const customMap = outlierStyles.reduce<object>((result, style, index) => {\n const {\n pointBorderColor,\n pointBorderStyle,\n pointBorderWidth = 1,\n pointColor,\n pointColorOpacity,\n pointSize,\n pointVisible = true,\n } = style\n\n const lineDash = pointBorderStyle === 'dashed' ? [5, 2] : pointBorderStyle === 'dotted' ? [2, 5] : [0, 0]\n return {\n ...result,\n [`custom${index + 1}`]: {\n // 优先级: 后者覆盖前者\n level: index + 1,\n filter: (datum: Datum) => {\n if (selector(datum, style.selector)) {\n return true\n }\n return false\n },\n style: {\n visible: pointVisible,\n size: pointSize,\n fill: pointColor,\n fillOpacity: pointColorOpacity,\n innerBorder: {\n stroke: pointBorderColor,\n lineWidth: pointBorderWidth,\n distance: (pointBorderWidth || 0) / 2,\n lineDash: lineDash,\n },\n },\n },\n }\n }, {})\n\n return {\n ...result,\n outlier: {\n ...result.outlier,\n state: {\n ...customMap,\n },\n },\n }\n}\n"],"names":["outlierStyle","spec","context","advancedVSeed","vseed","markStyle","config","theme","result","isNullish","isEmpty","outlierStyles","Array","customMap","style","index","pointBorderColor","pointBorderStyle","pointBorderWidth","pointColor","pointColorOpacity","pointSize","pointVisible","lineDash","datum","selector"],"mappings":";;AAKO,MAAMA,4BAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC9B,MAAM,EAAEH,YAAY,EAAE,GAAGK;IACzB,MAAME,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAc,EAAE;IACtD,MAAMI,SAAS;QACb,GAAGP,IAAI;QACP,SAAS;YACP,OAAO;gBAEL,MAAMM,OAAO;gBACb,WAAWA,OAAO;gBAClB,QAAQA,OAAO;YACjB;QACF;IACF;IAEA,IAAIE,UAAUT,iBAAiBU,QAAQV,eACrC,OAAOQ;IAGT,MAAMG,gBAAiBC,MAAM,OAAO,CAACZ,gBAAgBA,eAAe;QAACA;KAAa;IAElF,MAAMa,YAAYF,cAAc,MAAM,CAAS,CAACH,QAAQM,OAAOC;QAC7D,MAAM,EACJC,gBAAgB,EAChBC,gBAAgB,EAChBC,mBAAmB,CAAC,EACpBC,UAAU,EACVC,iBAAiB,EACjBC,SAAS,EACTC,eAAe,IAAI,EACpB,GAAGR;QAEJ,MAAMS,WAAWN,AAAqB,aAArBA,mBAAgC;YAAC;YAAG;SAAE,GAAGA,AAAqB,aAArBA,mBAAgC;YAAC;YAAG;SAAE,GAAG;YAAC;YAAG;SAAE;QACzG,OAAO;YACL,GAAGT,MAAM;YACT,CAAC,CAAC,MAAM,EAAEO,QAAQ,GAAG,CAAC,EAAE;gBAEtB,OAAOA,QAAQ;gBACf,QAAQ,CAACS;oBACP,IAAIC,SAASD,OAAOV,MAAM,QAAQ,GAChC,OAAO;oBAET,OAAO;gBACT;gBACA,OAAO;oBACL,SAASQ;oBACT,MAAMD;oBACN,MAAMF;oBACN,aAAaC;oBACb,aAAa;wBACX,QAAQJ;wBACR,WAAWE;wBACX,UAAWA,AAAAA,CAAAA,oBAAoB,KAAK;wBACpC,UAAUK;oBACZ;gBACF;YACF;QACF;IACF,GAAG,CAAC;IAEJ,OAAO;QACL,GAAGf,MAAM;QACT,SAAS;YACP,GAAGA,OAAO,OAAO;YACjB,OAAO;gBACL,GAAGK,SAAS;YACd;QACF;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/outlierStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/outlierStyle.ts"],"sourcesContent":["import type { IBoxPlotChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, OutlierStyle, VChartSpecPipe } from 'src/types'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const outlierStyle: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { markStyle, config } = advancedVSeed\n const { outlierStyle } = markStyle\n const theme = config?.[vseed.chartType as 'boxPlot']?.outlierStyle\n const result = {\n ...spec,\n outlier: {\n style: {\n // stroke: theme?.pointColor,\n fill: theme?.pointColor,\n lineWidth: theme?.pointBorderWidth,\n stroke: theme?.pointBorderColor,\n },\n },\n } as IBoxPlotChartSpec\n\n if (isNullish(outlierStyle) || isEmpty(outlierStyle)) {\n return result\n }\n\n const outlierStyles = (Array.isArray(outlierStyle) ? outlierStyle : [outlierStyle]) as OutlierStyle[]\n\n const customMap = outlierStyles.reduce<object>((result, style, index) => {\n const {\n pointBorderColor,\n pointBorderStyle,\n pointBorderWidth = 1,\n pointColor,\n pointColorOpacity,\n pointSize,\n pointVisible = true,\n } = style\n\n const lineDash = pointBorderStyle === 'dashed' ? [5, 2] : pointBorderStyle === 'dotted' ? [2, 5] : [0, 0]\n return {\n ...result,\n [`custom${index + 1}`]: {\n // 优先级: 后者覆盖前者\n level: index + 1,\n filter: (datum: Datum) => {\n if (selector(datum, style.selector)) {\n return true\n }\n return false\n },\n style: {\n visible: pointVisible,\n size: pointSize,\n fill: pointColor,\n fillOpacity: pointColorOpacity,\n stroke: pointBorderColor,\n lineWidth: pointBorderWidth,\n lineDash: lineDash,\n },\n },\n }\n }, {})\n\n return {\n ...result,\n outlier: {\n ...result.outlier,\n state: {\n ...customMap,\n },\n },\n }\n}\n"],"names":["outlierStyle","spec","context","advancedVSeed","vseed","markStyle","config","theme","result","isNullish","isEmpty","outlierStyles","Array","customMap","style","index","pointBorderColor","pointBorderStyle","pointBorderWidth","pointColor","pointColorOpacity","pointSize","pointVisible","lineDash","datum","selector"],"mappings":";;AAKO,MAAMA,4BAA+B,CAACC,MAAMC;IACjD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC9B,MAAM,EAAEH,YAAY,EAAE,GAAGK;IACzB,MAAME,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAc,EAAE;IACtD,MAAMI,SAAS;QACb,GAAGP,IAAI;QACP,SAAS;YACP,OAAO;gBAEL,MAAMM,OAAO;gBACb,WAAWA,OAAO;gBAClB,QAAQA,OAAO;YACjB;QACF;IACF;IAEA,IAAIE,UAAUT,iBAAiBU,QAAQV,eACrC,OAAOQ;IAGT,MAAMG,gBAAiBC,MAAM,OAAO,CAACZ,gBAAgBA,eAAe;QAACA;KAAa;IAElF,MAAMa,YAAYF,cAAc,MAAM,CAAS,CAACH,QAAQM,OAAOC;QAC7D,MAAM,EACJC,gBAAgB,EAChBC,gBAAgB,EAChBC,mBAAmB,CAAC,EACpBC,UAAU,EACVC,iBAAiB,EACjBC,SAAS,EACTC,eAAe,IAAI,EACpB,GAAGR;QAEJ,MAAMS,WAAWN,AAAqB,aAArBA,mBAAgC;YAAC;YAAG;SAAE,GAAGA,AAAqB,aAArBA,mBAAgC;YAAC;YAAG;SAAE,GAAG;YAAC;YAAG;SAAE;QACzG,OAAO;YACL,GAAGT,MAAM;YACT,CAAC,CAAC,MAAM,EAAEO,QAAQ,GAAG,CAAC,EAAE;gBAEtB,OAAOA,QAAQ;gBACf,QAAQ,CAACS;oBACP,IAAIC,SAASD,OAAOV,MAAM,QAAQ,GAChC,OAAO;oBAET,OAAO;gBACT;gBACA,OAAO;oBACL,SAASQ;oBACT,MAAMD;oBACN,MAAMF;oBACN,aAAaC;oBACb,QAAQJ;oBACR,WAAWE;oBACX,UAAUK;gBACZ;YACF;QACF;IACF,GAAG,CAAC;IAEJ,OAAO;QACL,GAAGf,MAAM;QACT,SAAS;YACP,GAAGA,OAAO,OAAO;YACjB,OAAO;gBACL,GAAGK,SAAS;YACd;QACF;IACF;AACF"}
@@ -1,25 +1,28 @@
1
1
  const getCommonBoxPlotStyle = ()=>({
2
- boxCornerRadius: 6
2
+ boxCornerRadius: 2
3
3
  });
4
4
  const getLightBoxPlotStyle = ()=>({
5
5
  ...getCommonBoxPlotStyle(),
6
- boxBorderColor: '#00000042',
6
+ boxBorderColor: '#606773',
7
7
  whiskerBorderColor: '#606773'
8
8
  });
9
9
  const getDarkBoxPlotStyle = ()=>({
10
10
  ...getCommonBoxPlotStyle(),
11
- boxBorderColor: '#ffffff42',
12
- whiskerBorderColor: '#E2E3E6'
11
+ boxBorderColor: '#888C93',
12
+ whiskerBorderColor: '#888C93'
13
13
  });
14
14
  const getCommonOutlierStyle = ()=>({
15
- pointBorderWidth: 2,
15
+ pointSize: 10,
16
+ pointBorderWidth: 1.5,
16
17
  pointColor: 'transparent'
17
18
  });
18
19
  const getLightOutlierStyle = ()=>({
19
- ...getCommonOutlierStyle()
20
+ ...getCommonOutlierStyle(),
21
+ pointBorderColor: '#606773'
20
22
  });
21
23
  const getDarkOutlierStyle = ()=>({
22
- ...getCommonOutlierStyle()
24
+ ...getCommonOutlierStyle(),
25
+ pointBorderColor: '#888C93'
23
26
  });
24
27
  export { getDarkBoxPlotStyle, getDarkOutlierStyle, getLightBoxPlotStyle, getLightOutlierStyle };
25
28
 
@@ -1 +1 @@
1
- {"version":3,"file":"theme/common/boxPlot.js","sources":["webpack://@visactor/vseed/./src/theme/common/boxPlot.ts"],"sourcesContent":["import type { BoxPlotStyle, OutlierStyle } from 'src/types'\n\nconst getCommonBoxPlotStyle = (): BoxPlotStyle => {\n return {\n boxCornerRadius: 6,\n }\n}\n\nexport const getLightBoxPlotStyle = (): BoxPlotStyle => {\n return {\n ...getCommonBoxPlotStyle(),\n boxBorderColor: '#00000042',\n whiskerBorderColor: '#606773',\n }\n}\n\nexport const getDarkBoxPlotStyle = (): BoxPlotStyle => {\n return {\n ...getCommonBoxPlotStyle(),\n boxBorderColor: '#ffffff42',\n whiskerBorderColor: '#E2E3E6',\n }\n}\nconst getCommonOutlierStyle = (): OutlierStyle => {\n return {\n pointBorderWidth: 2,\n pointColor: 'transparent',\n }\n}\n\nexport const getLightOutlierStyle = (): OutlierStyle => {\n return {\n ...getCommonOutlierStyle(),\n }\n}\n\nexport const getDarkOutlierStyle = (): OutlierStyle => {\n return {\n ...getCommonOutlierStyle(),\n }\n}\n"],"names":["getCommonBoxPlotStyle","getLightBoxPlotStyle","getDarkBoxPlotStyle","getCommonOutlierStyle","getLightOutlierStyle","getDarkOutlierStyle"],"mappings":"AAEA,MAAMA,wBAAwB,IACrB;QACL,iBAAiB;IACnB;AAGK,MAAMC,uBAAuB,IAC3B;QACL,GAAGD,uBAAuB;QAC1B,gBAAgB;QAChB,oBAAoB;IACtB;AAGK,MAAME,sBAAsB,IAC1B;QACL,GAAGF,uBAAuB;QAC1B,gBAAgB;QAChB,oBAAoB;IACtB;AAEF,MAAMG,wBAAwB,IACrB;QACL,kBAAkB;QAClB,YAAY;IACd;AAGK,MAAMC,uBAAuB,IAC3B;QACL,GAAGD,uBAAuB;IAC5B;AAGK,MAAME,sBAAsB,IAC1B;QACL,GAAGF,uBAAuB;IAC5B"}
1
+ {"version":3,"file":"theme/common/boxPlot.js","sources":["webpack://@visactor/vseed/./src/theme/common/boxPlot.ts"],"sourcesContent":["import type { BoxPlotStyle, OutlierStyle } from 'src/types'\n\nconst getCommonBoxPlotStyle = (): BoxPlotStyle => {\n return {\n boxCornerRadius: 2,\n }\n}\n\nexport const getLightBoxPlotStyle = (): BoxPlotStyle => {\n return {\n ...getCommonBoxPlotStyle(),\n boxBorderColor: '#606773',\n whiskerBorderColor: '#606773',\n }\n}\n\nexport const getDarkBoxPlotStyle = (): BoxPlotStyle => {\n return {\n ...getCommonBoxPlotStyle(),\n boxBorderColor: '#888C93',\n whiskerBorderColor: '#888C93',\n }\n}\nconst getCommonOutlierStyle = (): OutlierStyle => {\n return {\n pointSize: 10,\n pointBorderWidth: 1.5,\n pointColor: 'transparent',\n }\n}\n\nexport const getLightOutlierStyle = (): OutlierStyle => {\n return {\n ...getCommonOutlierStyle(),\n pointBorderColor: '#606773',\n }\n}\n\nexport const getDarkOutlierStyle = (): OutlierStyle => {\n return {\n ...getCommonOutlierStyle(),\n pointBorderColor: '#888C93',\n }\n}\n"],"names":["getCommonBoxPlotStyle","getLightBoxPlotStyle","getDarkBoxPlotStyle","getCommonOutlierStyle","getLightOutlierStyle","getDarkOutlierStyle"],"mappings":"AAEA,MAAMA,wBAAwB,IACrB;QACL,iBAAiB;IACnB;AAGK,MAAMC,uBAAuB,IAC3B;QACL,GAAGD,uBAAuB;QAC1B,gBAAgB;QAChB,oBAAoB;IACtB;AAGK,MAAME,sBAAsB,IAC1B;QACL,GAAGF,uBAAuB;QAC1B,gBAAgB;QAChB,oBAAoB;IACtB;AAEF,MAAMG,wBAAwB,IACrB;QACL,WAAW;QACX,kBAAkB;QAClB,YAAY;IACd;AAGK,MAAMC,uBAAuB,IAC3B;QACL,GAAGD,uBAAuB;QAC1B,kBAAkB;IACpB;AAGK,MAAME,sBAAsB,IAC1B;QACL,GAAGF,uBAAuB;QAC1B,kBAAkB;IACpB"}
@@ -7565,8 +7565,8 @@ export declare const zAdvancedVSeed: z.ZodObject<{
7565
7565
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7566
7566
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7567
7567
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7568
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7569
7568
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7569
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7570
7570
  }, z.core.$strip>>>;
7571
7571
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7572
7572
  pointVisible: z.ZodOptional<z.ZodBoolean>;
@@ -8888,8 +8888,8 @@ export declare const zAdvancedVSeed: z.ZodObject<{
8888
8888
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8889
8889
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8890
8890
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8891
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8892
8891
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8892
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8893
8893
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
8894
8894
  selector: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
8895
8895
  field: z.ZodString;
@@ -8967,8 +8967,8 @@ export declare const zAdvancedVSeed: z.ZodObject<{
8967
8967
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8968
8968
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8969
8969
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8970
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8971
8970
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8971
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8972
8972
  }, z.core.$strip>>]>>>;
8973
8973
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
8974
8974
  selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
@@ -16432,8 +16432,8 @@ export declare const zAdvancedVSeed: z.ZodObject<{
16432
16432
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16433
16433
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16434
16434
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16435
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16436
16435
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16436
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16437
16437
  }, z.core.$strip>>>;
16438
16438
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
16439
16439
  pointVisible: z.ZodOptional<z.ZodBoolean>;
@@ -530,8 +530,8 @@ export declare const zBoxPlot: z.ZodObject<{
530
530
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
531
531
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
532
532
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
533
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
534
533
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
534
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
535
535
  }, z.core.$strip>>, z.ZodObject<{
536
536
  selector: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
537
537
  field: z.ZodString;
@@ -609,8 +609,8 @@ export declare const zBoxPlot: z.ZodObject<{
609
609
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
610
610
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
611
611
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
612
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
613
612
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
613
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
614
614
  }, z.core.$strip>]>>>;
615
615
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodArray<z.ZodObject<{
616
616
  selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
@@ -424,8 +424,8 @@ export declare const zBoxplotConfig: z.ZodObject<{
424
424
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
425
425
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
426
426
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
427
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
428
427
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
428
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
429
429
  }, z.core.$strip>>>;
430
430
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
431
431
  pointVisible: z.ZodOptional<z.ZodBoolean>;
@@ -7219,8 +7219,8 @@ export declare const zConfig: z.ZodObject<{
7219
7219
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7220
7220
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7221
7221
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7222
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7223
7222
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7223
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7224
7224
  }, z.core.$strip>>>;
7225
7225
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7226
7226
  pointVisible: z.ZodOptional<z.ZodBoolean>;
@@ -72,14 +72,14 @@ export type BoxPlotStyle = {
72
72
  * @description 箱体的圆角大小
73
73
  */
74
74
  boxCornerRadius?: number;
75
- /**
76
- * @description 盒须线的颜色
77
- */
78
- whiskerBorderColor?: string;
79
75
  /**
80
76
  * @description 中位数线的颜色
81
77
  */
82
78
  medianBorderColor?: string;
79
+ /**
80
+ * @description 盒须线的颜色
81
+ */
82
+ whiskerBorderColor?: string;
83
83
  };
84
84
  export declare const zBoxPlotStyle: z.ZodObject<{
85
85
  selector: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
@@ -158,6 +158,6 @@ export declare const zBoxPlotStyle: z.ZodObject<{
158
158
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
159
159
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
160
160
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
161
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
161
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
163
  }, z.core.$strip>;
@@ -9,8 +9,8 @@ const zBoxPlotStyle = z.object({
9
9
  boxBorderWidth: z.number().min(0).nullish(),
10
10
  boxBorderOpacity: z.number().min(0).max(1).nullish(),
11
11
  boxCornerRadius: z.number().nullish(),
12
- whiskerBorderColor: z.string().nullish(),
13
- medianBorderColor: z.string().nullish()
12
+ medianBorderColor: z.string().nullish(),
13
+ whiskerBorderColor: z.string().nullish()
14
14
  });
15
15
  export { zBoxPlotStyle };
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"types/properties/markStyle/boxPlotStyle.js","sources":["webpack://@visactor/vseed/./src/types/properties/markStyle/boxPlotStyle.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zSelector, zSelectors, type Selector, type Selectors } from '../../dataSelector'\n\nexport type BoxPlotStyle = {\n /**\n * 数据选择器\n * @description\n * 若配置selector, 提供数值 selector, 局部数据 selector, 条件维度 selector, 条件指标 selector 共四类数据匹配能力\n * 若未配置selector, 则样式全局生效.\n * @type {Selector | Selectors}\n * @example 数值选择器\n * selector = \"tool\"\n * selector = [\"tool\", \"book\"]\n * selector = 100\n * selector = [100, 200]\n * @example 局部数据选择器\n * selector = { profit: 100 }\n * selector = [{ profit: 100 }, { profit: 200 }]\n * @example 条件维度选择器\n * selector = {\n * field: 'category',\n * operator: 'in',\n * value: 'tool'\n * }\n * selector = {\n * field: 'category',\n * operator: 'not in',\n * value: 'book'\n * }\n * @example 条件指标选择器\n * selector = {\n * field: 'profit',\n * operator: '>=',\n * value: 100\n * }\n * selector = {\n * field: 'profit',\n * operator: 'between'\n * value: [100, 300]\n * }\n */\n selector?: Selector | Selectors\n\n /**\n * @description boxPlot图元是否可见\n */\n boxVisible?: boolean\n /**\n * @description boxPlot图元颜色\n * @type {string}\n */\n boxColor?: string\n /**\n * @description boxPlot图元颜色透明度\n * @type {number}\n */\n boxColorOpacity?: number\n /**\n * @description boxPlot图元边框颜色\n * @type {string}\n */\n boxBorderColor?: string\n /**\n * @description boxPlot图元边框宽度\n * @type {number}\n */\n boxBorderWidth?: number\n /**\n * @description boxPlot图元边框透明度\n * @type {number}\n */\n boxBorderOpacity?: number\n /**\n * @description 箱体的圆角大小\n */\n boxCornerRadius?: number\n /**\n * @description 盒须线的颜色\n */\n whiskerBorderColor?: string\n /**\n * @description 中位数线的颜色\n */\n medianBorderColor?: string\n}\n\nexport const zBoxPlotStyle = z.object({\n selector: zSelector.or(zSelectors).nullish(),\n boxVisible: z.boolean().nullish(),\n boxColor: z.string().nullish(),\n boxColorOpacity: z.number().min(0).max(1).nullish(),\n boxBorderColor: z.string().nullish(),\n boxBorderWidth: z.number().min(0).nullish(),\n boxBorderOpacity: z.number().min(0).max(1).nullish(),\n boxCornerRadius: z.number().nullish(),\n whiskerBorderColor: z.string().nullish(),\n medianBorderColor: z.string().nullish(),\n})\n"],"names":["zBoxPlotStyle","z","zSelector","zSelectors"],"mappings":";;AAsFO,MAAMA,gBAAgBC,EAAE,MAAM,CAAC;IACpC,UAAUC,UAAU,EAAE,CAACC,YAAY,OAAO;IAC1C,YAAYF,EAAE,OAAO,GAAG,OAAO;IAC/B,UAAUA,EAAE,MAAM,GAAG,OAAO;IAC5B,iBAAiBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO;IACjD,gBAAgBA,EAAE,MAAM,GAAG,OAAO;IAClC,gBAAgBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,OAAO;IACzC,kBAAkBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO;IAClD,iBAAiBA,EAAE,MAAM,GAAG,OAAO;IACnC,oBAAoBA,EAAE,MAAM,GAAG,OAAO;IACtC,mBAAmBA,EAAE,MAAM,GAAG,OAAO;AACvC"}
1
+ {"version":3,"file":"types/properties/markStyle/boxPlotStyle.js","sources":["webpack://@visactor/vseed/./src/types/properties/markStyle/boxPlotStyle.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zSelector, zSelectors, type Selector, type Selectors } from '../../dataSelector'\n\nexport type BoxPlotStyle = {\n /**\n * 数据选择器\n * @description\n * 若配置selector, 提供数值 selector, 局部数据 selector, 条件维度 selector, 条件指标 selector 共四类数据匹配能力\n * 若未配置selector, 则样式全局生效.\n * @type {Selector | Selectors}\n * @example 数值选择器\n * selector = \"tool\"\n * selector = [\"tool\", \"book\"]\n * selector = 100\n * selector = [100, 200]\n * @example 局部数据选择器\n * selector = { profit: 100 }\n * selector = [{ profit: 100 }, { profit: 200 }]\n * @example 条件维度选择器\n * selector = {\n * field: 'category',\n * operator: 'in',\n * value: 'tool'\n * }\n * selector = {\n * field: 'category',\n * operator: 'not in',\n * value: 'book'\n * }\n * @example 条件指标选择器\n * selector = {\n * field: 'profit',\n * operator: '>=',\n * value: 100\n * }\n * selector = {\n * field: 'profit',\n * operator: 'between'\n * value: [100, 300]\n * }\n */\n selector?: Selector | Selectors\n\n /**\n * @description boxPlot图元是否可见\n */\n boxVisible?: boolean\n /**\n * @description boxPlot图元颜色\n * @type {string}\n */\n boxColor?: string\n /**\n * @description boxPlot图元颜色透明度\n * @type {number}\n */\n boxColorOpacity?: number\n /**\n * @description boxPlot图元边框颜色\n * @type {string}\n */\n boxBorderColor?: string\n /**\n * @description boxPlot图元边框宽度\n * @type {number}\n */\n boxBorderWidth?: number\n /**\n * @description boxPlot图元边框透明度\n * @type {number}\n */\n boxBorderOpacity?: number\n /**\n * @description 箱体的圆角大小\n */\n boxCornerRadius?: number\n /**\n * @description 中位数线的颜色\n */\n medianBorderColor?: string\n /**\n * @description 盒须线的颜色\n */\n whiskerBorderColor?: string\n}\n\nexport const zBoxPlotStyle = z.object({\n selector: zSelector.or(zSelectors).nullish(),\n boxVisible: z.boolean().nullish(),\n boxColor: z.string().nullish(),\n boxColorOpacity: z.number().min(0).max(1).nullish(),\n boxBorderColor: z.string().nullish(),\n boxBorderWidth: z.number().min(0).nullish(),\n boxBorderOpacity: z.number().min(0).max(1).nullish(),\n boxCornerRadius: z.number().nullish(),\n medianBorderColor: z.string().nullish(),\n whiskerBorderColor: z.string().nullish(),\n})\n"],"names":["zBoxPlotStyle","z","zSelector","zSelectors"],"mappings":";;AAsFO,MAAMA,gBAAgBC,EAAE,MAAM,CAAC;IACpC,UAAUC,UAAU,EAAE,CAACC,YAAY,OAAO;IAC1C,YAAYF,EAAE,OAAO,GAAG,OAAO;IAC/B,UAAUA,EAAE,MAAM,GAAG,OAAO;IAC5B,iBAAiBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO;IACjD,gBAAgBA,EAAE,MAAM,GAAG,OAAO;IAClC,gBAAgBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,OAAO;IACzC,kBAAkBA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO;IAClD,iBAAiBA,EAAE,MAAM,GAAG,OAAO;IACnC,mBAAmBA,EAAE,MAAM,GAAG,OAAO;IACrC,oBAAoBA,EAAE,MAAM,GAAG,OAAO;AACxC"}
@@ -703,8 +703,8 @@ export declare const zMarkStyle: z.ZodObject<{
703
703
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
704
704
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
705
705
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
706
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
707
706
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
707
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
708
708
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
709
709
  selector: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
710
710
  field: z.ZodString;
@@ -782,8 +782,8 @@ export declare const zMarkStyle: z.ZodObject<{
782
782
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
783
783
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
784
784
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
785
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
786
785
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
786
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
787
787
  }, z.core.$strip>>]>>>;
788
788
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
789
789
  selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
@@ -7219,8 +7219,8 @@ export declare const zCustomThemeConfig: z.ZodObject<{
7219
7219
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7220
7220
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7221
7221
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7222
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7223
7222
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7223
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7224
7224
  }, z.core.$strip>>>;
7225
7225
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7226
7226
  pointVisible: z.ZodOptional<z.ZodBoolean>;
@@ -15055,8 +15055,8 @@ export declare const zCustomTheme: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.Zod
15055
15055
  boxBorderWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15056
15056
  boxBorderOpacity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15057
15057
  boxCornerRadius: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15058
- whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15059
15058
  medianBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15059
+ whiskerBorderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15060
15060
  }, z.core.$strip>>>;
15061
15061
  outlierStyle: z.ZodOptional<z.ZodNullable<z.ZodObject<{
15062
15062
  pointVisible: z.ZodOptional<z.ZodBoolean>;