@visactor/vseed 0.1.33 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/builder.d.ts +1189 -3271
  4. package/dist/esm/pipeline/advanced/chart/pipes/config/column.d.ts +2 -0
  5. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +31 -0
  6. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -0
  7. package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +19 -3
  8. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +21 -3
  9. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -0
  10. package/dist/esm/pipeline/advanced/chart/pipes/config/line.d.ts +2 -0
  11. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +30 -0
  12. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -0
  13. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.d.ts +2 -0
  14. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +27 -0
  15. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -0
  16. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +3 -1
  17. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
  18. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +2 -2
  19. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
  20. package/dist/esm/pipeline/spec/chart/pipes/init/funnel.js +0 -3
  21. package/dist/esm/pipeline/spec/chart/pipes/init/funnel.js.map +1 -1
  22. package/dist/esm/pipeline/spec/chart/pipes/label/label.js +5 -4
  23. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  24. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +26 -11
  25. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
  26. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.d.ts +2 -0
  27. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js +19 -0
  28. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js.map +1 -0
  29. package/dist/esm/pipeline/spec/chart/pipes/legend/index.d.ts +1 -0
  30. package/dist/esm/pipeline/spec/chart/pipes/legend/index.js +2 -1
  31. package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js +8 -3
  32. package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
  33. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.js +1 -1
  34. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.js.map +1 -1
  35. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.d.ts +2 -0
  36. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js +22 -0
  37. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js.map +1 -0
  38. package/dist/esm/pipeline/spec/chart/pipes/markStyle/index.d.ts +1 -0
  39. package/dist/esm/pipeline/spec/chart/pipes/markStyle/index.js +2 -1
  40. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js +0 -1
  41. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
  42. package/dist/esm/pipeline/utils/constant.d.ts +1 -0
  43. package/dist/esm/pipeline/utils/constant.js +2 -1
  44. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  45. package/dist/esm/theme/common/funnelTransform.d.ts +3 -0
  46. package/dist/esm/theme/common/funnelTransform.js +11 -0
  47. package/dist/esm/theme/common/funnelTransform.js.map +1 -0
  48. package/dist/esm/theme/common/heatmapCell.d.ts +3 -0
  49. package/dist/esm/theme/common/heatmapCell.js +9 -0
  50. package/dist/esm/theme/common/heatmapCell.js.map +1 -0
  51. package/dist/esm/theme/common/table.d.ts +47 -5
  52. package/dist/esm/theme/common/table.js.map +1 -1
  53. package/dist/esm/theme/dark/dark.js +4 -0
  54. package/dist/esm/theme/dark/dark.js.map +1 -1
  55. package/dist/esm/theme/light/light.js +4 -0
  56. package/dist/esm/theme/light/light.js.map +1 -1
  57. package/dist/esm/types/advancedVSeed.d.ts +160 -958
  58. package/dist/esm/types/properties/config/annotation/zAnnotaion.d.ts +1 -1
  59. package/dist/esm/types/properties/config/annotation/zAnnotaion.js +2 -2
  60. package/dist/esm/types/properties/config/annotation/zAnnotaion.js.map +1 -1
  61. package/dist/esm/types/properties/config/area.d.ts +647 -0
  62. package/dist/esm/types/properties/config/area.js +26 -0
  63. package/dist/esm/types/properties/config/area.js.map +1 -0
  64. package/dist/esm/types/properties/config/axes/bandAxis.d.ts +149 -1
  65. package/dist/esm/types/properties/config/axes/linearAxis.d.ts +151 -1
  66. package/dist/esm/types/properties/config/bar.d.ts +970 -0
  67. package/dist/esm/types/properties/config/bar.js +29 -0
  68. package/dist/esm/types/properties/config/bar.js.map +1 -0
  69. package/dist/esm/types/properties/config/column.d.ts +970 -0
  70. package/dist/esm/types/properties/config/column.js +29 -0
  71. package/dist/esm/types/properties/config/column.js.map +1 -0
  72. package/dist/esm/types/properties/config/config.d.ts +138 -5667
  73. package/dist/esm/types/properties/config/config.js +13 -142
  74. package/dist/esm/types/properties/config/config.js.map +1 -1
  75. package/dist/esm/types/properties/config/dualAxis.d.ts +566 -0
  76. package/dist/esm/types/properties/config/dualAxis.js +29 -0
  77. package/dist/esm/types/properties/config/dualAxis.js.map +1 -0
  78. package/dist/esm/types/properties/config/funnel.d.ts +124 -0
  79. package/dist/esm/types/properties/config/funnel.js +20 -0
  80. package/dist/esm/types/properties/config/funnel.js.map +1 -0
  81. package/dist/esm/types/properties/config/funnelTransform/funnelTransform.d.ts +13 -0
  82. package/dist/esm/types/properties/config/funnelTransform/funnelTransform.js +0 -0
  83. package/dist/esm/types/properties/config/funnelTransform/index.d.ts +2 -0
  84. package/dist/esm/types/properties/config/funnelTransform/index.js +1 -0
  85. package/dist/esm/types/properties/config/funnelTransform/zFunnelTransform.d.ts +5 -0
  86. package/dist/esm/types/properties/config/funnelTransform/zFunnelTransform.js +8 -0
  87. package/dist/esm/types/properties/config/funnelTransform/zFunnelTransform.js.map +1 -0
  88. package/dist/esm/types/properties/config/heatmap/heatmap.d.ts +17 -0
  89. package/dist/esm/types/properties/config/heatmap/heatmap.js +0 -0
  90. package/dist/esm/types/properties/config/heatmap/index.d.ts +2 -0
  91. package/dist/esm/types/properties/config/heatmap/index.js +1 -0
  92. package/dist/esm/types/properties/config/heatmap/zHeatmap.d.ts +6 -0
  93. package/dist/esm/types/properties/config/heatmap/zHeatmap.js +9 -0
  94. package/dist/esm/types/properties/config/heatmap/zHeatmap.js.map +1 -0
  95. package/dist/esm/types/properties/config/heatmap.d.ts +125 -0
  96. package/dist/esm/types/properties/config/heatmap.js +20 -0
  97. package/dist/esm/types/properties/config/heatmap.js.map +1 -0
  98. package/dist/esm/types/properties/config/index.d.ts +17 -2
  99. package/dist/esm/types/properties/config/index.js +17 -2
  100. package/dist/esm/types/properties/config/line.d.ts +324 -0
  101. package/dist/esm/types/properties/config/line.js +25 -0
  102. package/dist/esm/types/properties/config/line.js.map +1 -0
  103. package/dist/esm/types/properties/config/pie.d.ts +364 -0
  104. package/dist/esm/types/properties/config/pie.js +21 -0
  105. package/dist/esm/types/properties/config/pie.js.map +1 -0
  106. package/dist/esm/types/properties/config/pivotGrid/index.d.ts +2 -0
  107. package/dist/esm/types/properties/config/pivotGrid/index.js +2 -0
  108. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +10 -0
  109. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +12 -0
  110. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -0
  111. package/dist/esm/types/properties/config/pivotTable.d.ts +18 -0
  112. package/dist/esm/types/properties/config/pivotTable.js +5 -0
  113. package/dist/esm/types/properties/config/pivotTable.js.map +1 -0
  114. package/dist/esm/types/properties/config/rose.d.ts +241 -0
  115. package/dist/esm/types/properties/config/rose.js +19 -0
  116. package/dist/esm/types/properties/config/rose.js.map +1 -0
  117. package/dist/esm/types/properties/config/scatter.d.ts +357 -0
  118. package/dist/esm/types/properties/config/scatter.js +27 -0
  119. package/dist/esm/types/properties/config/scatter.js.map +1 -0
  120. package/dist/esm/types/properties/config/table.d.ts +18 -0
  121. package/dist/esm/types/properties/config/table.js +21 -0
  122. package/dist/esm/types/properties/config/table.js.map +1 -0
  123. package/dist/esm/types/properties/theme/customTheme.d.ts +161 -959
  124. package/dist/umd/index.js +241 -137
  125. package/dist/umd/index.js.map +1 -1
  126. package/package.json +3 -3
  127. package/dist/esm/pipeline/advanced/chart/pipes/config/config.d.ts +0 -17
  128. package/dist/esm/pipeline/advanced/chart/pipes/config/config.js +0 -89
  129. package/dist/esm/pipeline/advanced/chart/pipes/config/config.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const columnConfig: AdvancedPipe;
