@visactor/vseed 0.1.40 → 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.
Files changed (94) hide show
  1. package/dist/cjs/index.cjs +3 -3
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/builder.d.ts +2788 -286
  4. package/dist/esm/pipeline/advanced/chart/pipeline/column.js +3 -2
  5. package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
  6. package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -2
  7. package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
  8. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +28 -1
  9. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
  10. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +0 -1
  11. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/column.js +5 -3
  13. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  14. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +5 -3
  15. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
  16. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +9 -3
  17. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  18. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.d.ts +2 -0
  19. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js +150 -0
  20. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -0
  21. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.d.ts +4 -0
  22. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js +21 -0
  23. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js.map +1 -0
  24. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.d.ts +2 -0
  25. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +98 -0
  26. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -0
  27. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.d.ts +4 -1
  28. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/index.js +4 -1
  29. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.d.ts +2 -0
  30. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +98 -0
  31. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -0
  32. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +16 -0
  33. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +159 -0
  34. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -0
  35. package/dist/esm/theme/common/regressionLine.d.ts +8 -4
  36. package/dist/esm/theme/common/regressionLine.js +60 -8
  37. package/dist/esm/theme/common/regressionLine.js.map +1 -1
  38. package/dist/esm/theme/dark/dark.js +6 -4
  39. package/dist/esm/theme/dark/dark.js.map +1 -1
  40. package/dist/esm/theme/light/light.js +6 -4
  41. package/dist/esm/theme/light/light.js.map +1 -1
  42. package/dist/esm/types/advancedVSeed.d.ts +908 -37
  43. package/dist/esm/types/advancedVSeed.js +2 -2
  44. package/dist/esm/types/advancedVSeed.js.map +1 -1
  45. package/dist/esm/types/chartType/column/column.d.ts +6 -1
  46. package/dist/esm/types/chartType/column/zColumn.d.ts +25 -0
  47. package/dist/esm/types/chartType/column/zColumn.js +2 -1
  48. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  49. package/dist/esm/types/chartType/histogram/histogram.d.ts +7 -3
  50. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +19 -4
  51. package/dist/esm/types/chartType/histogram/zHistogram.js +3 -2
  52. package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
  53. package/dist/esm/types/chartType/scatter/scatter.d.ts +21 -1
  54. package/dist/esm/types/chartType/scatter/zScatter.d.ts +94 -0
  55. package/dist/esm/types/chartType/scatter/zScatter.js +5 -1
  56. package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
  57. package/dist/esm/types/properties/config/column.d.ts +132 -2
  58. package/dist/esm/types/properties/config/column.js +6 -3
  59. package/dist/esm/types/properties/config/column.js.map +1 -1
  60. package/dist/esm/types/properties/config/config.d.ts +389 -9
  61. package/dist/esm/types/properties/config/histogram.d.ts +129 -9
  62. package/dist/esm/types/properties/config/histogram.js +2 -2
  63. package/dist/esm/types/properties/config/histogram.js.map +1 -1
  64. package/dist/esm/types/properties/config/scatter.d.ts +130 -0
  65. package/dist/esm/types/properties/config/scatter.js +3 -1
  66. package/dist/esm/types/properties/config/scatter.js.map +1 -1
  67. package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.d.ts → ecdfRegressionLine.d.ts} +2 -7
  68. package/dist/esm/types/properties/regressionLine/index.d.ts +7 -2
  69. package/dist/esm/types/properties/regressionLine/index.js +1 -1
  70. package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +40 -0
  71. package/dist/esm/types/properties/regressionLine/kdeRegressionLine.js +0 -0
  72. package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +53 -0
  73. package/dist/esm/types/properties/regressionLine/linearRegressionLine.js +0 -0
  74. package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +53 -0
  75. package/dist/esm/types/properties/regressionLine/logisticRegressionLine.js +0 -0
  76. package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +53 -0
  77. package/dist/esm/types/properties/regressionLine/lowessRegressionLine.js +0 -0
  78. package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +57 -0
  79. package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.js +0 -0
  80. package/dist/esm/types/properties/regressionLine/zRegressionLine.d.ts +199 -0
  81. package/dist/esm/types/properties/regressionLine/zRegressionLine.js +32 -0
  82. package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -0
  83. package/dist/esm/types/properties/theme/customTheme.d.ts +778 -18
  84. package/dist/esm/types/zVseed.d.ts +138 -4
  85. package/dist/umd/index.js +1144 -131
  86. package/dist/umd/index.js.map +1 -1
  87. package/package.json +1 -1
  88. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.d.ts +0 -2
  89. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js +0 -126
  90. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/histogramRegressionLine.js.map +0 -1
  91. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.d.ts +0 -11
  92. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js +0 -17
  93. package/dist/esm/types/properties/regressionLine/zHistogramRegressionLine.js.map +0 -1
  94. /package/dist/esm/types/properties/regressionLine/{histogramRegressionLine.js → ecdfRegressionLine.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { annotation, buildMeasures, columnConfig, defaultDimensions, defaultEncodingForColumn, defaultMeasureName, defaultMeasures, deleteEncodingForMeasure, deleteTooltipAndLabelDimension, encodingAdapter, encodingForColumn, initAdvancedVSeed, markStyle, pivotAdapter, pivotReshapeWithEncoding, reshapeWithEncoding, sortLegend, sortXBandAxis, theme } from "../pipes/index.js";
1
+ import { annotation, buildMeasures, columnConfig, defaultDimensions, defaultEncodingForColumn, defaultMeasureName, defaultMeasures, deleteEncodingForMeasure, deleteTooltipAndLabelDimension, encodingAdapter, encodingForColumn, initAdvancedVSeed, markStyle, pivotAdapter, pivotReshapeWithEncoding, regressionLine, reshapeWithEncoding, sortLegend, sortXBandAxis, theme } from "../pipes/index.js";
2
2
  const columnAdvancedPipeline = [
3
3
  initAdvancedVSeed,
4
4
  defaultMeasures,
@@ -27,7 +27,8 @@ const columnAdvancedPipeline = [
27
27
  columnConfig,
28
28
  theme,
29
29
  markStyle,
30
- annotation
30
+ annotation,
31
+ regressionLine
31
32
  ];
32
33
  export { columnAdvancedPipeline };
33
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipeline/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipeline/column.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport {\n initAdvancedVSeed,\n theme,\n pivotAdapter,\n columnConfig,\n markStyle,\n annotation,\n sortXBandAxis,\n sortLegend,\n encodingForColumn,\n reshapeWithEncoding,\n pivotReshapeWithEncoding,\n buildMeasures,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n encodingAdapter,\n defaultEncodingForColumn,\n deleteEncodingForMeasure,\n deleteTooltipAndLabelDimension,\n} from '../pipes'\n\nexport const columnAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n\n encodingAdapter(\n [defaultEncodingForColumn, buildMeasures],\n [\n encodingForColumn,\n buildMeasures,\n deleteEncodingForMeasure(['tooltip', 'label', 'color']),\n deleteTooltipAndLabelDimension,\n ],\n ),\n pivotAdapter([reshapeWithEncoding], [pivotReshapeWithEncoding]),\n\n sortXBandAxis,\n sortLegend,\n columnConfig,\n theme,\n markStyle,\n annotation,\n]\n"],"names":["columnAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","defaultMeasureName","encodingAdapter","defaultEncodingForColumn","buildMeasures","encodingForColumn","deleteEncodingForMeasure","deleteTooltipAndLabelDimension","pivotAdapter","reshapeWithEncoding","pivotReshapeWithEncoding","sortXBandAxis","sortLegend","columnConfig","theme","markStyle","annotation"],"mappings":";AAuBO,MAAMA,yBAA2C;IACtDC;IACAC;IACAC;IACAC;IAEAC,gBACE;QAACC;QAA0BC;KAAc,EACzC;QACEC;QACAD;QACAE,yBAAyB;YAAC;YAAW;YAAS;SAAQ;QACtDC;KACD;IAEHC,aAAa;QAACC;KAAoB,EAAE;QAACC;KAAyB;IAE9DC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipeline/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipeline/column.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport {\n initAdvancedVSeed,\n theme,\n pivotAdapter,\n columnConfig,\n markStyle,\n annotation,\n sortXBandAxis,\n sortLegend,\n encodingForColumn,\n reshapeWithEncoding,\n pivotReshapeWithEncoding,\n buildMeasures,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n encodingAdapter,\n defaultEncodingForColumn,\n deleteEncodingForMeasure,\n deleteTooltipAndLabelDimension,\n regressionLine,\n} from '../pipes'\n\nexport const columnAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n\n encodingAdapter(\n [defaultEncodingForColumn, buildMeasures],\n [\n encodingForColumn,\n buildMeasures,\n deleteEncodingForMeasure(['tooltip', 'label', 'color']),\n deleteTooltipAndLabelDimension,\n ],\n ),\n pivotAdapter([reshapeWithEncoding], [pivotReshapeWithEncoding]),\n\n sortXBandAxis,\n sortLegend,\n columnConfig,\n theme,\n markStyle,\n annotation,\n regressionLine,\n]\n"],"names":["columnAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","defaultMeasureName","encodingAdapter","defaultEncodingForColumn","buildMeasures","encodingForColumn","deleteEncodingForMeasure","deleteTooltipAndLabelDimension","pivotAdapter","reshapeWithEncoding","pivotReshapeWithEncoding","sortXBandAxis","sortLegend","columnConfig","theme","markStyle","annotation","regressionLine"],"mappings":";AAwBO,MAAMA,yBAA2C;IACtDC;IACAC;IACAC;IACAC;IAEAC,gBACE;QAACC;QAA0BC;KAAc,EACzC;QACEC;QACAD;QACAE,yBAAyB;YAAC;YAAW;YAAS;SAAQ;QACtDC;KACD;IAEHC,aAAa;QAACC;KAAoB,EAAE;QAACC;KAAyB;IAE9DC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD"}
@@ -1,4 +1,4 @@
1
- import { annotation, buildMeasuresForScatter, defaultDimensions, defaultEncodingForScatter, defaultMeasureName, defaultMeasures, deleteEncodingForMeasure, deleteTooltipAndLabelDimension, encodingAdapter, encodingForScatter, initAdvancedVSeed, markStyle, pivotAdapter, scatterConfig, theme } from "../pipes/index.js";
1
+ import { annotation, buildMeasuresForScatter, defaultDimensions, defaultEncodingForScatter, defaultMeasureName, defaultMeasures, deleteEncodingForMeasure, deleteTooltipAndLabelDimension, encodingAdapter, encodingForScatter, initAdvancedVSeed, markStyle, pivotAdapter, regressionLine, scatterConfig, theme } from "../pipes/index.js";
2
2
  import { reshapeWithScatterEncoding } from "../pipes/reshape/reshapeWithScatterEncoding.js";
