@visactor/vseed 0.1.49 → 0.1.51
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/buildAdvanced.js +1 -1
- package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
- package/dist/esm/builder/builder/buildSpec.js +1 -1
- package/dist/esm/builder/builder/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +483 -1
- package/dist/esm/builder/builder/builder.js +5 -1
- package/dist/esm/builder/builder/builder.js.map +1 -1
- package/dist/esm/dataSelector/selector.d.ts +5 -0
- package/dist/esm/dataSelector/selector.js +92 -50
- package/dist/esm/dataSelector/selector.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js +5 -4
- package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +94 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +12 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +12 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.js +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.js +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.js +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.js +3 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js +49 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +15 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js +13 -9
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +8 -5
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +8 -5
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +61 -29
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +8 -8
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +175 -0
- package/dist/esm/types/advancedVSeed.js +1 -0
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/area.d.ts +6 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +5 -0
- package/dist/esm/types/chartType/area/zArea.js +2 -1
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +5 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +5 -0
- package/dist/esm/types/chartType/bar/zBar.js +2 -1
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +5 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +5 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/boxplot/boxplot.d.ts +6 -1
- package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +5 -0
- package/dist/esm/types/chartType/boxplot/zBoxplot.js +2 -1
- package/dist/esm/types/chartType/boxplot/zBoxplot.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +5 -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/columnParallel/columnParallel.d.ts +6 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +5 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +5 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/dualAxis/dualAxis.d.ts +6 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +5 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js +2 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.js.map +1 -1
- package/dist/esm/types/chartType/histogram/histogram.d.ts +6 -1
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +5 -0
- package/dist/esm/types/chartType/histogram/zHistogram.js +2 -1
- package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +6 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +5 -0
- package/dist/esm/types/chartType/line/zLine.js +2 -1
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +5 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/properties/config/area.d.ts +10 -0
- package/dist/esm/types/properties/config/area.js +3 -1
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +15 -0
- package/dist/esm/types/properties/config/bar.js +3 -1
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/boxplot.d.ts +5 -0
- package/dist/esm/types/properties/config/boxplot.js +3 -1
- package/dist/esm/types/properties/config/boxplot.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +15 -0
- package/dist/esm/types/properties/config/column.js +3 -1
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +65 -0
- package/dist/esm/types/properties/config/dimensionLinkage/dimensionLinkage.d.ts +23 -0
- package/dist/esm/types/properties/config/dimensionLinkage/dimensionLinkage.js +9 -0
- package/dist/esm/types/properties/config/dimensionLinkage/dimensionLinkage.js.map +1 -0
- package/dist/esm/types/properties/config/dimensionLinkage/index.d.ts +1 -0
- package/dist/esm/types/properties/config/dimensionLinkage/index.js +1 -0
- package/dist/esm/types/properties/config/dualAxis.d.ts +5 -0
- package/dist/esm/types/properties/config/dualAxis.js +3 -1
- package/dist/esm/types/properties/config/dualAxis.js.map +1 -1
- package/dist/esm/types/properties/config/histogram.d.ts +5 -0
- package/dist/esm/types/properties/config/histogram.js +3 -1
- package/dist/esm/types/properties/config/histogram.js.map +1 -1
- package/dist/esm/types/properties/config/index.d.ts +1 -0
- package/dist/esm/types/properties/config/index.js +1 -0
- package/dist/esm/types/properties/config/label/pieLabel.d.ts +2 -2
- package/dist/esm/types/properties/config/line.d.ts +5 -0
- package/dist/esm/types/properties/config/line.js +3 -1
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +5 -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/ecdfRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +2 -2
- package/dist/esm/types/properties/theme/customTheme.d.ts +130 -0
- package/dist/esm/types/zVseed.d.ts +65 -0
- package/dist/umd/index.js +540 -205
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -8,9 +8,13 @@ class Builder {
|
|
|
8
8
|
_advancedVSeed = null;
|
|
9
9
|
_spec = null;
|
|
10
10
|
_performance = {};
|
|
11
|
+
_locale;
|
|
11
12
|
constructor(vseed){
|
|
12
13
|
this._vseed = vseed;
|
|
13
|
-
this.
|
|
14
|
+
this._locale = vseed.locale || intl.getLocale();
|
|
15
|
+
}
|
|
16
|
+
get locale() {
|
|
17
|
+
return this._locale;
|
|
14
18
|
}
|
|
15
19
|
build = ()=>build(this);
|
|
16
20
|
buildSpec = (advanced)=>buildSpec(this, advanced);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder/builder/builder.js","sources":["webpack://@visactor/vseed/./src/builder/builder/builder.ts"],"sourcesContent":["import type {\n AdvancedPipe,\n AdvancedPipeline,\n AdvancedVSeed,\n ChartType,\n CustomThemeConfig,\n Spec,\n SpecPipe,\n SpecPipeline,\n VSeed,\n VSeedBuilder,\n} from 'src/types'\nimport { buildAdvanced } from './buildAdvanced'\nimport { buildSpec } from './buildSpec'\nimport { build } from './build'\nimport { intl } from 'src/i18n'\nimport { getColorIdMap, getColorItems } from './advanced'\n\nexport class Builder implements VSeedBuilder {\n private _vseed: VSeed\n private _advancedVSeed: AdvancedVSeed | null = null\n private _spec: Spec | null = null\n private _performance: Record<string, string | number> = {}\n\n constructor(vseed: VSeed) {\n this._vseed = vseed\n this.
|
|
1
|
+
{"version":3,"file":"builder/builder/builder.js","sources":["webpack://@visactor/vseed/./src/builder/builder/builder.ts"],"sourcesContent":["import type {\n AdvancedPipe,\n AdvancedPipeline,\n AdvancedVSeed,\n ChartType,\n CustomThemeConfig,\n Locale,\n Spec,\n SpecPipe,\n SpecPipeline,\n VSeed,\n VSeedBuilder,\n} from 'src/types'\nimport { buildAdvanced } from './buildAdvanced'\nimport { buildSpec } from './buildSpec'\nimport { build } from './build'\nimport { intl } from 'src/i18n'\nimport { getColorIdMap, getColorItems } from './advanced'\n\nexport class Builder implements VSeedBuilder {\n private _vseed: VSeed\n private _advancedVSeed: AdvancedVSeed | null = null\n private _spec: Spec | null = null\n private _performance: Record<string, string | number> = {}\n\n private _locale: Locale\n\n constructor(vseed: VSeed) {\n this._vseed = vseed\n this._locale = vseed.locale || intl.getLocale()\n }\n\n get locale() {\n return this._locale\n }\n\n /**\n * @description 构建spec\n * @returns spec\n */\n build = <T extends Spec>(): T => build(this) as T\n\n /**\n * @description 构建spec\n * @param advanced 高级配置\n * @returns spec\n */\n buildSpec = (advanced: AdvancedVSeed): Spec => buildSpec(this, advanced)\n\n /**\n * @description 构建spec\n * @returns AdvancedVSeed | null\n */\n buildAdvanced = (): AdvancedVSeed | null => buildAdvanced(this)\n\n /**\n * @description 获取颜色项, 颜色项可以重复,\n * @returns 颜色项\n */\n getColorItems = () => getColorItems(this)\n\n /**\n * @description 获取颜色id映射\n * @returns 颜色id映射\n */\n getColorIdMap = () => getColorIdMap(this)\n\n /**\n * @description 获取vseed\n * @returns vseed\n */\n get vseed() {\n return this._vseed\n }\n\n /**\n * @description 设置vseed\n * @param value vseed\n */\n set vseed(value) {\n this._vseed = value\n }\n\n /**\n * @description 获取advancedVSeed\n * @returns advancedVSeed\n */\n get advancedVSeed() {\n return this._advancedVSeed\n }\n\n /**\n *\n * @description 设置advancedVSeed\n * @param value advancedVSeed\n */\n set advancedVSeed(value) {\n this._advancedVSeed = value\n }\n\n /**\n * @description 获取spec\n * @returns spec\n */\n get spec() {\n return this._spec\n }\n\n /**\n * @description 设置spec\n * @param value spec\n */\n set spec(value) {\n this._spec = value\n }\n\n /**\n * @description 获取performance, 统计了构建spec和advancedVSeed的时间\n * @returns performance\n */\n get performance() {\n return this._performance\n }\n\n /**\n * @description 设置performance\n * @param value performance\n */\n set performance(value) {\n this._performance = value\n }\n\n /**\n * @description 获取advancedPipeline\n * @param chartType 图表类型\n * @returns advancedPipeline\n */\n static getAdvancedPipeline = (chartType: ChartType) => {\n const customPipe = Builder._customAdvancedPipe[chartType] as AdvancedPipe\n const pipeline = Builder._advancedPipelineMap[chartType] as AdvancedPipeline\n if (customPipe) {\n pipeline.push(customPipe)\n }\n return pipeline\n }\n\n /**\n * @description 获取specPipeline\n * @param chartType 图表类型\n * @returns specPipeline\n */\n\n static getSpecPipeline = (chartType: ChartType) => {\n const customPipe = Builder._customSpecPipe[chartType] as SpecPipe\n const pipeline = Builder._specPipelineMap[chartType] as SpecPipeline\n if (customPipe) {\n pipeline.push(customPipe)\n }\n return pipeline\n }\n\n /**\n * @description 根据主题key获取主题配置\n * @param themeKey 主题key\n * @example Builder.getTheme('light'), 获取浅色主题\n * @returns 主题配置\n */\n static getTheme = (themeKey?: string) => Builder._themeMap[themeKey || 'light']\n\n /**\n * @description 获取主题配置映射表\n * @example Builder.getThemeMap()\n * @returns 主题配置映射表\n */\n static getThemeMap = () => Builder._themeMap\n\n /**\n * @description 从vseed创建builder\n * @param vseed 完整的vseed DSL\n * @returns builder\n */\n static from = (vseed: VSeed) => new Builder(vseed)\n\n static _advancedPipelineMap: Partial<Record<ChartType, AdvancedPipeline>> = {}\n static _specPipelineMap: Partial<Record<ChartType, SpecPipeline>> = {}\n static _customAdvancedPipe: Partial<Record<ChartType, AdvancedPipe>> = {}\n static _customSpecPipe: Partial<Record<ChartType, SpecPipe>> = {}\n static _themeMap: Record<string, CustomThemeConfig> = {}\n}\n"],"names":["Builder","vseed","intl","build","advanced","buildSpec","buildAdvanced","getColorItems","getColorIdMap","value","chartType","customPipe","pipeline","themeKey"],"mappings":";;;;;AAmBO,MAAMA;IACH,OAAa;IACb,iBAAuC,KAAI;IAC3C,QAAqB,KAAI;IACzB,eAAgD,CAAC,EAAC;IAElD,QAAe;IAEvB,YAAYC,KAAY,CAAE;QACxB,IAAI,CAAC,MAAM,GAAGA;QACd,IAAI,CAAC,OAAO,GAAGA,MAAM,MAAM,IAAIC,KAAK,SAAS;IAC/C;IAEA,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO;IACrB;IAMA,QAAQ,IAAyBC,MAAM,IAAI,EAAM;IAOjD,YAAY,CAACC,WAAkCC,UAAU,IAAI,EAAED,UAAS;IAMxE,gBAAgB,IAA4BE,cAAc,IAAI,EAAC;IAM/D,gBAAgB,IAAMC,cAAc,IAAI,EAAC;IAMzC,gBAAgB,IAAMC,cAAc,IAAI,EAAC;IAMzC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM;IACpB;IAMA,IAAI,MAAMC,KAAK,EAAE;QACf,IAAI,CAAC,MAAM,GAAGA;IAChB;IAMA,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,cAAc;IAC5B;IAOA,IAAI,cAAcA,KAAK,EAAE;QACvB,IAAI,CAAC,cAAc,GAAGA;IACxB;IAMA,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK;IACnB;IAMA,IAAI,KAAKA,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,GAAGA;IACf;IAMA,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,YAAY;IAC1B;IAMA,IAAI,YAAYA,KAAK,EAAE;QACrB,IAAI,CAAC,YAAY,GAAGA;IACtB;IAOA,OAAO,sBAAsB,CAACC;QAC5B,MAAMC,aAAaX,QAAQ,mBAAmB,CAACU,UAAU;QACzD,MAAME,WAAWZ,QAAQ,oBAAoB,CAACU,UAAU;QACxD,IAAIC,YACFC,SAAS,IAAI,CAACD;QAEhB,OAAOC;IACT,EAAC;IAQD,OAAO,kBAAkB,CAACF;QACxB,MAAMC,aAAaX,QAAQ,eAAe,CAACU,UAAU;QACrD,MAAME,WAAWZ,QAAQ,gBAAgB,CAACU,UAAU;QACpD,IAAIC,YACFC,SAAS,IAAI,CAACD;QAEhB,OAAOC;IACT,EAAC;IAQD,OAAO,WAAW,CAACC,WAAsBb,QAAQ,SAAS,CAACa,YAAY,QAAQ;IAO/E,OAAO,cAAc,IAAMb,QAAQ,SAAS;IAO5C,OAAO,OAAO,CAACC,QAAiB,IAAID,QAAQC,OAAM;IAElD,OAAO,uBAAqE,CAAC,EAAC;IAC9E,OAAO,mBAA6D,CAAC,EAAC;IACtE,OAAO,sBAAgE,CAAC,EAAC;IACzE,OAAO,kBAAwD,CAAC,EAAC;IACjE,OAAO,YAA+C,CAAC,EAAC;AAC1D"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Datum } from '../types';
|
|
2
2
|
import type { DimensionSelector, MeasureSelector, PartialDatumSelector, Selector, Selectors, ValueSelector } from '../types/dataSelector';
|
|
3
3
|
export declare const selector: (vchartDatum: Datum, selector: Selector | Selectors | undefined | null, selectorMode?: "And" | "Or") => boolean;
|
|
4
|
+
export declare const selectorDatum: (datum: Datum, selector: Selector | Selectors | undefined | null) => Datum[];
|
|
4
5
|
export declare const isValueSelector: (selector: Selector) => selector is ValueSelector;
|
|
5
6
|
export declare const isPartialDatumSelector: (selector: Selector) => selector is PartialDatumSelector;
|
|
6
7
|
export declare const isMeasureSelector: (selector: Selector) => selector is MeasureSelector;
|
|
7
8
|
export declare const isDimensionSelector: (selector: Selector) => selector is DimensionSelector;
|
|
9
|
+
export declare const selectByMeasure: (selector: MeasureSelector, datum: Datum) => boolean;
|
|
10
|
+
export declare const selectByDmension: (selector: DimensionSelector, datum: Datum) => boolean;
|
|
11
|
+
export declare const selectByPartial: (selector: PartialDatumSelector, datum: Datum) => boolean;
|
|
12
|
+
export declare const selectByValue: (selector: ValueSelector, datum: Datum) => boolean;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { omit } from "remeda";
|
|
2
|
+
function nearlyEqual(a, b, epsilon = 1e-8) {
|
|
3
|
+
if (Number.isNaN(a) || Number.isNaN(b)) return false;
|
|
4
|
+
if (a === b) return true;
|
|
5
|
+
const diff = Math.abs(a - b);
|
|
6
|
+
return diff <= epsilon;
|
|
7
|
+
}
|
|
2
8
|
const selector_selector = (vchartDatum, selector, selectorMode = 'And')=>{
|
|
3
9
|
if (!selector) return true;
|
|
4
10
|
const vchartKeys = Object.keys(vchartDatum).filter((k)=>k.toLocaleLowerCase().startsWith('__vchart'));
|
|
@@ -7,58 +13,44 @@ const selector_selector = (vchartDatum, selector, selectorMode = 'And')=>{
|
|
|
7
13
|
selector
|
|
8
14
|
];
|
|
9
15
|
return selectors['And' === selectorMode ? 'every' : 'some']((selector)=>{
|
|
10
|
-
if (isValueSelector(selector))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
|
15
|
-
selector.value
|
|
16
|
-
];
|
|
17
|
-
switch(op){
|
|
18
|
-
case '=':
|
|
19
|
-
if (String(datum[selector.field]) === String(selectorValueArr[0])) return true;
|
|
20
|
-
break;
|
|
21
|
-
case '==':
|
|
22
|
-
if (datum[selector.field] === selectorValueArr[0]) return true;
|
|
23
|
-
break;
|
|
24
|
-
case '!=':
|
|
25
|
-
if (datum[selector.field] !== selectorValueArr[0]) return true;
|
|
26
|
-
break;
|
|
27
|
-
case '>':
|
|
28
|
-
if (datum[selector.field] > selectorValueArr[0]) return true;
|
|
29
|
-
break;
|
|
30
|
-
case '<':
|
|
31
|
-
if (datum[selector.field] < selectorValueArr[0]) return true;
|
|
32
|
-
break;
|
|
33
|
-
case '>=':
|
|
34
|
-
if (datum[selector.field] >= selectorValueArr[0]) return true;
|
|
35
|
-
break;
|
|
36
|
-
case '<=':
|
|
37
|
-
if (datum[selector.field] <= selectorValueArr[0]) return true;
|
|
38
|
-
break;
|
|
39
|
-
case 'between':
|
|
40
|
-
if (Array.isArray(selector.value) && datum[selector.field] >= selectorValueArr[0] && datum[selector.field] <= selectorValueArr[1]) return true;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
} else if (isDimensionSelector(selector)) {
|
|
44
|
-
const op = selector.operator || selector.op;
|
|
45
|
-
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
|
46
|
-
selector.value
|
|
47
|
-
];
|
|
48
|
-
switch(op){
|
|
49
|
-
case 'in':
|
|
50
|
-
if (selectorValueArr.includes(datum[selector.field])) return true;
|
|
51
|
-
break;
|
|
52
|
-
case 'not in':
|
|
53
|
-
if (!selectorValueArr.includes(datum[selector.field])) return true;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
} else if (isPartialDatumSelector(selector)) {
|
|
57
|
-
if (Object.keys(selector).every((key)=>datum[key] === selector[key])) return true;
|
|
58
|
-
}
|
|
16
|
+
if (isValueSelector(selector)) return selectByValue(selector, datum);
|
|
17
|
+
if (isMeasureSelector(selector)) return selectByMeasure(selector, datum);
|
|
18
|
+
if (isDimensionSelector(selector)) return selectByDmension(selector, datum);
|
|
19
|
+
if (isPartialDatumSelector(selector)) return selectByPartial(selector, datum);
|
|
59
20
|
return false;
|
|
60
21
|
});
|
|
61
22
|
};
|
|
23
|
+
const selectorDatum = (datum, selector)=>{
|
|
24
|
+
if (!selector) return [];
|
|
25
|
+
const selectors = Array.isArray(selector) ? selector : [
|
|
26
|
+
selector
|
|
27
|
+
];
|
|
28
|
+
let finalResult = [];
|
|
29
|
+
for (const selector of selectors){
|
|
30
|
+
const results = [];
|
|
31
|
+
if (isValueSelector(selector)) Object.entries(datum).forEach(([key, value])=>{
|
|
32
|
+
if (value === selector) results.push({
|
|
33
|
+
[key]: value
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
else if (isMeasureSelector(selector) && selectByMeasure(selector, datum)) results.push({
|
|
37
|
+
[selector.field]: datum[selector.field]
|
|
38
|
+
});
|
|
39
|
+
else if (isDimensionSelector(selector) && selectByDmension(selector, datum)) results.push({
|
|
40
|
+
[selector.field]: datum[selector.field]
|
|
41
|
+
});
|
|
42
|
+
else if (isPartialDatumSelector(selector) && selectByPartial(selector, datum)) results.push(selector);
|
|
43
|
+
if (results.length) finalResult = finalResult.length ? finalResult.flatMap((prev)=>results.map((r)=>({
|
|
44
|
+
...prev,
|
|
45
|
+
...r
|
|
46
|
+
}))) : results;
|
|
47
|
+
else {
|
|
48
|
+
finalResult = [];
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return finalResult;
|
|
53
|
+
};
|
|
62
54
|
const isValueSelector = (selector)=>'string' == typeof selector || 'number' == typeof selector;
|
|
63
55
|
const isPartialDatumSelector = (selector)=>'object' == typeof selector && null !== selector;
|
|
64
56
|
const isMeasureSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && ('operator' in selector || 'op' in selector) && 'value' in selector && ([
|
|
@@ -87,6 +79,56 @@ const isDimensionSelector = (selector)=>'object' == typeof selector && null !==
|
|
|
87
79
|
'in',
|
|
88
80
|
'not in'
|
|
89
81
|
].includes(selector.op));
|
|
90
|
-
|
|
82
|
+
const selectByMeasure = (selector, datum)=>{
|
|
83
|
+
const op = selector.operator || selector.op;
|
|
84
|
+
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
|
85
|
+
selector.value
|
|
86
|
+
];
|
|
87
|
+
switch(op){
|
|
88
|
+
case '=':
|
|
89
|
+
if (String(datum[selector.field]) === String(selectorValueArr[0]) || nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) return true;
|
|
90
|
+
break;
|
|
91
|
+
case '==':
|
|
92
|
+
if (datum[selector.field] === selectorValueArr[0]) return true;
|
|
93
|
+
break;
|
|
94
|
+
case '!=':
|
|
95
|
+
if (datum[selector.field] !== selectorValueArr[0]) return true;
|
|
96
|
+
break;
|
|
97
|
+
case '>':
|
|
98
|
+
if (datum[selector.field] > selectorValueArr[0] && !nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) return true;
|
|
99
|
+
break;
|
|
100
|
+
case '<':
|
|
101
|
+
if (datum[selector.field] < selectorValueArr[0] && !nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) return true;
|
|
102
|
+
break;
|
|
103
|
+
case '>=':
|
|
104
|
+
if (datum[selector.field] >= selectorValueArr[0] || nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) return true;
|
|
105
|
+
break;
|
|
106
|
+
case '<=':
|
|
107
|
+
if (datum[selector.field] <= selectorValueArr[0] || nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) return true;
|
|
108
|
+
break;
|
|
109
|
+
case 'between':
|
|
110
|
+
if (Array.isArray(selector.value) && (datum[selector.field] >= selectorValueArr[0] || nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) && (datum[selector.field] <= selectorValueArr[1] || nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[1])))) return true;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
};
|
|
115
|
+
const selectByDmension = (selector, datum)=>{
|
|
116
|
+
const op = selector.operator || selector.op;
|
|
117
|
+
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
|
118
|
+
selector.value
|
|
119
|
+
];
|
|
120
|
+
switch(op){
|
|
121
|
+
case 'in':
|
|
122
|
+
if (selectorValueArr.includes(datum[selector.field])) return true;
|
|
123
|
+
break;
|
|
124
|
+
case 'not in':
|
|
125
|
+
if (!selectorValueArr.includes(datum[selector.field])) return true;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
};
|
|
130
|
+
const selectByPartial = (selector, datum)=>Object.keys(selector).every((key)=>datum[key] === selector[key]);
|
|
131
|
+
const selectByValue = (selector, datum)=>Object.values(datum).some((v)=>v === selector);
|
|
132
|
+
export { isDimensionSelector, isMeasureSelector, isPartialDatumSelector, isValueSelector, selectByDmension, selectByMeasure, selectByPartial, selectByValue, selector_selector as selector, selectorDatum };
|
|
91
133
|
|
|
92
134
|
//# sourceMappingURL=selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSelector/selector.js","sources":["webpack://@visactor/vseed/./src/dataSelector/selector.ts"],"sourcesContent":["import type { Datum } from 'src/types'\nimport type {\n DimensionSelector,\n MeasureSelector,\n PartialDatumSelector,\n Selector,\n Selectors,\n ValueSelector,\n} from '../types/dataSelector'\nimport { omit } from 'remeda'\n\nexport const selector = (\n vchartDatum: Datum,\n selector: Selector | Selectors | undefined | null,\n selectorMode: 'And' | 'Or' = 'And',\n) => {\n // 无有效选择器, 则认为全部匹配成功\n if (!selector) {\n return true\n }\n\n // 过滤掉 vchart 相关字段\n const vchartKeys = Object.keys(vchartDatum).filter((k) => k.toLocaleLowerCase().startsWith('__vchart'))\n const datum = omit(vchartDatum, vchartKeys) as Datum\n\n // 统一处理选择器为数组\n const selectors = (Array.isArray(selector) ? selector : [selector]) as Selectors\n\n return selectors[selectorMode === 'And' ? 'every' : 'some']((selector) => {\n // 1. 字符串或数字\n if (isValueSelector(selector)) {\n if (Object.values(datum).find((v) => v === selector)) {\n return true\n }\n }\n\n // 2. 指标选择器\n else if (isMeasureSelector(selector)) {\n const op = selector.operator || selector.op\n const selectorValueArr = Array.isArray(selector.value) ? selector.value : [selector.value]\n\n switch (op) {\n case '=':\n if (String(datum[selector.field]) === String(selectorValueArr[0])) {\n return true\n }\n break\n case '==':\n if (datum[selector.field] === selectorValueArr[0]) {\n return true\n }\n break\n case '!=':\n if (datum[selector.field] !== selectorValueArr[0]) {\n return true\n }\n break\n case '>':\n if (datum[selector.field] > selectorValueArr[0]) {\n return true\n }\n break\n case '<':\n if (datum[selector.field] < selectorValueArr[0]) {\n return true\n }\n break\n case '>=':\n if (datum[selector.field] >= selectorValueArr[0]) {\n return true\n }\n break\n case '<=':\n if (datum[selector.field] <= selectorValueArr[0]) {\n return true\n }\n break\n case 'between':\n if (\n Array.isArray(selector.value) &&\n datum[selector.field] >= selectorValueArr[0] &&\n datum[selector.field] <= selectorValueArr[1]\n ) {\n return true\n }\n break\n }\n }\n // 3. 维度选择器\n else if (isDimensionSelector(selector)) {\n const op = selector.operator || selector.op\n const selectorValueArr = Array.isArray(selector.value) ? selector.value : [selector.value]\n switch (op) {\n case 'in':\n if (selectorValueArr.includes(datum[selector.field] as string | number)) {\n return true\n }\n break\n case 'not in':\n if (!selectorValueArr.includes(datum[selector.field] as string | number)) {\n return true\n }\n break\n }\n }\n // 4. 部分数据对象选择器\n else if (isPartialDatumSelector(selector)) {\n if (Object.keys(selector).every((key) => datum[key] === selector[key])) {\n return true\n }\n }\n\n return false\n })\n}\n\nexport const isValueSelector = (selector: Selector): selector is ValueSelector => {\n return typeof selector === 'string' || typeof selector === 'number'\n}\n\nexport const isPartialDatumSelector = (selector: Selector): selector is PartialDatumSelector => {\n return typeof selector === 'object' && selector !== null\n}\n\nexport const isMeasureSelector = (selector: Selector): selector is MeasureSelector => {\n return (\n typeof selector === 'object' &&\n selector !== null &&\n 'field' in selector &&\n ('operator' in selector || 'op' in selector) &&\n 'value' in selector &&\n (['=', '==', '!=', '>', '<', '>=', '<=', 'between'].includes(selector.operator as string) ||\n ['=', '==', '!=', '>', '<', '>=', '<=', 'between'].includes(selector.op as string))\n )\n}\n\nexport const isDimensionSelector = (selector: Selector): selector is DimensionSelector => {\n return (\n typeof selector === 'object' &&\n selector !== null &&\n 'field' in selector &&\n ('operator' in selector || 'op' in selector) &&\n 'value' in selector &&\n (['in', 'not in'].includes(selector.operator as string) || ['in', 'not in'].includes(selector.op as string))\n )\n}\n"],"names":["selector","vchartDatum","selectorMode","vchartKeys","Object","k","datum","omit","selectors","Array","isValueSelector","v","isMeasureSelector","op","selectorValueArr","String","isDimensionSelector","isPartialDatumSelector","key"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"dataSelector/selector.js","sources":["webpack://@visactor/vseed/./src/dataSelector/selector.ts"],"sourcesContent":["import type { Datum } from 'src/types'\nimport type {\n DimensionSelector,\n MeasureSelector,\n PartialDatumSelector,\n Selector,\n Selectors,\n ValueSelector,\n} from '../types/dataSelector'\nimport { omit } from 'remeda'\n\n/**\n * 判断两个数字是否“近似相等”\n */\nfunction nearlyEqual(a: number, b: number, epsilon = 1e-8) {\n // NaN 直接不相等\n if (Number.isNaN(a) || Number.isNaN(b)) return false\n // 引用同一个数 或 完全相等\n if (a === b) return true\n const diff = Math.abs(a - b)\n return diff <= epsilon\n}\n\nexport const selector = (\n vchartDatum: Datum,\n selector: Selector | Selectors | undefined | null,\n selectorMode: 'And' | 'Or' = 'And',\n) => {\n // 无有效选择器, 则认为全部匹配成功\n if (!selector) {\n return true\n }\n\n // 过滤掉 vchart 相关字段\n const vchartKeys = Object.keys(vchartDatum).filter((k) => k.toLocaleLowerCase().startsWith('__vchart'))\n const datum = omit(vchartDatum, vchartKeys) as Datum\n\n // 统一处理选择器为数组\n const selectors = (Array.isArray(selector) ? selector : [selector]) as Selectors\n\n return selectors[selectorMode === 'And' ? 'every' : 'some']((selector) => {\n // 1. 字符串或数字\n if (isValueSelector(selector)) {\n return selectByValue(selector, datum)\n }\n\n // 2. 指标选择器\n else if (isMeasureSelector(selector)) {\n return selectByMeasure(selector, datum)\n }\n // 3. 维度选择器\n else if (isDimensionSelector(selector)) {\n return selectByDmension(selector, datum)\n }\n // 4. 部分数据对象选择器\n else if (isPartialDatumSelector(selector)) {\n return selectByPartial(selector, datum)\n }\n\n return false\n })\n}\n\nexport const selectorDatum = (datum: Datum, selector: Selector | Selectors | undefined | null): Datum[] => {\n // 无有效选择器, 则认为全部匹配成功\n if (!selector) {\n return []\n }\n\n // 统一处理选择器为数组\n const selectors = (Array.isArray(selector) ? selector : [selector]) as Selectors\n let finalResult: Datum[] = []\n\n for (const selector of selectors) {\n const results: Datum[] = []\n // 1. 字符串或数字\n if (isValueSelector(selector)) {\n Object.entries(datum).forEach(([key, value]) => {\n if (value === selector) {\n results.push({ [key]: value } as Datum)\n }\n })\n } else if (isMeasureSelector(selector) && selectByMeasure(selector, datum)) {\n results.push({ [selector.field]: datum[selector.field] } as Datum)\n } else if (isDimensionSelector(selector) && selectByDmension(selector, datum)) {\n results.push({ [selector.field]: datum[selector.field] } as Datum)\n } else if (isPartialDatumSelector(selector) && selectByPartial(selector, datum)) {\n results.push(selector)\n }\n\n if (results.length) {\n if (finalResult.length) {\n finalResult = finalResult.flatMap((prev) => {\n return results.map((r) => {\n return {\n ...prev,\n ...r,\n }\n })\n })\n } else {\n finalResult = results\n }\n } else {\n finalResult = []\n break\n }\n }\n\n return finalResult\n}\n\nexport const isValueSelector = (selector: Selector): selector is ValueSelector => {\n return typeof selector === 'string' || typeof selector === 'number'\n}\n\nexport const isPartialDatumSelector = (selector: Selector): selector is PartialDatumSelector => {\n return typeof selector === 'object' && selector !== null\n}\n\nexport const isMeasureSelector = (selector: Selector): selector is MeasureSelector => {\n return (\n typeof selector === 'object' &&\n selector !== null &&\n 'field' in selector &&\n ('operator' in selector || 'op' in selector) &&\n 'value' in selector &&\n (['=', '==', '!=', '>', '<', '>=', '<=', 'between'].includes(selector.operator as string) ||\n ['=', '==', '!=', '>', '<', '>=', '<=', 'between'].includes(selector.op as string))\n )\n}\n\nexport const isDimensionSelector = (selector: Selector): selector is DimensionSelector => {\n return (\n typeof selector === 'object' &&\n selector !== null &&\n 'field' in selector &&\n ('operator' in selector || 'op' in selector) &&\n 'value' in selector &&\n (['in', 'not in'].includes(selector.operator as string) || ['in', 'not in'].includes(selector.op as string))\n )\n}\n\nexport const selectByMeasure = (selector: MeasureSelector, datum: Datum) => {\n const op = selector.operator || selector.op\n const selectorValueArr = Array.isArray(selector.value) ? selector.value : [selector.value]\n\n switch (op) {\n case '=':\n if (\n String(datum[selector.field]) === String(selectorValueArr[0]) ||\n nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))\n ) {\n return true\n }\n break\n case '==':\n if (datum[selector.field] === selectorValueArr[0]) {\n return true\n }\n break\n case '!=':\n if (datum[selector.field] !== selectorValueArr[0]) {\n return true\n }\n break\n case '>':\n if (\n datum[selector.field] > selectorValueArr[0] &&\n !nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))\n ) {\n return true\n }\n break\n case '<':\n if (\n datum[selector.field] < selectorValueArr[0] &&\n !nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))\n ) {\n return true\n }\n break\n case '>=':\n if (\n datum[selector.field] >= selectorValueArr[0] ||\n nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))\n ) {\n return true\n }\n break\n case '<=':\n if (\n datum[selector.field] <= selectorValueArr[0] ||\n nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))\n ) {\n return true\n }\n break\n case 'between':\n if (\n Array.isArray(selector.value) &&\n (datum[selector.field] >= selectorValueArr[0] ||\n nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[0]))) &&\n (datum[selector.field] <= selectorValueArr[1] ||\n nearlyEqual(Number(datum[selector.field]), Number(selectorValueArr[1])))\n ) {\n return true\n }\n break\n }\n return false\n}\n\nexport const selectByDmension = (selector: DimensionSelector, datum: Datum) => {\n const op = selector.operator || selector.op\n const selectorValueArr = Array.isArray(selector.value) ? selector.value : [selector.value]\n switch (op) {\n case 'in':\n if (selectorValueArr.includes(datum[selector.field] as string | number)) {\n return true\n }\n break\n case 'not in':\n if (!selectorValueArr.includes(datum[selector.field] as string | number)) {\n return true\n }\n break\n }\n\n return false\n}\n\nexport const selectByPartial = (selector: PartialDatumSelector, datum: Datum) => {\n return Object.keys(selector).every((key) => datum[key] === selector[key])\n}\n\nexport const selectByValue = (selector: ValueSelector, datum: Datum) => {\n return Object.values(datum).some((v) => v === selector)\n}\n"],"names":["nearlyEqual","a","b","epsilon","Number","diff","Math","selector","vchartDatum","selectorMode","vchartKeys","Object","k","datum","omit","selectors","Array","isValueSelector","selectByValue","isMeasureSelector","selectByMeasure","isDimensionSelector","selectByDmension","isPartialDatumSelector","selectByPartial","selectorDatum","finalResult","results","key","value","prev","r","op","selectorValueArr","String","v"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/boxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/boxplot.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const boxplotConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'whiskers',\n ]) as Config['boxPlot']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["boxplotConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,gBAA8B,CAACC,eAAeC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/boxplot.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/boxplot.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const boxplotConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'whiskers',\n\n 'dimensionLinkage',\n ]) as Config['boxPlot']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["boxplotConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,gBAA8B,CAACC,eAAeC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QAEA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/column.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const columnConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'stackCornerRadius',\n 'barMaxWidth',\n 'barGapInGroup',\n ]) as Config['column']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["columnConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,eAA6B,CAACC,eAAeC;IACxD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/column.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/column.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const columnConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'stackCornerRadius',\n 'barMaxWidth',\n 'barGapInGroup',\n\n 'dimensionLinkage',\n ]) as Config['column']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["columnConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,eAA6B,CAACC,eAAeC;IACxD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QAEA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -21,7 +21,8 @@ const dualAxisConfig = (advancedVSeed, context)=>{
|
|
|
21
21
|
'crosshairRect',
|
|
22
22
|
'barGapInGroup',
|
|
23
23
|
'barMaxWidth',
|
|
24
|
-
'stackCornerRadius'
|
|
24
|
+
'stackCornerRadius',
|
|
25
|
+
'dimensionLinkage'
|
|
25
26
|
]);
|
|
26
27
|
const config = replaceNullToUndefined(pickedConfig);
|
|
27
28
|
result.config = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/dualAxis.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const dualAxisConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n // common\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n\n // only for dualAxis\n 'dualChartType',\n 'alignTicks',\n 'primaryYAxis',\n 'secondaryYAxis',\n 'crosshairLine',\n 'crosshairRect',\n\n 'barGapInGroup',\n 'barMaxWidth',\n 'stackCornerRadius',\n ]) as Config['dualAxis']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["dualAxisConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,iBAA+B,CAACC,eAAeC;IAC1D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAE/B;QACA;QACA;QACA;QACA;QACA;QAGA;QACA;QACA;QACA;QACA;QACA;QAEA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/dualAxis.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const dualAxisConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n // common\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n\n // only for dualAxis\n 'dualChartType',\n 'alignTicks',\n 'primaryYAxis',\n 'secondaryYAxis',\n 'crosshairLine',\n 'crosshairRect',\n\n 'barGapInGroup',\n 'barMaxWidth',\n 'stackCornerRadius',\n\n 'dimensionLinkage',\n ]) as Config['dualAxis']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["dualAxisConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,iBAA+B,CAACC,eAAeC;IAC1D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAE/B;QACA;QACA;QACA;QACA;QACA;QAGA;QACA;QACA;QACA;QACA;QACA;QAEA;QACA;QACA;QAEA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -19,7 +19,8 @@ const histogramConfig = (advancedVSeed, context)=>{
|
|
|
19
19
|
'crosshairRect',
|
|
20
20
|
'binCount',
|
|
21
21
|
'binStep',
|
|
22
|
-
'binValueType'
|
|
22
|
+
'binValueType',
|
|
23
|
+
'dimensionLinkage'
|
|
23
24
|
]);
|
|
24
25
|
let config = replaceNullToUndefined(pickedConfig);
|
|
25
26
|
if (!hasColorEncoding && !config?.legend?.enable) config = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/histogram.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { pick } from 'remeda'\nimport { BinEndMeasureId, BinStartMeasureId } from 'src/dataReshape'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config, Dimension } from 'src/types'\n\nexport const histogramConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n const hasColorEncoding = (advancedVSeed?.dimensions || []).find((field: Dimension) => field?.encoding === 'color')\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'binCount',\n 'binStep',\n 'binValueType',\n ]) as Config['histogram']\n\n let config = replaceNullToUndefined(pickedConfig)\n\n if (!hasColorEncoding && !config?.legend?.enable) {\n config = {\n ...config,\n legend: {\n ...config?.legend,\n enable: false,\n },\n }\n }\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const histogramXAxisConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n const { dataset = [] } = advancedVSeed\n const flattenDatasert = dataset.flat()\n const minValue = Math.min(...flattenDatasert.map((v) => +v[BinStartMeasureId]))\n const maxValue = Math.max(...flattenDatasert.map((v) => +v[BinEndMeasureId]))\n\n const chartConfig = result.config?.[chartType] as any\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...chartConfig,\n xAxis: {\n min: Number.isNaN(minValue) ? undefined : minValue,\n max: Number.isNaN(maxValue) ? undefined : maxValue,\n ...(chartConfig?.xAxis || {}),\n },\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["histogramConfig","advancedVSeed","context","vseed","chartType","result","hasColorEncoding","field","pickedConfig","pick","config","replaceNullToUndefined","histogramXAxisConfig","dataset","flattenDatasert","minValue","Math","v","BinStartMeasureId","maxValue","BinEndMeasureId","chartConfig","Number","undefined"],"mappings":";;;AAMO,MAAMA,kBAAgC,CAACC,eAAeC;IAC3D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IACA,MAAMK,mBAAoBL,AAAAA,CAAAA,eAAe,cAAc,EAAC,EAAG,IAAI,CAAC,CAACM,QAAqBA,OAAO,aAAa;IAE1G,MAAMC,eAAeC,KAAKN,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,IAAIO,SAASC,uBAAuBH;IAEpC,IAAI,CAACF,oBAAoB,CAACI,QAAQ,QAAQ,QACxCA,SAAS;QACP,GAAGA,MAAM;QACT,QAAQ;YACN,GAAGA,QAAQ,MAAM;YACjB,QAAQ;QACV;IACF;IAEFL,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGM,MAAM;QACX;IACF;IAEA,OAAOL;AACT;AAEO,MAAMO,uBAAqC,CAACX,eAAeC;IAChE,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IACA,MAAM,EAAEY,UAAU,EAAE,EAAE,GAAGZ;IACzB,MAAMa,kBAAkBD,QAAQ,IAAI;IACpC,MAAME,WAAWC,KAAK,GAAG,IAAIF,gBAAgB,GAAG,CAAC,CAACG,IAAM,CAACA,CAAC,CAACC,kBAAkB;IAC7E,MAAMC,WAAWH,KAAK,GAAG,IAAIF,gBAAgB,GAAG,CAAC,CAACG,IAAM,CAACA,CAAC,CAACG,gBAAgB;IAE3E,MAAMC,cAAchB,OAAO,MAAM,EAAE,CAACD,UAAU;IAC9CC,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGiB,WAAW;YACd,OAAO;gBACL,KAAKC,OAAO,KAAK,CAACP,YAAYQ,SAAYR;gBAC1C,KAAKO,OAAO,KAAK,CAACH,YAAYI,SAAYJ;gBAC1C,GAAIE,aAAa,SAAS,CAAC,CAAC;YAC9B;QACF;IACF;IAEA,OAAOhB;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/histogram.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/histogram.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { pick } from 'remeda'\nimport { BinEndMeasureId, BinStartMeasureId } from 'src/dataReshape'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config, Dimension } from 'src/types'\n\nexport const histogramConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n const hasColorEncoding = (advancedVSeed?.dimensions || []).find((field: Dimension) => field?.encoding === 'color')\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairRect',\n 'binCount',\n 'binStep',\n 'binValueType',\n\n 'dimensionLinkage',\n ]) as Config['histogram']\n\n let config = replaceNullToUndefined(pickedConfig)\n\n if (!hasColorEncoding && !config?.legend?.enable) {\n config = {\n ...config,\n legend: {\n ...config?.legend,\n enable: false,\n },\n }\n }\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const histogramXAxisConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n const { dataset = [] } = advancedVSeed\n const flattenDatasert = dataset.flat()\n const minValue = Math.min(...flattenDatasert.map((v) => +v[BinStartMeasureId]))\n const maxValue = Math.max(...flattenDatasert.map((v) => +v[BinEndMeasureId]))\n\n const chartConfig = result.config?.[chartType] as any\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...chartConfig,\n xAxis: {\n min: Number.isNaN(minValue) ? undefined : minValue,\n max: Number.isNaN(maxValue) ? undefined : maxValue,\n ...(chartConfig?.xAxis || {}),\n },\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["histogramConfig","advancedVSeed","context","vseed","chartType","result","hasColorEncoding","field","pickedConfig","pick","config","replaceNullToUndefined","histogramXAxisConfig","dataset","flattenDatasert","minValue","Math","v","BinStartMeasureId","maxValue","BinEndMeasureId","chartConfig","Number","undefined"],"mappings":";;;AAMO,MAAMA,kBAAgC,CAACC,eAAeC;IAC3D,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IACA,MAAMK,mBAAoBL,AAAAA,CAAAA,eAAe,cAAc,EAAC,EAAG,IAAI,CAAC,CAACM,QAAqBA,OAAO,aAAa;IAE1G,MAAMC,eAAeC,KAAKN,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QAEA;KACD;IAED,IAAIO,SAASC,uBAAuBH;IAEpC,IAAI,CAACF,oBAAoB,CAACI,QAAQ,QAAQ,QACxCA,SAAS;QACP,GAAGA,MAAM;QACT,QAAQ;YACN,GAAGA,QAAQ,MAAM;YACjB,QAAQ;QACV;IACF;IAEFL,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGM,MAAM;QACX;IACF;IAEA,OAAOL;AACT;AAEO,MAAMO,uBAAqC,CAACX,eAAeC;IAChE,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IACA,MAAM,EAAEY,UAAU,EAAE,EAAE,GAAGZ;IACzB,MAAMa,kBAAkBD,QAAQ,IAAI;IACpC,MAAME,WAAWC,KAAK,GAAG,IAAIF,gBAAgB,GAAG,CAAC,CAACG,IAAM,CAACA,CAAC,CAACC,kBAAkB;IAC7E,MAAMC,WAAWH,KAAK,GAAG,IAAIF,gBAAgB,GAAG,CAAC,CAACG,IAAM,CAACA,CAAC,CAACG,gBAAgB;IAE3E,MAAMC,cAAchB,OAAO,MAAM,EAAE,CAACD,UAAU;IAC9CC,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGiB,WAAW;YACd,OAAO;gBACL,KAAKC,OAAO,KAAK,CAACP,YAAYQ,SAAYR;gBAC1C,KAAKO,OAAO,KAAK,CAACH,YAAYI,SAAYJ;gBAC1C,GAAIE,aAAa,SAAS,CAAC,CAAC;YAC9B;QACF;IACF;IAEA,OAAOhB;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/line.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/line.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const lineConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairLine',\n ]) as Config['line']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["lineConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,aAA2B,CAACC,eAAeC;IACtD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/line.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/line.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const lineConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'crosshairLine',\n 'dimensionLinkage',\n ]) as Config['line']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["lineConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,aAA2B,CAACC,eAAeC;IACtD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/config/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/scatter.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const scatterConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'sizeRange',\n 'size',\n 'crosshairLine',\n ]) as Config['line']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["scatterConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,gBAA8B,CAACC,eAAeC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/config/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/scatter.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const scatterConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, [\n 'backgroundColor',\n 'color',\n 'label',\n 'legend',\n 'tooltip',\n 'xAxis',\n 'yAxis',\n 'sizeRange',\n 'size',\n 'crosshairLine',\n\n 'dimensionLinkage',\n ]) as Config['line']\n\n const config = replaceNullToUndefined(pickedConfig)\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n"],"names":["scatterConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,gBAA8B,CAACC,eAAeC;IACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAC/B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QAEA;KACD;IAED,MAAMK,SAASC,uBAAuBH;IAEtCD,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -10,7 +10,7 @@ const reshapeWithEncoding = (advancedVSeed, context)=>{
|
|
|
10
10
|
const { dataset, chartType } = vseed;
|
|
11
11
|
const { encoding } = advancedVSeed;
|
|
12
12
|
const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
|
|
13
|
-
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, uniqueBy(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item)=>item.id), uniqueBy(advancedVSeed.reshapeMeasures ??
|
|
13
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, uniqueBy(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item)=>item.id), uniqueBy(findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures), (item)=>item.id), encoding, {
|
|
14
14
|
colorItemAsId: false,
|
|
15
15
|
colorMeasureId
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Encoding } from 'src/types'\n\nexport const reshapeWithEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { encoding } = advancedVSeed\n\n const colorMeasureId = getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed)\n const {\n dataset: newDatasets,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item) => item.id),\n uniqueBy(advancedVSeed.reshapeMeasures ??
|
|
1
|
+
{"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Encoding } from 'src/types'\n\nexport const reshapeWithEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { encoding } = advancedVSeed\n\n const colorMeasureId = getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed)\n const {\n dataset: newDatasets,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item) => item.id),\n uniqueBy(findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures), (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n colorMeasureId,\n },\n )\n\n return {\n ...result,\n dataset: newDatasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo,\n unfoldInfo,\n },\n ],\n }\n}\n"],"names":["reshapeWithEncoding","advancedVSeed","context","result","vseed","dataset","chartType","encoding","colorMeasureId","getColorMeasureId","newDatasets","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","item","findAllMeasures","String"],"mappings":";;;;AAMO,MAAMA,sBAAoC,CAACC,eAAeC;IAC/D,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,QAAQ,EAAE,GAAGN;IAErB,MAAMO,iBAAiBC,kBAAkBR,eAAgCG;IACzE,MAAM,EACJ,SAASM,WAAW,EACpBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFR,SACAS,SAASb,cAAc,iBAAiB,IAAIA,cAAc,UAAU,IAAI,EAAE,EAAE,CAACc,OAASA,KAAK,EAAE,GAC7FD,SAASE,gBAAgBf,cAAc,eAAe,IAAIA,cAAc,QAAQ,GAAG,CAACc,OAASA,KAAK,EAAE,GACpGR,UACA;QACE,eAAe;QACfC;IACF;IAGF,OAAO;QACL,GAAGL,MAAM;QACT,SAASO;QACT,oBAAoB;YAClB;gBACE,IAAIO,OAAOX;gBACX,OAAO;gBACPK;gBACAC;YACF;SACD;IACH;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, color, colorAdapter, colorAreaStyleFill, colorLegend, colorLineStyleFill, colorPointStyleFill, datasetPivot, datasetXY, discreteLegend, initArea, initPivot, label, lineStyle, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, pointStateDimensionHover, pointStyle, progressive, splitLine, stackInverse, tooltip, verticalCrosshairLine, xBand, yLinear } from "../pipes/index.js";
|
|
1
|
+
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, color, colorAdapter, colorAreaStyleFill, colorLegend, colorLineStyleFill, colorPointStyleFill, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, initArea, initPivot, label, lineStyle, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, pointStateDimensionHover, pointStyle, progressive, splitLine, stackInverse, tooltip, verticalCrosshairLine, xBand, yLinear } from "../pipes/index.js";
|
|
2
2
|
const area_area = [
|
|
3
3
|
initArea,
|
|
4
4
|
stackInverse,
|
|
@@ -52,7 +52,8 @@ const pivotArea = [
|
|
|
52
52
|
pivotRowDimensions,
|
|
53
53
|
pivotColumnDimensions,
|
|
54
54
|
pivotTitle,
|
|
55
|
-
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
55
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend),
|
|
56
|
+
dimensionLinkage
|
|
56
57
|
];
|
|
57
58
|
const areaSpecPipeline = [
|
|
58
59
|
pivotAdapter(area_area, pivotArea)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/area.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/area.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n xBand,\n yLinear,\n initArea,\n stackInverse,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotAdapter,\n initPivot,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n lineStyle,\n areaStyle,\n verticalCrosshairLine,\n pointStateDimensionHover,\n datasetXY,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorPointStyleFill,\n colorLineStyleFill,\n colorAreaStyleFill,\n pivotColorLegend,\n pivotAxisStyle,\n pivotTitle,\n splitLine,\n} from '../pipes'\n\nconst area: VChartSpecPipeline = [\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n splitLine,\n]\n\nconst pivotArea: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initArea,\n colorAdapter(color, linearColor),\n backgroundColor,\n stackInverse,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n label,\n tooltip,\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n splitLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const areaSpecPipeline = [pivotAdapter(area, pivotArea)]\n"],"names":["area","initArea","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","tooltip","discreteLegend","colorLegend","verticalCrosshairLine","colorPointStyleFill","pointStyle","pointStateDimensionHover","colorLineStyleFill","lineStyle","colorAreaStyleFill","areaStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","splitLine","pivotArea","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","areaSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/area.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/area.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n xBand,\n yLinear,\n initArea,\n stackInverse,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotAdapter,\n initPivot,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n lineStyle,\n areaStyle,\n verticalCrosshairLine,\n pointStateDimensionHover,\n datasetXY,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorPointStyleFill,\n colorLineStyleFill,\n colorAreaStyleFill,\n pivotColorLegend,\n pivotAxisStyle,\n pivotTitle,\n splitLine,\n dimensionLinkage,\n} from '../pipes'\n\nconst area: VChartSpecPipeline = [\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n splitLine,\n]\n\nconst pivotArea: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initArea,\n colorAdapter(color, linearColor),\n backgroundColor,\n stackInverse,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n label,\n tooltip,\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n splitLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const areaSpecPipeline = [pivotAdapter(area, pivotArea)]\n"],"names":["area","initArea","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","tooltip","discreteLegend","colorLegend","verticalCrosshairLine","colorPointStyleFill","pointStyle","pointStateDimensionHover","colorLineStyleFill","lineStyle","colorAreaStyleFill","areaStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","splitLine","pivotArea","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","areaSpecPipeline","pivotAdapter"],"mappings":";AA4CA,MAAMA,YAA2B;IAC/BC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,oBAAoBC;IACpBC;IACAC,mBAAmBC;IACnBC,mBAAmBC;IACnBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,YAAoC;IACxCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAE,aAAaC,OAAOC;QACpBC;QACAJ;QACAK;QACAC;QACAC;QACAyB,eAAexB;QACfC;QACAC;QACAG;QACAC,oBAAoBC;QACpBC;QACAC,mBAAmBC;QACnBC,mBAAmBC;QACnBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACAlC,aAAamC,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,mBAAmB;IAACC,aAAa1C,WAAM4B;CAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, color, colorAdapter, colorAreaStyleFill, colorLegend, colorLineStyleFill, colorPointStyleFill, datasetPivot, datasetXY, discreteLegend, initArea, initPivot, label, lineStyle, linearColor, percent, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, pointStateDimensionHover, pointStyle, progressive, stackInverse, tooltip, verticalCrosshairLine, xBand, yLinear } from "../pipes/index.js";
|
|
1
|
+
import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, areaStyle, backgroundColor, color, colorAdapter, colorAreaStyleFill, colorLegend, colorLineStyleFill, colorPointStyleFill, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, initArea, initPivot, label, lineStyle, linearColor, percent, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, pointStateDimensionHover, pointStyle, progressive, stackInverse, tooltip, verticalCrosshairLine, xBand, yLinear } from "../pipes/index.js";
|
|
2
2
|
const areaPercent = [
|
|
3
3
|
initArea,
|
|
4
4
|
stackInverse,
|
|
@@ -52,7 +52,8 @@ const pivotAreaPercent = [
|
|
|
52
52
|
pivotRowDimensions,
|
|
53
53
|
pivotColumnDimensions,
|
|
54
54
|
pivotTitle,
|
|
55
|
-
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
55
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend),
|
|
56
|
+
dimensionLinkage
|
|
56
57
|
];
|
|
57
58
|
const areaPercentSpecPipeline = [
|
|
58
59
|
pivotAdapter(areaPercent, pivotAreaPercent)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/areaPercent.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/areaPercent.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n percent,\n datasetXY,\n xBand,\n yLinear,\n initArea,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotAdapter,\n initPivot,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n lineStyle,\n areaStyle,\n verticalCrosshairLine,\n progressive,\n colorLegend,\n colorAdapter,\n linearColor,\n pivotColorLegend,\n pointStateDimensionHover,\n colorPointStyleFill,\n colorLineStyleFill,\n colorAreaStyleFill,\n pivotAxisStyle,\n pivotTitle,\n} from '../pipes'\n\nconst areaPercent: VChartSpecPipeline = [\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n percent,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotAreaPercent: PivotChartSpecPipeline = [\n initPivot,\n\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n percent,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n label,\n tooltip,\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const areaPercentSpecPipeline = [pivotAdapter(areaPercent, pivotAreaPercent)]\n"],"names":["areaPercent","initArea","stackInverse","colorAdapter","color","linearColor","backgroundColor","percent","datasetXY","progressive","xBand","yLinear","label","tooltip","discreteLegend","colorLegend","verticalCrosshairLine","colorPointStyleFill","pointStyle","pointStateDimensionHover","colorLineStyleFill","lineStyle","colorAreaStyleFill","areaStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotAreaPercent","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","areaPercentSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/areaPercent.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/areaPercent.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n percent,\n datasetXY,\n xBand,\n yLinear,\n initArea,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotAdapter,\n initPivot,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n lineStyle,\n areaStyle,\n verticalCrosshairLine,\n progressive,\n colorLegend,\n colorAdapter,\n linearColor,\n pivotColorLegend,\n pointStateDimensionHover,\n colorPointStyleFill,\n colorLineStyleFill,\n colorAreaStyleFill,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n} from '../pipes'\n\nconst areaPercent: VChartSpecPipeline = [\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n percent,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotAreaPercent: PivotChartSpecPipeline = [\n initPivot,\n\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initArea,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n percent,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n label,\n tooltip,\n verticalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateDimensionHover,\n colorLineStyleFill(lineStyle),\n colorAreaStyleFill(areaStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const areaPercentSpecPipeline = [pivotAdapter(areaPercent, pivotAreaPercent)]\n"],"names":["areaPercent","initArea","stackInverse","colorAdapter","color","linearColor","backgroundColor","percent","datasetXY","progressive","xBand","yLinear","label","tooltip","discreteLegend","colorLegend","verticalCrosshairLine","colorPointStyleFill","pointStyle","pointStateDimensionHover","colorLineStyleFill","lineStyle","colorAreaStyleFill","areaStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotAreaPercent","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","areaPercentSpecPipeline","pivotAdapter"],"mappings":";AA4CA,MAAMA,cAAkC;IACtCC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC,oBAAoBC;IACpBC;IACAC,mBAAmBC;IACnBC,mBAAmBC;IACnBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,mBAA2C;IAC/CC;IAEAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAwB,eAAevB;QACfC;QACAC;QACAG;QACAC,oBAAoBC;QACpBC;QACAC,mBAAmBC;QACnBC,mBAAmBC;QACnBC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACAlC,aAAamC,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,0BAA0B;IAACC,aAAa1C,aAAa4B;CAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, discreteLegend, horizontalCrosshairRect, initBar, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
|
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, horizontalCrosshairRect, initBar, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
|
|
2
2
|
const bar = [
|
|
3
3
|
initBar,
|
|
4
4
|
stackCornerRadius,
|
|
@@ -46,7 +46,8 @@ const pivotBar = [
|
|
|
46
46
|
pivotRowDimensions,
|
|
47
47
|
pivotColumnDimensions,
|
|
48
48
|
pivotTitle,
|
|
49
|
-
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
49
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend),
|
|
50
|
+
dimensionLinkage
|
|
50
51
|
];
|
|
51
52
|
const barSpecPipeline = [
|
|
52
53
|
pivotAdapter(bar, pivotBar)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n pivotAxisStyle,\n pivotTitle,\n} from '../pipes'\n\nconst bar: VChartSpecPipeline = [\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBar: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n pivotAxisStyle(yBand),\n label,\n tooltip,\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const barSpecPipeline = [pivotAdapter(bar, pivotBar)]\n"],"names":["bar","initBar","stackCornerRadius","barMaxWidth","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBar","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","barSpecPipeline","pivotAdapter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n} from '../pipes'\n\nconst bar: VChartSpecPipeline = [\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n tooltip,\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBar: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n pivotAxisStyle(yBand),\n label,\n tooltip,\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const barSpecPipeline = [pivotAdapter(bar, pivotBar)]\n"],"names":["bar","initBar","stackCornerRadius","barMaxWidth","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBar","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","barSpecPipeline","pivotAdapter"],"mappings":";AAuCA,MAAMA,MAA0B;IAC9BC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,WAAmC;IACvCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd3B;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAmB,eAAelB;QACfC;QACAC;QACAI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA5B,aAAa6B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,kBAAkB;IAACC,aAAarC,KAAKuB;CAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, discreteLegend, horizontalCrosshairRect, initBarParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
|
|
1
|
+
import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, horizontalCrosshairRect, initBarParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
|
|
2
2
|
const barParallel = [
|
|
3
3
|
initBarParallel,
|
|
4
4
|
stackCornerRadius,
|
|
@@ -46,7 +46,8 @@ const pivotBarParallel = [
|
|
|
46
46
|
pivotRowDimensions,
|
|
47
47
|
pivotColumnDimensions,
|
|
48
48
|
pivotTitle,
|
|
49
|
-
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
|
49
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend),
|
|
50
|
+
dimensionLinkage
|
|
50
51
|
];
|
|
51
52
|
const barParallelSpecPipeline = [
|
|
52
53
|
pivotAdapter(barParallel, pivotBarParallel)
|