@visactor/vseed 0.1.16 → 0.1.18

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 (115) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/pipeline/advanced/chart/pipeline/area.js +5 -2
  4. package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
  5. package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +5 -2
  6. package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
  7. package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +5 -2
  8. package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
  9. package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +5 -2
  10. package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
  11. package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +5 -2
  12. package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
  13. package/dist/esm/pipeline/advanced/chart/pipeline/column.js +5 -2
  14. package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
  15. package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +5 -2
  16. package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
  17. package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +5 -2
  18. package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
  19. package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +5 -2
  20. package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
  21. package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +5 -2
  22. package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
  23. package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +5 -2
  24. package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
  25. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +5 -2
  26. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
  27. package/dist/esm/pipeline/advanced/chart/pipeline/line.js +5 -2
  28. package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
  29. package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +5 -2
  30. package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
  31. package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +5 -2
  32. package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
  33. package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +5 -2
  34. package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
  35. package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +5 -2
  36. package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
  37. package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +6 -2
  38. package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
  39. package/dist/esm/pipeline/advanced/chart/pipes/config/config.d.ts +0 -1
  40. package/dist/esm/pipeline/advanced/chart/pipes/config/config.js +1 -2
  41. package/dist/esm/pipeline/advanced/chart/pipes/config/config.js.map +1 -1
  42. package/dist/esm/pipeline/advanced/chart/pipes/config/index.d.ts +1 -0
  43. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js +1 -0
  44. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.d.ts +2 -0
  45. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +32 -0
  46. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -0
  47. package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +1 -0
  48. package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
  49. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.d.ts +2 -0
  50. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.js +12 -0
  51. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.js.map +1 -0
  52. package/dist/esm/pipeline/advanced/chart/pipes/measures/index.d.ts +1 -1
  53. package/dist/esm/pipeline/advanced/chart/pipes/measures/index.js +2 -2
  54. package/dist/esm/pipeline/spec/chart/pipeline/rose.js +1 -3
  55. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  56. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +1 -3
  57. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  58. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
  59. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipes/axes/index.d.ts +0 -1
  61. package/dist/esm/pipeline/spec/chart/pipes/axes/index.js +1 -2
  62. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js +2 -17
  63. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
  64. package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
  65. package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
  66. package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js +3 -2
  67. package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
  68. package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js +3 -2
  69. package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
  70. package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js +3 -2
  71. package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
  72. package/dist/esm/pipeline/spec/chart/pipes/size/index.d.ts +1 -0
  73. package/dist/esm/pipeline/spec/chart/pipes/size/index.js +2 -0
  74. package/dist/esm/pipeline/spec/chart/pipes/{axes/angle.d.ts → size/scatterSize.d.ts} +1 -1
  75. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js +22 -0
  76. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js.map +1 -0
  77. package/dist/esm/pipeline/utils/format/createNumFormatter.js +4 -1
  78. package/dist/esm/pipeline/utils/format/createNumFormatter.js.map +1 -1
  79. package/dist/esm/types/chartType/area/area.d.ts +1 -1
  80. package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +1 -1
  81. package/dist/esm/types/chartType/bar/bar.d.ts +1 -1
  82. package/dist/esm/types/chartType/barParallel/barParallel.d.ts +1 -1
  83. package/dist/esm/types/chartType/barPercent/barPercent.d.ts +1 -1
  84. package/dist/esm/types/chartType/column/column.d.ts +1 -1
  85. package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +1 -1
  86. package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +1 -1
  87. package/dist/esm/types/chartType/donut/donut.d.ts +1 -1
  88. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +10 -40
  89. package/dist/esm/types/chartType/funnel/funnel.d.ts +1 -1
  90. package/dist/esm/types/chartType/pie/pie.d.ts +1 -1
  91. package/dist/esm/types/chartType/rose/rose.d.ts +1 -1
  92. package/dist/esm/types/chartType/scatter/scatter.d.ts +14 -0
  93. package/dist/esm/types/chartType/scatter/zScatter.d.ts +12 -40
  94. package/dist/esm/types/chartType/scatter/zScatter.js +2 -0
  95. package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
  96. package/dist/esm/types/chartType/table/table.d.ts +1 -1
  97. package/dist/esm/types/properties/format/numFormat.d.ts +1 -5
  98. package/dist/esm/types/properties/format/numFormat.js.map +1 -1
  99. package/dist/esm/types/properties/measures/dualMeasures.d.ts +2 -2
  100. package/dist/esm/types/properties/measures/scatterMeasures.d.ts +2 -2
  101. package/dist/esm/types/properties/measures/zDualMeasures.d.ts +20 -80
  102. package/dist/esm/types/properties/measures/zDualMeasures.js +7 -1
  103. package/dist/esm/types/properties/measures/zDualMeasures.js.map +1 -1
  104. package/dist/esm/types/properties/measures/zScatterMeasures.d.ts +20 -80
  105. package/dist/esm/types/properties/measures/zScatterMeasures.js +8 -2
  106. package/dist/esm/types/properties/measures/zScatterMeasures.js.map +1 -1
  107. package/dist/esm/types/zVseed.d.ts +22 -80
  108. package/dist/umd/index.js +198 -100
  109. package/dist/umd/index.js.map +1 -1
  110. package/package.json +2 -2
  111. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.d.ts +0 -2
  112. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.js +0 -12
  113. package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.js.map +0 -1
  114. package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js +0 -46
  115. package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js.map +0 -1
@@ -73,7 +73,6 @@ const pieConfig = (advancedVSeed, context)=>{
73
73
  };
74
74
  const areaConfig = lineConfig;
75
75
  const areaPercentConfig = lineConfig;
76
- const scatterConfig = lineConfig;
77
76
  const barConfig = columnConfig;
78
77
  const barParallelConfig = columnConfig;
79
78
  const barPercentConfig = columnConfig;
@@ -85,6 +84,6 @@ const roseParallelConfig = pieConfig;
85
84
  const funnelConfig = pieConfig;
86
85
  const heatmapConfig = pieConfig;
87
86
  const radarConfig = pieConfig;
88
- export { areaConfig, areaPercentConfig, barConfig, barParallelConfig, barPercentConfig, columnConfig, columnParallelConfig, columnPercentConfig, donutConfig, funnelConfig, heatmapConfig, lineConfig, pieConfig, radarConfig, roseConfig, roseParallelConfig, scatterConfig };
87
+ export { areaConfig, areaPercentConfig, barConfig, barParallelConfig, barPercentConfig, columnConfig, columnParallelConfig, columnPercentConfig, donutConfig, funnelConfig, heatmapConfig, lineConfig, pieConfig, radarConfig, roseConfig, roseParallelConfig };
89
88
 