3
3
  import { pivotReshapeWithScatterEncoding } from "../pipes/reshape/pivotReshapeWithScatterEncoding.js";
4
4
  const scatterAdvancedPipeline = [
@@ -27,7 +27,8 @@ const scatterAdvancedPipeline = [
27
27
  scatterConfig,
28
28
  theme,
29
29
  markStyle,
30
- annotation
30
+ annotation,
31
+ regressionLine
31
32
  ];
32
33
  export { scatterAdvancedPipeline };
33
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipeline/scatter.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport {\n initAdvancedVSeed,\n theme,\n pivotAdapter,\n annotation,\n markStyle,\n scatterConfig,\n encodingForScatter,\n buildMeasuresForScatter,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n encodingAdapter,\n defaultEncodingForScatter,\n deleteEncodingForMeasure,\n deleteTooltipAndLabelDimension,\n} from '../pipes'\nimport { reshapeWithScatterEncoding } from '../pipes/reshape/reshapeWithScatterEncoding'\nimport { pivotReshapeWithScatterEncoding } from '../pipes/reshape/pivotReshapeWithScatterEncoding'\n\nexport const scatterAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n\n encodingAdapter(\n [defaultEncodingForScatter, buildMeasuresForScatter],\n [\n encodingForScatter,\n buildMeasuresForScatter,\n deleteEncodingForMeasure(['tooltip', 'label', 'size']),\n deleteTooltipAndLabelDimension,\n ],\n ),\n pivotAdapter([reshapeWithScatterEncoding], [pivotReshapeWithScatterEncoding]),\n\n scatterConfig,\n theme,\n markStyle,\n annotation,\n]\n"],"names":["scatterAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","defaultMeasureName","encodingAdapter","defaultEncodingForScatter","buildMeasuresForScatter","encodingForScatter","deleteEncodingForMeasure","deleteTooltipAndLabelDimension","pivotAdapter","reshapeWithScatterEncoding","pivotReshapeWithScatterEncoding","scatterConfig","theme","markStyle","annotation"],"mappings":";;;AAqBO,MAAMA,0BAA4C;IACvDC;IACAC;IACAC;IACAC;IAEAC,gBACE;QAACC;QAA2BC;KAAwB,EACpD;QACEC;QACAD;QACAE,yBAAyB;YAAC;YAAW;YAAS;SAAO;QACrDC;KACD;IAEHC,aAAa;QAACC;KAA2B,EAAE;QAACC;KAAgC;IAE5EC;IACAC;IACAC;IACAC;CACD"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipeline/scatter.ts"],"sourcesContent":["import type { AdvancedPipeline } from 'src/types'\nimport {\n initAdvancedVSeed,\n theme,\n pivotAdapter,\n annotation,\n markStyle,\n scatterConfig,\n encodingForScatter,\n buildMeasuresForScatter,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n encodingAdapter,\n defaultEncodingForScatter,\n deleteEncodingForMeasure,\n deleteTooltipAndLabelDimension,\n regressionLine,\n} from '../pipes'\nimport { reshapeWithScatterEncoding } from '../pipes/reshape/reshapeWithScatterEncoding'\nimport { pivotReshapeWithScatterEncoding } from '../pipes/reshape/pivotReshapeWithScatterEncoding'\n\nexport const scatterAdvancedPipeline: AdvancedPipeline = [\n initAdvancedVSeed,\n defaultMeasures,\n defaultDimensions,\n defaultMeasureName,\n\n encodingAdapter(\n [defaultEncodingForScatter, buildMeasuresForScatter],\n [\n encodingForScatter,\n buildMeasuresForScatter,\n deleteEncodingForMeasure(['tooltip', 'label', 'size']),\n deleteTooltipAndLabelDimension,\n ],\n ),\n pivotAdapter([reshapeWithScatterEncoding], [pivotReshapeWithScatterEncoding]),\n\n scatterConfig,\n theme,\n markStyle,\n annotation,\n regressionLine,\n]\n"],"names":["scatterAdvancedPipeline","initAdvancedVSeed","defaultMeasures","defaultDimensions","defaultMeasureName","encodingAdapter","defaultEncodingForScatter","buildMeasuresForScatter","encodingForScatter","deleteEncodingForMeasure","deleteTooltipAndLabelDimension","pivotAdapter","reshapeWithScatterEncoding","pivotReshapeWithScatterEncoding","scatterConfig","theme","markStyle","annotation","regressionLine"],"mappings":";;;AAsBO,MAAMA,0BAA4C;IACvDC;IACAC;IACAC;IACAC;IAEAC,gBACE;QAACC;QAA2BC;KAAwB,EACpD;QACEC;QACAD;QACAE,yBAAyB;YAAC;YAAW;YAAS;SAAO;QACrDC;KACD;IAEHC,aAAa;QAACC;KAA2B,EAAE;QAACC;KAAgC;IAE5EC;IACAC;IACAC;IACAC;IACAC;CACD"}
@@ -1,6 +1,33 @@
1
1
  const regressionLine = (advancedVSeed, context)=>{
2
2
  const { vseed } = context;
3
- if ('histogramRegressionLine' in vseed && 'histogram' === vseed.chartType) advancedVSeed.histogramRegressionLine = vseed.histogramRegressionLine;
3
+ let keys = [];
4
+ if ('histogram' === vseed.chartType) keys = [
5
+ 'kdeRegressionLine',
6
+ 'ecdfRegressionLine'
7
+ ];
8
+ else if ('scatter' === vseed.chartType) keys = [
9
+ 'linearRegressionLine',
10
+ 'lowessRegressionLine',
11
+ 'polynomialRegressionLine',
12
+ 'logisticRegressionLine'
13
+ ];
14
+ else if ('column' === vseed.chartType) keys = [
15
+ 'polynomialRegressionLine'
16
+ ];
17
+ if (keys.length) {
18
+ const regressionLineConfig = {};
19
+ let hasLine = false;
20
+ keys.forEach((key)=>{
21
+ if (vseed[key]) {
22
+ hasLine = true;
23
+ regressionLineConfig[key] = true === vseed[key] ? {} : vseed[key];
24
+ }
25
+ });
26
+ return hasLine ? {
27
+ ...advancedVSeed,
28
+ regressionLine: regressionLineConfig
29
+ } : advancedVSeed;
30
+ }
4
31
  return advancedVSeed;
5
32
  };
