@visactor/vseed 0.1.39 → 0.1.41
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 +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +3028 -286
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +28 -1
- package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +0 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +5 -3
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +5 -3
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +9 -3
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js +7 -2
- package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js +150 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.d.ts +4 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js +21 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +98 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.d.ts +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.js +4 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +98 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +16 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +159 -0
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -0
- package/dist/esm/theme/common/regressionLine.d.ts +8 -4
- package/dist/esm/theme/common/regressionLine.js +60 -8
- package/dist/esm/theme/common/regressionLine.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +6 -4
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +6 -4
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +988 -37
- package/dist/esm/types/advancedVSeed.js +2 -2
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +25 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/histogram/histogram.d.ts +7 -3
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +19 -4
- package/dist/esm/types/chartType/histogram/zHistogram.js +3 -2
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +21 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +94 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +5 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +4 -0
- package/dist/esm/types/properties/config/bar.d.ts +6 -0
- package/dist/esm/types/properties/config/boxplot.d.ts +2 -0
- package/dist/esm/types/properties/config/column.d.ts +138 -2
- package/dist/esm/types/properties/config/column.js +6 -3
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +429 -9
- package/dist/esm/types/properties/config/dualAxis.d.ts +2 -0
- package/dist/esm/types/properties/config/funnel.d.ts +2 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +2 -0
- package/dist/esm/types/properties/config/histogram.d.ts +131 -9
- package/dist/esm/types/properties/config/histogram.js +2 -2
- package/dist/esm/types/properties/config/histogram.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +2 -0
- package/dist/esm/types/properties/config/pie.d.ts +6 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +2 -0
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +3 -1
- package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
- package/dist/esm/types/properties/config/rose.d.ts +4 -0
- package/dist/esm/types/properties/config/scatter.d.ts +132 -0
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.d.ts → ecdfRegressionLine.d.ts} +2 -7
- package/dist/esm/types/properties/regressionLine/index.d.ts +7 -2
- package/dist/esm/types/properties/regressionLine/index.js +1 -1
- package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +40 -0
- package/dist/esm/types/properties/regressionLine/kdeRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +53 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +57 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.js +0 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.d.ts +199 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js +32 -0
- package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -0
- package/dist/esm/types/properties/theme/customTheme.d.ts +858 -18
- package/dist/esm/types/zVseed.d.ts +138 -4
- package/dist/umd/index.js +1156 -134
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.d.ts +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js +0 -126
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js.map +0 -1
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.d.ts +0 -11
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js +0 -17
- package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js.map +0 -1
- /package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.js → ecdfRegressionLine.js} +0 -0
package/package.json
CHANGED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { isNullish, uniqueBy } from "remeda";
|
|
2
|
-
import { ecdf, kde } from "@visactor/vutils";
|
|
3
|
-
import { BinEndMeasureId, BinStartMeasureId } from "../../../../../dataReshape/index.js";
|
|
4
|
-
const getRegressionByType = (type, data, kdeOptions)=>{
|
|
5
|
-
switch(type){
|
|
6
|
-
case 'kde':
|
|
7
|
-
return kde(data, kdeOptions);
|
|
8
|
-
case 'ecdf':
|
|
9
|
-
return ecdf(data);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const histogramRegressionLine_histogramRegressionLine = (spec, context)=>{
|
|
13
|
-
const result = {
|
|
14
|
-
...spec
|
|
15
|
-
};
|
|
16
|
-
const { advancedVSeed, vseed } = context;
|
|
17
|
-
const { chartType, encoding = {}, dimensions, histogramRegressionLine } = advancedVSeed;
|
|
18
|
-
const { dataset } = vseed;
|
|
19
|
-
const theme = advancedVSeed.config[chartType]?.histogramRegressionLine;
|
|
20
|
-
if (!histogramRegressionLine) return result;
|
|
21
|
-
const rowColumnFields = uniqueBy(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
|
|
22
|
-
const lineList = Array.isArray(histogramRegressionLine) ? histogramRegressionLine : [
|
|
23
|
-
histogramRegressionLine
|
|
24
|
-
];
|
|
25
|
-
if (!result.customMark) result.customMark = [];
|
|
26
|
-
lineList.forEach((line)=>{
|
|
27
|
-
const { color, type, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight } = line;
|
|
28
|
-
result.customMark.push({
|
|
29
|
-
type: 'line',
|
|
30
|
-
interactive: false,
|
|
31
|
-
zIndex: 500,
|
|
32
|
-
style: {
|
|
33
|
-
lineWidth: lineWidth ?? theme?.lineWidth,
|
|
34
|
-
lineDash: lineDash ?? theme?.lineDash,
|
|
35
|
-
stroke: color ?? ((datum, ctx)=>{
|
|
36
|
-
const vchart = ctx.vchart;
|
|
37
|
-
const chart = vchart.getChart();
|
|
38
|
-
const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
|
|
39
|
-
return series.length ? series[0].getOption().globalScale.getScale('color')?.scale(series[0].getSeriesKeys()[0]) : void 0;
|
|
40
|
-
}),
|
|
41
|
-
points: (datum, ctx)=>{
|
|
42
|
-
const vchart = ctx.vchart;
|
|
43
|
-
const chart = vchart.getChart();
|
|
44
|
-
const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
|
|
45
|
-
if (series && series.length) {
|
|
46
|
-
const s = series[0];
|
|
47
|
-
const region = s.getRegion().getLayoutStartPoint();
|
|
48
|
-
const fieldX = s.fieldX?.[0];
|
|
49
|
-
const scaleY = s.getYAxisHelper().getScale?.(0);
|
|
50
|
-
const viewData = s.getViewData()?.latestData;
|
|
51
|
-
if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return;
|
|
52
|
-
const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)=>d[encoding.value?.[0]]);
|
|
53
|
-
const res = getRegressionByType(type, simpleData, 'kde' === type ? {
|
|
54
|
-
bandwidth: Math.abs(viewData[0][BinEndMeasureId] - viewData[0][BinStartMeasureId])
|
|
55
|
-
} : void 0);
|
|
56
|
-
const N = Math.max(3, Math.floor(simpleData.length / 4));
|
|
57
|
-
const lineData = res.evaluateGrid(N);
|
|
58
|
-
const yRange = scaleY.range();
|
|
59
|
-
const y0 = yRange[0];
|
|
60
|
-
const y1 = yRange[yRange.length - 1];
|
|
61
|
-
const scaleR = 'kde' === type ? (k)=>scaleY.scale(k * simpleData.length * res.bandwidth) : (e)=>y0 + (y1 - y0) * e;
|
|
62
|
-
return lineData.map((ld)=>{
|
|
63
|
-
const d = {
|
|
64
|
-
[fieldX]: ld.x
|
|
65
|
-
};
|
|
66
|
-
return {
|
|
67
|
-
x: s.dataToPositionX(d) + region.x,
|
|
68
|
-
y: scaleR(ld.y) + region.y
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (!isNullish(text)) result.customMark.push({
|
|
77
|
-
type: 'text',
|
|
78
|
-
interactive: false,
|
|
79
|
-
zIndex: 500,
|
|
80
|
-
style: {
|
|
81
|
-
textAlign: 'end',
|
|
82
|
-
fill: textColor ?? theme?.textColor,
|
|
83
|
-
fontSize: textFontSize ?? theme?.textFontSize,
|
|
84
|
-
fontWeight: textFontWeight ?? theme?.textFontWeight,
|
|
85
|
-
text: text,
|
|
86
|
-
x: (datum, ctx)=>{
|
|
87
|
-
const vchart = ctx.vchart;
|
|
88
|
-
const chart = vchart.getChart();
|
|
89
|
-
const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
|
|
90
|
-
if (series && series.length) {
|
|
91
|
-
const s = series[0];
|
|
92
|
-
const startPoint = s.getRegion().getLayoutStartPoint();
|
|
93
|
-
const fieldX = s.fieldX[0];
|
|
94
|
-
const fieldX2 = s.fieldX2;
|
|
95
|
-
const scaleY = s.getYAxisHelper().getScale?.(0);
|
|
96
|
-
const viewData = s.getViewData()?.latestData;
|
|
97
|
-
if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return;
|
|
98
|
-
const maxX = Math.max.apply(null, viewData.map((d)=>Math.max(d[fieldX], d[fieldX2])));
|
|
99
|
-
return startPoint.x + s.dataToPositionX({
|
|
100
|
-
[fieldX]: maxX
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
y: (datum, ctx)=>{
|
|
105
|
-
const vchart = ctx.vchart;
|
|
106
|
-
const chart = vchart.getChart();
|
|
107
|
-
const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
|
|
108
|
-
if (series && series.length) {
|
|
109
|
-
const s = series[0];
|
|
110
|
-
const startPoint = s.getRegion().getLayoutStartPoint();
|
|
111
|
-
const fieldY = s.fieldY[0];
|
|
112
|
-
const viewData = s.getViewData()?.latestData;
|
|
113
|
-
if (!viewData || !viewData.length) return;
|
|
114
|
-
return 'ecdf' === type ? startPoint.y + 12 : startPoint.y + s.dataToPositionY({
|
|
115
|
-
[fieldY]: viewData[viewData.length - 1]?.[fieldY]
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
return result;
|
|
123
|
-
};
|
|
124
|
-
export { histogramRegressionLine_histogramRegressionLine as histogramRegressionLine };
|
|
125
|
-
|
|
126
|
-
//# sourceMappingURL=histogramRegressionLine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, IHistogramChartSpec, IVChart } from '@visactor/vchart'\nimport type { KDEEvaluator, KDEOptions } from '@visactor/vutils'\nimport { isNullish, uniqueBy } from 'remeda'\nimport { ecdf, kde } from '@visactor/vutils'\nimport { BinEndMeasureId, BinStartMeasureId } from 'src/dataReshape'\nimport type { Datum, Dimension, HistogramRegressionLine, SpecPipe, Encoding } from 'src/types'\n\nconst getRegressionByType = (type: 'kde' | 'ecdf', data: number[], kdeOptions?: KDEOptions) => {\n switch (type) {\n case 'kde':\n return kde(data, kdeOptions)\n case 'ecdf':\n return ecdf(data)\n }\n}\n\nexport const histogramRegressionLine: SpecPipe = (spec, context) => {\n const result = { ...spec } as IHistogramChartSpec\n const { advancedVSeed, vseed } = context\n const { chartType, encoding = {} as Encoding, dimensions, histogramRegressionLine } = advancedVSeed\n const { dataset } = vseed\n const theme = advancedVSeed.config[chartType as 'histogram']?.histogramRegressionLine as HistogramRegressionLine\n\n if (!histogramRegressionLine) {\n return result\n }\n\n const rowColumnFields = uniqueBy(\n dimensions.filter((dim: Dimension) => dim.encoding === 'row' || dim.encoding === 'column'),\n (item: Dimension) => item.id,\n )\n const lineList = Array.isArray(histogramRegressionLine) ? histogramRegressionLine : [histogramRegressionLine]\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n lineList.forEach((line) => {\n const { color, type, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight } =\n line as HistogramRegressionLine\n\n ;(result.customMark as any[]).push({\n type: 'line',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme?.lineWidth,\n lineDash: lineDash ?? theme?.lineDash,\n stroke:\n color ??\n ((datum: Datum, ctx: any): string | undefined => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const series = chart.getAllSeries().filter((s: any) => s.type === 'bar')\n\n return series.length\n ? series[0].getOption().globalScale.getScale('color')?.scale(series[0].getSeriesKeys()[0])\n : undefined\n }),\n points: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const series = chart.getAllSeries().filter((s: any) => s.type === 'bar')\n\n // 直方图使用的是bar系列\n if (series && series.length) {\n const s = series[0] as ICartesianSeries\n const region = s.getRegion().getLayoutStartPoint()\n\n const fieldX = s.fieldX?.[0]\n const scaleY = s.getYAxisHelper().getScale?.(0)\n const viewData = s.getViewData()?.latestData\n\n if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) {\n return\n }\n const simpleData = dataset\n .filter((entry: Datum) => {\n return rowColumnFields.length\n ? rowColumnFields.every((dim: Dimension) => {\n return entry[dim.id] === viewData[0][dim.id]\n })\n : true\n })\n .map((d: Datum) => (d as any)[encoding.value?.[0] as string]) as number[]\n const res = getRegressionByType(\n type,\n simpleData,\n type === 'kde'\n ? ({\n bandwidth: Math.abs(viewData[0][BinEndMeasureId] - viewData[0][BinStartMeasureId]),\n } as KDEOptions)\n : undefined,\n )\n const N = Math.max(3, Math.floor(simpleData.length / 4))\n const lineData = res.evaluateGrid(N)\n const yRange = scaleY.range()\n const y0 = yRange[0]\n const y1 = yRange[yRange.length - 1]\n const scaleR =\n type === 'kde'\n ? (k: number) => {\n return scaleY.scale(k * simpleData.length * (res as KDEEvaluator).bandwidth)\n }\n : (e: number) => {\n return y0 + (y1 - y0) * e\n }\n\n //color: color ?? s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0]),\n\n return lineData.map((ld: Datum) => {\n const d = { [fieldX]: ld.x }\n return {\n x: s.dataToPositionX(d)! + region.x,\n y: scaleR(ld.y as number) + region.y,\n }\n })\n }\n return []\n },\n },\n })\n\n if (!isNullish(text)) {\n ;(result.customMark as any[]).push({\n type: 'text',\n interactive: false,\n zIndex: 500,\n style: {\n textAlign: 'end',\n fill: textColor ?? theme?.textColor,\n fontSize: textFontSize ?? theme?.textFontSize,\n fontWeight: textFontWeight ?? theme?.textFontWeight,\n text: text,\n x: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const series = chart.getAllSeries().filter((s: any) => s.type === 'bar')\n // 直方图使用的是bar系列\n if (series && series.length) {\n const s = series[0] as ICartesianSeries\n const startPoint = s.getRegion().getLayoutStartPoint()\n\n const fieldX = s.fieldX[0]\n const fieldX2 = s.fieldX2\n const scaleY = s.getYAxisHelper().getScale?.(0)\n const viewData = s.getViewData()?.latestData\n if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) {\n return undefined\n }\n const maxX = Math.max.apply(\n null,\n (viewData as any[]).map((d: Datum) =>\n Math.max((d as any)[fieldX] as number, (d as any)[fieldX2] as number),\n ),\n )\n return startPoint.x + s.dataToPositionX({ [fieldX]: maxX })!\n }\n\n return undefined\n },\n y: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const series = chart.getAllSeries().filter((s: any) => s.type === 'bar')\n // 直方图使用的是bar系列\n if (series && series.length) {\n const s = series[0] as ICartesianSeries\n const startPoint = s.getRegion().getLayoutStartPoint()\n\n const fieldY = s.fieldY[0]\n const viewData = s.getViewData()?.latestData\n if (!viewData || !viewData.length) {\n return undefined\n }\n return type === 'ecdf'\n ? startPoint.y + 12\n : startPoint.y + s.dataToPositionY({ [fieldY]: viewData[viewData.length - 1]?.[fieldY] })!\n }\n\n return undefined\n },\n },\n })\n }\n })\n\n return result\n}\n"],"names":["getRegressionByType","type","data","kdeOptions","kde","ecdf","histogramRegressionLine","spec","context","result","advancedVSeed","vseed","chartType","encoding","dimensions","dataset","theme","rowColumnFields","uniqueBy","dim","item","lineList","Array","line","color","lineWidth","lineDash","text","textColor","textFontSize","textFontWeight","datum","ctx","vchart","chart","series","s","undefined","region","fieldX","scaleY","viewData","simpleData","entry","d","res","Math","BinEndMeasureId","BinStartMeasureId","N","lineData","yRange","y0","y1","scaleR","k","e","ld","isNullish","startPoint","fieldX2","maxX","fieldY"],"mappings":";;;AAOA,MAAMA,sBAAsB,CAACC,MAAsBC,MAAgBC;IACjE,OAAQF;QACN,KAAK;YACH,OAAOG,IAAIF,MAAMC;QACnB,KAAK;YACH,OAAOE,KAAKH;IAChB;AACF;AAEO,MAAMI,kDAAoC,CAACC,MAAMC;IACtD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAEC,WAAW,CAAC,CAAa,EAAEC,UAAU,EAAER,uBAAuB,EAAE,GAAGI;IACtF,MAAM,EAAEK,OAAO,EAAE,GAAGJ;IACpB,MAAMK,QAAQN,cAAc,MAAM,CAACE,UAAyB,EAAE;IAE9D,IAAI,CAACN,yBACH,OAAOG;IAGT,MAAMQ,kBAAkBC,SACtBJ,WAAW,MAAM,CAAC,CAACK,MAAmBA,AAAiB,UAAjBA,IAAI,QAAQ,IAAcA,AAAiB,aAAjBA,IAAI,QAAQ,GAC5E,CAACC,OAAoBA,KAAK,EAAE;IAE9B,MAAMC,WAAWC,MAAM,OAAO,CAAChB,2BAA2BA,0BAA0B;QAACA;KAAwB;IAE7G,IAAI,CAACG,OAAO,UAAU,EACpBA,OAAO,UAAU,GAAG,EAAE;IAGxBY,SAAS,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C,IAAID,MAAM,CAAC,EAAE;wBACnB,MAAMwB,aAAavB,EAAE,SAAS,GAAG,mBAAmB;wBAEpD,MAAM0B,SAAS1B,EAAE,MAAM,CAAC,EAAE;wBAC1B,MAAMK,WAAWL,EAAE,WAAW,IAAI;wBAClC,IAAI,CAACK,YAAY,CAACA,SAAS,MAAM,EAC/B;wBAEF,OAAOxC,AAAS,WAATA,OACH0D,WAAW,CAAC,GAAG,KACfA,WAAW,CAAC,GAAGvB,EAAE,eAAe,CAAC;4BAAE,CAAC0B,OAAO,EAAErB,QAAQ,CAACA,SAAS,MAAM,GAAG,EAAE,EAAE,CAACqB,OAAO;wBAAC;oBAC3F;gBAGF;YACF;QACF;IAEJ;IAEA,OAAOrD;AACT"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const zHistogramRegressionLine: z.ZodObject<{
|
|
3
|
-
type: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"kde">, z.ZodLiteral<"ecdf">]>>>;
|
|
4
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
-
lineWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6
|
-
lineDash: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
7
|
-
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
-
textColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
-
textFontSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
|
-
textFontWeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
11
|
-
}, z.core.$strip>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const zHistogramRegressionLine = z.object({
|
|
3
|
-
type: z.union([
|
|
4
|
-
z.literal('kde'),
|
|
5
|
-
z.literal('ecdf')
|
|
6
|
-
]).nullish(),
|
|
7
|
-
color: z.string().nullish(),
|
|
8
|
-
lineWidth: z.number().nullish(),
|
|
9
|
-
lineDash: z.array(z.number()).nullish(),
|
|
10
|
-
text: z.string().nullish(),
|
|
11
|
-
textColor: z.string().nullish(),
|
|
12
|
-
textFontSize: z.number().nullish(),
|
|
13
|
-
textFontWeight: z.number().nullish()
|
|
14
|
-
});
|
|
15
|
-
export { zHistogramRegressionLine };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=zHistogramRegressionLine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types/properties/regressionLine/zHistogramRegressionLine.js","sources":["webpack://@visactor/vseed/./src/types/properties/regressionLine/zHistogramRegressionLine.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const zHistogramRegressionLine = z.object({\n type: z.union([z.literal('kde'), z.literal('ecdf')]).nullish(),\n color: z.string().nullish(),\n lineWidth: z.number().nullish(),\n lineDash: z.array(z.number()).nullish(),\n text: z.string().nullish(),\n textColor: z.string().nullish(),\n textFontSize: z.number().nullish(),\n textFontWeight: z.number().nullish(),\n})\n"],"names":["zHistogramRegressionLine","z"],"mappings":";AAEO,MAAMA,2BAA2BC,EAAE,MAAM,CAAC;IAC/C,MAAMA,EAAE,KAAK,CAAC;QAACA,EAAE,OAAO,CAAC;QAAQA,EAAE,OAAO,CAAC;KAAQ,EAAE,OAAO;IAC5D,OAAOA,EAAE,MAAM,GAAG,OAAO;IACzB,WAAWA,EAAE,MAAM,GAAG,OAAO;IAC7B,UAAUA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,OAAO;IACrC,MAAMA,EAAE,MAAM,GAAG,OAAO;IACxB,WAAWA,EAAE,MAAM,GAAG,OAAO;IAC7B,cAAcA,EAAE,MAAM,GAAG,OAAO;IAChC,gBAAgBA,EAAE,MAAM,GAAG,OAAO;AACpC"}
|
|
File without changes
|