90
89
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/config/config.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/config.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\nexport const columnConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const config = 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 result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const pieConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const config = pick(vseed, ['backgroundColor', 'color', 'label', 'legend', 'tooltip']) as Config['pie']\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const areaConfig: AdvancedPipe = lineConfig\nexport const areaPercentConfig: AdvancedPipe = lineConfig\nexport const scatterConfig: AdvancedPipe = lineConfig\n\nexport const barConfig: AdvancedPipe = columnConfig\nexport const barParallelConfig: AdvancedPipe = columnConfig\nexport const barPercentConfig: AdvancedPipe = columnConfig\nexport const columnParallelConfig: AdvancedPipe = columnConfig\nexport const columnPercentConfig: AdvancedPipe = columnConfig\n\nexport const donutConfig: AdvancedPipe = pieConfig\nexport const roseConfig: AdvancedPipe = pieConfig\nexport const roseParallelConfig: AdvancedPipe = pieConfig\nexport const funnelConfig: AdvancedPipe = pieConfig\nexport const heatmapConfig: AdvancedPipe = pieConfig\nexport const radarConfig: AdvancedPipe = pieConfig\n"],"names":["lineConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined","columnConfig","pieConfig","areaConfig","areaPercentConfig","scatterConfig","barConfig","barParallelConfig","barPercentConfig","columnParallelConfig","columnPercentConfig","donutConfig","roseConfig","roseParallelConfig","funnelConfig","heatmapConfig","radarConfig"],"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;AAEO,MAAMK,eAA6B,CAACT,eAAeC;IACxD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMO,SAASD,KAAKJ,OAAO;QACzB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAEDE,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT;AAEO,MAAMM,YAA0B,CAACV,eAAeC;IACrD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMO,SAASD,KAAKJ,OAAO;QAAC;QAAmB;QAAS;QAAS;QAAU;KAAU;IAErFE,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT;AAEO,MAAMO,aAA2BZ;AACjC,MAAMa,oBAAkCb;AACxC,MAAMc,gBAA8Bd;AAEpC,MAAMe,YAA0BL;AAChC,MAAMM,oBAAkCN;AACxC,MAAMO,mBAAiCP;AACvC,MAAMQ,uBAAqCR;AAC3C,MAAMS,sBAAoCT;AAE1C,MAAMU,cAA4BT;AAClC,MAAMU,aAA2BV;AACjC,MAAMW,qBAAmCX;AACzC,MAAMY,eAA6BZ;AACnC,MAAMa,gBAA8Bb;AACpC,MAAMc,cAA4Bd"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/config/config.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/config/config.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\nexport const columnConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const config = 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 result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const pieConfig: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const { chartType } = vseed\n const result = {\n ...advancedVSeed,\n }\n\n const config = pick(vseed, ['backgroundColor', 'color', 'label', 'legend', 'tooltip']) as Config['pie']\n\n result.config = {\n ...(result.config || {}),\n [chartType]: {\n ...config,\n },\n }\n\n return result as AdvancedVSeed\n}\n\nexport const areaConfig: AdvancedPipe = lineConfig\nexport const areaPercentConfig: AdvancedPipe = lineConfig\n\nexport const barConfig: AdvancedPipe = columnConfig\nexport const barParallelConfig: AdvancedPipe = columnConfig\nexport const barPercentConfig: AdvancedPipe = columnConfig\nexport const columnParallelConfig: AdvancedPipe = columnConfig\nexport const columnPercentConfig: AdvancedPipe = columnConfig\n\nexport const donutConfig: AdvancedPipe = pieConfig\nexport const roseConfig: AdvancedPipe = pieConfig\nexport const roseParallelConfig: AdvancedPipe = pieConfig\nexport const funnelConfig: AdvancedPipe = pieConfig\nexport const heatmapConfig: AdvancedPipe = pieConfig\nexport const radarConfig: AdvancedPipe = pieConfig\n"],"names":["lineConfig","advancedVSeed","context","vseed","chartType","result","pickedConfig","pick","config","replaceNullToUndefined","columnConfig","pieConfig","areaConfig","areaPercentConfig","barConfig","barParallelConfig","barPercentConfig","columnParallelConfig","columnPercentConfig","donutConfig","roseConfig","roseParallelConfig","funnelConfig","heatmapConfig","radarConfig"],"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;AAEO,MAAMK,eAA6B,CAACT,eAAeC;IACxD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMO,SAASD,KAAKJ,OAAO;QACzB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAEDE,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT;AAEO,MAAMM,YAA0B,CAACV,eAAeC;IACrD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,SAAS;QACb,GAAGJ,aAAa;IAClB;IAEA,MAAMO,SAASD,KAAKJ,OAAO;QAAC;QAAmB;QAAS;QAAS;QAAU;KAAU;IAErFE,OAAO,MAAM,GAAG;QACd,GAAIA,OAAO,MAAM,IAAI,CAAC,CAAC;QACvB,CAACD,UAAU,EAAE;YACX,GAAGI,MAAM;QACX;IACF;IAEA,OAAOH;AACT;AAEO,MAAMO,aAA2BZ;AACjC,MAAMa,oBAAkCb;AAExC,MAAMc,YAA0BJ;AAChC,MAAMK,oBAAkCL;AACxC,MAAMM,mBAAiCN;AACvC,MAAMO,uBAAqCP;AAC3C,MAAMQ,sBAAoCR;AAE1C,MAAMS,cAA4BR;AAClC,MAAMS,aAA2BT;AACjC,MAAMU,qBAAmCV;AACzC,MAAMW,eAA6BX;AACnC,MAAMY,gBAA8BZ;AACpC,MAAMa,cAA4Bb"}
@@ -1,2 +1,3 @@
1
1
  export * from './config';
2
2
  export * from './dualAxis';
3
+ export * from './scatter';
@@ -1,2 +1,3 @@
1
1
  export * from "./config.js";
2
2
  export * from "./dualAxis.js";