6
33
  export { regressionLine };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/regressionLine/regressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/regressionLine/regressionLine.ts"],"sourcesContent":["import type { AdvancedPipe } from 'src/types'\n\nexport const regressionLine: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n\n if ('histogramRegressionLine' in vseed && vseed.chartType === 'histogram') {\n advancedVSeed.histogramRegressionLine = vseed.histogramRegressionLine\n }\n\n return advancedVSeed\n}\n"],"names":["regressionLine","advancedVSeed","context","vseed"],"mappings":"AAEO,MAAMA,iBAA+B,CAACC,eAAeC;IAC1D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAElB,IAAI,6BAA6BC,SAASA,AAAoB,gBAApBA,MAAM,SAAS,EACvDF,cAAc,uBAAuB,GAAGE,MAAM,uBAAuB;IAGvE,OAAOF;AACT"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/regressionLine/regressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/regressionLine/regressionLine.ts"],"sourcesContent":["import type { AdvancedPipe, RegressionLineConfig } from 'src/types'\n\nexport const regressionLine: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n let keys = [] as string[]\n\n if (vseed.chartType === 'histogram') {\n keys = ['kdeRegressionLine', 'ecdfRegressionLine']\n } else if (vseed.chartType === 'scatter') {\n keys = ['linearRegressionLine', 'lowessRegressionLine', 'polynomialRegressionLine', 'logisticRegressionLine']\n } else if (vseed.chartType === 'column') {\n keys = ['polynomialRegressionLine']\n }\n\n if (keys.length) {\n const regressionLineConfig: RegressionLineConfig = {}\n let hasLine = false\n\n keys.forEach((key: string) => {\n if ((vseed as any)[key]) {\n hasLine = true\n regressionLineConfig[key as keyof RegressionLineConfig] =\n (vseed as any)[key] === true ? {} : (vseed as any)[key]\n }\n })\n\n return hasLine\n ? {\n ...advancedVSeed,\n regressionLine: regressionLineConfig,\n }\n : advancedVSeed\n }\n\n return advancedVSeed\n}\n"],"names":["regressionLine","advancedVSeed","context","vseed","keys","regressionLineConfig","hasLine","key"],"mappings":"AAEO,MAAMA,iBAA+B,CAACC,eAAeC;IAC1D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,IAAIE,OAAO,EAAE;IAEb,IAAID,AAAoB,gBAApBA,MAAM,SAAS,EACjBC,OAAO;QAAC;QAAqB;KAAqB;SAC7C,IAAID,AAAoB,cAApBA,MAAM,SAAS,EACxBC,OAAO;QAAC;QAAwB;QAAwB;QAA4B;KAAyB;SACxG,IAAID,AAAoB,aAApBA,MAAM,SAAS,EACxBC,OAAO;QAAC;KAA2B;IAGrC,IAAIA,KAAK,MAAM,EAAE;QACf,MAAMC,uBAA6C,CAAC;QACpD,IAAIC,UAAU;QAEdF,KAAK,OAAO,CAAC,CAACG;YACZ,IAAKJ,KAAa,CAACI,IAAI,EAAE;gBACvBD,UAAU;gBACVD,oBAAoB,CAACE,IAAkC,GACpDJ,AAAuB,SAAvBA,KAAa,CAACI,IAAI,GAAY,CAAC,IAAKJ,KAAa,CAACI,IAAI;YAC3D;QACF;QAEA,OAAOD,UACH;YACE,GAAGL,aAAa;YAChB,gBAAgBI;QAClB,IACAJ;IACN;IAEA,OAAOA;AACT"}
@@ -84,7 +84,6 @@ const pivotReshapeWithBoxplotEncoding = (advancedVSeed, context)=>{
84
84
  datasets.push(newDatasets);
85
85
  datasetReshapeInfo.push(reshapeInfo);
86
86
  });