@@ -0,0 +1,31 @@
1
+ import { pick } from "remeda";
2
+ import { replaceNullToUndefined } from "../../../../utils/index.js";
3
+ const columnConfig = (advancedVSeed, context)=>{
4
+ const { vseed } = context;
5
+ const { chartType } = vseed;
6
+ const result = {
7
+ ...advancedVSeed
8
+ };
9
+ const pickedConfig = pick(vseed, [
10
+ 'backgroundColor',
11
+ 'color',
12
+ 'label',
13
+ 'legend',
14
+ 'tooltip',
15
+ 'xAxis',
16
+ 'yAxis',
17
+ 'crosshairRect',
18
+ 'stackCornerRadius'
19
+ ]);
20
+ const config = replaceNullToUndefined(pickedConfig);
21
+ result.config = {
22
+ ...result.config || {},
23
+ [chartType]: {
24
+ ...config
25
+ }
26
+ };
27
+ return result;
28
+ };
29
+ export { columnConfig };
30
+
31
+ //# sourceMappingURL=column.js.map
@@ -0,0 +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 ]) 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;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,3 +1,19 @@
1
- export * from './config';
2
- export * from './dualAxis';
3
- export * from './scatter';
1
+ import { lineConfig } from './line';
2
+ import { columnConfig } from './column';
3
+ import { pieConfig } from './pie';
4
+ import { dualAxisConfig } from './dualAxis';
5
+ import { scatterConfig } from './scatter';
6
+ export { lineConfig, columnConfig, pieConfig, dualAxisConfig, scatterConfig };
7
+ export declare const areaConfig: import("../../../../..").AdvancedPipe;
8
+ export declare const areaPercentConfig: import("../../../../..").AdvancedPipe;
9
+ export declare const barConfig: import("../../../../..").AdvancedPipe;
10
+ export declare const barParallelConfig: import("../../../../..").AdvancedPipe;
11
+ export declare const barPercentConfig: import("../../../../..").AdvancedPipe;
12
+ export declare const columnParallelConfig: import("../../../../..").AdvancedPipe;
13
+ export declare const columnPercentConfig: import("../../../../..").AdvancedPipe;
14
+ export declare const donutConfig: import("../../../../..").AdvancedPipe;
15
+ export declare const roseConfig: import("../../../../..").AdvancedPipe;
16
+ export declare const roseParallelConfig: import("../../../../..").AdvancedPipe;
17
+ export declare const radarConfig: import("../../../../..").AdvancedPipe;
18
+ export declare const funnelConfig: import("../../../../..").AdvancedPipe;
19
+ export declare const heatmapConfig: import("../../../../..").AdvancedPipe;
@@ -1,3 +1,21 @@
1
- export * from "./config.js";
2
- export * from "./dualAxis.js";
3
- export * from "./scatter.js";
1
+ import { lineConfig } from "./line.js";
2
+ import { columnConfig } from "./column.js";
3
+ import { pieConfig } from "./pie.js";
4
+ import { dualAxisConfig } from "./dualAxis.js";
5
+ import { scatterConfig } from "./scatter.js";
6
+ const areaConfig = lineConfig;
7
+ const areaPercentConfig = lineConfig;
8
+ const barConfig = columnConfig;
9
+ const barParallelConfig = columnConfig;
10
+ const barPercentConfig = columnConfig;
11
+ const columnParallelConfig = columnConfig;
12
+ const columnPercentConfig = columnConfig;
13
+ const donutConfig = pieConfig;
14
+ const roseConfig = pieConfig;
15
+ const roseParallelConfig = pieConfig;
16
+ const radarConfig = pieConfig;
17
+ const funnelConfig = pieConfig;
18
+ const heatmapConfig = pieConfig;
19
+ export { areaConfig, areaPercentConfig, barConfig, barParallelConfig, barPercentConfig, columnConfig, columnParallelConfig, columnPercentConfig, donutConfig, dualAxisConfig, funnelConfig, heatmapConfig, lineConfig, pieConfig, radarConfig, roseConfig, roseParallelConfig, scatterConfig };
20
+
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/config/index.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/index.ts"],"sourcesContent":["import { lineConfig } from './line'\nimport { columnConfig } from './column'\nimport { pieConfig } from './pie'\nimport { dualAxisConfig } from './dualAxis'\nimport { scatterConfig } from './scatter'\n\nexport { lineConfig, columnConfig, pieConfig, dualAxisConfig, scatterConfig }\n\n// area\nexport const areaConfig = lineConfig\nexport const areaPercentConfig = lineConfig\n\n// bar\nexport const barConfig = columnConfig\nexport const barParallelConfig = columnConfig\nexport const barPercentConfig = columnConfig\n\n// column\nexport const columnParallelConfig = columnConfig\nexport const columnPercentConfig = columnConfig\n\n// donut, rose\nexport const donutConfig = pieConfig\nexport const roseConfig = pieConfig\nexport const roseParallelConfig = pieConfig\nexport const radarConfig = pieConfig\n\n// funnel, heatmap\nexport const funnelConfig = pieConfig\nexport const heatmapConfig = pieConfig\n"],"names":["areaConfig","lineConfig","areaPercentConfig","barConfig","columnConfig","barParallelConfig","barPercentConfig","columnParallelConfig","columnPercentConfig","donutConfig","pieConfig","roseConfig","roseParallelConfig","radarConfig","funnelConfig","heatmapConfig"],"mappings":";;;;;AASO,MAAMA,aAAaC;AACnB,MAAMC,oBAAoBD;AAG1B,MAAME,YAAYC;AAClB,MAAMC,oBAAoBD;AAC1B,MAAME,mBAAmBF;AAGzB,MAAMG,uBAAuBH;AAC7B,MAAMI,sBAAsBJ;AAG5B,MAAMK,cAAcC;AACpB,MAAMC,aAAaD;AACnB,MAAME,qBAAqBF;AAC3B,MAAMG,cAAcH;AAGpB,MAAMI,eAAeJ;AACrB,MAAMK,gBAAgBL"}
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const lineConfig: AdvancedPipe;
@@ -0,0 +1,30 @@
1
+ import { pick } from "remeda";
2
+ import { replaceNullToUndefined } from "../../../../utils/index.js";
3
+ const lineConfig = (advancedVSeed, context)=>{
4
+ const { vseed } = context;
5
+ const { chartType } = vseed;
6
+ const result = {
7
+ ...advancedVSeed
8
+ };
9
+ const pickedConfig = pick(vseed, [
10
+ 'backgroundColor',
11
+ 'color',
12
+ 'label',
13
+ 'legend',
14
+ 'tooltip',
15
+ 'xAxis',
16
+ 'yAxis',
17
+ 'crosshairLine'
18
+ ]);
19
+ const config = replaceNullToUndefined(pickedConfig);
20
+ result.config = {
21
+ ...result.config || {},
22
+ [chartType]: {
23
+ ...config
24
+ }
25
+ };
26
+ return result;
27
+ };
28
+ export { lineConfig };
29
+
30
+ //# sourceMappingURL=line.js.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const pieConfig: AdvancedPipe;
@@ -0,0 +1,27 @@
1
+ import { pick } from "remeda";
2
+ import { replaceNullToUndefined } from "../../../../utils/index.js";
3
+ const pieConfig = (advancedVSeed, context)=>{
4
+ const { vseed } = context;
5
+ const { chartType } = vseed;
6
+ const result = {
7
+ ...advancedVSeed
8
+ };
9
+ const pickedConfig = pick(vseed, [
10
+ 'backgroundColor',
11
+ 'color',
12
+ 'label',
13
+ 'legend',
14
+ 'tooltip'
15
+ ]);
16
+ const config = replaceNullToUndefined(pickedConfig);
17
+ result.config = {
18
+ ...result.config || {},
19
+ [chartType]: {
20
+ ...config
21
+ }
22
+ };
23
+ return result;
24
+ };
25
+ export { pieConfig };
26
+
27
+ //# sourceMappingURL=pie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/config/pie.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/pie.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport { replaceNullToUndefined } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, Config } from 'src/types'\n\nexport const pieConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const pickedConfig = pick(vseed, ['backgroundColor', 'color', 'label', 'legend', 'tooltip']) as Config['pie']\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":["pieConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined"],"mappings":";;AAIO,MAAMA,YAA0B,CAACC,eAAeC;IACrD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMK,eAAeC,KAAKJ,OAAO;QAAC;QAAmB;QAAS;QAAS;QAAU;KAAU;IAE3F,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,4 +1,4 @@
1
- import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorFunnelStyleFill, colorLegend, datasetPivot, datasetXY, discreteLegend, funnelStyle, initFunnel, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, tooltip } from "../pipes/index.js";
1
+ import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorFunnelStyleFill, colorLegend, datasetPivot, datasetXY, discreteLegend, funnelStyle, funnelTransformStyle, initFunnel, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotHideIndicatorName, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, tooltip } from "../pipes/index.js";
2
2
  const funnel = [
3
3
  initFunnel,
4
4
  backgroundColor,
@@ -7,6 +7,7 @@ const funnel = [
7
7
  label,
8
8
  colorAdapter(discreteLegend, colorLegend),
9
9
  colorFunnelStyleFill(funnelStyle),
10
+ funnelTransformStyle,
10
11
  tooltip,
11
12
  annotationPoint,
12
13
  annotationVerticalLine,
@@ -27,6 +28,7 @@ const pivotFunnel = [
27
28
  label,
28
29
  tooltip,
29
30
  colorFunnelStyleFill(funnelStyle),
31
+ funnelTransformStyle,
30
32
  annotationPoint,
31
33
  annotationVerticalLine,
32
34
  annotationHorizontalLine,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/funnel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/funnel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n datasetXY,\n datasetPivot,\n initPivot,\n label,\n pivotAdapter,\n pivotColumnDimensions,\n pivotGridStyle,\n pivotIndicators,\n pivotIndicatorsAsRow,\n pivotRowDimensions,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n initFunnel,\n discreteLegend,\n color,\n funnelStyle,\n linearColor,\n colorAdapter,\n colorLegend,\n colorFunnelStyleFill,\n pivotDiscreteLegend,\n pivotColorLegend,\n pivotHideIndicatorName,\n} from '../pipes'\n\nconst funnel: SpecPipeline = [\n initFunnel,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n colorAdapter(discreteLegend, colorLegend),\n colorFunnelStyleFill(funnelStyle),\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotFunnel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initFunnel,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n tooltip,\n colorFunnelStyleFill(funnelStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const funnelSpecPipeline: SpecPipeline = [pivotAdapter(funnel, pivotFunnel)]\n"],"names":["funnel","initFunnel","backgroundColor","datasetXY","colorAdapter","color","linearColor","label","discreteLegend","colorLegend","colorFunnelStyleFill","funnelStyle","tooltip","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotFunnel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","funnelSpecPipeline","pivotAdapter"],"mappings":";AA+BA,MAAMA,SAAuB;IAC3BC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAH,aAAaI,gBAAgBC;IAC7BC,qBAAqBC;IACrBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAA4B;IAChCC;IACAC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdtB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAK;QACAF,qBAAqBC;QACrBE;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACArB,aAAasB,qBAAqBC;CACnC;AAEM,MAAMC,qBAAmC;IAACC,aAAa7B,QAAQiB;CAAa"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/funnel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/funnel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n backgroundColor,\n datasetXY,\n datasetPivot,\n initPivot,\n label,\n pivotAdapter,\n pivotColumnDimensions,\n pivotGridStyle,\n pivotIndicators,\n pivotIndicatorsAsRow,\n pivotRowDimensions,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n initFunnel,\n discreteLegend,\n color,\n funnelStyle,\n linearColor,\n colorAdapter,\n colorLegend,\n colorFunnelStyleFill,\n pivotDiscreteLegend,\n pivotColorLegend,\n pivotHideIndicatorName,\n funnelTransformStyle,\n} from '../pipes'\n\nconst funnel: SpecPipeline = [\n initFunnel,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n colorAdapter(discreteLegend, colorLegend),\n colorFunnelStyleFill(funnelStyle),\n funnelTransformStyle,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotFunnel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n pivotHideIndicatorName,\n datasetPivot,\n pivotIndicators([\n initFunnel,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n tooltip,\n colorFunnelStyleFill(funnelStyle),\n funnelTransformStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const funnelSpecPipeline: SpecPipeline = [pivotAdapter(funnel, pivotFunnel)]\n"],"names":["funnel","initFunnel","backgroundColor","datasetXY","colorAdapter","color","linearColor","label","discreteLegend","colorLegend","colorFunnelStyleFill","funnelStyle","funnelTransformStyle","tooltip","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotFunnel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","pivotHideIndicatorName","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","funnelSpecPipeline","pivotAdapter"],"mappings":";AAgCA,MAAMA,SAAuB;IAC3BC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAH,aAAaI,gBAAgBC;IAC7BC,qBAAqBC;IACrBC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAA4B;IAChCC;IACAC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdvB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAM;QACAH,qBAAqBC;QACrBC;QACAE;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAtB,aAAauB,qBAAqBC;CACnC;AAEM,MAAMC,qBAAmC;IAACC,aAAa9B,QAAQkB;CAAa"}
@@ -1,4 +1,4 @@
1
- import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, cellStyle, color, colorAdapter, colorCellStyleFill, colorLegend, datasetPivot, datasetXY, discreteLegend, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, tooltipHeatmap } from "../pipes/index.js";
1
+ import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, cellStyle, color, colorAdapter, colorCellStyleFill, datasetPivot, datasetXY, discreteLegend, heatmapColorLegend, initPivot, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, tooltipHeatmap } from "../pipes/index.js";
2
2
  import { initHeatmap } from "../pipes/init/heatmap.js";