3
+ export * from "./scatter.js";
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const scatterConfig: AdvancedPipe;
@@ -0,0 +1,32 @@
1
+ import { pick } from "remeda";
2
+ import { replaceNullToUndefined } from "../../../../utils/index.js";
3
+ const scatterConfig = (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
+ 'sizeRange',
18
+ 'size',
19
+ 'crosshairLine'
20
+ ]);
21
+ const config = replaceNullToUndefined(pickedConfig);
22
+ result.config = {
23
+ ...result.config || {},
24
+ [chartType]: {
25
+ ...config
26
+ }
27
+ };
28
+ return result;
29
+ };
30
+ export { scatterConfig };
31
+
32
+ //# sourceMappingURL=scatter.js.map
@@ -0,0 +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"}
@@ -58,6 +58,7 @@ const generateMeasureEncoding = (measures, encoding)=>{
58
58
  if (color.length > 0) encoding.color = [
59
59
  color[0]
60
60
  ];
61
+ encoding.size = unique(measures.filter((item)=>'size' === item.encoding).map((item)=>item.id));
61
62
  const label = unique(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
62
63
  encoding.label = unique([
63
64
  ...encoding.label || [],
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/encoding/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/encoding/scatter.ts"],"sourcesContent":["import { unique } from 'remeda'\nimport { MeasureName } from 'src/dataReshape'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, Dimension, Dimensions, Encoding, Measure, Measures } from 'src/types'\nimport { addColorToEncoding } from './color'\n\nexport const defaultEncodingForScatter: AdvancedPipe = (advancedVSeed) => {\n const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed\n const measures = findAllMeasures(vseedMeasures)\n const encoding: Encoding = {}\n generateDefaultDimensionEncoding(dimensions, encoding)\n generateDefaultMeasureEncoding(measures, encoding)\n return { ...advancedVSeed, encoding }\n}\n\nexport const encodingForScatter: AdvancedPipe = (advancedVSeed) => {\n const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed\n // prepare measures and dimensions\n const measures = findAllMeasures(vseedMeasures)\n\n // exist encoding condition\n const hasDimensionEncoding = dimensions.some((item: Dimension) => item.encoding)\n const hasMeasureEncoding = measures.some((item: Measure) => item.encoding)\n\n // encoding for modify in place\n const encoding: Encoding = {}\n\n if (hasDimensionEncoding) {\n generateDimensionEncoding(dimensions, encoding)\n } else {\n generateDefaultDimensionEncoding(dimensions, encoding)\n }\n\n if (hasMeasureEncoding) {\n generateMeasureEncoding(measures, encoding)\n } else {\n generateDefaultMeasureEncoding(measures, encoding)\n }\n\n return { ...advancedVSeed, encoding }\n}\n/**\n * --------------------维度--------------------\n */\nconst generateDefaultDimensionEncoding = (dimensions: Dimensions, encoding: Encoding) => {\n const dimensionsWithoutMeasureName = dimensions.filter((item) => item.id !== MeasureName)\n const uniqueDimIds = unique(dimensionsWithoutMeasureName.map((d) => d.id))\n encoding.color = uniqueDimIds.slice(0)\n encoding.detail = encoding.color\n encoding.tooltip = uniqueDimIds.filter((d) => d !== MeasureName) // 展示指标名称之外的所有维度\n encoding.label = [] // 默认不展示标签\n encoding.row = [] // 默认不进行行透视\n encoding.column = [] // 默认不进行列透视\n}\nconst generateDimensionEncoding = (dimensions: Dimensions, encoding: Encoding) => {\n // color\n addColorToEncoding(dimensions, encoding, false)\n\n // detail\n encoding.detail = unique(dimensions.filter((item) => item.encoding === 'detail').map((item) => item.id))\n if (encoding.detail.length === 0) {\n encoding.detail = [MeasureName]\n }\n // tooltip\n encoding.tooltip = unique(dimensions.map((item) => item.id))\n encoding.tooltip = encoding.tooltip.filter((d) => d !== MeasureName)\n\n // label\n encoding.label = unique(dimensions.filter((item) => item.encoding === 'label').map((item) => item.id))\n encoding.label = encoding.label.filter((d) => d !== MeasureName)\n}\n\n/**\n * --------------------指标--------------------\n */\nconst generateDefaultMeasureEncoding = (measures: Measures, encoding: Encoding) => {\n encoding.y = unique(\n measures\n .filter((item) => item.encoding === 'xAxis' || item.encoding === 'yAxis' || !item.encoding)\n .map((item) => item.id),\n )\n}\nconst generateMeasureEncoding = (measures: Measures, encoding: Encoding) => {\n encoding.y = unique(\n measures\n .filter((item) => item.encoding === 'xAxis' || item.encoding === 'yAxis' || !item.encoding)\n .map((item) => item.id),\n )\n const color = unique(measures.filter((item) => item.encoding === 'color').map((item) => item.id))\n if (color.length > 0) {\n encoding.color = [color[0]]\n }\n\n // label\n const label = unique(measures.filter((item) => item.encoding === 'label').map((item) => item.id))\n encoding.label = unique([...(encoding.label || []), ...label])\n\n // tooltip\n const tooltip = unique(measures.filter((item) => item.encoding === 'tooltip').map((item) => item.id))\n encoding.tooltip = unique([...(encoding.tooltip || []), ...label, ...tooltip])\n}\n"],"names":["defaultEncodingForScatter","advancedVSeed","vseedMeasures","dimensions","measures","findAllMeasures","encoding","generateDefaultDimensionEncoding","generateDefaultMeasureEncoding","encodingForScatter","hasDimensionEncoding","item","hasMeasureEncoding","generateDimensionEncoding","generateMeasureEncoding","dimensionsWithoutMeasureName","MeasureName","uniqueDimIds","unique","d","addColorToEncoding","color","label","tooltip"],"mappings":"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"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/encoding/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/encoding/scatter.ts"],"sourcesContent":["import { unique } from 'remeda'\nimport { MeasureName } from 'src/dataReshape'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, Dimension, Dimensions, Encoding, Measure, Measures } from 'src/types'\nimport { addColorToEncoding } from './color'\n\nexport const defaultEncodingForScatter: AdvancedPipe = (advancedVSeed) => {\n const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed\n const measures = findAllMeasures(vseedMeasures)\n const encoding: Encoding = {}\n generateDefaultDimensionEncoding(dimensions, encoding)\n generateDefaultMeasureEncoding(measures, encoding)\n return { ...advancedVSeed, encoding }\n}\n\nexport const encodingForScatter: AdvancedPipe = (advancedVSeed) => {\n const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed\n // prepare measures and dimensions\n const measures = findAllMeasures(vseedMeasures)\n\n // exist encoding condition\n const hasDimensionEncoding = dimensions.some((item: Dimension) => item.encoding)\n const hasMeasureEncoding = measures.some((item: Measure) => item.encoding)\n\n // encoding for modify in place\n const encoding: Encoding = {}\n\n if (hasDimensionEncoding) {\n generateDimensionEncoding(dimensions, encoding)\n } else {\n generateDefaultDimensionEncoding(dimensions, encoding)\n }\n\n if (hasMeasureEncoding) {\n generateMeasureEncoding(measures, encoding)\n } else {\n generateDefaultMeasureEncoding(measures, encoding)\n }\n\n return { ...advancedVSeed, encoding }\n}\n/**\n * --------------------维度--------------------\n */\nconst generateDefaultDimensionEncoding = (dimensions: Dimensions, encoding: Encoding) => {\n const dimensionsWithoutMeasureName = dimensions.filter((item) => item.id !== MeasureName)\n const uniqueDimIds = unique(dimensionsWithoutMeasureName.map((d) => d.id))\n encoding.color = uniqueDimIds.slice(0)\n encoding.detail = encoding.color\n encoding.tooltip = uniqueDimIds.filter((d) => d !== MeasureName) // 展示指标名称之外的所有维度\n encoding.label = [] // 默认不展示标签\n encoding.row = [] // 默认不进行行透视\n encoding.column = [] // 默认不进行列透视\n}\nconst generateDimensionEncoding = (dimensions: Dimensions, encoding: Encoding) => {\n // color\n addColorToEncoding(dimensions, encoding, false)\n\n // detail\n encoding.detail = unique(dimensions.filter((item) => item.encoding === 'detail').map((item) => item.id))\n if (encoding.detail.length === 0) {\n encoding.detail = [MeasureName]\n }\n // tooltip\n encoding.tooltip = unique(dimensions.map((item) => item.id))\n encoding.tooltip = encoding.tooltip.filter((d) => d !== MeasureName)\n\n // label\n encoding.label = unique(dimensions.filter((item) => item.encoding === 'label').map((item) => item.id))\n encoding.label = encoding.label.filter((d) => d !== MeasureName)\n}\n\n/**\n * --------------------指标--------------------\n */\nconst generateDefaultMeasureEncoding = (measures: Measures, encoding: Encoding) => {\n encoding.y = unique(\n measures\n .filter((item) => item.encoding === 'xAxis' || item.encoding === 'yAxis' || !item.encoding)\n .map((item) => item.id),\n )\n}\nconst generateMeasureEncoding = (measures: Measures, encoding: Encoding) => {\n encoding.y = unique(\n measures\n .filter((item) => item.encoding === 'xAxis' || item.encoding === 'yAxis' || !item.encoding)\n .map((item) => item.id),\n )\n const color = unique(measures.filter((item) => item.encoding === 'color').map((item) => item.id))\n if (color.length > 0) {\n encoding.color = [color[0]]\n }\n\n // size\n encoding.size = unique(measures.filter((item) => item.encoding === 'size').map((item) => item.id))\n\n // label\n const label = unique(measures.filter((item) => item.encoding === 'label').map((item) => item.id))\n encoding.label = unique([...(encoding.label || []), ...label])\n\n // tooltip\n const tooltip = unique(measures.filter((item) => item.encoding === 'tooltip').map((item) => item.id))\n encoding.tooltip = unique([...(encoding.tooltip || []), ...label, ...tooltip])\n}\n"],"names":["defaultEncodingForScatter","advancedVSeed","vseedMeasures","dimensions","measures","findAllMeasures","encoding","generateDefaultDimensionEncoding","generateDefaultMeasureEncoding","encodingForScatter","hasDimensionEncoding","item","hasMeasureEncoding","generateDimensionEncoding","generateMeasureEncoding","dimensionsWithoutMeasureName","MeasureName","uniqueDimIds","unique","d","addColorToEncoding","color","label","tooltip"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const deleteEncodingForMeasure: (encodingKeys: string[]) => AdvancedPipe;
@@ -0,0 +1,12 @@
1
+ import { deleteMeasureTreeByCallback } from "../../../../utils/index.js";
2
+ const deleteEncodingForMeasure = (encodingKeys)=>(advancedVSeed)=>{
3
+ const deleteBy = (measure)=>encodingKeys.includes(measure.encoding);
4
+ const measureTree = deleteMeasureTreeByCallback(advancedVSeed.measures, deleteBy);
5
+ return {
6
+ ...advancedVSeed,
7
+ measures: measureTree
8
+ };
9
+ };
10
+ export { deleteEncodingForMeasure };
11
+
12
+ //# sourceMappingURL=deleteEncodingForMeasure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.ts"],"sourcesContent":["import { deleteMeasureTreeByCallback } from 'src/pipeline/utils'\nimport type { AdvancedPipe, Measure } from 'src/types'\n\nexport const deleteEncodingForMeasure = (encodingKeys: string[]): AdvancedPipe => {\n return (advancedVSeed) => {\n const deleteBy = (measure: Measure) => encodingKeys.includes(measure.encoding as string)\n\n const measureTree = deleteMeasureTreeByCallback(advancedVSeed.measures, deleteBy)\n\n return {\n ...advancedVSeed,\n measures: measureTree,\n }\n }\n}\n"],"names":["deleteEncodingForMeasure","encodingKeys","advancedVSeed","deleteBy","measure","measureTree","deleteMeasureTreeByCallback"],"mappings":";AAGO,MAAMA,2BAA2B,CAACC,eAChC,CAACC;QACN,MAAMC,WAAW,CAACC,UAAqBH,aAAa,QAAQ,CAACG,QAAQ,QAAQ;QAE7E,MAAMC,cAAcC,4BAA4BJ,cAAc,QAAQ,EAAEC;QAExE,OAAO;YACL,GAAGD,aAAa;YAChB,UAAUG;QACZ;IACF"}
@@ -2,4 +2,4 @@ export * from './utils';
2
2
  export { buildMeasuresForDualAxis } from './buildMeasuresForDualAxis';
3
3
  export { buildMeasures } from './buildMeasures';
4
4
  export { buildMeasuresForScatter } from './buildMeasuresForScatter';
5
- export { deleteTooltipAndLabelMeasure } from './deleteTooltipAndLabelMeasure';
5
+ export { deleteEncodingForMeasure } from './deleteEncodingForMeasure';
@@ -1,6 +1,6 @@
1
1
  import { buildMeasuresForDualAxis } from "./buildMeasuresForDualAxis.js";
2
2
  import { buildMeasures } from "./buildMeasures.js";
3
3
  import { buildMeasuresForScatter } from "./buildMeasuresForScatter.js";
4
- import { deleteTooltipAndLabelMeasure } from "./deleteTooltipAndLabelMeasure.js";
4
+ import { deleteEncodingForMeasure } from "./deleteEncodingForMeasure.js";
5
5
  export * from "./utils.js";
6
- export { buildMeasures, buildMeasuresForDualAxis, buildMeasuresForScatter, deleteTooltipAndLabelMeasure };
6
+ export { buildMeasures, buildMeasuresForDualAxis, buildMeasuresForScatter, deleteEncodingForMeasure };
@@ -1,4 +1,4 @@
1
- import { angleAxis, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect } from "../pipes/index.js";
1
+ import { backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRose, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect } from "../pipes/index.js";
2
2
  const rose = [
3
3
  initRose,
4
4
  stackCornerRadius,
@@ -7,7 +7,6 @@ const rose = [
7
7
  backgroundColor,
8
8
  datasetXY,
9
9
  progressive,
10
- angleAxis,
11
10
  radiusAxis,
12
11
  verticalCrosshairRect,
13
12
  colorRoseStyleFill(roseStyle),
@@ -29,7 +28,6 @@ const pivotRose = [
29
28
  datasetXY,
30
29
  progressive,
31
30
  radiusAxis,
32
- angleAxis,
33
31
  verticalCrosshairRect,
34
32
  colorRoseStyleFill(roseStyle),
35
33
  label,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/rose.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/rose.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n verticalCrosshairRect,\n stackCornerRadius,\n initRose,\n radiusAxis,\n angleAxis,\n progressive,\n linearColor,\n colorAdapter,\n pivotColorLegend,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n} from '../pipes'\n\nconst rose: SpecPipeline = [\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n angleAxis,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n label,\n tooltip,\n]\n\nconst pivotRose: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n angleAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n label,\n tooltip,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseSpecPipeline = [pivotAdapter(rose, pivotRose)]\n"],"names":["rose","initRose","stackCornerRadius","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","angleAxis","radiusAxis","verticalCrosshairRect","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","label","tooltip","pivotRose","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseSpecPipeline","pivotAdapter"],"mappings":";AAgCA,MAAMA,OAAqB;IACzBC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBV,aAAaW,gBAAgBC;IAC7BC;IACAC;CACD;AAED,MAAMC,YAA0B;IAC9BC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdvB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAE;QACAD;QACAE;QACAC,mBAAmBC;QACnBG;QACAC;KACD;IACDO;IACAC;IACAtB,aAAauB,qBAAqBC;CACnC;AAEM,MAAMC,mBAAmB;IAACC,aAAa9B,MAAMmB;CAAW"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/rose.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/rose.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n verticalCrosshairRect,\n stackCornerRadius,\n initRose,\n radiusAxis,\n progressive,\n linearColor,\n colorAdapter,\n pivotColorLegend,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n} from '../pipes'\n\nconst rose: SpecPipeline = [\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n label,\n tooltip,\n]\n\nconst pivotRose: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initRose,\n stackCornerRadius,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n label,\n tooltip,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseSpecPipeline = [pivotAdapter(rose, pivotRose)]\n"],"names":["rose","initRose","stackCornerRadius","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","verticalCrosshairRect","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","label","tooltip","pivotRose","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseSpecPipeline","pivotAdapter"],"mappings":";AA+BA,MAAMA,OAAqB;IACzBC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBT,aAAaU,gBAAgBC;IAC7BC;IACAC;CACD;AAED,MAAMC,YAA0B;IAC9BC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdtB;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC,mBAAmBC;QACnBG;QACAC;KACD;IACDO;IACAC;IACArB,aAAasB,qBAAqBC;CACnC;AAEM,MAAMC,mBAAmB;IAACC,aAAa7B,MAAMkB;CAAW"}
@@ -1,4 +1,4 @@
1
- import { angleAxis, annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, tooltip, verticalCrosshairRect } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorRoseStyleFill, datasetPivot, datasetXY, discreteLegend, initPivot, initRoseParallel, label, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, progressive, radiusAxis, roseStyle, stackCornerRadius, tooltip, verticalCrosshairRect } from "../pipes/index.js";
2
2
  const roseParallel = [
3
3
  initRoseParallel,
4
4
  stackCornerRadius,
@@ -7,7 +7,6 @@ const roseParallel = [
7
7
  datasetXY,
8
8
  progressive,
9
9
  radiusAxis,
10
- angleAxis,
11
10
  colorRoseStyleFill(roseStyle),
12
11
  colorAdapter(discreteLegend, colorLegend),
13
12
  label,
@@ -31,7 +30,6 @@ const pivotRoseParallel = [
31
30
  datasetXY,
32
31
  progressive,
33
32
  radiusAxis,
34
- angleAxis,
35
33
  verticalCrosshairRect,
36
34
  colorRoseStyleFill(roseStyle),
37
35
  label,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/roseParallel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n initRoseParallel,\n radiusAxis,\n angleAxis,\n progressive,\n pivotColorLegend,\n colorAdapter,\n linearColor,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n} from '../pipes'\n\nconst roseParallel: SpecPipeline = [\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n angleAxis,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n label,\n tooltip,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotRoseParallel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n angleAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n label,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseParallelSpecPipeline: SpecPipeline = [pivotAdapter(roseParallel, pivotRoseParallel)]\n"],"names":["roseParallel","initRoseParallel","stackCornerRadius","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","angleAxis","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","label","tooltip","verticalCrosshairRect","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotRoseParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseParallelSpecPipeline","pivotAdapter"],"mappings":";AAmCA,MAAMA,eAA6B;IACjCC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBT,aAAaU,gBAAgBC;IAC7BC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,oBAAkC;IACtCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd1B;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAO;QACAN,mBAAmBC;QACnBG;QACAC;QACAE;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA1B,aAAa2B,qBAAqBC;CACnC;AAEM,MAAMC,2BAAyC;IAACC,aAAajC,cAAcsB;CAAmB"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/roseParallel.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n datasetXY,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n initRoseParallel,\n radiusAxis,\n progressive,\n pivotColorLegend,\n colorAdapter,\n linearColor,\n colorLegend,\n roseStyle,\n colorRoseStyleFill,\n} from '../pipes'\n\nconst roseParallel: SpecPipeline = [\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n colorRoseStyleFill(roseStyle),\n colorAdapter(discreteLegend, colorLegend),\n label,\n tooltip,\n verticalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotRoseParallel: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initRoseParallel,\n stackCornerRadius,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n radiusAxis,\n verticalCrosshairRect,\n colorRoseStyleFill(roseStyle),\n label,\n tooltip,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const roseParallelSpecPipeline: SpecPipeline = [pivotAdapter(roseParallel, pivotRoseParallel)]\n"],"names":["roseParallel","initRoseParallel","stackCornerRadius","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","radiusAxis","colorRoseStyleFill","roseStyle","discreteLegend","colorLegend","label","tooltip","verticalCrosshairRect","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotRoseParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","roseParallelSpecPipeline","pivotAdapter"],"mappings":";AAkCA,MAAMA,eAA6B;IACjCC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC,mBAAmBC;IACnBR,aAAaS,gBAAgBC;IAC7BC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,oBAAkC;IACtCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdzB;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAO;QACAN,mBAAmBC;QACnBG;QACAC;QACAE;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACAzB,aAAa0B,qBAAqBC;CACnC;AAEM,MAAMC,2BAAyC;IAACC,aAAahC,cAAcqB;CAAmB"}
@@ -1,4 +1,4 @@
1
- import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateHover, pointStyle, progressive, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
1
+ import { annotationArea, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, color, colorAdapter, colorLegend, colorPointStyleFill, datasetPivot, datasetScatter, discreteLegend, horizontalCrosshairLine, initPivot, initScatter, labelScatter, linearColor, pivotAdapter, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pointStateHover, pointStyle, progressive, scatterSize, tooltipScatter, verticalCrosshairLine, xLinear, yLinear } from "../pipes/index.js";
2
2
  const scatter = [
3
3
  initScatter,
4
4
  colorAdapter(color, linearColor),
@@ -7,6 +7,7 @@ const scatter = [
7
7
  progressive,
8
8
  xLinear,
9
9
  yLinear,
10
+ scatterSize,
10
11
  labelScatter,
11
12
  tooltipScatter,
12
13
  colorAdapter(discreteLegend, colorLegend),
@@ -32,6 +33,7 @@ const pivotScatter = [
32
33
  progressive,
33
34
  xLinear,
34
35
  yLinear,
36
+ scatterSize,
35
37
  labelScatter,
36
38
  tooltipScatter,
37
39
  verticalCrosshairLine,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";AAoCA,MAAMA,UAAwB;IAC5BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAT,aAAaU,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd3B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA5B,aAAa6B,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAalC,SAASuB;CAAc"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { SpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n} from '../pipes'\n\nconst scatter: SpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n]\n\nconst pivotScatter: SpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n]\n\nexport const scatterSpecPipeline: SpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotRowDimensions","pivotColumnDimensions","pivotDiscreteLegend","pivotColorLegend","scatterSpecPipeline","pivotAdapter"],"mappings":";AAqCA,MAAMA,UAAwB;IAC5BC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd5B;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDO;IACAC;IACA7B,aAAa8B,qBAAqBC;CACnC;AAEM,MAAMC,sBAAoC;IAACC,aAAanC,SAASwB;CAAc"}
@@ -5,6 +5,5 @@ export { yLinear } from './yLinear';
5
5
  export { yLinearPrimary } from './yLinearPrimary';
6
6
  export { yLinearSecondary } from './yLinearSecondary';
7
7
  export { radiusAxis } from './radius';
8
- export { angleAxis } from './angle';
9
8
  export { radarAngleAxis } from './radarAngle';
10
9
  export { radarRadiusAxis } from './radarRadius';
@@ -5,7 +5,6 @@ import { yLinear } from "./yLinear.js";
5
5
  import { yLinearPrimary } from "./yLinearPrimary.js";
6
6
  import { yLinearSecondary } from "./yLinearSecondary.js";
7
7
  import { radiusAxis } from "./radius.js";
8
- import { angleAxis } from "./angle.js";
9
8
  import { radarAngleAxis } from "./radarAngle.js";
10
9
  import { radarRadiusAxis } from "./radarRadius.js";
11
- export { angleAxis, radarAngleAxis, radarRadiusAxis, radiusAxis, xBand, xLinear, yBand, yLinear, yLinearPrimary, yLinearSecondary };
10
+ export { radarAngleAxis, radarRadiusAxis, radiusAxis, xBand, xLinear, yBand, yLinear, yLinearPrimary, yLinearSecondary };
@@ -5,28 +5,13 @@ const radiusAxis = (spec, context)=>{
5
5
  const { advancedVSeed } = context;
6
6
  const { dimensions, measures } = advancedVSeed;
7
7
  if (!dimensions || !measures) return result;
8
- const is0D = 0 === dimensions.length;
9
- const is1M1D = 1 === dimensions.length && 1 === measures.length;
10
- const showAxis = !(is0D || is1M1D);
11
8
  if (!result.axes) result.axes = [];
12
9
  result.axes.push({
13
10
  type: 'linear',
14
11
  orient: 'radius',
15
- visible: showAxis,
12
+ visible: false,
16
13
  zero: true,
17
- nice: !!showAxis,
18
- grid: {
19
- visible: showAxis
20
- },
21
- tick: {
22
- visible: showAxis
23
- },
24
- label: {
25
- visible: showAxis
26
- },
27
- domainLine: {
28
- visible: showAxis
29
- }
14
+ nice: false
30
15
  });
31
16
  return result;
32
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/radius.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/radius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const radiusAxis: SpecPipe = (spec, context) => {\n const result = { ...spec } as IRoseChartSpec\n const { advancedVSeed } = context\n const { dimensions, measures } = advancedVSeed\n\n if (!dimensions || !measures) {\n return result\n }\n\n const is0D = dimensions.length === 0\n const is1M1D = dimensions.length === 1 && measures.length === 1\n const showAxis = !(is0D || is1M1D)\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n type: 'linear',\n orient: 'radius',\n visible: showAxis,\n zero: true,\n nice: showAxis ? true : false,\n grid: {\n visible: showAxis,\n },\n tick: {\n visible: showAxis,\n },\n label: {\n visible: showAxis,\n },\n domainLine: {\n visible: showAxis,\n },\n })\n\n return result\n}\n"],"names":["radiusAxis","spec","context","result","advancedVSeed","dimensions","measures","is0D","is1M1D","showAxis"],"mappings":"AAGO,MAAMA,aAAuB,CAACC,MAAMC;IACzC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGF;IAEjC,IAAI,CAACC,cAAc,CAACC,UAClB,OAAOH;IAGT,MAAMI,OAAOF,AAAsB,MAAtBA,WAAW,MAAM;IAC9B,MAAMG,SAASH,AAAsB,MAAtBA,WAAW,MAAM,IAAUC,AAAoB,MAApBA,SAAS,MAAM;IACzD,MAAMG,WAAW,CAAEF,CAAAA,QAAQC,MAAK;IAEhC,IAAI,CAACL,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,MAAM;QACN,QAAQ;QACR,SAASM;QACT,MAAM;QACN,IAAI,IAAEA;QACN,MAAM;YACJ,SAASA;QACX;QACA,MAAM;YACJ,SAASA;QACX;QACA,OAAO;YACL,SAASA;QACX;QACA,YAAY;YACV,SAASA;QACX;IACF;IAEA,OAAON;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/radius.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/radius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const radiusAxis: SpecPipe = (spec, context) => {\n const result = { ...spec } as IRoseChartSpec\n const { advancedVSeed } = context\n const { dimensions, measures } = advancedVSeed\n\n if (!dimensions || !measures) {\n return result\n }\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n type: 'linear',\n orient: 'radius',\n visible: false,\n zero: true,\n nice: false,\n })\n\n return result\n}\n"],"names":["radiusAxis","spec","context","result","advancedVSeed","dimensions","measures"],"mappings":"AAGO,MAAMA,aAAuB,CAACC,MAAMC;IACzC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGF;IAEjC,IAAI,CAACC,cAAc,CAACC,UAClB,OAAOH;IAGT,IAAI,CAACA,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,MAAM;QACN,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;IACR;IAEA,OAAOA;AACT"}
@@ -14,3 +14,4 @@ export * from './annotation';
14
14
  export * from './crosshair';
15
15
  export * from './series';
16
16
  export * from './dual';
17
+ export * from './size';
@@ -14,3 +14,4 @@ export * from "./annotation/index.js";
14
14
  export * from "./crosshair/index.js";
15
15
  export * from "./series/index.js";
16
16
  export * from "./dual/index.js";
17
+ export * from "./size/index.js";
@@ -1,11 +1,12 @@
1
+ import { isDeepEqual } from "remeda";
1
2
  const initBarParallel = (spec, context)=>{
2
3
  const result = {
3
4
  ...spec
4
5
  };
5
6
  const { advancedVSeed } = context;
6
- const { datasetReshapeInfo, dimensions } = advancedVSeed;
7
+ const { datasetReshapeInfo, encoding } = advancedVSeed;
7
8
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
8
- const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
9
+ const sameDimensionsMode = isDeepEqual(encoding.y, encoding.color);
9
10
  result.type = 'bar';
10
11
  result.direction = 'horizontal';
11
12
  result.yField = sameDimensionsMode ? [
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/barParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/barParallel.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const initBarParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dimensions } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim) => dim.id === dimensions[0].id)\n\n result.type = 'bar'\n result.direction = 'horizontal'\n\n result.yField = sameDimensionsMode\n ? [unfoldInfo.encodingY]\n : ([unfoldInfo.encodingY, unfoldInfo.encodingDetail] as string[])\n result.xField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initBarParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","dimensions","unfoldInfo","foldInfo","sameDimensionsMode","dim"],"mappings":"AAGO,MAAMA,kBAA4B,CAACC,MAAMC;IAC9C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,UAAU,EAAE,GAAGF;IAC3C,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,MAAMI,qBAAqBH,WAAW,MAAM,GAAG,KAAKA,WAAW,KAAK,CAAC,CAACI,MAAQA,IAAI,EAAE,KAAKJ,UAAU,CAAC,EAAE,CAAC,EAAE;IAEzGH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IAEnBA,OAAO,MAAM,GAAGM,qBACZ;QAACF,WAAW,SAAS;KAAC,GACrB;QAACA,WAAW,SAAS;QAAEA,WAAW,cAAc;KAAC;IACtDJ,OAAO,MAAM,GAAGK,SAAS,YAAY;IACrCL,OAAO,WAAW,GAAGI,WAAW,eAAe;IAE/CJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/barParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/barParallel.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport { isDeepEqual } from 'remeda'\nimport type { SpecPipe } from 'src/types'\n\nexport const initBarParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = isDeepEqual(encoding.y, encoding.color)\n\n result.type = 'bar'\n result.direction = 'horizontal'\n\n result.yField = sameDimensionsMode\n ? [unfoldInfo.encodingY]\n : ([unfoldInfo.encodingY, unfoldInfo.encodingDetail] as string[])\n result.xField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initBarParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","encoding","unfoldInfo","foldInfo","sameDimensionsMode","isDeepEqual"],"mappings":";AAIO,MAAMA,kBAA4B,CAACC,MAAMC;IAC9C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,QAAQ,EAAE,GAAGF;IACzC,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,MAAMI,qBAAqBC,YAAYJ,SAAS,CAAC,EAAEA,SAAS,KAAK;IAEjEH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IAEnBA,OAAO,MAAM,GAAGM,qBACZ;QAACF,WAAW,SAAS;KAAC,GACrB;QAACA,WAAW,SAAS;QAAEA,WAAW,cAAc;KAAC;IACtDJ,OAAO,MAAM,GAAGK,SAAS,YAAY;IACrCL,OAAO,WAAW,GAAGI,WAAW,eAAe;IAE/CJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
@@ -1,11 +1,12 @@
1
+ import { isDeepEqual } from "remeda";
1
2
  const initColumnParallel = (spec, context)=>{
2
3
  const result = {
3
4
  ...spec
4
5
  };
5
6
  const { advancedVSeed } = context;
6
- const { datasetReshapeInfo, dimensions } = advancedVSeed;
7
+ const { datasetReshapeInfo, encoding } = advancedVSeed;
7
8
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
8
- const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
9
+ const sameDimensionsMode = isDeepEqual(encoding.x, encoding.color);
9
10
  result.type = 'bar';
10
11
  result.direction = 'vertical';
11
12
  result.xField = sameDimensionsMode ? [
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/columnParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/columnParallel.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const initColumnParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dimensions } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim) => dim.id === dimensions[0].id)\n\n result.type = 'bar'\n result.direction = 'vertical'\n result.xField = sameDimensionsMode ? [unfoldInfo.encodingX] : [unfoldInfo.encodingX, unfoldInfo.encodingDetail]\n result.yField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initColumnParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","dimensions","unfoldInfo","foldInfo","sameDimensionsMode","dim"],"mappings":"AAGO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,UAAU,EAAE,GAAGF;IAC3C,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,MAAMI,qBAAqBH,WAAW,MAAM,GAAG,KAAKA,WAAW,KAAK,CAAC,CAACI,MAAQA,IAAI,EAAE,KAAKJ,UAAU,CAAC,EAAE,CAAC,EAAE;IAEzGH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGM,qBAAqB;QAACF,WAAW,SAAS;KAAC,GAAG;QAACA,WAAW,SAAS;QAAEA,WAAW,cAAc;KAAC;IAC/GJ,OAAO,MAAM,GAAGK,SAAS,YAAY;IACrCL,OAAO,WAAW,GAAGI,WAAW,eAAe;IAC/CJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/columnParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/columnParallel.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport { isDeepEqual } from 'remeda'\nimport type { SpecPipe } from 'src/types'\n\nexport const initColumnParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, encoding } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = isDeepEqual(encoding.x, encoding.color)\n\n result.type = 'bar'\n result.direction = 'vertical'\n result.xField = sameDimensionsMode ? [unfoldInfo.encodingX] : [unfoldInfo.encodingX, unfoldInfo.encodingDetail]\n result.yField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n return result\n}\n"],"names":["initColumnParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","encoding","unfoldInfo","foldInfo","sameDimensionsMode","isDeepEqual"],"mappings":";AAIO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,QAAQ,EAAE,GAAGF;IACzC,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,MAAMI,qBAAqBC,YAAYJ,SAAS,CAAC,EAAEA,SAAS,KAAK;IAEjEH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGM,qBAAqB;QAACF,WAAW,SAAS;KAAC,GAAG;QAACA,WAAW,SAAS;QAAEA,WAAW,cAAc;KAAC;IAC/GJ,OAAO,MAAM,GAAGK,SAAS,YAAY;IACrCL,OAAO,WAAW,GAAGI,WAAW,eAAe;IAC/CJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
@@ -1,11 +1,12 @@
1
+ import { isDeepEqual } from "remeda";
1
2
  const initRoseParallel = (spec, context)=>{
2
3
  const result = {
3
4
  ...spec
4
5
  };
5
6
  const { advancedVSeed } = context;
6
- const { datasetReshapeInfo, dataset, dimensions } = advancedVSeed;
7
+ const { datasetReshapeInfo, dataset, encoding } = advancedVSeed;
7
8
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
8
- const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
9
+ const sameDimensionsMode = isDeepEqual(encoding.angle, encoding.color);
9
10
  result.type = 'rose';
10
11
  result.angleField = sameDimensionsMode ? [
11
12
  unfoldInfo.encodingAngle
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/roseParallel.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const initRoseParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IRoseChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dataset, dimensions } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim) => dim.id === dimensions[0].id)\n\n result.type = 'rose'\n result.angleField = sameDimensionsMode\n ? [unfoldInfo.encodingAngle]\n : [unfoldInfo.encodingAngle, unfoldInfo.encodingDetail]\n result.valueField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n result.padding = 0\n\n result.outerRadius = 0.9\n result.innerRadius = 0\n\n const hasNegativeValue = dataset.flat().find((d) => d[foldInfo.measureValue] < 0)\n if (hasNegativeValue) {\n result.innerRadius = 0.05\n }\n\n result.rose = {\n style: {\n stroke: '#ffffff',\n lineWidth: 1,\n },\n state: {\n hover: {\n lineWidth: 1,\n fillOpacity: 0.6,\n },\n },\n }\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n\n return result\n}\n"],"names":["initRoseParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","dataset","dimensions","unfoldInfo","foldInfo","sameDimensionsMode","dim","hasNegativeValue","d"],"mappings":"AAGO,MAAMA,mBAA6B,CAACC,MAAMC;IAC/C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGH;IACpD,MAAM,EAAEI,UAAU,EAAEC,QAAQ,EAAE,GAAGJ,kBAAkB,CAAC,EAAE;IAEtD,MAAMK,qBAAqBH,WAAW,MAAM,GAAG,KAAKA,WAAW,KAAK,CAAC,CAACI,MAAQA,IAAI,EAAE,KAAKJ,UAAU,CAAC,EAAE,CAAC,EAAE;IAEzGJ,OAAO,IAAI,GAAG;IACdA,OAAO,UAAU,GAAGO,qBAChB;QAACF,WAAW,aAAa;KAAC,GAC1B;QAACA,WAAW,aAAa;QAAEA,WAAW,cAAc;KAAC;IACzDL,OAAO,UAAU,GAAGM,SAAS,YAAY;IACzCN,OAAO,WAAW,GAAGK,WAAW,eAAe;IAC/CL,OAAO,OAAO,GAAG;IAEjBA,OAAO,WAAW,GAAG;IACrBA,OAAO,WAAW,GAAG;IAErB,MAAMS,mBAAmBN,QAAQ,IAAI,GAAG,IAAI,CAAC,CAACO,IAAMA,CAAC,CAACJ,SAAS,YAAY,CAAC,GAAG;IAC/E,IAAIG,kBACFT,OAAO,WAAW,GAAG;IAGvBA,OAAO,IAAI,GAAG;QACZ,OAAO;YACL,QAAQ;YACR,WAAW;QACb;QACA,OAAO;YACL,OAAO;gBACL,WAAW;gBACX,aAAa;YACf;QACF;IACF;IACAA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/roseParallel.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/roseParallel.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport { isDeepEqual } from 'remeda'\nimport type { SpecPipe } from 'src/types'\n\nexport const initRoseParallel: SpecPipe = (spec, context) => {\n const result = { ...spec } as IRoseChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dataset, encoding } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n const sameDimensionsMode = isDeepEqual(encoding.angle, encoding.color)\n\n result.type = 'rose'\n result.angleField = sameDimensionsMode\n ? [unfoldInfo.encodingAngle]\n : [unfoldInfo.encodingAngle, unfoldInfo.encodingDetail]\n result.valueField = foldInfo.measureValue\n result.seriesField = unfoldInfo.encodingColorId\n result.padding = 0\n\n result.outerRadius = 0.9\n result.innerRadius = 0\n\n const hasNegativeValue = dataset.flat().find((d) => d[foldInfo.measureValue] < 0)\n if (hasNegativeValue) {\n result.innerRadius = 0.05\n }\n\n result.rose = {\n style: {\n stroke: '#ffffff',\n lineWidth: 1,\n },\n state: {\n hover: {\n lineWidth: 1,\n fillOpacity: 0.6,\n },\n },\n }\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n\n return result\n}\n"],"names":["initRoseParallel","spec","context","result","advancedVSeed","datasetReshapeInfo","dataset","encoding","unfoldInfo","foldInfo","sameDimensionsMode","isDeepEqual","hasNegativeValue","d"],"mappings":";AAIO,MAAMA,mBAA6B,CAACC,MAAMC;IAC/C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGH;IAClD,MAAM,EAAEI,UAAU,EAAEC,QAAQ,EAAE,GAAGJ,kBAAkB,CAAC,EAAE;IAEtD,MAAMK,qBAAqBC,YAAYJ,SAAS,KAAK,EAAEA,SAAS,KAAK;IAErEJ,OAAO,IAAI,GAAG;IACdA,OAAO,UAAU,GAAGO,qBAChB;QAACF,WAAW,aAAa;KAAC,GAC1B;QAACA,WAAW,aAAa;QAAEA,WAAW,cAAc;KAAC;IACzDL,OAAO,UAAU,GAAGM,SAAS,YAAY;IACzCN,OAAO,WAAW,GAAGK,WAAW,eAAe;IAC/CL,OAAO,OAAO,GAAG;IAEjBA,OAAO,WAAW,GAAG;IACrBA,OAAO,WAAW,GAAG;IAErB,MAAMS,mBAAmBN,QAAQ,IAAI,GAAG,IAAI,CAAC,CAACO,IAAMA,CAAC,CAACJ,SAAS,YAAY,CAAC,GAAG;IAC/E,IAAIG,kBACFT,OAAO,WAAW,GAAG;IAGvBA,OAAO,IAAI,GAAG;QACZ,OAAO;YACL,QAAQ;YACR,WAAW;QACb;QACA,OAAO;YACL,OAAO;gBACL,WAAW;gBACX,aAAa;YACf;QACF;IACF;IACAA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
@@ -0,0 +1 @@
1
+ export { scatterSize } from './scatterSize';
@@ -0,0 +1,2 @@
1
+ import { scatterSize } from "./scatterSize.js";
2
+ export { scatterSize };
@@ -1,2 +1,2 @@
1
1
  import type { SpecPipe } from '../../../../../types';