87
- console.log(datasets);
88
87
  return {
89
88
  ...result,
90
89
  dataset: datasets,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.ts"],"sourcesContent":["import { boxplot } from '@visactor/vdataset'\nimport { uniqueBy } from 'remeda'\nimport {\n FoldMeasureId,\n FoldMeasureName,\n MaxMeasureId,\n MedianMeasureId,\n MinMeasureId,\n OutliersMeasureId,\n Q1MeasureValue,\n Q3MeasureValue,\n Separator,\n unfoldDimensions,\n} from 'src/dataReshape'\nimport type {\n AdvancedPipe,\n ColumnParallel,\n Dataset,\n DatasetReshapeInfo,\n Dimension,\n Encoding,\n MeasureGroup,\n} from 'src/types'\n\nexport const pivotReshapeWithBoxplotEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed\n const uniqDims = uniqueBy(dimensions, (item: Dimension) => item.id)\n const chartConfig = config?.[chartType as 'boxPlot']\n const whiskers = chartConfig?.whiskers\n\n const measureGroups: MeasureGroup[] = []\n if (measures) {\n measures.forEach((measure: MeasureGroup) => {\n if (measure.children && measure.children.length > 0) {\n measureGroups.push(measure)\n }\n })\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 datasets: Dataset = []\n const datasetReshapeInfo: DatasetReshapeInfo = []\n\n measureGroups.forEach((measureGroup, index) => {\n const subMeasures = measureGroup.children\n if (!subMeasures) {\n return\n }\n const groupId = measureGroup.id\n let newDatasets: any[] = []\n let foldInfo: any = {}\n let unfoldInfo: any = {}\n\n if (encoding.value?.length) {\n encoding.value.forEach((f) => {\n const m = subMeasures.find((m) => m.id === f)\n const boxPlotData = boxplot(dataset, {\n field: f,\n groupField: [\n ...(encoding.x ?? []),\n ...(encoding.color ?? []),\n ...rowColumnFields.map((item: Dimension) => item.id),\n ] as string[],\n whiskers,\n outputNames: {\n q1: Q1MeasureValue,\n q3: Q3MeasureValue,\n min: MinMeasureId,\n max: MaxMeasureId,\n median: MedianMeasureId,\n outliers: OutliersMeasureId,\n },\n }) as Dataset\n\n boxPlotData.forEach((datum) => {\n datum[FoldMeasureId] = f\n datum[FoldMeasureName] = m?.alias ?? f\n })\n\n const res = unfoldDimensions(boxPlotData, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((d) => {\n newDatasets.push(d)\n })\n unfoldInfo = res.unfoldInfo\n })\n } else if (\n encoding.q1?.length &&\n encoding.q3?.length &&\n encoding.min?.length &&\n encoding.max?.length &&\n encoding.median?.length\n ) {\n const res = unfoldDimensions(dataset, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((datum) => {\n datum[MaxMeasureId] = datum[encoding.max![0]]\n datum[MinMeasureId] = datum[encoding.min![0]]\n datum[Q1MeasureValue] = datum[encoding.q1![0]]\n datum[Q3MeasureValue] = datum[encoding.q3![0]]\n datum[MedianMeasureId] = datum[encoding.median![0]]\n })\n\n newDatasets = res.dataset\n foldInfo = {}\n unfoldInfo = res.unfoldInfo\n }\n\n const reshapeInfo = {\n id: groupId,\n index,\n foldInfo,\n unfoldInfo,\n }\n datasets.push(newDatasets)\n datasetReshapeInfo.push(reshapeInfo)\n })\n\n console.log(datasets)\n\n return {\n ...result,\n dataset: datasets,\n datasetReshapeInfo: datasetReshapeInfo,\n }\n}\n"],"names":["pivotReshapeWithBoxplotEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","config","uniqDims","uniqueBy","item","chartConfig","whiskers","measureGroups","measure","rowColumnFields","dim","datasets","datasetReshapeInfo","measureGroup","index","subMeasures","groupId","newDatasets","foldInfo","unfoldInfo","f","m","boxPlotData","boxplot","Q1MeasureValue","Q3MeasureValue","MinMeasureId","MaxMeasureId","MedianMeasureId","OutliersMeasureId","datum","FoldMeasureId","FoldMeasureName","res","unfoldDimensions","Separator","d","reshapeInfo","console"],"mappings":";;;AAwBO,MAAMA,kCAAgD,CAACC,eAAeC;IAC3E,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,WAAW,CAAC,CAAC,EAAEC,MAAM,EAAE,GAAGT;IAClE,MAAMU,WAAWC,SAASL,YAAY,CAACM,OAAoBA,KAAK,EAAE;IAClE,MAAMC,cAAcJ,QAAQ,CAACJ,UAAuB;IACpD,MAAMS,WAAWD,aAAa;IAE9B,MAAME,gBAAgC,EAAE;IACxC,IAAIR,UACFA,SAAS,OAAO,CAAC,CAACS;QAChB,IAAIA,QAAQ,QAAQ,IAAIA,QAAQ,QAAQ,CAAC,MAAM,GAAG,GAChDD,cAAc,IAAI,CAACC;IAEvB;IAGF,MAAMC,kBAAkBN,SACtBL,WAAW,MAAM,CAAC,CAACY,MAAmBA,AAAiB,UAAjBA,IAAI,QAAQ,IAAcA,AAAiB,aAAjBA,IAAI,QAAQ,GAC5E,CAACN,OAAoBA,KAAK,EAAE;IAE9B,MAAMO,WAAoB,EAAE;IAC5B,MAAMC,qBAAyC,EAAE;IAEjDL,cAAc,OAAO,CAAC,CAACM,cAAcC;QACnC,MAAMC,cAAcF,aAAa,QAAQ;QACzC,IAAI,CAACE,aACH;QAEF,MAAMC,UAAUH,aAAa,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B,KAAK,CAACJ,aAAa,GAAGI,KAAK,CAAC9B,SAAS,GAAI,CAAC,EAAE,CAAC;gBAC7C8B,KAAK,CAACN,eAAe,GAAGM,KAAK,CAAC9B,SAAS,EAAG,CAAC,EAAE,CAAC;gBAC9C8B,KAAK,CAACL,eAAe,GAAGK,KAAK,CAAC9B,SAAS,EAAG,CAAC,EAAE,CAAC;gBAC9C8B,KAAK,CAACF,gBAAgB,GAAGE,KAAK,CAAC9B,SAAS,MAAO,CAAC,EAAE,CAAC;YACrD;YAEAiB,cAAcgB,IAAI,OAAO;YACzBf,WAAW,CAAC;YACZC,aAAac,IAAI,UAAU;QAC7B;QAEA,MAAMI,cAAc;YAClB,IAAIrB;YACJF;YACAI;YACAC;QACF;QACAR,SAAS,IAAI,CAACM;QACdL,mBAAmB,IAAI,CAACyB;IAC1B;IAEAC,QAAQ,GAAG,CAAC3B;IAEZ,OAAO;QACL,GAAGjB,MAAM;QACT,SAASiB;QACT,oBAAoBC;IACtB;AACF"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.ts"],"sourcesContent":["import { boxplot } from '@visactor/vdataset'\nimport { uniqueBy } from 'remeda'\nimport {\n FoldMeasureId,\n FoldMeasureName,\n MaxMeasureId,\n MedianMeasureId,\n MinMeasureId,\n OutliersMeasureId,\n Q1MeasureValue,\n Q3MeasureValue,\n Separator,\n unfoldDimensions,\n} from 'src/dataReshape'\nimport type {\n AdvancedPipe,\n ColumnParallel,\n Dataset,\n DatasetReshapeInfo,\n Dimension,\n Encoding,\n MeasureGroup,\n} from 'src/types'\n\nexport const pivotReshapeWithBoxplotEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding = {}, config } = advancedVSeed\n const uniqDims = uniqueBy(dimensions, (item: Dimension) => item.id)\n const chartConfig = config?.[chartType as 'boxPlot']\n const whiskers = chartConfig?.whiskers\n\n const measureGroups: MeasureGroup[] = []\n if (measures) {\n measures.forEach((measure: MeasureGroup) => {\n if (measure.children && measure.children.length > 0) {\n measureGroups.push(measure)\n }\n })\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 datasets: Dataset = []\n const datasetReshapeInfo: DatasetReshapeInfo = []\n\n measureGroups.forEach((measureGroup, index) => {\n const subMeasures = measureGroup.children\n if (!subMeasures) {\n return\n }\n const groupId = measureGroup.id\n let newDatasets: any[] = []\n let foldInfo: any = {}\n let unfoldInfo: any = {}\n\n if (encoding.value?.length) {\n encoding.value.forEach((f) => {\n const m = subMeasures.find((m) => m.id === f)\n const boxPlotData = boxplot(dataset, {\n field: f,\n groupField: [\n ...(encoding.x ?? []),\n ...(encoding.color ?? []),\n ...rowColumnFields.map((item: Dimension) => item.id),\n ] as string[],\n whiskers,\n outputNames: {\n q1: Q1MeasureValue,\n q3: Q3MeasureValue,\n min: MinMeasureId,\n max: MaxMeasureId,\n median: MedianMeasureId,\n outliers: OutliersMeasureId,\n },\n }) as Dataset\n\n boxPlotData.forEach((datum) => {\n datum[FoldMeasureId] = f\n datum[FoldMeasureName] = m?.alias ?? f\n })\n\n const res = unfoldDimensions(boxPlotData, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((d) => {\n newDatasets.push(d)\n })\n unfoldInfo = res.unfoldInfo\n })\n } else if (\n encoding.q1?.length &&\n encoding.q3?.length &&\n encoding.min?.length &&\n encoding.max?.length &&\n encoding.median?.length\n ) {\n const res = unfoldDimensions(dataset, uniqDims, encoding as Encoding, {\n foldMeasureId: FoldMeasureId,\n separator: Separator,\n colorItemAsId: false,\n })\n\n res.dataset.forEach((datum) => {\n datum[MaxMeasureId] = datum[encoding.max![0]]\n datum[MinMeasureId] = datum[encoding.min![0]]\n datum[Q1MeasureValue] = datum[encoding.q1![0]]\n datum[Q3MeasureValue] = datum[encoding.q3![0]]\n datum[MedianMeasureId] = datum[encoding.median![0]]\n })\n\n newDatasets = res.dataset\n foldInfo = {}\n unfoldInfo = res.unfoldInfo\n }\n\n const reshapeInfo = {\n id: groupId,\n index,\n foldInfo,\n unfoldInfo,\n }\n datasets.push(newDatasets)\n datasetReshapeInfo.push(reshapeInfo)\n })\n\n return {\n ...result,\n dataset: datasets,\n datasetReshapeInfo: datasetReshapeInfo,\n }\n}\n"],"names":["pivotReshapeWithBoxplotEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","config","uniqDims","uniqueBy","item","chartConfig","whiskers","measureGroups","measure","rowColumnFields","dim","datasets","datasetReshapeInfo","measureGroup","index","subMeasures","groupId","newDatasets","foldInfo","unfoldInfo","f","m","boxPlotData","boxplot","Q1MeasureValue","Q3MeasureValue","MinMeasureId","MaxMeasureId","MedianMeasureId","OutliersMeasureId","datum","FoldMeasureId","FoldMeasureName","res","unfoldDimensions","Separator","d","reshapeInfo"],"mappings":";;;AAwBO,MAAMA,kCAAgD,CAACC,eAAeC;IAC3E,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,WAAW,CAAC,CAAC,EAAEC,MAAM,EAAE,GAAGT;IAClE,MAAMU,WAAWC,SAASL,YAAY,CAACM,OAAoBA,KAAK,EAAE;IAClE,MAAMC,cAAcJ,QAAQ,CAACJ,UAAuB;IACpD,MAAMS,WAAWD,aAAa;IAE9B,MAAME,gBAAgC,EAAE;IACxC,IAAIR,UACFA,SAAS,OAAO,CAAC,CAACS;QAChB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,CAACG;gBACnBnB,YAAY,IAAI,CAACmB;YACnB;YACAjB,aAAac,IAAI,UAAU;QAC7B;aACK,IACLjC,SAAS,EAAE,EAAE,UACbA,SAAS,EAAE,EAAE,UACbA,SAAS,GAAG,EAAE,UACdA,SAAS,GAAG,EAAE,UACdA,SAAS,MAAM,EAAE,QACjB;YACA,MAAMiC,MAAMC,iBAAiBtC,SAASM,UAAUF,UAAsB;gBACpE,eAAe+B;gBACf,WAAWI;gBACX,eAAe;YACjB;YAEAF,IAAI,OAAO,CAAC,OAAO,CAAC,CAACH;gBACnBA,KAAK,CAACH,aAAa,GAAGG,KAAK,CAAC9B,SAAS,GAAI,CAAC,EAAE,CAAC;gBAC7C8B,KAAK,CAACJ,aAAa,GAAGI,KAAK,CAAC9B,SAAS,GAAI,CAAC,EAAE,CAAC;gBAC7C8B,KAAK,CAACN,eAAe,GAAGM,KAAK,CAAC9B,SAAS,EAAG,CAAC,EAAE,CAAC;gBAC9C8B,KAAK,CAACL,eAAe,GAAGK,KAAK,CAAC9B,SAAS,EAAG,CAAC,EAAE,CAAC;gBAC9C8B,KAAK,CAACF,gBAAgB,GAAGE,KAAK,CAAC9B,SAAS,MAAO,CAAC,EAAE,CAAC;YACrD;YAEAiB,cAAcgB,IAAI,OAAO;YACzBf,WAAW,CAAC;YACZC,aAAac,IAAI,UAAU;QAC7B;QAEA,MAAMI,cAAc;YAClB,IAAIrB;YACJF;YACAI;YACAC;QACF;QACAR,SAAS,IAAI,CAACM;QACdL,mBAAmB,IAAI,CAACyB;IAC1B;IAEA,OAAO;QACL,GAAG3C,MAAM;QACT,SAASiB;QACT,oBAAoBC;IACtB;AACF"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetXY, discreteLegend, initColumn, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, columnPolynomialRegressionLine, datasetPivot, datasetXY, discreteLegend, initColumn, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
2
2
  const column = [
3
3
  initColumn,
4
4
  stackCornerRadius,
@@ -18,7 +18,8 @@ const column = [
18
18
  annotationPoint,
19
19
  annotationVerticalLine,
20
20
  annotationHorizontalLine,
21
- annotationAreaBand
21
+ annotationAreaBand,
22
+ columnPolynomialRegressionLine
22
23
  ];
23
24
  const pivotColumn = [
24
25
  initPivot,
@@ -42,7 +43,8 @@ const pivotColumn = [
42
43
  annotationPoint,
43
44
  annotationVerticalLine,
44
45
  annotationHorizontalLine,
45
- annotationAreaBand
46
+ annotationAreaBand,
47
+ columnPolynomialRegressionLine
46
48
  ]),
47
49
  pivotRowDimensions,
48
50
  pivotColumnDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/column.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n initColumn,\n datasetXY,\n xBand,\n yLinear,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n} from '../pipes'\n\nconst column: SpecPipeline = [\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n verticalCrosshairRect,\n colorAdapter(discreteLegend, colorLegend),\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotColumn: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initColumn,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const columnSpecPipeline = [pivotAdapter(column, pivotColumn)]\n"],"names":["column","initColumn","stackCornerRadius","barMaxWidth","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","tooltip","verticalCrosshairRect","discreteLegend","colorLegend","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotColumn","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","columnSpecPipeline","pivotAdapter"],"mappings":";AAqCA,MAAMA,SAAuB;IAC3BC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAA4B;IAChCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd5B;QACAC;QACAE;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA1B,aAAa2B,qBAAqBC;CACnC;AAEM,MAAMC,qBAAqB;IAACC,aAAanC,QAAQwB;CAAa"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/column.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n initColumn,\n datasetXY,\n xBand,\n yLinear,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n columnPolynomialRegressionLine,\n} from '../pipes'\n\nconst column: SpecPipeline = [\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n verticalCrosshairRect,\n colorAdapter(discreteLegend, colorLegend),\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n]\n\nconst pivotColumn: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initColumn,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const columnSpecPipeline = [pivotAdapter(column, pivotColumn)]\n"],"names":["column","initColumn","stackCornerRadius","barMaxWidth","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","tooltip","verticalCrosshairRect","discreteLegend","colorLegend","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","columnPolynomialRegressionLine","pivotColumn","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","columnSpecPipeline","pivotAdapter"],"mappings":";AAsCA,MAAMA,SAAuB;IAC3BC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAA4B;IAChCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd7B;QACAC;QACAE;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA3B,aAAa4B,qBAAqBC;CACnC;AAEM,MAAMC,qBAAqB;IAACC,aAAapC,QAAQyB;CAAa"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetHistogram, datasetPivot, discreteLegend, histogramRegressionLine, initHistogram, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, progressive, tooltipHistogram, verticalCrosshairRect, xLinear, yLinear } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetHistogram, datasetPivot, discreteLegend, ecdfRegressionLine, initHistogram, initPivot, kdeRegressionLine, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotRowDimensions, progressive, tooltipHistogram, verticalCrosshairRect, xLinear, yLinear } from "../pipes/index.js";