3
3
  const heatmap = [
4
4
  initHeatmap,
@@ -6,7 +6,7 @@ const heatmap = [
6
6
  datasetXY,
7
7
  colorAdapter(color, linearColor),
8
8
  label,
9
- colorAdapter(discreteLegend, colorLegend),
9
+ colorAdapter(discreteLegend, heatmapColorLegend),
10
10
  colorCellStyleFill(cellStyle),
11
11
  tooltipHeatmap,
12
12
  annotationPoint,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/heatmap.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/heatmap.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltipHeatmap,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n discreteLegend,\n color,\n colorAdapter,\n linearColor,\n colorLegend,\n cellStyle,\n colorCellStyleFill,\n pivotDiscreteLegend,\n pivotColorLegend,\n} from '../pipes'\nimport { initHeatmap } from '../pipes/init/heatmap'\n\nconst heatmap: SpecPipeline = [\n initHeatmap,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n colorAdapter(discreteLegend, colorLegend),\n colorCellStyleFill(cellStyle),\n tooltipHeatmap,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotHeatmap: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initHeatmap,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n tooltipHeatmap,\n colorCellStyleFill(cellStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const heatmapSpecPipeline: SpecPipeline = [pivotAdapter(heatmap, pivotHeatmap)]\n"],"names":["heatmap","initHeatmap","backgroundColor","datasetXY","colorAdapter","color","linearColor","label","discreteLegend","colorLegend","colorCellStyleFill","cellStyle","tooltipHeatmap","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotHeatmap","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","heatmapSpecPipeline","pivotAdapter"],"mappings":";;AA8BA,MAAMA,UAAwB;IAC5BC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAH,aAAaI,gBAAgBC;IAC7BC,mBAAmBC;IACnBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdrB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAK;QACAF,mBAAmBC;QACnBE;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACApB,aAAaqB,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAa5B,SAASiB;CAAc"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/heatmap.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/heatmap.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltipHeatmap,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n discreteLegend,\n color,\n colorAdapter,\n linearColor,\n heatmapColorLegend,\n cellStyle,\n colorCellStyleFill,\n pivotDiscreteLegend,\n pivotColorLegend,\n} from '../pipes'\nimport { initHeatmap } from '../pipes/init/heatmap'\n\nconst heatmap: SpecPipeline = [\n initHeatmap,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n colorAdapter(discreteLegend, heatmapColorLegend),\n colorCellStyleFill(cellStyle),\n tooltipHeatmap,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotHeatmap: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initHeatmap,\n backgroundColor,\n datasetXY,\n colorAdapter(color, linearColor),\n label,\n tooltipHeatmap,\n colorCellStyleFill(cellStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const heatmapSpecPipeline: SpecPipeline = [pivotAdapter(heatmap, pivotHeatmap)]\n"],"names":["heatmap","initHeatmap","backgroundColor","datasetXY","colorAdapter","color","linearColor","label","discreteLegend","heatmapColorLegend","colorCellStyleFill","cellStyle","tooltipHeatmap","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotHeatmap","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","heatmapSpecPipeline","pivotAdapter"],"mappings":";;AA8BA,MAAMA,UAAwB;IAC5BC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAH,aAAaI,gBAAgBC;IAC7BC,mBAAmBC;IACnBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdrB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAK;QACAF,mBAAmBC;QACnBE;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACApB,aAAaqB,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAa5B,SAASiB;CAAc"}
@@ -18,9 +18,6 @@ const initFunnel = (spec, context)=>{
18
18
  clip: true
19
19
  }
20
20
  ];