2
- export declare const angleAxis: SpecPipe;
2
+ export declare const scatterSize: SpecPipe;
@@ -0,0 +1,22 @@
1
+ const scatterSize = (spec, context)=>{
2
+ const result = {
3
+ ...spec
4
+ };
5
+ const { advancedVSeed } = context;
6
+ const { chartType, encoding } = advancedVSeed;
7
+ const baseConfig = advancedVSeed.config[chartType];
8
+ if (!baseConfig || !baseConfig.sizeRange && !baseConfig.size) return result;
9
+ const size = baseConfig.size ?? baseConfig.sizeRange;
10
+ result.size = {
11
+ type: 'linear',
12
+ range: Array.isArray(size) ? size : [
13
+ size,
14
+ size
15
+ ]
16
+ };
17
+ result.sizeField = encoding?.size?.[0] || void 0;
18
+ return result;
19
+ };
20
+ export { scatterSize };
21
+
22
+ //# sourceMappingURL=scatterSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/size/scatterSize.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/size/scatterSize.ts"],"sourcesContent":["import type { IScatterChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\n\nexport const scatterSize: SpecPipe = (spec, context) => {\n const result = { ...spec } as IScatterChartSpec\n const { advancedVSeed } = context\n const { chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as {\n sizeRange: number | number[]\n size?: number | number[]\n }\n\n if (!baseConfig || (!baseConfig.sizeRange && !baseConfig.size)) {\n return result\n }\n\n const size = baseConfig.size ?? baseConfig.sizeRange\n\n result.size = {\n type: 'linear',\n range: Array.isArray(size) ? size : [size, size],\n } as IScatterChartSpec['size']\n\n result.sizeField = encoding?.size?.[0] || undefined\n\n return result\n}\n"],"names":["scatterSize","spec","context","result","advancedVSeed","chartType","encoding","baseConfig","size","Array","undefined"],"mappings":"AAGO,MAAMA,cAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,SAAS,EAAEC,QAAQ,EAAE,GAAGF;IAChC,MAAMG,aAAaH,cAAc,MAAM,CAACC,UAAU;IAKlD,IAAI,CAACE,cAAe,CAACA,WAAW,SAAS,IAAI,CAACA,WAAW,IAAI,EAC3D,OAAOJ;IAGT,MAAMK,OAAOD,WAAW,IAAI,IAAIA,WAAW,SAAS;IAEpDJ,OAAO,IAAI,GAAG;QACZ,MAAM;QACN,OAAOM,MAAM,OAAO,CAACD,QAAQA,OAAO;YAACA;YAAMA;SAAK;IAClD;IAEAL,OAAO,SAAS,GAAGG,UAAU,MAAM,CAAC,EAAE,IAAII;IAE1C,OAAOP;AACT"}
@@ -20,7 +20,10 @@ const createNumFormatter = (format, locale = intl.getLocale())=>{
20
20
  numFormatterOptions.maximumSignificantDigits = significantDigits;
21
21
  }