2
2
  const histogram = [
3
3
  initHistogram,
4
4
  colorAdapter(color, linearColor),
@@ -16,7 +16,8 @@ const histogram = [
16
16
  annotationVerticalLine,
17
17
  annotationHorizontalLine,
18
18
  annotationAreaBand,
19
- histogramRegressionLine
19
+ kdeRegressionLine,
20
+ ecdfRegressionLine
20
21
  ];
21
22
  const pivotHistogram = [
22
23
  initPivot,
@@ -38,7 +39,8 @@ const pivotHistogram = [
38
39
  annotationVerticalLine,
39
40
  annotationHorizontalLine,
40
41
  annotationAreaBand,
41
- histogramRegressionLine
42
+ kdeRegressionLine,
43
+ ecdfRegressionLine
42
44
  ]),
43
45
  pivotRowDimensions,
44
46
  pivotColumnDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/histogram.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n xLinear,\n backgroundColor,\n label,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n datasetHistogram,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n initHistogram,\n yLinear,\n verticalCrosshairRect,\n tooltipHistogram,\n histogramRegressionLine,\n} from '../pipes'\n\nconst histogram: SpecPipeline = [\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n histogramRegressionLine,\n]\n\nconst pivotHistogram: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorBarStyleFill(barStyle),\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n histogramRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const histogramSpecPipeline: SpecPipeline = [pivotAdapter(histogram, pivotHistogram)]\n"],"names":["histogram","initHistogram","colorAdapter","color","linearColor","backgroundColor","datasetHistogram","progressive","xLinear","yLinear","label","tooltipHistogram","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","histogramRegressionLine","pivotHistogram","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","histogramSpecPipeline","pivotAdapter"],"mappings":";AAkCA,MAAMA,YAA0B;IAC9BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,iBAA+B;IACnCC;IACAC;IACAC;IACAC,gBAAgB;QACdzB;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;KACD;IACDM;IACAC;IACA1B,aAAa2B,qBAAqBC;CACnC;AAEM,MAAMC,wBAAsC;IAACC,aAAahC,WAAWsB;CAAgB"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/histogram.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n xLinear,\n backgroundColor,\n label,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n datasetHistogram,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n initHistogram,\n yLinear,\n verticalCrosshairRect,\n tooltipHistogram,\n kdeRegressionLine,\n ecdfRegressionLine,\n} from '../pipes'\n\nconst histogram: SpecPipeline = [\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n kdeRegressionLine,\n ecdfRegressionLine,\n]\n\nconst pivotHistogram: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n datasetPivot,\n pivotIndicators([\n initHistogram,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetHistogram,\n progressive,\n xLinear,\n yLinear,\n label,\n tooltipHistogram,\n colorBarStyleFill(barStyle),\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n kdeRegressionLine,\n ecdfRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const histogramSpecPipeline: SpecPipeline = [pivotAdapter(histogram, pivotHistogram)]\n"],"names":["histogram","initHistogram","colorAdapter","color","linearColor","backgroundColor","datasetHistogram","progressive","xLinear","yLinear","label","tooltipHistogram","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","kdeRegressionLine","ecdfRegressionLine","pivotHistogram","initPivot","pivotGridStyle","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","histogramSpecPipeline","pivotAdapter"],"mappings":";AAmCA,MAAMA,YAA0B;IAC9BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,iBAA+B;IACnCC;IACAC;IACAC;IACAC,gBAAgB;QACd1B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDM;IACAC;IACA3B,aAAa4B,qBAAqBC;CACnC;AAEM,MAAMC,wBAAsC;IAACC,aAAajC,WAAWuB;CAAgB"}