21
- result.transformLabel = {
22
- visible: true
23
- };
24
21
  result.animation = true;
25
22
  return result;
26
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/funnel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/funnel.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const initFunnel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IFunnelChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n result.type = 'funnel'\n result.valueField = foldInfo.measureValue\n result.categoryField = unfoldInfo.encodingColorId\n\n result.padding = 0\n result.isTransform = true\n result.shape = 'rect'\n result.maxSize = '75%'\n result.minSize = '10%'\n result.region = [\n {\n clip: true,\n },\n ]\n\n result.transformLabel = {\n visible: true,\n }\n\n result.animation = true\n\n return result\n}\n"],"names":["initFunnel","spec","context","result","advancedVSeed","datasetReshapeInfo","foldInfo","unfoldInfo"],"mappings":"AAGO,MAAMA,aAAuB,CAACC,MAAMC;IACzC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAEtDF,OAAO,IAAI,GAAG;IACdA,OAAO,UAAU,GAAGG,SAAS,YAAY;IACzCH,OAAO,aAAa,GAAGI,WAAW,eAAe;IAEjDJ,OAAO,OAAO,GAAG;IACjBA,OAAO,WAAW,GAAG;IACrBA,OAAO,KAAK,GAAG;IACfA,OAAO,OAAO,GAAG;IACjBA,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IAEDA,OAAO,cAAc,GAAG;QACtB,SAAS;IACX;IAEAA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/funnel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/funnel.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const initFunnel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IFunnelChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n result.type = 'funnel'\n result.valueField = foldInfo.measureValue\n result.categoryField = unfoldInfo.encodingColorId\n\n result.padding = 0\n result.isTransform = true\n result.shape = 'rect'\n result.maxSize = '75%'\n result.minSize = '10%'\n result.region = [\n {\n clip: true,\n },\n ]\n\n result.animation = true\n\n return result\n}\n"],"names":["initFunnel","spec","context","result","advancedVSeed","datasetReshapeInfo","foldInfo","unfoldInfo"],"mappings":"AAGO,MAAMA,aAAuB,CAACC,MAAMC;IACzC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAEtDF,OAAO,IAAI,GAAG;IACdA,OAAO,UAAU,GAAGG,SAAS,YAAY;IACzCH,OAAO,aAAa,GAAGI,WAAW,eAAe;IAEjDJ,OAAO,OAAO,GAAG;IACjBA,OAAO,WAAW,GAAG;IACrBA,OAAO,KAAK,GAAG;IACfA,OAAO,OAAO,GAAG;IACjBA,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IAEDA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
@@ -1,6 +1,6 @@
1
- import { createFormatter, createFormatterByMeasure, findMeasureById } from "../../../../utils/index.js";
2
- import { merge, uniqueBy } from "remeda";
3
- import { MeasureName } from "../../../../../dataReshape/index.js";
1
+ import { DATUM_HIDE_KEY, createFormatter, createFormatterByMeasure, findMeasureById } from "../../../../utils/index.js";
2
+ import { isNumber, merge, uniqueBy } from "remeda";
3
+ import { MeasureName } from "../../../../../dataReshape/constant.js";
4
4
  const label_label = (spec, context)=>{
5
5
  const result = {
6
6
  ...spec
@@ -44,6 +44,7 @@ const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSe
44
44
  const percentFormatter = createFormatter(percentFormat);
45
45
  const result = {
46
46
  visible: enable,
47
+ dataFilter: (data)=>data.filter((entry)=>entry.data?.[DATUM_HIDE_KEY] !== true),
47
48
  formatMethod: (_, datum)=>{
48
49
  const result = [];
49
50
  const dimLabels = labelDims.map((item)=>{
@@ -57,7 +58,7 @@ const buildLabel = (label, vseedMeasures = [], vseedDimensions = [], advancedVSe
57
58
  const measure = findMeasureById(advancedVSeedMeasures, datum[measureId]);
58
59
  if (measure) {
59
60
  const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
60
- const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
61
+ const measurePercentLabel = isNumber(datum['__VCHART_ARC_RATIO']) ? generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter) : generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
61
62
  if (showValue) result.push(measureValueLabel);
62
63
  if (showValuePercent) result.push(measurePercentLabel);
63
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { IArcLabelSpec, ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport { createFormatter, createFormatterByMeasure, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n SpecPipe,\n} from 'src/types'\nimport { merge, uniqueBy } from 'remeda'\nimport { MeasureName } from 'src/dataReshape'\n\nexport const label: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel<ILineLikeLabelSpec>(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n )\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure: Measure,\n labelAutoFormat?: boolean,\n numFormat: NumFormat = {},\n) => {\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = <T extends ILineLikeLabelSpec | IArcLabelSpec>(\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedDimensions: Dimensions,\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: FoldInfo[],\n): T => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n showDimension,\n labelOverlap,\n labelColorSmartInvert,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat,\n numFormat = {},\n } = label\n\n const hasDimLabelEncoding = vseedDimensions.some((item) => encoding.label?.includes(item.id))\n\n const labelDims = uniqueBy(\n hasDimLabelEncoding\n ? vseedDimensions.filter((item) => encoding.label?.includes(item.id))\n : showDimension\n ? advancedVSeedDimensions.filter((d) => d.id !== MeasureName)\n : [],\n (item) => item.id,\n )\n\n const labelMeas = uniqueBy(\n vseedMeasures.filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n formatMethod: (_, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item) => {\n const id = item.id\n return datum[id] as number | string\n })\n\n const meaLabels = labelMeas.map((item) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n if (measure) {\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n const measurePercentLabel = generateMeasurePercent(\n datum[measureValue] as number | string,\n statistics.sum,\n percentFormatter,\n )\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n result.push(measurePercentLabel)\n }\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n } as T\n\n if (labelOverlap) {\n result.overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","showDimension","labelOverlap","labelColorSmartInvert","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","hasDimLabelEncoding","item","labelDims","uniqueBy","d","MeasureName","labelMeas","percentFormat","percentFormatter","createFormatter","_","datum","dimLabels","id","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","measurePercentLabel"],"mappings":";;;AAkBO,MAAMA,cAAkB,CAACC,MAAMC;IACpC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,SAAS,EAAEC,QAAQ,EAA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;gBAEhB;YACF;YAEA/D,OAAO,IAAI,IAAIyD;YAEf,IAAI1B,MACF,OAAO/B;YAET,OAAOA,OAAO,IAAI,CAAC;QACrB;QACA,UAAUyC;QACV,OAAO;YACL,MAAMJ;YACN,UAAUC;YACV,YAAYC;YACZ,YAAYC;QACd;QACA,aAAaJ;IACf;IAEA,IAAID,cACFnC,OAAO,OAAO,GAAG;QACf,WAAW;QACX,YAAY;IACd;IAGF,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/label/label.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/label/label.ts"],"sourcesContent":["import type { IArcLabelSpec, ILineChartSpec } from '@visactor/vchart'\nimport type { ILineLikeLabelSpec } from '@visactor/vchart/esm/series/mixin/interface'\nimport { createFormatter, createFormatterByMeasure, DATUM_HIDE_KEY, findMeasureById } from '../../../../utils'\nimport type {\n Datum,\n Dimensions,\n Encoding,\n FoldInfo,\n Formatter,\n Label,\n Measure,\n Measures,\n NumFormat,\n SpecPipe,\n} from 'src/types'\nimport { isNumber, merge, uniqueBy } from 'remeda'\nimport { MeasureName } from 'src/dataReshape/constant'\n\nexport const label: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { label: Label }\n const foldInfo = datasetReshapeInfo[0].foldInfo as FoldInfo\n\n const { label } = baseConfig\n\n result.label = buildLabel<ILineLikeLabelSpec>(\n label,\n vseed.measures,\n vseed.dimensions,\n advancedVSeed.dimensions,\n advancedVSeed.measures,\n encoding as Encoding,\n [foldInfo],\n )\n\n return result\n}\n\nexport const generateMeasureValue = (\n value: number | string,\n measure: Measure,\n labelAutoFormat?: boolean,\n numFormat: NumFormat = {},\n) => {\n const format = merge(numFormat, measure.numFormat || measure.format)\n const mergedMeasure = { ...measure, numFormat: format, autoFormat: labelAutoFormat || measure.autoFormat }\n\n const formatter = createFormatterByMeasure(mergedMeasure)\n return formatter(value)\n}\n\nexport const generateMeasurePercent = (value: number | string, sum: number, formatter: Formatter) => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const percentValue = num / sum\n return formatter(percentValue)\n}\n\nexport const buildLabel = <T extends ILineLikeLabelSpec | IArcLabelSpec>(\n label: Label,\n vseedMeasures: Measures = [],\n vseedDimensions: Dimensions = [],\n advancedVSeedDimensions: Dimensions,\n advancedVSeedMeasures: Measures,\n encoding: Encoding,\n foldInfoList: FoldInfo[],\n): T => {\n const {\n enable,\n wrap,\n showValue,\n showValuePercent,\n showDimension,\n labelOverlap,\n labelColorSmartInvert,\n labelColor,\n labelFontSize,\n labelFontWeight,\n labelBackgroundColor,\n labelPosition,\n autoFormat,\n numFormat = {},\n } = label\n\n const hasDimLabelEncoding = vseedDimensions.some((item) => encoding.label?.includes(item.id))\n\n const labelDims = uniqueBy(\n hasDimLabelEncoding\n ? vseedDimensions.filter((item) => encoding.label?.includes(item.id))\n : showDimension\n ? advancedVSeedDimensions.filter((d) => d.id !== MeasureName)\n : [],\n (item) => item.id,\n )\n\n const labelMeas = uniqueBy(\n vseedMeasures.filter((item) => encoding.label?.includes(item.id)),\n (item) => item.id,\n )\n\n const percentFormat: NumFormat = merge(numFormat, {\n type: 'percent',\n } as NumFormat)\n\n const percentFormatter = createFormatter(percentFormat)\n\n const result = {\n visible: enable,\n dataFilter: (data) => {\n return data.filter((entry) => {\n return entry.data?.[DATUM_HIDE_KEY] !== true\n })\n },\n formatMethod: (_, datum: Datum) => {\n const result = []\n\n const dimLabels = labelDims.map((item) => {\n const id = item.id\n return datum[id] as number | string\n })\n\n const meaLabels = labelMeas.map((item) =>\n generateMeasureValue(datum[item.id] as number | string, item, autoFormat, numFormat),\n )\n\n result.push(...dimLabels)\n\n foldInfoList.forEach((foldInfo) => {\n const { measureId, measureValue, statistics } = foldInfo\n const measure = findMeasureById(advancedVSeedMeasures, datum[measureId] as string)\n if (measure) {\n const measureValueLabel = generateMeasureValue(\n datum[measureValue] as number | string,\n measure,\n autoFormat,\n numFormat,\n )\n // 饼图/环图需要使用实际占比数据\n const measurePercentLabel = isNumber(datum['__VCHART_ARC_RATIO'])\n ? generateMeasurePercent(datum['__VCHART_ARC_RATIO'], 1, percentFormatter)\n : generateMeasurePercent(datum[measureValue] as number | string, statistics.sum, percentFormatter)\n if (showValue) {\n result.push(measureValueLabel)\n }\n if (showValuePercent) {\n result.push(measurePercentLabel)\n }\n }\n })\n\n result.push(...meaLabels)\n\n if (wrap) {\n return result\n }\n return result.join(' ')\n },\n position: labelPosition,\n style: {\n fill: labelColor,\n fontSize: labelFontSize,\n fontWeight: labelFontWeight,\n background: labelBackgroundColor,\n },\n smartInvert: labelColorSmartInvert,\n } as T\n\n if (labelOverlap) {\n result.overlap = {\n hideOnHit: true,\n clampForce: true,\n }\n }\n\n return result\n}\n"],"names":["label","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","encoding","baseConfig","foldInfo","buildLabel","generateMeasureValue","value","measure","labelAutoFormat","numFormat","format","merge","mergedMeasure","formatter","createFormatterByMeasure","generateMeasurePercent","sum","String","num","Number","percentValue","vseedMeasures","vseedDimensions","advancedVSeedDimensions","advancedVSeedMeasures","foldInfoList","enable","wrap","showValue","showValuePercent","showDimension","labelOverlap","labelColorSmartInvert","labelColor","labelFontSize","labelFontWeight","labelBackgroundColor","labelPosition","autoFormat","hasDimLabelEncoding","item","labelDims","uniqueBy","d","MeasureName","labelMeas","percentFormat","percentFormatter","createFormatter","data","entry","DATUM_HIDE_KEY","_","datum","dimLabels","id","meaLabels","measureId","measureValue","statistics","findMeasureById","measureValueLabel","measurePercentLabel","isNumber"],"mappings":";;;AAkBO,MAAMA,cAAkB,CAACC,MAAMC;IACpC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;I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,YACA7B;oBAGF,MAAMqD,sBAAsBC,SAASV,KAAK,CAAC,qBAAqB,IAC5DtC,uBAAuBsC,KAAK,CAAC,qBAAqB,EAAE,GAAGN,oBACvDhC,uBAAuBsC,KAAK,CAACK,aAAa,EAAqBC,WAAW,GAAG,EAAEZ;oBACnF,IAAInB,WACFhC,OAAO,IAAI,CAACiE;oBAEd,IAAIhC,kBACFjC,OAAO,IAAI,CAACkE;gBAEhB;YACF;YAEAlE,OAAO,IAAI,IAAI4D;YAEf,IAAI7B,MACF,OAAO/B;YAET,OAAOA,OAAO,IAAI,CAAC;QACrB;QACA,UAAUyC;QACV,OAAO;YACL,MAAMJ;YACN,UAAUC;YACV,YAAYC;YACZ,YAAYC;QACd;QACA,aAAaJ;IACf;IAEA,IAAID,cACFnC,OAAO,OAAO,GAAG;QACf,WAAW;QACX,YAAY;IACd;IAGF,OAAOA;AACT"}
@@ -55,14 +55,6 @@ const discreteLegend = (spec, context)=>{
55
55
  autoPage: true,
56
56
  orient,
57
57
  position: legendPosition,
58
- data: border ? (items)=>items.map((item)=>{
59
- item.shape.outerBorder = {
60
- stroke: item.shape.fill,
61
- distance: 3,
62
- lineWidth: 1
63
- };
64
- return item;
65
- }) : void 0,
66
58
  item: {
67
59
  focus: true,
68
60
  maxWidth: '30%',
@@ -73,9 +65,23 @@ const discreteLegend = (spec, context)=>{
73
65
  },
74
66
  shape: {
75
67
  space: border ? 6 : 4,
76
- style: {
77
- symbolType: shapeType,
78
- size: border ? 8 : 10
68
+ style: (item)=>({
69
+ symbolType: shapeType,
70
+ size: border ? 8 : 10,
71
+ fillOpacity: 1,
72
+ opacity: 1,
73
+ stroke: false,
74
+ outerBorder: border ? {
75
+ stroke: item.shape.fill,
76
+ distance: 3,
77
+ lineWidth: 1
78
+ } : null
79
+ }),
80
+ state: {
81
+ unSelected: {
82
+ opacity: 0.2,
83
+ fillOpacity: 1
84
+ }
79
85
  }
80
86
  },
81
87
  label: {
@@ -84,6 +90,12 @@ const discreteLegend = (spec, context)=>{
84
90
  fontSize: labelFontSize,
85
91
  fill: labelColor || labelFontColor,
86
92
  fontWeight: labelFontWeight
93
+ },
94
+ state: {
95
+ unSelected: {
96
+ fill: labelColor || labelFontColor,
97
+ fillOpacity: 0.8
98
+ }
87
99
  }
88
100
  },
89
101
  background: {
@@ -91,6 +103,9 @@ const discreteLegend = (spec, context)=>{
91
103
  selectedHover: {
92
104
  fill: labelColor || labelFontColor,
93
105
  fillOpacity: 0.05
106
+ },
107
+ unSelectedHover: {
108
+ fill: null
94
109
  }
95
110
  }
96
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/legend/discreteLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/discreteLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const discreteLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const {\n enable,\n position = 'bottom',\n labelFontColor,\n labelColor,\n labelFontSize = 12,\n labelFontWeight,\n maxSize = 1,\n border,\n shapeType = 'rectRound',\n } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'discrete',\n visible: enable,\n maxCol: Math.max(1, maxSize),\n maxRow: Math.max(1, maxSize),\n autoPage: true,\n orient,\n position: legendPosition,\n data: border\n ? (items) => {\n return items.map((item) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n item.shape.outerBorder = {\n stroke: item.shape.fill,\n distance: 3,\n lineWidth: 1,\n }\n return item\n })\n }\n : undefined,\n item: {\n focus: true,\n maxWidth: '30%',\n focusIconStyle: {\n size: labelFontSize + 2,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n shape: {\n space: border ? 6 : 4,\n style: {\n symbolType: shapeType,\n size: border ? 8 : 10,\n },\n },\n label: {\n formatMethod: (value) => {\n return unfoldInfo.colorIdMap[String(value)] ?? value\n },\n style: {\n fontSize: labelFontSize,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n },\n background: {\n state: {\n selectedHover: {\n fill: labelColor || labelFontColor,\n fillOpacity: 0.05,\n },\n },\n },\n },\n padding: 0,\n }\n return result\n}\n"],"names":["discreteLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelColor","labelFontSize","labelFontWeight","maxSize","border","shapeType","orient","legendPosition","Math","items","item","undefined","value","String"],"mappings":"AAEO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EACJE,MAAM,EACNC,WAAW,QAAQ,EACnBC,cAA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ACA,YAAY;gBACV,OAAO;oBACL,eAAe;wBACb,MAAMF,cAAcD;wBACpB,aAAa;oBACf;gBACF;YACF;QACF;QACA,SAAS;IACX;IACA,OAAOT;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/legend/discreteLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/discreteLegend.ts"],"sourcesContent":["import type { Legend, SpecPipe } from 'src/types'\n\nexport const discreteLegend: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n const baseConfig = advancedVSeed.config[chartType] as { legend: Legend }\n if (!baseConfig || !baseConfig.legend) {\n return result\n }\n\n const { legend } = baseConfig\n const {\n enable,\n position = 'bottom',\n labelFontColor,\n labelColor,\n labelFontSize = 12,\n labelFontWeight,\n maxSize = 1,\n border,\n shapeType = 'rectRound',\n } = legend || {}\n\n const orient = ['bottom', 'bottomLeft', 'bottomRight', 'bl', 'br'].includes(position)\n ? 'bottom'\n : ['top', 'topLeft', 'topRight', 'tl', 'tr'].includes(position)\n ? 'top'\n : ['left', 'leftTop', 'leftBottom', 'lt', 'lb'].includes(position)\n ? 'left'\n : 'right'\n\n const legendPosition = ['topLeft', 'bottomLeft', 'leftTop', 'rightTop', 'lt', 'rt', 'tl', 'bl'].includes(position)\n ? 'start'\n : ['topRight', 'bottomRight', 'leftBottom', 'rightBottom', 'lb', 'rb', 'rt', 'br'].includes(position)\n ? 'end'\n : 'middle'\n\n result.legends = {\n type: 'discrete',\n visible: enable,\n maxCol: Math.max(1, maxSize),\n maxRow: Math.max(1, maxSize),\n autoPage: true,\n orient,\n position: legendPosition,\n item: {\n focus: true,\n maxWidth: '30%',\n focusIconStyle: {\n size: labelFontSize + 2,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n shape: {\n space: border ? 6 : 4,\n style: (item) => {\n return {\n symbolType: shapeType,\n size: border ? 8 : 10,\n fillOpacity: 1,\n opacity: 1,\n stroke: false,\n outerBorder: border\n ? {\n stroke: item.shape.fill,\n distance: 3,\n lineWidth: 1,\n }\n : null,\n }\n },\n state: {\n unSelected: {\n opacity: 0.2,\n fillOpacity: 1, // 覆盖 vchart 里的默认值\n },\n },\n },\n label: {\n formatMethod: (value) => {\n return unfoldInfo.colorIdMap[String(value)] ?? value\n },\n style: {\n fontSize: labelFontSize,\n fill: labelColor || labelFontColor,\n fontWeight: labelFontWeight,\n },\n state: {\n unSelected: {\n fill: labelColor || labelFontColor, // 覆盖vchart里面的默认值\n fillOpacity: 0.8, // 覆盖 vchart 里的默认值\n },\n },\n },\n background: {\n state: {\n selectedHover: {\n fill: labelColor || labelFontColor,\n fillOpacity: 0.05,\n },\n unSelectedHover: {\n fill: null,\n },\n },\n },\n },\n padding: 0,\n }\n return result\n}\n"],"names":["discreteLegend","spec","context","result","advancedVSeed","datasetReshapeInfo","chartType","unfoldInfo","baseConfig","legend","enable","position","labelFontColor","labelColor","labelFontSize","labelFontWeight","maxSize","border","shapeType","orient","legendPosition","Math","item","value","String"],"mappings":"AAEO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAE,GAAGF;IAC1C,MAAM,EAAEG,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAC5C,MAAMG,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,IAAI,CAACE,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOL;IAGT,MAAM,EAAEM,MAAM,EAAE,GAAGD;IACnB,MAAM,EACJE,MAAM,EACNC,WAAW,QAAQ,EACnBC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAAE,EAClBC,eAAe,EACfC,UAAU,CAAC,EACXC,MAAM,EACNC,YAAY,WAAW,EACxB,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;oBACL,eAAe;wBACb,MAAMC,cAAcD;wBACpB,aAAa;oBACf;oBACA,iBAAiB;wBACf,MAAM;oBACR;gBACF;YACF;QACF;QACA,SAAS;IACX;IACA,OAAOT;AACT"}
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../../types';
2
+ export declare const heatmapColorLegend: SpecPipe;
@@ -0,0 +1,19 @@
1
+ import { colorLegend } from "./colorLegend.js";
2
+ import { DATUM_HIDE_KEY } from "../../../../utils/constant.js";
3
+ const heatmapColorLegend = (spec, context)=>{
4
+ const result = colorLegend(spec, context);
5
+ if (result.legends) result.legends.customFilter = (data, range, key)=>{
6
+ const min = Math.min(range[0], range[1]);
7
+ const max = Math.max(range[0], range[1]);
8
+ return (data ?? []).map((entry)=>{
9
+ const val = entry[key];
10
+ const isHide = val - min < -0.000001 || val - max > 1e-6;
11
+ entry[DATUM_HIDE_KEY] = isHide;
12
+ return entry;
13
+ });
14
+ };
15
+ return result;
16
+ };
17
+ export { heatmapColorLegend };
18
+
19
+ //# sourceMappingURL=heatmapColorLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/legend/heatmapColorLegend.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/legend/heatmapColorLegend.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport type { SpecPipe } from 'src/types'\nimport { colorLegend } from './colorLegend'\nimport type { Datum, IHeatmapChartSpec } from '@visactor/vchart'\nimport { DATUM_HIDE_KEY } from 'src/pipeline/utils/constant'\n\nexport const heatmapColorLegend: SpecPipe = (spec, context) => {\n const result = colorLegend(spec, context) as IHeatmapChartSpec\n\n if (result.legends) {\n ;(result.legends as any).customFilter = (data: Datum[], range: number[], key: string) => {\n const min = Math.min(range[0], range[1])\n const max = Math.max(range[0], range[1])\n return (data ?? []).map((entry: Datum) => {\n const val = entry[key]\n const isHide = val - min < -1e-6 || val - max > 1e-6\n\n entry[DATUM_HIDE_KEY] = isHide\n\n return entry\n })\n }\n }\n\n return result\n}\n"],"names":["heatmapColorLegend","spec","context","result","colorLegend","data","range","key","min","Math","max","entry","val","isHide","DATUM_HIDE_KEY"],"mappings":";;AAMO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAMC,SAASC,YAAYH,MAAMC;IAEjC,IAAIC,OAAO,OAAO,EACdA,OAAO,OAAO,CAAS,YAAY,GAAG,CAACE,MAAeC,OAAiBC;QACvE,MAAMC,MAAMC,KAAK,GAAG,CAACH,KAAK,CAAC,EAAE,EAAEA,KAAK,CAAC,EAAE;QACvC,MAAMI,MAAMD,KAAK,GAAG,CAACH,KAAK,CAAC,EAAE,EAAEA,KAAK,CAAC,EAAE;QACvC,OAAQD,AAAAA,CAAAA,QAAQ,EAAC,EAAG,GAAG,CAAC,CAACM;YACvB,MAAMC,MAAMD,KAAK,CAACJ,IAAI;YACtB,MAAMM,SAASD,MAAMJ,MAAM,aAASI,MAAMF,MAAM;YAEhDC,KAAK,CAACG,eAAe,GAAGD;YAExB,OAAOF;QACT;IACF;IAGF,OAAOR;AACT"}
@@ -2,3 +2,4 @@ export { discreteLegend } from './discreteLegend';
2
2
  export { pivotDiscreteLegend } from './pivotDiscreteLegend';
3
3
  export { colorLegend } from './colorLegend';
4
4
  export { pivotColorLegend } from './pivotColorLegend';
5
+ export { heatmapColorLegend } from './heatmapColorLegend';
@@ -2,4 +2,5 @@ import { discreteLegend } from "./discreteLegend.js";
2
2
  import { pivotDiscreteLegend } from "./pivotDiscreteLegend.js";
3
3
  import { colorLegend } from "./colorLegend.js";
4
4
  import { pivotColorLegend } from "./pivotColorLegend.js";
5
- export { colorLegend, discreteLegend, pivotColorLegend, pivotDiscreteLegend };
5
+ import { heatmapColorLegend } from "./heatmapColorLegend.js";
6
+ export { colorLegend, discreteLegend, heatmapColorLegend, pivotColorLegend, pivotDiscreteLegend };
@@ -1,17 +1,22 @@
1
- const cellStyle = (spec)=>{
1
+ import { DATUM_HIDE_KEY } from "../../../../utils/constant.js";
2
+ const cellStyle = (spec, context)=>{
2
3
  const result = {
3
4
  ...spec,
4
5
  cell: {
5
6
  style: {}
6
7
  }
7
8
  };
9
+ const { advancedVSeed, vseed } = context;
10
+ const { chartType } = vseed;
11
+ const cell = advancedVSeed.config?.[chartType]?.cell;
8
12
  return {
9
13
  ...result,
10
14
  cell: {
11
15
  style: {
16
+ visible: (datum)=>datum?.[DATUM_HIDE_KEY] !== true,
12
17
  shape: 'rect',
13
- stroke: '#ffffff',
14
- lineWidth: 1
18
+ stroke: cell?.stroke,
19
+ lineWidth: cell?.lineWidth ?? 1
15
20
  }
16
21
  }
17
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/cellStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/cellStyle.ts"],"sourcesContent":["import type { IHeatmapChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const cellStyle: SpecPipe = (spec) => {\n const result = {\n ...spec,\n cell: {\n style: {},\n },\n } as IHeatmapChartSpec\n\n return {\n ...result,\n cell: {\n style: {\n shape: 'rect',\n stroke: '#ffffff',\n lineWidth: 1,\n },\n },\n }\n}\n"],"names":["cellStyle","spec","result"],"mappings":"AAGO,MAAMA,YAAsB,CAACC;IAClC,MAAMC,SAAS;QACb,GAAGD,IAAI;QACP,MAAM;YACJ,OAAO,CAAC;QACV;IACF;IAEA,OAAO;QACL,GAAGC,MAAM;QACT,MAAM;YACJ,OAAO;gBACL,OAAO;gBACP,QAAQ;gBACR,WAAW;YACb;QACF;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/cellStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/cellStyle.ts"],"sourcesContent":["import type { IHeatmapChartSpec } from '@visactor/vchart'\nimport { DATUM_HIDE_KEY } from 'src/pipeline/utils/constant'\nimport type { SpecPipe } from 'src/types'\n\nexport const cellStyle: SpecPipe = (spec, context) => {\n const result = {\n ...spec,\n cell: {\n style: {},\n },\n } as IHeatmapChartSpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const cell = advancedVSeed.config?.[chartType as 'heatmap']?.cell\n\n return {\n ...result,\n cell: {\n style: {\n visible: (datum: any) => {\n return datum?.[DATUM_HIDE_KEY] !== true\n },\n shape: 'rect',\n stroke: cell?.stroke,\n lineWidth: cell?.lineWidth ?? 1,\n },\n },\n }\n}\n"],"names":["cellStyle","spec","context","result","advancedVSeed","vseed","chartType","cell","datum","DATUM_HIDE_KEY"],"mappings":";AAIO,MAAMA,YAAsB,CAACC,MAAMC;IACxC,MAAMC,SAAS;QACb,GAAGF,IAAI;QACP,MAAM;YACJ,OAAO,CAAC;QACV;IACF;IACA,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAME,OAAOH,cAAc,MAAM,EAAE,CAACE,UAAuB,EAAE;IAE7D,OAAO;QACL,GAAGH,MAAM;QACT,MAAM;YACJ,OAAO;gBACL,SAAS,CAACK,QACDA,OAAO,CAACC,eAAe,KAAK;gBAErC,OAAO;gBACP,QAAQF,MAAM;gBACd,WAAWA,MAAM,aAAa;YAChC;QACF;IACF;AACF"}
@@ -9,7 +9,7 @@ const funnelStyle = (spec)=>{
9
9
  ...result,
10
10
  funnel: {
11
11
  style: {
12
- cornerRadius: 4
12
+ cornerRadius: 0
13
13
  },
14
14
  state: {
15
15
  hover: {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/funnelStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/funnelStyle.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const funnelStyle: SpecPipe = (spec) => {\n const result = {\n ...spec,\n funnel: {\n style: {},\n },\n } as IFunnelChartSpec\n\n return {\n ...result,\n funnel: {\n style: {\n cornerRadius: 4,\n },\n state: {\n hover: {\n fillOpacity: 0.6,\n },\n },\n },\n }\n}\n"],"names":["funnelStyle","spec","result"],"mappings":"AAGO,MAAMA,cAAwB,CAACC;IACpC,MAAMC,SAAS;QACb,GAAGD,IAAI;QACP,QAAQ;YACN,OAAO,CAAC;QACV;IACF;IAEA,OAAO;QACL,GAAGC,MAAM;QACT,QAAQ;YACN,OAAO;gBACL,cAAc;YAChB;YACA,OAAO;gBACL,OAAO;oBACL,aAAa;gBACf;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/funnelStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/funnelStyle.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const funnelStyle: SpecPipe = (spec) => {\n const result = {\n ...spec,\n funnel: {\n style: {},\n },\n } as IFunnelChartSpec\n\n return {\n ...result,\n funnel: {\n style: {\n cornerRadius: 0,\n },\n state: {\n hover: {\n fillOpacity: 0.6,\n },\n },\n },\n }\n}\n"],"names":["funnelStyle","spec","result"],"mappings":"AAGO,MAAMA,cAAwB,CAACC;IACpC,MAAMC,SAAS;QACb,GAAGD,IAAI;QACP,QAAQ;YACN,OAAO,CAAC;QACV;IACF;IAEA,OAAO;QACL,GAAGC,MAAM;QACT,QAAQ;YACN,OAAO;gBACL,cAAc;YAChB;YACA,OAAO;gBACL,OAAO;oBACL,aAAa;gBACf;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../../types';
2
+ export declare const funnelTransformStyle: SpecPipe;
@@ -0,0 +1,22 @@
1
+ const funnelTransformStyle = (spec, context)=>{
2
+ const { advancedVSeed, vseed } = context;
3
+ const { chartType } = vseed;
4
+ const config = advancedVSeed.config?.[chartType]?.transform;
5
+ return {
6
+ ...spec,
7
+ transform: {
8
+ style: {
9
+ fill: config?.backgroundColor
10
+ }
11
+ },
12
+ transformLabel: {
13
+ visible: true,
14
+ style: {
15
+ fill: config?.textColor
16
+ }
17
+ }
18
+ };
19
+ };
20
+ export { funnelTransformStyle };
21
+
22
+ //# sourceMappingURL=funnelTransformStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.ts"],"sourcesContent":["import type { SpecPipe } from 'src/types'\n\nexport const funnelTransformStyle: SpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const config = advancedVSeed.config?.[chartType as 'funnel']?.transform\n\n return {\n ...spec,\n transform: {\n style: {\n fill: config?.backgroundColor,\n },\n },\n transformLabel: {\n visible: true,\n style: {\n fill: config?.textColor,\n },\n },\n }\n}\n"],"names":["funnelTransformStyle","spec","context","advancedVSeed","vseed","chartType","config"],"mappings":"AAEO,MAAMA,uBAAiC,CAACC,MAAMC;IACnD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,SAAS,EAAE,GAAGD;IACtB,MAAME,SAASH,cAAc,MAAM,EAAE,CAACE,UAAsB,EAAE;IAE9D,OAAO;QACL,GAAGJ,IAAI;QACP,WAAW;YACT,OAAO;gBACL,MAAMK,QAAQ;YAChB;QACF;QACA,gBAAgB;YACd,SAAS;YACT,OAAO;gBACL,MAAMA,QAAQ;YAChB;QACF;IACF;AACF"}
@@ -7,3 +7,4 @@ export { cellStyle } from './cellStyle';
7
7
  export { funnelStyle } from './funnelStyle';
8
8
  export { pieStyle } from './pieStyle';
9
9
  export { roseStyle } from './roseStyle';
10
+ export { funnelTransformStyle } from './funnelTransformStyle';
@@ -6,5 +6,6 @@ import { cellStyle } from "./cellStyle.js";
6
6
  import { funnelStyle } from "./funnelStyle.js";
7
7
  import { pieStyle } from "./pieStyle.js";
8
8
  import { roseStyle } from "./roseStyle.js";
9
+ import { funnelTransformStyle } from "./funnelTransformStyle.js";
9
10
  export * from "./pointState.js";
10
- export { areaStyle, barStyle, cellStyle, funnelStyle, lineStyle, pieStyle, pointStyle, roseStyle };
11
+ export { areaStyle, barStyle, cellStyle, funnelStyle, funnelTransformStyle, lineStyle, pieStyle, pointStyle, roseStyle };
@@ -10,7 +10,6 @@ const pivotColumnDimensions = (spec, context)=>{
10
10
  dimensionKey: dim.id,
11
11
  title: dim.alias || dim.id
12
12
  }));
13
- console.log('Pivot Column Dimensions:', columns);
14
13
  return {
15
14
  ...result,
16
15
  columns: columns