22
22
  }
23
- const numFormatter = new Intl.NumberFormat(locale, numFormatterOptions);
23
+ const numFormatter = new Intl.NumberFormat(locale, {
24
+ ...numFormatterOptions,
25
+ useGrouping: thousandSeparator
26
+ });
24
27
  return (value)=>{
25
28
  let num = Number(value);
26
29
  let typeSymbol = '';
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/utils/format/createNumFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createNumFormatter.ts"],"sourcesContent":["import { isNumber } from 'remeda'\nimport { intl } from '../../../i18n'\nimport type { Formatter, Locale, NumFormat } from 'src/types'\n\nexport const createNumFormatter = (format?: Partial<NumFormat>, locale: Locale = intl.getLocale()): Formatter => {\n const {\n type = 'number',\n ratio = 1,\n symbol = '',\n thousandSeparator = true,\n prefix = '',\n suffix = '',\n\n fractionDigits = 2,\n significantDigits,\n roundingMode = 'halfExpand',\n roundingPriority = 'auto',\n } = format || {}\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: type === 'scientific' ? 'scientific' : 'standard',\n // @ts-expect-error roundingMode is not in NumberFormatOptions\n roundingMode,\n roundingPriority,\n }\n\n if (isNumber(fractionDigits)) {\n if (fractionDigits >= 0) {\n numFormatterOptions.minimumFractionDigits = fractionDigits\n numFormatterOptions.maximumFractionDigits = fractionDigits\n }\n }\n if (isNumber(significantDigits) && significantDigits > 0) {\n if (significantDigits > 0) {\n numFormatterOptions.minimumSignificantDigits = significantDigits\n numFormatterOptions.maximumSignificantDigits = significantDigits\n }\n }\n\n const numFormatter = new Intl.NumberFormat(locale, numFormatterOptions)\n\n return (value?: number | string) => {\n let num = Number(value)\n let typeSymbol = ''\n if (Number.isNaN(num)) {\n return String(value)\n }\n\n // apply ratio for percent/permille\n if (type === 'percent') {\n num *= 100\n typeSymbol = '%'\n } else if (type === 'permille') {\n num *= 1000\n typeSymbol = '‰'\n } else if (type === 'number') {\n num = num / (ratio || 1)\n }\n\n // format value\n let numStr = numFormatter.format(num)\n\n // add thousand separator\n if (thousandSeparator) {\n const parts = numStr.split('.')\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n numStr = parts.join('.')\n }\n\n // add symbol, typeSymbol, prefix and suffix\n return `${prefix}${numStr}${typeSymbol}${symbol}${suffix}`\n }\n}\n\nexport const autoNumFormatter = (value?: number | string, locale: Locale = intl.getLocale()): string => {\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 numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: 'compact',\n }\n numFormatterOptions.minimumFractionDigits = 0\n numFormatterOptions.maximumFractionDigits = 2\n\n const numFormatter = new Intl.NumberFormat(locale, { ...numFormatterOptions })\n\n return numFormatter.format(Number(value))\n}\n"],"names":["createNumFormatter","format","locale","intl","type","ratio","symbol","thousandSeparator","prefix","suffix","fractionDigits","significantDigits","roundingMode","roundingPriority","numFormatterOptions","isNumber","numFormatter","Intl","value","num","Number","typeSymbol","String","numStr","parts","autoNumFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAACC,QAA6BC,SAAiBC,KAAK,SAAS,EAAE;IAC/F,MAAM,EACJC,OAAO,QAAQ,EACfC,QAAQ,CAAC,EACTC,SAAS,EAAE,EACXC,oBAAoB,IAAI,EACxBC,SAAS,EAAE,EACXC,SAAS,EAAE,EAEXC,iBAAiB,CAAC,EAClBC,iBAAiB,EACjBC,eAAe,YAAY,EAC3BC,mBAAmB,MAAM,EAC1B,GAAGZ,UAAU,CAAC;IAEf,MAAMa,sBAAgD;QACpD,OAAO;QACP,UAAUV,AAAS,iBAATA,OAAwB,eAAe;QAEjDQ;QACAC;IACF;IAEA,IAAIE,SAASL,iBACX;QAAA,IAAIA,kBAAkB,GAAG;YACvBI,oBAAoB,qBAAqB,GAAGJ;YAC5CI,oBAAoB,qBAAqB,GAAGJ;QAC9C;IAAA;IAEF,IAAIK,SAASJ,sBAAsBA,oBAAoB,GACrD;QAAA,IAAIA,oBAAoB,GAAG;YACzBG,oBAAoB,wBAAwB,GAAGH;YAC/CG,oBAAoB,wBAAwB,GAAGH;QACjD;IAAA;IAGF,MAAMK,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQY;IAEnD,OAAO,CAACI;QACN,IAAIC,MAAMC,OAAOF;QACjB,IAAIG,aAAa;QACjB,IAAID,OAAO,KAAK,CAACD,MACf,OAAOG,OAAOJ;QAIhB,IAAId,AAAS,cAATA,MAAoB;YACtBe,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,eAATA,MAAqB;YAC9Be,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,aAATA,MACTe,OAAad,SAAS;QAIxB,IAAIkB,SAASP,aAAa,MAAM,CAACG;QAGjC,IAAIZ,mBAAmB;YACrB,MAAMiB,QAAQD,OAAO,KAAK,CAAC;YAC3BC,KAAK,CAAC,EAAE,GAAGA,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,yBAAyB;YACrDD,SAASC,MAAM,IAAI,CAAC;QACtB;QAGA,OAAO,GAAGhB,SAASe,SAASF,aAAaf,SAASG,QAAQ;IAC5D;AACF;AAEO,MAAMgB,mBAAmB,CAACP,OAAyBhB,SAAiBC,KAAK,SAAS,EAAE;IACzF,IAAIe,QAAAA,OAAuC,OAAOI,OAAOJ;IACzD,MAAMC,MAAMC,OAAOF;IACnB,IAAIE,OAAO,KAAK,CAACD,MAAM,OAAOG,OAAOJ;IAErC,MAAMJ,sBAAgD;QACpD,OAAO;QACP,UAAU;IACZ;IACAA,oBAAoB,qBAAqB,GAAG;IAC5CA,oBAAoB,qBAAqB,GAAG;IAE5C,MAAME,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQ;QAAE,GAAGY,mBAAmB;IAAC;IAE5E,OAAOE,aAAa,MAAM,CAACI,OAAOF;AACpC"}
1
+ {"version":3,"file":"pipeline/utils/format/createNumFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createNumFormatter.ts"],"sourcesContent":["import { isNumber } from 'remeda'\nimport { intl } from '../../../i18n'\nimport type { Formatter, Locale, NumFormat } from 'src/types'\n\nexport const createNumFormatter = (format?: Partial<NumFormat>, locale: Locale = intl.getLocale()): Formatter => {\n const {\n type = 'number',\n ratio = 1,\n symbol = '',\n thousandSeparator = true,\n prefix = '',\n suffix = '',\n\n fractionDigits = 2,\n significantDigits,\n roundingMode = 'halfExpand',\n roundingPriority = 'auto',\n } = format || {}\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: type === 'scientific' ? 'scientific' : 'standard',\n // @ts-expect-error roundingMode is not in NumberFormatOptions\n roundingMode,\n roundingPriority,\n }\n\n if (isNumber(fractionDigits)) {\n if (fractionDigits >= 0) {\n numFormatterOptions.minimumFractionDigits = fractionDigits\n numFormatterOptions.maximumFractionDigits = fractionDigits\n }\n }\n if (isNumber(significantDigits) && significantDigits > 0) {\n if (significantDigits > 0) {\n numFormatterOptions.minimumSignificantDigits = significantDigits\n numFormatterOptions.maximumSignificantDigits = significantDigits\n }\n }\n\n const numFormatter = new Intl.NumberFormat(locale, { ...numFormatterOptions, useGrouping: thousandSeparator })\n\n return (value?: number | string) => {\n let num = Number(value)\n let typeSymbol = ''\n if (Number.isNaN(num)) {\n return String(value)\n }\n\n // apply ratio for percent/permille\n if (type === 'percent') {\n num *= 100\n typeSymbol = '%'\n } else if (type === 'permille') {\n num *= 1000\n typeSymbol = '‰'\n } else if (type === 'number') {\n num = num / (ratio || 1)\n }\n\n // format value\n let numStr = numFormatter.format(num)\n\n // add thousand separator\n if (thousandSeparator) {\n const parts = numStr.split('.')\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n numStr = parts.join('.')\n }\n\n // add symbol, typeSymbol, prefix and suffix\n return `${prefix}${numStr}${typeSymbol}${symbol}${suffix}`\n }\n}\n\nexport const autoNumFormatter = (value?: number | string, locale: Locale = intl.getLocale()): string => {\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 numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: 'compact',\n }\n numFormatterOptions.minimumFractionDigits = 0\n numFormatterOptions.maximumFractionDigits = 2\n\n const numFormatter = new Intl.NumberFormat(locale, { ...numFormatterOptions })\n\n return numFormatter.format(Number(value))\n}\n"],"names":["createNumFormatter","format","locale","intl","type","ratio","symbol","thousandSeparator","prefix","suffix","fractionDigits","significantDigits","roundingMode","roundingPriority","numFormatterOptions","isNumber","numFormatter","Intl","value","num","Number","typeSymbol","String","numStr","parts","autoNumFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAACC,QAA6BC,SAAiBC,KAAK,SAAS,EAAE;IAC/F,MAAM,EACJC,OAAO,QAAQ,EACfC,QAAQ,CAAC,EACTC,SAAS,EAAE,EACXC,oBAAoB,IAAI,EACxBC,SAAS,EAAE,EACXC,SAAS,EAAE,EAEXC,iBAAiB,CAAC,EAClBC,iBAAiB,EACjBC,eAAe,YAAY,EAC3BC,mBAAmB,MAAM,EAC1B,GAAGZ,UAAU,CAAC;IAEf,MAAMa,sBAAgD;QACpD,OAAO;QACP,UAAUV,AAAS,iBAATA,OAAwB,eAAe;QAEjDQ;QACAC;IACF;IAEA,IAAIE,SAASL,iBACX;QAAA,IAAIA,kBAAkB,GAAG;YACvBI,oBAAoB,qBAAqB,GAAGJ;YAC5CI,oBAAoB,qBAAqB,GAAGJ;QAC9C;IAAA;IAEF,IAAIK,SAASJ,sBAAsBA,oBAAoB,GACrD;QAAA,IAAIA,oBAAoB,GAAG;YACzBG,oBAAoB,wBAAwB,GAAGH;YAC/CG,oBAAoB,wBAAwB,GAAGH;QACjD;IAAA;IAGF,MAAMK,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQ;QAAE,GAAGY,mBAAmB;QAAE,aAAaP;IAAkB;IAE5G,OAAO,CAACW;QACN,IAAIC,MAAMC,OAAOF;QACjB,IAAIG,aAAa;QACjB,IAAID,OAAO,KAAK,CAACD,MACf,OAAOG,OAAOJ;QAIhB,IAAId,AAAS,cAATA,MAAoB;YACtBe,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,eAATA,MAAqB;YAC9Be,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,aAATA,MACTe,OAAad,SAAS;QAIxB,IAAIkB,SAASP,aAAa,MAAM,CAACG;QAGjC,IAAIZ,mBAAmB;YACrB,MAAMiB,QAAQD,OAAO,KAAK,CAAC;YAC3BC,KAAK,CAAC,EAAE,GAAGA,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,yBAAyB;YACrDD,SAASC,MAAM,IAAI,CAAC;QACtB;QAGA,OAAO,GAAGhB,SAASe,SAASF,aAAaf,SAASG,QAAQ;IAC5D;AACF;AAEO,MAAMgB,mBAAmB,CAACP,OAAyBhB,SAAiBC,KAAK,SAAS,EAAE;IACzF,IAAIe,QAAAA,OAAuC,OAAOI,OAAOJ;IACzD,MAAMC,MAAMC,OAAOF;IACnB,IAAIE,OAAO,KAAK,CAACD,MAAM,OAAOG,OAAOJ;IAErC,MAAMJ,sBAAgD;QACpD,OAAO;QACP,UAAU;IACZ;IACAA,oBAAoB,qBAAqB,GAAG;IAC5CA,oBAAoB,qBAAqB,GAAG;IAE5C,MAAME,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQ;QAAE,GAAGY,mBAAmB;IAAC;IAE5E,OAAOE,aAAa,MAAM,CAACI,OAAOF;AACpC"}
@@ -57,7 +57,7 @@ export interface Area {
57
57
  /**
58
58
  * 指标
59
59
  * @description 面积图的指标会自动合并为一个指标, 映射到Y轴, 指标名称会与其余维度合并, 作为图例项展示.
60
- * @type {DimensionTree}
60
+ * @type {MeasureTree}
61
61
  * @example [{id: 'value', alias: '数值'}]
62
62
  */
63
63
  measures?: MeasureTree;
@@ -49,7 +49,7 @@ export interface AreaPercent {
49
49
  /**
50
50
  * 指标
51
51
  * @description 百分比面积图的指标会自动合并为一个指标, 映射到Y轴, 指标名称会与其余维度合并, 作为图例项展示.
52
- * @type {DimensionTree}
52
+ * @type {MeasureTree}
53
53
  * @example [{id: 'value', alias: '数值占比', format: 'percent'}]
54
54
  */
55
55
  measures?: MeasureTree;
@@ -48,7 +48,7 @@ export interface Bar {
48
48
  /**
49
49
  * 指标
50
50
  * @description 指标, 条形图指标会自动合并为一个指标, 映射到X轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
51
- * @type {DimensionTree}
51
+ * @type {MeasureTree}
52
52
  * @example [{id: "value", alias: "数值"}]
53
53
  */
54
54
  measures?: MeasureTree;