@@ -1,4 +1,4 @@
1
- import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateHover, pointStyle, progressive, scatterSize, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
1
+ import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, linearRegressionLine, logisticRegressionLine, lowessRegressionLine, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateHover, pointStyle, polynomialRegressionLine, progressive, scatterSize, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
2
2
  const scatter = [
3
3
  initScatter,
4
4
  colorAdapter(color, linearColor),
@@ -18,7 +18,11 @@ const scatter = [
18
18
  annotationPoint,
19
19
  annotationVerticalLine,
20
20
  annotationHorizontalLine,
21
- annotationArea
21
+ annotationArea,
22
+ linearRegressionLine,
23
+ lowessRegressionLine,
24
+ polynomialRegressionLine,
25
+ logisticRegressionLine
22
26
  ];
23
27
  const pivotScatter = [
24
28
  initPivot,
@@ -43,7 +47,9 @@ const pivotScatter = [
43
47
  annotationPoint,
44
48
  annotationVerticalLine,
45
49
  annotationHorizontalLine,
46
- annotationArea
50
+ annotationArea,
51
+ linearRegressionLine,
52
+ lowessRegressionLine
47
53
  ]),
48
54
  pivotRowDimensions,
49
55
  pivotColumnDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";AAqCA,MAAMA,UAAwB;IAC5BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd5B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA7B,aAAa8B,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAanC,SAASwB;CAAc"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","linearRegressionLine","lowessRegressionLine","polynomialRegressionLine","logisticRegressionLine","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";AAyCA,MAAMA,UAAwB;IAC5BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDS;IACAC;IACAjC,aAAakC,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAavC,SAAS4B;CAAc"}
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../../types';
2
+ export declare const columnPolynomialRegressionLine: SpecPipe;
@@ -0,0 +1,150 @@
1
+ import { isNullish } from "remeda";
2
+ import { array, clamper, regressionPolynomial } from "@visactor/vutils";
3
+ import { defaultRegressionLineColor } from "./common.js";
4
+ const columnPolynomialRegressionLine = (spec, context)=>{
5
+ const result = {
6
+ ...spec
7
+ };
8
+ const { advancedVSeed } = context;
9
+ const { chartType, regressionLine } = advancedVSeed;
10
+ const lineTheme = advancedVSeed.config[chartType]?.regressionLine;
11
+ if (!regressionLine || !regressionLine.polynomialRegressionLine) return result;
12
+ const lineList = array(regressionLine.polynomialRegressionLine);
13
+ if (!result.customMark) result.customMark = [];
14
+ lineList.forEach((line, lineIndex)=>{
15
+ const theme = lineTheme.linearRegressionLine ?? {};
16
+ const { color, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight, confidenceIntervalOpacity, confidenceIntervalVisible = theme.confidenceIntervalVisible } = line;
17
+ const childrenMarks = [];
18
+ result.customMark.push({
19
+ type: 'group',
20
+ interactive: false,
21
+ zIndex: 500,
22
+ name: `polynomialRegressionLine-${lineIndex}`,
23
+ style: {
24
+ data: (datum, ctx)=>{
25
+ const vchart = ctx.vchart;
26
+ const chart = vchart.getChart();
27
+ const s = chart.getAllSeries()[0];
28
+ if (s) {
29
+ const rect = s.getRegion().getLayoutRect();
30
+ if (0 === rect.width || 0 === rect.height) return null;
31
+ const start = s.getRegion().getLayoutStartPoint();
32
+ const yClamper = clamper(start.y, start.y + rect.height);
33
+ const data = s.getViewData()?.latestData;
34
+ const fieldX = s.fieldX?.[0];
35
+ const fieldY = s.fieldY?.[0];
36
+ const xValues = s.getRawDataStatisticsByField(fieldX).values;
37
+ if (!fieldX || !fieldY || !data || data.length <= 2 || xValues.length <= 2) return null;
38
+ const { confidenceInterval, evaluateGrid } = regressionPolynomial(xValues.map((xVal, index)=>{
39
+ const filteredData = data.filter((d)=>d[fieldX] === xVal);
40
+ return {
41
+ x: index,
42
+ y: Math.max(...filteredData.map((d)=>d[fieldY]))
43
+ };
44
+ }), void 0, void 0, {
45
+ degree: line.degree ?? 2
46
+ });
47
+ const N = xValues.length;
48
+ const xAxisHelper = s.getXAxisHelper();
49
+ const halfBandWidth = xAxisHelper ? xAxisHelper.getBandwidth(0) / 2 : 0;
50
+ const lineData = evaluateGrid(N);
51
+ const linePoints = lineData.map((datum, index)=>{
52
+ const d = {
53
+ [fieldX]: xValues[index],
54
+ [fieldY]: datum.y
55
+ };
56
+ return {
57
+ x: s.dataToPositionX(d) + start.x + halfBandWidth,
58
+ y: yClamper(s.dataToPositionY(d) + start.y)
59
+ };
60
+ });
61
+ const result = {
62
+ linePoints,
63
+ color: s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0])
64
+ };
65
+ if (confidenceIntervalVisible) {
66
+ const intervalData = confidenceInterval(N);
67
+ result.areaPoints = intervalData.map((datum, index)=>{
68
+ const d = {
69
+ [fieldX]: xValues[index],
70
+ [fieldY]: datum.lower
71
+ };
72
+ return {
73
+ x: s.dataToPositionX(d) + start.x + halfBandWidth,
74
+ y: yClamper(s.dataToPositionY(d) + start.y),
75
+ y1: yClamper(s.dataToPositionY({
76
+ [fieldY]: datum.upper
77
+ }) + start.y)
78
+ };
79
+ });
80
+ }
81
+ return result;
82
+ }
83
+ return null;
84
+ }
85
+ },
86
+ children: childrenMarks
87
+ });
88
+ if (confidenceIntervalVisible) childrenMarks.push({
89
+ type: 'area',
90
+ interactive: false,
91
+ zIndex: 500,
92
+ style: {
93
+ lineWidth: lineWidth ?? theme.lineWidth,
94
+ lineDash: lineDash ?? theme.lineDash,
95
+ fillOpacity: confidenceIntervalOpacity ?? theme.confidenceIntervalOpacity,
96
+ fill: color ?? defaultRegressionLineColor,
97
+ points: (datum, ctx, opt)=>{
98
+ const parentNode = opt.mark?._product?.parent;
99
+ if (parentNode?.attribute?.data) return parentNode.attribute.data.areaPoints;
100
+ return [];
101
+ }
102
+ }
103
+ });
104
+ childrenMarks.push({
105
+ type: 'line',
106
+ interactive: false,
107
+ zIndex: 500,
108
+ style: {
109
+ lineWidth: lineWidth ?? theme.lineWidth,
110
+ lineDash: lineDash ?? theme.lineDash,
111
+ stroke: color ?? defaultRegressionLineColor,
112
+ points: (datum, ctx, opt)=>{
113
+ const parentNode = opt.mark?._product?.parent;
114
+ if (parentNode?.attribute?.data) return parentNode.attribute.data.linePoints;
115
+ return [];
116
+ }
117
+ }
118
+ });
119
+ if (!isNullish(text)) childrenMarks.push({
120
+ type: 'text',
121
+ interactive: false,
122
+ zIndex: 500,
123
+ style: {
124
+ textAlign: 'end',
125
+ fill: textColor ?? theme.textColor,
126
+ fontSize: textFontSize ?? theme.textFontSize,
127
+ fontWeight: textFontWeight ?? theme.textFontWeight,
128
+ text: text,
129
+ x: (datum, ctx, opt)=>{
130
+ const parentNode = opt.mark?._product?.parent;
131
+ if (parentNode?.attribute?.data?.linePoints) {
132
+ const points = parentNode.attribute.data.linePoints;
133
+ return points[points.length - 1]?.x;
134
+ }
135
+ },
136
+ y: (datum, ctx, opt)=>{
137
+ const parentNode = opt.mark?._product?.parent;
138
+ if (parentNode?.attribute?.data?.linePoints) {
139
+ const points = parentNode.attribute.data.linePoints;
140
+ return points[points.length - 1]?.y;
141
+ }
142
+ }
143
+ }
144
+ });
145
+ });
146
+ return result;
147
+ };
148
+ export { columnPolynomialRegressionLine };
149
+
150
+ //# sourceMappingURL=columnRegressionLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.ts"],"sourcesContent":["import type { IBarChartSpec, ICartesianSeries, IChart, IVChart } from '@visactor/vchart'\nimport { isNullish } from 'remeda'\nimport { array, clamper, regressionPolynomial } from '@visactor/vutils'\nimport type { Datum, SpecPipe, RegressionLineConfig, LinearRegressionLine, PolynomialRegressionLine } from 'src/types'\nimport { defaultRegressionLineColor } from './common'\n\nexport const columnPolynomialRegressionLine: SpecPipe = (spec, context): Partial<IBarChartSpec> => {\n const result = { ...spec } as Partial<IBarChartSpec>\n const { advancedVSeed } = context\n const { chartType, regressionLine } = advancedVSeed\n const lineTheme = advancedVSeed.config[chartType as 'scatter']?.regressionLine as RegressionLineConfig\n\n if (!regressionLine || !regressionLine.polynomialRegressionLine) {\n return result\n }\n\n const lineList = array(regressionLine.polynomialRegressionLine)\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n lineList.forEach((line, lineIndex) => {\n const theme = (lineTheme.linearRegressionLine ?? {}) as LinearRegressionLine\n const {\n color,\n lineWidth,\n lineDash,\n text,\n textColor,\n textFontSize,\n textFontWeight,\n confidenceIntervalOpacity,\n confidenceIntervalVisible = theme.confidenceIntervalVisible,\n } = line as LinearRegressionLine\n\n const childrenMarks: any[] = []\n\n ;(result.customMark as any[]).push({\n type: 'group',\n interactive: false,\n zIndex: 500,\n name: `polynomialRegressionLine-${lineIndex}`,\n style: {\n data: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const s = chart.getAllSeries()[0] as ICartesianSeries\n\n if (s) {\n const rect = s.getRegion().getLayoutRect()\n\n if (rect.width === 0 || rect.height === 0) {\n return null\n }\n\n const start = s.getRegion().getLayoutStartPoint()\n const yClamper = clamper(start.y, start.y + rect.height)\n const data = s.getViewData()?.latestData as Datum[]\n const fieldX = s.fieldX?.[0]\n const fieldY = s.fieldY?.[0]\n const xValues = s.getRawDataStatisticsByField(fieldX).values as string[]\n\n if (!fieldX || !fieldY || !data || data.length <= 2 || xValues.length <= 2) {\n return null\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { confidenceInterval, evaluateGrid } = regressionPolynomial(\n xValues.map((xVal, index: number) => {\n const filteredData = data.filter((d) => d[fieldX] === xVal)\n\n return {\n x: index,\n y: Math.max(...filteredData.map((d) => d[fieldY] as number)),\n }\n }),\n undefined,\n undefined,\n {\n degree: (line as PolynomialRegressionLine).degree ?? 2,\n },\n )\n const N = xValues.length\n const xAxisHelper = s.getXAxisHelper()\n const halfBandWidth = xAxisHelper ? xAxisHelper.getBandwidth!(0) / 2 : 0\n const lineData = evaluateGrid(N)\n const linePoints = lineData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.y }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n }\n })\n const result: {\n linePoints: { x: number; y: number }[]\n areaPoints?: { x: number; y: number; y1: number }[]\n color: string\n } = {\n linePoints,\n color: s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0]),\n }\n\n if (confidenceIntervalVisible) {\n const intervalData = confidenceInterval(N)\n\n result.areaPoints = intervalData.map((datum: Datum, index: number) => {\n const d = { [fieldX]: xValues[index], [fieldY]: datum.lower }\n return {\n x: s.dataToPositionX(d)! + start.x + halfBandWidth,\n y: yClamper(s.dataToPositionY(d)! + start.y),\n y1: yClamper(s.dataToPositionY({ [fieldY]: datum.upper })! + start.y),\n }\n })\n }\n\n return result\n }\n return null\n },\n },\n children: childrenMarks,\n })\n\n if (confidenceIntervalVisible) {\n childrenMarks.push({\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n fillOpacity: confidenceIntervalOpacity ?? theme.confidenceIntervalOpacity,\n fill: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.areaPoints\n }\n\n return []\n },\n },\n })\n }\n\n childrenMarks.push({\n type: 'line',\n interactive: false,\n zIndex: 500,\n style: {\n lineWidth: lineWidth ?? theme.lineWidth,\n lineDash: lineDash ?? theme.lineDash,\n stroke: color ?? defaultRegressionLineColor,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return parentNode.attribute.data.linePoints\n }\n\n return []\n },\n },\n })\n\n if (!isNullish(text)) {\n childrenMarks.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, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.x\n }\n\n return undefined\n },\n y: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.y\n }\n\n return undefined\n },\n },\n })\n }\n })\n\n return result\n}\n"],"names":["columnPolynomialRegressionLine","spec","context","result","advancedVSeed","chartType","regressionLine","lineTheme","lineList","array","line","lineIndex","theme","color","lineWidth","lineDash","text","textColor","textFontSize","textFontWeight","confidenceIntervalOpacity","confidenceIntervalVisible","childrenMarks","datum","ctx","vchart","chart","s","rect","start","yClamper","clamper","data","fieldX","fieldY","xValues","confidenceInterval","evaluateGrid","regressionPolynomial","xVal","index","filteredData","d","Math","undefined","N","xAxisHelper","halfBandWidth","lineData","linePoints","intervalData","defaultRegressionLineColor","opt","parentNode","isNullish","points"],"mappings":";;;AAMO,MAAMA,iCAA2C,CAACC,MAAMC;IAC7D,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,SAAS,EAAEC,cAAc,EAAE,GAAGF;IACtC,MAAMG,YAAYH,cAAc,MAAM,CAACC,UAAuB,EAAE;IAEhE,IAAI,CAACC,kBAAkB,CAACA,eAAe,wBAAwB,EAC7D,OAAOH;IAGT,MAAMK,WAAWC,MAAMH,eAAe,wBAAwB;IAE9D,IAAI,CAACH,OAAO,UAAU,EACpBA,OAAO,UAAU,GAAG,EAAE;IAGxBK,SAAS,OAAO,CAAC,CAACE,MAAMC;QACtB,MAAMC,QAASL,UAAU,oBAAoB,IAAI,CAAC;QAClD,MAAM,EACJM,KAAK,EACLC,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,yBAAyB,EACzBC,4BAA4BT,MAAM,yBAAyB,EAC5D,GAAGF;QAEJ,MAAMY,gBAAuB,EAAE;QAE7BnB,OAAO,UAAU,CAAW,IAAI,CAAC;YACjC,MAAM;YACN,aAAa;YACb,QAAQ;YACR,MAAM,CA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,CAAC,UAAU;wBACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;oBACpC;gBAGF;YACF;QACF;IAEJ;IAEA,OAAOpD;AACT"}
@@ -0,0 +1,4 @@
1
+ import type { Datum } from '@visactor/vchart';
2
+ export declare const defaultRegressionLineColor: (datum: Datum, ctx: any, opt: any) => string | undefined;
3
+ export declare const defaultRegressionLineLabelX: (datum: any, ctx: any, opt: any) => any;
4
+ export declare const defaultRegressionLineLabelY: (datum: any, ctx: any, opt: any) => any;
@@ -0,0 +1,21 @@
1
+ const defaultRegressionLineColor = (datum, ctx, opt)=>{
2
+ const parentNode = opt.mark?._product?.parent;
3
+ if (parentNode?.attribute?.data) return parentNode.attribute.data.color;
4
+ };
5
+ const defaultRegressionLineLabelX = (datum, ctx, opt)=>{
6
+ const parentNode = opt.mark?._product?.parent;
7
+ if (parentNode?.attribute?.data?.linePoints) {
8
+ const points = parentNode.attribute.data.linePoints;
9
+ return points[points.length - 1]?.x;
10
+ }
11
+ };
12
+ const defaultRegressionLineLabelY = (datum, ctx, opt)=>{
13
+ const parentNode = opt.mark?._product?.parent;
14
+ if (parentNode?.attribute?.data?.linePoints) {
15
+ const points = parentNode.attribute.data.linePoints;
16
+ return points[points.length - 1]?.y;
17
+ }
18
+ };
19
+ export { defaultRegressionLineColor, defaultRegressionLineLabelX, defaultRegressionLineLabelY };
20
+
21
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/regressionLine/common.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/regressionLine/common.ts"],"sourcesContent":["import type { Datum } from '@visactor/vchart'\n\nexport const defaultRegressionLineColor = (datum: Datum, ctx: any, opt: any): string | undefined => {\n const parentNode = opt.mark?._product?.parent\n if (parentNode?.attribute?.data) {\n return parentNode.attribute.data.color\n }\n return undefined\n}\n\nexport const defaultRegressionLineLabelX = (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.x\n }\n\n return undefined\n}\n\nexport const defaultRegressionLineLabelY = (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.data?.linePoints) {\n const points = parentNode.attribute.data.linePoints\n return points[points.length - 1]?.y\n }\n\n return undefined\n}\n"],"names":["defaultRegressionLineColor","datum","ctx","opt","parentNode","defaultRegressionLineLabelX","points","defaultRegressionLineLabelY"],"mappings":"AAEO,MAAMA,6BAA6B,CAACC,OAAcC,KAAUC;IACjE,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;IACvC,IAAIC,YAAY,WAAW,MACzB,OAAOA,WAAW,SAAS,CAAC,IAAI,CAAC,KAAK;AAG1C;AAEO,MAAMC,8BAA8B,CAACJ,OAAYC,KAAUC;IAChE,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;IAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;QAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;QACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;IACpC;AAGF;AAEO,MAAMC,8BAA8B,CAACN,OAAYC,KAAUC;IAChE,MAAMC,aAAaD,IAAI,IAAI,EAAE,UAAU;IAEvC,IAAIC,YAAY,WAAW,MAAM,YAAY;QAC3C,MAAME,SAASF,WAAW,SAAS,CAAC,IAAI,CAAC,UAAU;QACnD,OAAOE,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE,EAAE;IACpC;AAGF"}
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../../types';
2
+ export declare const ecdfRegressionLine: SpecPipe;
@@ -0,0 +1,98 @@
1
+ import { isNullish, uniqueBy } from "remeda";
2
+ import { array, ecdf } from "@visactor/vutils";
3
+ import { defaultRegressionLineColor, defaultRegressionLineLabelX, defaultRegressionLineLabelY } from "./common.js";
4
+ const ecdfRegressionLine = (spec, context)=>{
5
+ const result = {
6
+ ...spec
7
+ };
8
+ const { advancedVSeed, vseed } = context;
9
+ const { chartType, encoding = {}, dimensions, regressionLine } = advancedVSeed;
10
+ const { dataset } = vseed;
11
+ const lineTheme = advancedVSeed.config[chartType]?.regressionLine;
12
+ if (!regressionLine || !regressionLine.ecdfRegressionLine) return result;
13
+ const rowColumnFields = uniqueBy(dimensions.filter((dim)=>'row' === dim.encoding || 'column' === dim.encoding), (item)=>item.id);
14
+ const lineList = array(regressionLine.ecdfRegressionLine);
15
+ if (!result.customMark) result.customMark = [];
16
+ lineList.forEach((line, lineIndex)=>{
17
+ const theme = lineTheme?.ecdfRegressionLine ?? {};
18
+ const { color, lineWidth, lineDash, text, textColor, textFontSize, textFontWeight } = line;
19
+ const childrenMarks = [];
20
+ result.customMark.push({
21
+ type: 'group',
22
+ interactive: false,
23
+ zIndex: 500,
24
+ name: `ecdfRegressionLine-${lineIndex}`,
25
+ style: {
26
+ data: (datum, ctx)=>{
27
+ const vchart = ctx.vchart;
28
+ const chart = vchart.getChart();
29
+ const series = chart.getAllSeries().filter((s)=>'bar' === s.type);
30
+ if (series && series.length) {
31
+ const s = series[0];
32
+ const region = s.getRegion().getLayoutStartPoint();
33
+ const fieldX = s.fieldX?.[0];
34
+ const scaleY = s.getYAxisHelper().getScale?.(0);
35
+ const viewData = s.getViewData()?.latestData;
36
+ if (!dataset || !dataset.length || !viewData || !viewData.length || !scaleY) return null;
37
+ const simpleData = dataset.filter((entry)=>rowColumnFields.length ? rowColumnFields.every((dim)=>entry[dim.id] === viewData[0][dim.id]) : true).map((d)=>d[encoding.value?.[0]]);
38
+ const res = ecdf(simpleData);
39
+ const N = Math.max(3, Math.floor(simpleData.length / 4));
40
+ const lineData = res.evaluateGrid(N);
41
+ const yRange = scaleY.range();
42
+ const y0 = yRange[0];
43
+ const y1 = yRange[yRange.length - 1];
44
+ const scaleR = (e)=>y0 + (y1 - y0) * e;
45
+ const linePoints = lineData.map((ld)=>{
46
+ const d = {
47
+ [fieldX]: ld.x
48
+ };
49
+ return {
50
+ x: s.dataToPositionX(d) + region.x,
51
+ y: scaleR(ld.y) + region.y
52
+ };
53
+ });
54
+ return {
55
+ linePoints,
56
+ color: color ?? s.getOption().globalScale.getScale('color')?.scale(s.getSeriesKeys()[0])
57
+ };
58
+ }
59
+ return null;
60
+ }
61
+ },
62
+ children: childrenMarks
63
+ });
64
+ childrenMarks.push({
65
+ type: 'line',
66
+ interactive: false,
67
+ zIndex: 500,
68
+ style: {
69
+ lineWidth: lineWidth ?? theme.lineWidth,
70
+ lineDash: lineDash ?? theme.lineDash,
71
+ stroke: color ?? defaultRegressionLineColor,
72
+ points: (datum, ctx, opt)=>{
73
+ const parentNode = opt.mark?._product?.parent;
74
+ if (parentNode?.attribute?.data) return parentNode.attribute.data.linePoints;
75
+ return [];
76
+ }
77
+ }
78
+ });
79
+ if (!isNullish(text)) childrenMarks.push({
80
+ type: 'text',
81
+ interactive: false,
82
+ zIndex: 500,
83
+ style: {
84
+ textAlign: 'end',
85
+ fill: textColor ?? theme.textColor,
86
+ fontSize: textFontSize ?? theme.textFontSize,
87
+ fontWeight: textFontWeight ?? theme.textFontWeight,
88
+ text: text,
89
+ x: defaultRegressionLineLabelX,
90
+ y: defaultRegressionLineLabelY
91
+ }
92
+ });
93
+ });
94
+ return result;
95
+ };
96
+ export { ecdfRegressionLine };
97
+
98
+ //# sourceMappingURL=ecdfRegressionLine.js.map