@visactor/vseed 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/buildAdvanced.js +1 -2
- package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
- package/dist/esm/builder/builder/buildSpec.js +1 -2
- package/dist/esm/builder/builder/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +628 -334
- package/dist/esm/builder/register/all.js +2 -2
- package/dist/esm/builder/register/all.js.map +1 -1
- package/dist/esm/builder/register/chartType/boxplot.d.ts +1 -1
- package/dist/esm/builder/register/chartType/boxplot.js +2 -2
- package/dist/esm/builder/register/chartType/boxplot.js.map +1 -1
- package/dist/esm/builder/register/chartType/index.d.ts +1 -1
- package/dist/esm/builder/register/chartType/index.js +2 -2
- package/dist/esm/dataReshape/constant.d.ts +1 -0
- package/dist/esm/dataReshape/constant.js +2 -1
- package/dist/esm/dataReshape/constant.js.map +1 -1
- package/dist/esm/i18n/i18n.js +1 -4
- package/dist/esm/i18n/i18n.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/pipes/config/histogram.js +17 -0
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +12 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +4 -12
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js +3 -76
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.d.ts +6 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js +95 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +16 -84
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfHistogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfHistogram.js +23 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfHistogram.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +4 -12
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/axisStyle.d.ts +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/axisStyle.js +65 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/axisStyle.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js +24 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/heatmapBandAxis.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +15 -72
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +17 -73
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js +11 -13
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +10 -8
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js +0 -12
- package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +13 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.js +58 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipElement.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +11 -8
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/utils/histogram.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/utils/histogram.js +6 -2
- package/dist/esm/pipeline/spec/chart/utils/histogram.js.map +1 -1
- package/dist/esm/pipeline/utils/boxplot.d.ts +1 -0
- package/dist/esm/pipeline/utils/boxplot.js +8 -0
- package/dist/esm/pipeline/utils/boxplot.js.map +1 -0
- package/dist/esm/pipeline/utils/index.d.ts +1 -0
- package/dist/esm/pipeline/utils/index.js +1 -0
- package/dist/esm/theme/common/legend.d.ts +3 -1
- package/dist/esm/theme/common/legend.js +13 -1
- package/dist/esm/theme/common/legend.js.map +1 -1
- package/dist/esm/theme/common/tooltip.js +1 -1
- package/dist/esm/theme/common/tooltip.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +4 -1
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +4 -1
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +252 -420
- package/dist/esm/types/chartType/area/area.d.ts +2 -2
- package/dist/esm/types/chartType/area/zArea.d.ts +5 -281
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +3 -5
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +5 -281
- package/dist/esm/types/chartType/bar/bar.d.ts +3 -3
- package/dist/esm/types/chartType/bar/zBar.d.ts +5 -281
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +3 -3
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +5 -281
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +3 -3
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +5 -281
- package/dist/esm/types/chartType/{boxplot/boxplot.d.ts → boxPlot/boxPlot.d.ts} +6 -6
- 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 → boxPlot/zBoxPlot.d.ts} +6 -282
- package/dist/esm/types/chartType/{boxplot/zBoxplot.js → boxPlot/zBoxPlot.js} +3 -3
- package/dist/esm/types/chartType/{boxplot/zBoxplot.js.map → boxPlot/zBoxPlot.js.map} +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +4 -4
- package/dist/esm/types/chartType/column/zColumn.d.ts +7 -283
- package/dist/esm/types/chartType/column/zColumn.js +1 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +3 -5
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +5 -281
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +3 -3
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +5 -281
- package/dist/esm/types/chartType/donut/zDonut.d.ts +1 -1
- package/dist/esm/types/chartType/dualAxis/dualAxis.d.ts +3 -3
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +5 -281
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +5 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +5 -0
- package/dist/esm/types/chartType/histogram/histogram.d.ts +6 -6
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +5 -281
- package/dist/esm/types/chartType/index.d.ts +1 -1
- package/dist/esm/types/chartType/index.js +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +3 -5
- package/dist/esm/types/chartType/line/zLine.d.ts +5 -281
- package/dist/esm/types/chartType/pie/zPie.d.ts +1 -1
- package/dist/esm/types/chartType/pivotTable/pivotTable.d.ts +1 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +1 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +1 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +7 -7
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +13 -289
- package/dist/esm/types/chartType/scatter/zScatter.js +4 -4
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/chartType/table/table.d.ts +1 -1
- package/dist/esm/types/dataSelector/selector.d.ts +108 -0
- package/dist/esm/types/dataSelector/selector.js +58 -51
- package/dist/esm/types/dataSelector/selector.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotation.d.ts +4 -280
- package/dist/esm/types/properties/annotation/annotationArea.d.ts +2 -2
- package/dist/esm/types/properties/annotation/annotationHorizontalLine.d.ts +1 -6
- package/dist/esm/types/properties/annotation/annotationVerticalLine.d.ts +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationArea.d.ts +2 -2
- package/dist/esm/types/properties/annotation/zAnnotationArea.js +3 -3
- package/dist/esm/types/properties/annotation/zAnnotationArea.js.map +1 -1
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.d.ts +0 -69
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js.map +1 -1
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.d.ts +0 -69
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js +0 -5
- package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +2 -2
- package/dist/esm/types/properties/config/bar.d.ts +3 -3
- package/dist/esm/types/properties/config/boxplot.d.ts +1 -1
- package/dist/esm/types/properties/config/column.d.ts +3 -3
- package/dist/esm/types/properties/config/config.d.ts +102 -48
- package/dist/esm/types/properties/config/dualAxis.d.ts +1 -1
- package/dist/esm/types/properties/config/funnel.d.ts +1 -1
- package/dist/esm/types/properties/config/heatmap.d.ts +83 -29
- package/dist/esm/types/properties/config/heatmap.js +6 -3
- package/dist/esm/types/properties/config/heatmap.js.map +1 -1
- package/dist/esm/types/properties/config/histogram.d.ts +1 -1
- package/dist/esm/types/properties/config/legend/legend.d.ts +10 -2
- package/dist/esm/types/properties/config/legend/legend.js +7 -2
- package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +3 -3
- package/dist/esm/types/properties/config/rose.d.ts +2 -2
- package/dist/esm/types/properties/config/scatter.d.ts +1 -1
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +4 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +204 -96
- package/dist/esm/types/vseed.d.ts +2 -2
- package/dist/esm/types/zVseed.d.ts +837 -4415
- package/dist/esm/types/zVseed.js +2 -2
- package/dist/esm/types/zVseed.js.map +1 -1
- package/dist/umd/index.js +541 -426
- package/dist/umd/index.js.map +1 -1
- package/package.json +10 -5
- package/dist/esm/types/chartType/boxplot/index.d.ts +0 -2
- package/dist/esm/types/chartType/boxplot/index.js +0 -1
- /package/dist/esm/types/chartType/{boxplot/boxplot.js → boxPlot/boxPlot.js} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ISpec, IMarkPointSpec } from '@visactor/vchart';
|
|
2
|
+
import type { Datum, Selector, Selectors, SpecPipelineContext, VChartSpecPipe } from '../../../../../types';
|
|
3
|
+
export declare const generateAnnotationPointPipe: (options: {
|
|
4
|
+
findSelectedDatas?: (dataset: Datum[], selector: Selector | Selectors | undefined | null, spec: ISpec, context: SpecPipelineContext) => Datum[];
|
|
5
|
+
generateMarkPoint?: (datum: Datum, spec: ISpec, context: SpecPipelineContext) => IMarkPointSpec[] | undefined;
|
|
6
|
+
}) => VChartSpecPipe;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { selector } from "../../../../../dataSelector/index.js";
|
|
2
|
+
import { isSubset } from "./utils.js";
|
|
3
|
+
import { ANNOTATION_Z_INDEX } from "../../../../utils/constant.js";
|
|
4
|
+
import { isBarLikeChart } from "../../../../utils/chatType.js";
|
|
5
|
+
const generateAnnotationPointPipe = (options)=>{
|
|
6
|
+
const findSelectedDatas = options.findSelectedDatas ?? ((dataset, s)=>dataset.filter((datum)=>selector(datum, s)));
|
|
7
|
+
const generateMarkPoint = options.generateMarkPoint ?? ((datum)=>[
|
|
8
|
+
{
|
|
9
|
+
coordinate: (data)=>data.find((item)=>isSubset(datum, item))
|
|
10
|
+
}
|
|
11
|
+
]);
|
|
12
|
+
return (spec, context)=>{
|
|
13
|
+
const { advancedVSeed, vseed } = context;
|
|
14
|
+
const { annotation, config } = advancedVSeed;
|
|
15
|
+
if (!annotation || !annotation.annotationPoint) return spec;
|
|
16
|
+
const theme = config?.[vseed.chartType]?.annotation?.annotationPoint;
|
|
17
|
+
const { annotationPoint } = annotation;
|
|
18
|
+
const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [
|
|
19
|
+
annotationPoint
|
|
20
|
+
];
|
|
21
|
+
const isHorizontalBar = isBarLikeChart(advancedVSeed);
|
|
22
|
+
const defaultStyle = isHorizontalBar ? {
|
|
23
|
+
textAlign: 'right',
|
|
24
|
+
textBaseline: 'middle'
|
|
25
|
+
} : {
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
textBaseline: 'top'
|
|
28
|
+
};
|
|
29
|
+
const markPoint = annotationPointList.flatMap((annotationPoint)=>{
|
|
30
|
+
const { selector: selectorPoint, text = '', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = defaultStyle.textAlign, textBaseline = defaultStyle.textBaseline, textBackgroundBorderColor = theme?.textBackgroundBorderColor, textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundPadding = theme?.textBackgroundPadding ?? 2, textBackgroundVisible = theme?.textBackgroundVisible ?? true, offsetX = theme?.offsetX ?? 0, offsetY = theme?.offsetY ?? 0 } = annotationPoint;
|
|
31
|
+
const dataset = advancedVSeed.dataset.flat();
|
|
32
|
+
const selectedData = selectorPoint ? findSelectedDatas(dataset, selectorPoint, spec, context) : [];
|
|
33
|
+
const dx = -10 - (isHorizontalBar ? textFontSize : 0);
|
|
34
|
+
const dy = isHorizontalBar ? 0 : textFontSize;
|
|
35
|
+
const markPointStyle = {
|
|
36
|
+
zIndex: ANNOTATION_Z_INDEX,
|
|
37
|
+
regionRelative: true,
|
|
38
|
+
itemLine: {
|
|
39
|
+
visible: false
|
|
40
|
+
},
|
|
41
|
+
itemContent: {
|
|
42
|
+
offsetY,
|
|
43
|
+
offsetX,
|
|
44
|
+
confine: true,
|
|
45
|
+
text: {
|
|
46
|
+
text: text,
|
|
47
|
+
style: {
|
|
48
|
+
opacity: 0.95,
|
|
49
|
+
visible: true,
|
|
50
|
+
textAlign: textAlign,
|
|
51
|
+
textBaseline: textBaseline,
|
|
52
|
+
fill: textColor,
|
|
53
|
+
stroke: textBackgroundColor,
|
|
54
|
+
lineWidth: 1,
|
|
55
|
+
fontSize: textFontSize,
|
|
56
|
+
fontWeight: textFontWeight,
|
|
57
|
+
dx,
|
|
58
|
+
dy
|
|
59
|
+
},
|
|
60
|
+
labelBackground: {
|
|
61
|
+
visible: textBackgroundVisible,
|
|
62
|
+
padding: textBackgroundPadding,
|
|
63
|
+
style: {
|
|
64
|
+
opacity: 0.95,
|
|
65
|
+
cornerRadius: textBackgroundBorderRadius ?? 4,
|
|
66
|
+
fill: textBackgroundColor,
|
|
67
|
+
stroke: textBackgroundBorderColor,
|
|
68
|
+
lineWidth: textBackgroundBorderWidth,
|
|
69
|
+
dx,
|
|
70
|
+
dy
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return selectedData.reduce((res, datum)=>{
|
|
77
|
+
const marks = generateMarkPoint(datum, spec, context);
|
|
78
|
+
if (marks && marks.length) marks.forEach((mark)=>{
|
|
79
|
+
res.push({
|
|
80
|
+
...markPointStyle,
|
|
81
|
+
...mark
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return res;
|
|
85
|
+
}, []);
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
...spec,
|
|
89
|
+
markPoint
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export { generateAnnotationPointPipe };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=annotationPointCommon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointCommon.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPointCommon.ts"],"sourcesContent":["import type { ISpec, IMarkPointSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, Selector, Selectors, SpecPipelineContext, VChartSpecPipe, 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 generateAnnotationPointPipe = (options: {\n findSelectedDatas?: (\n dataset: Datum[],\n selector: Selector | Selectors | undefined | null,\n spec: ISpec,\n context: SpecPipelineContext,\n ) => Datum[]\n generateMarkPoint?: (datum: Datum, spec: ISpec, context: SpecPipelineContext) => IMarkPointSpec[] | undefined\n}) => {\n const findSelectedDatas = options.findSelectedDatas ?? ((dataset, s) => dataset.filter((datum) => selector(datum, s)))\n const generateMarkPoint =\n options.generateMarkPoint ??\n ((datum: Datum) => {\n return [\n {\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n },\n ]\n })\n\n return ((spec: ISpec, context: SpecPipelineContext) => {\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 ? findSelectedDatas(dataset, selectorPoint, spec, context) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n const markPointStyle = {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\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 opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n } as Partial<IMarkPointSpec>\n\n return selectedData.reduce((res: IMarkPointSpec[], datum) => {\n const marks = generateMarkPoint(datum, spec, context)\n\n if (marks && marks.length) {\n marks.forEach((mark) => {\n res.push({\n ...markPointStyle,\n ...mark,\n } as IMarkPointSpec)\n })\n }\n\n return res\n }, [])\n }) as unknown as IMarkPointSpec[]\n\n return {\n ...spec,\n markPoint,\n } as ISpec\n }) as VChartSpecPipe\n}\n"],"names":["generateAnnotationPointPipe","options","findSelectedDatas","dataset","s","datum","selector","generateMarkPoint","data","item","isSubset","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPoint","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","selectedData","dx","dy","markPointStyle","ANNOTATION_Z_INDEX","res","marks","mark"],"mappings":"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"}
|
|
@@ -1,94 +1,26 @@
|
|
|
1
1
|
import { selector } from "../../../../../dataSelector/index.js";
|
|
2
2
|
import { isSubset } from "./utils.js";
|
|
3
|
-
import { ANNOTATION_Z_INDEX } from "../../../../utils/constant.js";
|
|
4
|
-
import { isBarLikeChart } from "../../../../utils/chatType.js";
|
|
5
3
|
import { findAllMeasures } from "../../../../utils/index.js";
|
|
6
4
|
import { MeasureId } from "../../../../../dataReshape/constant.js";
|
|
7
5
|
import { pickWithout } from "@visactor/vutils";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { annotationPoint } = annotation;
|
|
14
|
-
const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [
|
|
15
|
-
annotationPoint
|
|
16
|
-
];
|
|
17
|
-
const isHorizontalBar = isBarLikeChart(advancedVSeed);
|
|
18
|
-
const defaultStyle = isHorizontalBar ? {
|
|
19
|
-
textAlign: 'right',
|
|
20
|
-
textBaseline: 'middle'
|
|
21
|
-
} : {
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
textBaseline: 'top'
|
|
24
|
-
};
|
|
25
|
-
const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m)=>m.id);
|
|
26
|
-
const markPoint = annotationPointList.flatMap((annotationPoint)=>{
|
|
27
|
-
const { selector: selectorPoint, text = '', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = defaultStyle.textAlign, textBaseline = defaultStyle.textBaseline, textBackgroundBorderColor = theme?.textBackgroundBorderColor, textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundPadding = theme?.textBackgroundPadding ?? 2, textBackgroundVisible = theme?.textBackgroundVisible ?? true, offsetX = theme?.offsetX ?? 0, offsetY = theme?.offsetY ?? 0 } = annotationPoint;
|
|
28
|
-
const dataset = advancedVSeed.dataset.flat();
|
|
29
|
-
const selectedData = selectorPoint ? dataset.reduce((res, d)=>{
|
|
6
|
+
import { generateAnnotationPointPipe } from "./annotationPointCommon.js";
|
|
7
|
+
const annotationPointOfDualAxis = generateAnnotationPointPipe({
|
|
8
|
+
findSelectedDatas: (dataset, s, spec, context)=>dataset.reduce((res, d)=>{
|
|
9
|
+
const { advancedVSeed } = context;
|
|
10
|
+
const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m)=>m.id);
|
|
30
11
|
const pickedDatum = pickWithout(d, allMeasureIds.filter((id)=>id !== d[MeasureId]));
|
|
31
|
-
if (selector(pickedDatum,
|
|
12
|
+
if (selector(pickedDatum, s)) res.push(pickedDatum);
|
|
32
13
|
return res;
|
|
33
|
-
}, [])
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
offsetX,
|
|
44
|
-
confine: true,
|
|
45
|
-
text: {
|
|
46
|
-
text: text,
|
|
47
|
-
style: {
|
|
48
|
-
opacity: 0.95,
|
|
49
|
-
visible: true,
|
|
50
|
-
textAlign: textAlign,
|
|
51
|
-
textBaseline: textBaseline,
|
|
52
|
-
fill: textColor,
|
|
53
|
-
stroke: textBackgroundColor,
|
|
54
|
-
lineWidth: 1,
|
|
55
|
-
fontSize: textFontSize,
|
|
56
|
-
fontWeight: textFontWeight,
|
|
57
|
-
dx,
|
|
58
|
-
dy
|
|
59
|
-
},
|
|
60
|
-
labelBackground: {
|
|
61
|
-
visible: textBackgroundVisible,
|
|
62
|
-
padding: textBackgroundPadding,
|
|
63
|
-
style: {
|
|
64
|
-
opacity: 0.95,
|
|
65
|
-
cornerRadius: textBackgroundBorderRadius ?? 4,
|
|
66
|
-
fill: textBackgroundColor,
|
|
67
|
-
stroke: textBackgroundBorderColor,
|
|
68
|
-
lineWidth: textBackgroundBorderWidth,
|
|
69
|
-
dx,
|
|
70
|
-
dy
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
return spec.series?.reduce((res, s, index)=>{
|
|
77
|
-
selectedData.forEach((datum)=>{
|
|
78
|
-
res.push({
|
|
79
|
-
...baseConfig,
|
|
80
|
-
relativeSeriesIndex: index,
|
|
81
|
-
coordinate: (data)=>data.find((item)=>isSubset(datum, item, allMeasureIds.filter((id)=>id !== item[MeasureId])))
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
return res;
|
|
85
|
-
}, []);
|
|
86
|
-
});
|
|
87
|
-
return {
|
|
88
|
-
...spec,
|
|
89
|
-
markPoint
|
|
90
|
-
};
|
|
91
|
-
};
|
|
14
|
+
}, []),
|
|
15
|
+
generateMarkPoint: (datum, spec, context)=>{
|
|
16
|
+
const { advancedVSeed } = context;
|
|
17
|
+
const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m)=>m.id);
|
|
18
|
+
return spec.series?.map((s, index)=>({
|
|
19
|
+
relativeSeriesIndex: index,
|
|
20
|
+
coordinate: (data)=>data.find((item)=>isSubset(datum, item, allMeasureIds.filter((id)=>id !== item[MeasureId])))
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
92
24
|
export { annotationPointOfDualAxis };
|
|
93
25
|
|
|
94
26
|
//# sourceMappingURL=annotationPointOfDualAxis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.ts"],"sourcesContent":["import type { IMarkPointSpec, ISpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipelineContext, VChartSpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape/constant'\nimport { pickWithout } from '@visactor/vutils'\nimport { generateAnnotationPointPipe } from './annotationPointCommon'\n\nexport const annotationPointOfDualAxis: VChartSpecPipe = generateAnnotationPointPipe({\n findSelectedDatas: (dataset, s, spec: ISpec, context: SpecPipelineContext) => {\n return dataset.reduce((res: Datum[], d: Datum) => {\n const { advancedVSeed } = context\n const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m) => m.id)\n const pickedDatum = pickWithout(\n d,\n allMeasureIds.filter((id) => id !== d[MeasureId]),\n )\n\n if (selector(pickedDatum, s)) {\n res.push(pickedDatum)\n }\n\n return res\n }, [])\n },\n generateMarkPoint: (datum: Datum, spec: ISpec, context: SpecPipelineContext) => {\n const { advancedVSeed } = context\n const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m) => m.id)\n return spec.series?.map((s: any, index: number) => {\n return {\n relativeSeriesIndex: index,\n coordinate: (data: Datum[]) => {\n return data.find((item) => {\n return isSubset(\n datum,\n item,\n allMeasureIds.filter((id) => id !== item[MeasureId]),\n )\n })\n },\n } as IMarkPointSpec\n })\n },\n})\n"],"names":["annotationPointOfDualAxis","generateAnnotationPointPipe","dataset","s","spec","context","res","d","advancedVSeed","allMeasureIds","findAllMeasures","m","pickedDatum","pickWithout","id","MeasureId","selector","datum","index","data","item","isSubset"],"mappings":";;;;;;AASO,MAAMA,4BAA4CC,4BAA4B;IACnF,mBAAmB,CAACC,SAASC,GAAGC,MAAaC,UACpCH,QAAQ,MAAM,CAAC,CAACI,KAAcC;YACnC,MAAM,EAAEC,aAAa,EAAE,GAAGH;YAC1B,MAAMI,gBAAgBC,gBAAgBF,cAAc,eAAe,IAAIA,cAAc,QAAQ,EAAE,GAAG,CAAC,CAACG,IAAMA,EAAE,EAAE;YAC9G,MAAMC,cAAcC,YAClBN,GACAE,cAAc,MAAM,CAAC,CAACK,KAAOA,OAAOP,CAAC,CAACQ,UAAU;YAGlD,IAAIC,SAASJ,aAAaT,IACxBG,IAAI,IAAI,CAACM;YAGX,OAAON;QACT,GAAG,EAAE;IAEP,mBAAmB,CAACW,OAAcb,MAAaC;QAC7C,MAAM,EAAEG,aAAa,EAAE,GAAGH;QAC1B,MAAMI,gBAAgBC,gBAAgBF,cAAc,eAAe,IAAIA,cAAc,QAAQ,EAAE,GAAG,CAAC,CAACG,IAAMA,EAAE,EAAE;QAC9G,OAAOP,KAAK,MAAM,EAAE,IAAI,CAACD,GAAQe,QACxB;gBACL,qBAAqBA;gBACrB,YAAY,CAACC,OACJA,KAAK,IAAI,CAAC,CAACC,OACTC,SACLJ,OACAG,MACAX,cAAc,MAAM,CAAC,CAACK,KAAOA,OAAOM,IAAI,CAACL,UAAU;YAI3D;IAEJ;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isSubset } from "./utils.js";
|
|
2
|
+
import { generateAnnotationPointPipe } from "./annotationPointCommon.js";
|
|
3
|
+
const annotationPointOfHistogram = generateAnnotationPointPipe({
|
|
4
|
+
generateMarkPoint: (datum, spec)=>{
|
|
5
|
+
const histogramSpec = spec;
|
|
6
|
+
const xField = histogramSpec.xField;
|
|
7
|
+
const x2Field = histogramSpec.x2Field;
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
coordinate: (data)=>{
|
|
11
|
+
const d = data.find((item)=>isSubset(datum, item));
|
|
12
|
+
return d ? {
|
|
13
|
+
...d,
|
|
14
|
+
[xField]: (d[xField] + d[x2Field]) / 2
|
|
15
|
+
} : void 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export { annotationPointOfHistogram };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=annotationPointOfHistogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointOfHistogram.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPointOfHistogram.ts"],"sourcesContent":["import type { IHistogramChartSpec, IMarkPointSpec } from '@visactor/vchart'\nimport type { Datum, VChartSpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { generateAnnotationPointPipe } from './annotationPointCommon'\n\nexport const annotationPointOfHistogram: VChartSpecPipe = generateAnnotationPointPipe({\n generateMarkPoint: (datum: Datum, spec) => {\n const histogramSpec = spec as IHistogramChartSpec\n const xField = histogramSpec.xField as string\n const x2Field = histogramSpec.x2Field as string\n\n return [\n {\n coordinate: (data: Datum[]) => {\n const d = data.find((item) => isSubset(datum, item))\n\n return d\n ? {\n ...d,\n [xField]: (d[xField] + d[x2Field]) / 2,\n }\n : undefined\n },\n } as IMarkPointSpec,\n ]\n },\n})\n"],"names":["annotationPointOfHistogram","generateAnnotationPointPipe","datum","spec","histogramSpec","xField","x2Field","data","d","item","isSubset","undefined"],"mappings":";;AAKO,MAAMA,6BAA6CC,4BAA4B;IACpF,mBAAmB,CAACC,OAAcC;QAChC,MAAMC,gBAAgBD;QACtB,MAAME,SAASD,cAAc,MAAM;QACnC,MAAME,UAAUF,cAAc,OAAO;QAErC,OAAO;YACL;gBACE,YAAY,CAACG;oBACX,MAAMC,IAAID,KAAK,IAAI,CAAC,CAACE,OAASC,SAASR,OAAOO;oBAE9C,OAAOD,IACH;wBACE,GAAGA,CAAC;wBACJ,CAACH,OAAO,EAAGG,AAAAA,CAAAA,CAAC,CAACH,OAAO,GAAGG,CAAC,CAACF,QAAO,IAAK;oBACvC,IACAK;gBACN;YACF;SACD;IACH;AACF"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { selector } from "../../../../../dataSelector/index.js";
|
|
2
1
|
import { isArray, isNumber, isString } from "remeda";
|
|
3
2
|
import { ANNOTATION_Z_INDEX } from "../../../../utils/constant.js";
|
|
4
3
|
const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
5
4
|
const { advancedVSeed, vseed } = context;
|
|
6
|
-
const { annotation,
|
|
7
|
-
const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
|
|
5
|
+
const { annotation, config } = advancedVSeed;
|
|
8
6
|
if (!annotation || !annotation.annotationVerticalLine) return spec;
|
|
9
7
|
const theme = config?.[vseed.chartType]?.annotation?.annotationVerticalLine;
|
|
10
8
|
const { annotationVerticalLine } = annotation;
|
|
@@ -20,8 +18,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
|
20
18
|
insideEnd: 'insideEndTop'
|
|
21
19
|
};
|
|
22
20
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
|
23
|
-
const {
|
|
24
|
-
const dataset = advancedVSeed.dataset.flat();
|
|
21
|
+
const { xValue, text = '', textPosition = 'insideEnd', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = 'center', textBaseline = 'top', lineColor = theme?.lineColor ?? '#212121', lineStyle = theme?.lineStyle ?? 'dashed', lineVisible = theme?.lineStyle ?? true, lineWidth = theme?.lineWidth ?? 1, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121', textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundPadding = theme?.textBackgroundPadding ?? 2 } = annotationVerticalLine;
|
|
25
22
|
const generateOneMarkLine = (x)=>({
|
|
26
23
|
x,
|
|
27
24
|
autoRange: true,
|
|
@@ -92,18 +89,13 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
});
|
|
95
|
-
if (
|
|
92
|
+
if (isArray(xValue) || isString(xValue) || isNumber(xValue)) {
|
|
96
93
|
const xValueArr = Array.isArray(xValue) ? xValue : [
|
|
97
94
|
xValue
|
|
98
95
|
];
|
|
99
96
|
return xValueArr.map(generateOneMarkLine);
|
|
100
97
|
}
|
|
101
|
-
|
|
102
|
-
return selectedData.map((datum)=>{
|
|
103
|
-
if (datum[unfoldInfo.encodingX]) return generateOneMarkLine(datum[unfoldInfo.encodingX]);
|
|
104
|
-
if (datum[foldInfo.measureValue]) return generateOneMarkLine(datum[foldInfo.measureValue]);
|
|
105
|
-
return {};
|
|
106
|
-
});
|
|
98
|
+
return [];
|
|
107
99
|
});
|
|
108
100
|
const specMarkLine = spec.markLine || [];
|
|
109
101
|
const newMarkLine = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationVerticalLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationVerticalLine) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationVerticalLine\n const { annotationVerticalLine } = annotation\n const annotationVerticalLineList = Array.isArray(annotationVerticalLine)\n ? annotationVerticalLine\n : [annotationVerticalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine) => {\n const {\n xValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationVerticalLine\n\n const generateOneMarkLine = (x: number | string) => ({\n x,\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineStyle: lineStyle,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: (positionMap as any)[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n dx: 5,\n visible: true,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dx: 5,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n fillOpacity: 1,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dy: -3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dy: 4,\n fill: lineColor,\n },\n },\n })\n\n if (isArray(xValue) || isString(xValue) || isNumber(xValue)) {\n const xValueArr = Array.isArray(xValue) ? xValue : [xValue]\n return xValueArr.map(generateOneMarkLine)\n }\n\n return []\n }) as IMarkLineSpec[]\n\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationVerticalLine","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationVerticalLineList","Array","positionMap","markLine","xValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","generateOneMarkLine","x","ANNOTATION_Z_INDEX","isArray","isString","isNumber","xValueArr","specMarkLine","newMarkLine"],"mappings":"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"}
|
|
@@ -5,3 +5,4 @@ export { annotationHorizontalLine } from './annotationHorizontalLine';
|
|
|
5
5
|
export { annotationArea } from './annotationArea';
|
|
6
6
|
export { annotationAreaBand } from './annotationAreaBand';
|
|
7
7
|
export { splitLine } from './splitLine';
|
|
8
|
+
export { annotationPointOfHistogram } from './annotationPointOfHistogram';
|
|
@@ -5,4 +5,5 @@ import { annotationHorizontalLine } from "./annotationHorizontalLine.js";
|
|
|
5
5
|
import { annotationArea } from "./annotationArea.js";
|
|
6
6
|
import { annotationAreaBand } from "./annotationAreaBand.js";
|
|
7
7
|
import { splitLine } from "./splitLine.js";
|
|
8
|
-
|
|
8
|
+
import { annotationPointOfHistogram } from "./annotationPointOfHistogram.js";
|
|
9
|
+
export { annotationArea, annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationPointOfDualAxis, annotationPointOfHistogram, annotationVerticalLine, splitLine };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AXIS_LABEL_SPACE } from "../../../../utils/index.js";
|
|
2
|
+
const bandAxisStyle = (config)=>{
|
|
3
|
+
const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength = 80, labelAutoRotate, labelAutoRotateAngleRange } = config;
|
|
4
|
+
return {
|
|
5
|
+
type: 'band',
|
|
6
|
+
sampling: !(labelAutoHide || labelAutoRotate || labelAutoLimit),
|
|
7
|
+
visible,
|
|
8
|
+
hover: true,
|
|
9
|
+
label: {
|
|
10
|
+
visible: label?.visible,
|
|
11
|
+
flush: true,
|
|
12
|
+
space: AXIS_LABEL_SPACE,
|
|
13
|
+
style: {
|
|
14
|
+
maxLineWidth: labelAutoLimitLength,
|
|
15
|
+
fill: label?.labelColor,
|
|
16
|
+
angle: label?.labelAngle,
|
|
17
|
+
fontSize: label?.labelFontSize,
|
|
18
|
+
fontWeight: label?.labelFontWeight
|
|
19
|
+
},
|
|
20
|
+
minGap: labelAutoHideGap,
|
|
21
|
+
autoHide: labelAutoHide,
|
|
22
|
+
autoHideMethod: 'greedy',
|
|
23
|
+
autoHideSeparation: labelAutoHideGap,
|
|
24
|
+
autoLimit: labelAutoLimit,
|
|
25
|
+
autoRotate: labelAutoRotate,
|
|
26
|
+
autoRotateAngle: labelAutoRotateAngleRange,
|
|
27
|
+
lastVisible: true
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
visible: title?.visible,
|
|
31
|
+
text: title?.titleText,
|
|
32
|
+
style: {
|
|
33
|
+
fill: title?.titleColor,
|
|
34
|
+
fontSize: title?.titleFontSize,
|
|
35
|
+
fontWeight: title?.titleFontWeight
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
tick: {
|
|
39
|
+
visible: tick?.visible,
|
|
40
|
+
tickSize: tick?.tickSize,
|
|
41
|
+
inside: tick?.tickInside,
|
|
42
|
+
style: {
|
|
43
|
+
stroke: tick?.tickColor
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
grid: {
|
|
47
|
+
visible: grid?.visible,
|
|
48
|
+
style: {
|
|
49
|
+
lineWidth: grid?.gridWidth,
|
|
50
|
+
stroke: grid?.gridColor,
|
|
51
|
+
lineDash: grid?.gridLineDash
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
domainLine: {
|
|
55
|
+
visible: line?.visible,
|
|
56
|
+
style: {
|
|
57
|
+
lineWidth: line?.lineWidth,
|
|
58
|
+
stroke: line?.lineColor
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export { bandAxisStyle };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=axisStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/axes/axisStyle.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/axisStyle.ts"],"sourcesContent":["import type { ICartesianBandAxisSpec } from '@visactor/vchart'\nimport type { XBandAxis } from 'src/types'\nimport { AXIS_LABEL_SPACE } from 'src/pipeline/utils'\n\nexport const bandAxisStyle = (config: XBandAxis) => {\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n labelAutoHide,\n labelAutoHideGap,\n labelAutoLimit,\n labelAutoLimitLength = 80,\n labelAutoRotate,\n labelAutoRotateAngleRange,\n } = config\n\n return {\n type: 'band',\n sampling: !(labelAutoHide || labelAutoRotate || labelAutoLimit),\n visible,\n hover: true,\n label: {\n visible: label?.visible,\n flush: true,\n space: AXIS_LABEL_SPACE,\n style: {\n maxLineWidth: labelAutoLimitLength,\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n\n // 防重叠相关\n minGap: labelAutoHideGap,\n autoHide: labelAutoHide,\n autoHideMethod: 'greedy',\n autoHideSeparation: labelAutoHideGap,\n autoLimit: labelAutoLimit,\n autoRotate: labelAutoRotate,\n autoRotateAngle: labelAutoRotateAngleRange,\n lastVisible: true,\n },\n title: {\n visible: title?.visible,\n text: title?.titleText,\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n } as Partial<ICartesianBandAxisSpec>\n}\n"],"names":["bandAxisStyle","config","visible","label","tick","title","grid","line","labelAutoHide","labelAutoHideGap","labelAutoLimit","labelAutoLimitLength","labelAutoRotate","labelAutoRotateAngleRange","AXIS_LABEL_SPACE"],"mappings":";AAIO,MAAMA,gBAAgB,CAACC;IAC5B,MAAM,EACJC,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,uBAAuB,EAAE,EACzBC,eAAe,EACfC,yBAAyB,EAC1B,GAAGZ;IAEJ,OAAO;QACL,MAAM;QACN,UAAU,CAAEO,CAAAA,iBAAiBI,mBAAmBF,cAAa;QAC7DR;QACA,OAAO;QACP,OAAO;YACL,SAASC,OAAO;YAChB,OAAO;YACP,OAAOW;YACP,OAAO;gBACL,cAAcH;gBACd,MAAMR,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;YAGA,QAAQM;YACR,UAAUD;YACV,gBAAgB;YAChB,oBAAoBC;YACpB,WAAWC;YACX,YAAYE;YACZ,iBAAiBC;YACjB,aAAa;QACf;QACA,OAAO;YACL,SAASR,OAAO;YAChB,MAAMA,OAAO;YACb,OAAO;gBACL,MAAMA,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;gBACd,UAAUA,MAAM;YAClB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { bandAxisStyle } from "./axisStyle.js";
|
|
2
|
+
const heatmapBandAxis = (spec, context)=>{
|
|
3
|
+
const result = {
|
|
4
|
+
...spec
|
|
5
|
+
};
|
|
6
|
+
const { advancedVSeed, vseed } = context;
|
|
7
|
+
const { chartType } = vseed;
|
|
8
|
+
const xAxisConfig = advancedVSeed.config?.[chartType]?.xAxis ?? {};
|
|
9
|
+
const yAxisConfig = advancedVSeed.config?.[chartType]?.yAxis ?? {};
|
|
10
|
+
const xBandAxis = bandAxisStyle(xAxisConfig);
|
|
11
|
+
const yBandAxis = bandAxisStyle(yAxisConfig);
|
|
12
|
+
xBandAxis.orient = 'bottom';
|
|
13
|
+
xBandAxis.bandPadding = 0;
|
|
14
|
+
yBandAxis.orient = 'left';
|
|
15
|
+
yBandAxis.bandPadding = 0;
|
|
16
|
+
result.axes = [
|
|
17
|
+
xBandAxis,
|
|
18
|
+
yBandAxis
|
|
19
|
+
];
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
export { heatmapBandAxis };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=heatmapBandAxis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/axes/heatmapBandAxis.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/heatmapBandAxis.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XBandAxis, YBandAxis } from 'src/types'\nimport { bandAxisStyle } from './axisStyle'\n\nexport const heatmapBandAxis: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const xAxisConfig = (advancedVSeed.config?.[chartType as 'heatmap']?.xAxis ?? {}) as XBandAxis\n const yAxisConfig = (advancedVSeed.config?.[chartType as 'heatmap']?.yAxis ?? {}) as YBandAxis\n const xBandAxis = bandAxisStyle(xAxisConfig)\n const yBandAxis = bandAxisStyle(yAxisConfig)\n\n xBandAxis.orient = 'bottom'\n xBandAxis.bandPadding = 0\n yBandAxis.orient = 'left'\n yBandAxis.bandPadding = 0\n\n result.axes = [xBandAxis, yBandAxis]\n\n return result\n}\n"],"names":["heatmapBandAxis","spec","context","result","advancedVSeed","vseed","chartType","xAxisConfig","yAxisConfig","xBandAxis","bandAxisStyle","yBandAxis"],"mappings":";AAIO,MAAMA,kBAAkC,CAACC,MAAMC;IACpD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAME,cAAeH,cAAc,MAAM,EAAE,CAACE,UAAuB,EAAE,SAAS,CAAC;IAC/E,MAAME,cAAeJ,cAAc,MAAM,EAAE,CAACE,UAAuB,EAAE,SAAS,CAAC;IAC/E,MAAMG,YAAYC,cAAcH;IAChC,MAAMI,YAAYD,cAAcF;IAEhCC,UAAU,MAAM,GAAG;IACnBA,UAAU,WAAW,GAAG;IACxBE,UAAU,MAAM,GAAG;IACnBA,UAAU,WAAW,GAAG;IAExBR,OAAO,IAAI,GAAG;QAACM;QAAWE;KAAU;IAEpC,OAAOR;AACT"}
|
|
@@ -7,4 +7,5 @@ import { yLinearSecondary } from "./yLinearSecondary.js";
|
|
|
7
7
|
import { radiusAxis } from "./radius.js";
|
|
8
8
|
import { radarAngleAxis } from "./radarAngle.js";
|
|
9
9
|
import { radarRadiusAxis } from "./radarRadius.js";
|
|
10
|
-
|
|
10
|
+
import { heatmapBandAxis } from "./heatmapBandAxis.js";
|
|
11
|
+
export { heatmapBandAxis, radarAngleAxis, radarRadiusAxis, radiusAxis, xBand, xLinear, yBand, yLinear, yLinearPrimary, yLinearSecondary };
|