@visactor/vseed 0.1.22 → 0.1.23

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 (97) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/pipeline/advanced/chart/pipeline/area.js +2 -1
  4. package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
  5. package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +2 -1
  6. package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
  7. package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +2 -1
  8. package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
  9. package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +2 -1
  10. package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
  11. package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +2 -1
  12. package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
  13. package/dist/esm/pipeline/advanced/chart/pipeline/column.js +2 -1
  14. package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
  15. package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +2 -1
  16. package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
  17. package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +2 -1
  18. package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
  19. package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +2 -1
  20. package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
  21. package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +2 -1
  22. package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
  23. package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +2 -1
  24. package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
  25. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +2 -1
  26. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
  27. package/dist/esm/pipeline/advanced/chart/pipeline/line.js +2 -1
  28. package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
  29. package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +2 -1
  30. package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
  31. package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +2 -1
  32. package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
  33. package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +2 -1
  34. package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
  35. package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +2 -1
  36. package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
  37. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +2 -2
  38. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
  39. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +1 -1
  40. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
  41. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +2 -2
  42. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
  43. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +2 -2
  44. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
  45. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +2 -1
  46. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
  47. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +2 -2
  48. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
  49. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +9 -3
  50. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
  51. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +9 -3
  52. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
  53. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +3 -3
  54. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js +8 -6
  55. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
  56. package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.js +2 -2
  57. package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.js.map +1 -1
  58. package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.js +2 -2
  59. package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.js.map +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js +2 -2
  61. package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +1 -1
  62. package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js +2 -2
  63. package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js.map +1 -1
  64. package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.js +2 -2
  65. package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.js.map +1 -1
  66. package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.js +2 -2
  67. package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.js.map +1 -1
  68. package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.js +2 -2
  69. package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.js.map +1 -1
  70. package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.js +2 -2
  71. package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.js.map +1 -1
  72. package/dist/esm/pipeline/spec/chart/pipes/init/area.js +2 -2
  73. package/dist/esm/pipeline/spec/chart/pipes/init/area.js.map +1 -1
  74. package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.js +2 -2
  75. package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.js.map +1 -1
  76. package/dist/esm/pipeline/spec/chart/pipes/init/line.js +2 -2
  77. package/dist/esm/pipeline/spec/chart/pipes/init/line.js.map +1 -1
  78. package/dist/esm/pipeline/spec/chart/pipes/init/radar.js +2 -2
  79. package/dist/esm/pipeline/spec/chart/pipes/init/radar.js.map +1 -1
  80. package/dist/esm/pipeline/utils/chatType.d.ts +4 -1
  81. package/dist/esm/pipeline/utils/chatType.js +8 -5
  82. package/dist/esm/pipeline/utils/chatType.js.map +1 -1
  83. package/dist/esm/pipeline/utils/constant.d.ts +22 -0
  84. package/dist/esm/pipeline/utils/constant.js +23 -1
  85. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  86. package/dist/esm/pipeline/utils/format/createNumFormatter.js +2 -1
  87. package/dist/esm/pipeline/utils/format/createNumFormatter.js.map +1 -1
  88. package/dist/esm/pipeline/utils/index.d.ts +1 -0
  89. package/dist/esm/pipeline/utils/index.js +1 -0
  90. package/dist/esm/theme/light.js +3 -12
  91. package/dist/esm/theme/light.js.map +1 -1
  92. package/dist/esm/types/properties/chartType/chartType.d.ts +0 -22
  93. package/dist/esm/types/properties/chartType/chartType.js +1 -23
  94. package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
  95. package/dist/umd/index.js +260 -201
  96. package/dist/umd/index.js.map +1 -1
  97. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding, FoldPrimaryMeasureValue, FoldSecondaryMeasureValue } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport type {\n AdvancedPipe,\n AdvancedVSeed,\n ColumnParallel,\n Dataset,\n Encoding,\n FoldInfo,\n MeasureGroup,\n UnfoldInfo,\n} from 'src/types'\n\nexport const reshapeWithDualEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed\n\n if (measures.length > 2) {\n throw new Error('measures can not be more than 2 groups in dualAxis')\n }\n const foldInfoList: FoldInfo[] = []\n const unfoldInfoList: UnfoldInfo[] = []\n\n const datasets: Dataset[] = []\n const primaryMeasures = measures[0] as MeasureGroup\n const secondaryMeasures = (measures[1] || []) as MeasureGroup\n\n if (primaryMeasures && primaryMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(primaryMeasures.children, (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n foldMeasureValue: FoldPrimaryMeasureValue,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n if (secondaryMeasures && secondaryMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(secondaryMeasures.children, (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n foldMeasureValue: FoldSecondaryMeasureValue,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n const unfoldInfo: UnfoldInfo = {\n ...unfoldInfoList[0],\n colorItems: unfoldInfoList.flatMap((d) => d.colorItems),\n colorIdMap: unfoldInfoList.reduce((prev, cur) => ({ ...prev, ...cur.colorIdMap }), {}),\n }\n\n return {\n ...result,\n dataset: datasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo: foldInfoList[0],\n foldInfoList: foldInfoList,\n unfoldInfo: unfoldInfo,\n },\n ],\n }\n}\n"],"names":["reshapeWithDualEncoding","advancedVSeed","context","result","vseed","dataset","dimensions","measures","encoding","chartType","Error","foldInfoList","unfoldInfoList","datasets","primaryMeasures","secondaryMeasures","newDataset","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","item","FoldPrimaryMeasureValue","getColorMeasureId","FoldSecondaryMeasureValue","d","prev","cur","String"],"mappings":";;;AAcO,MAAMA,0BAAwC,CAACC,eAAeC;IACnE,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAE,GAAGD;IACpB,MAAM,EAAEE,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGR;IAEhE,IAAIM,SAAS,MAAM,GAAG,GACpB,MAAM,IAAIG,MAAM;IAElB,MAAMC,eAA2B,EAAE;IACnC,MAAMC,iBAA+B,EAAE;IAEvC,MAAMC,WAAsB,EAAE;IAC9B,MAAMC,kBAAkBP,QAAQ,CAAC,EAAE;IACnC,MAAMQ,oBAAqBR,QAAQ,CAAC,EAAE,IAAI,EAAE;IAE5C,IAAIO,mBAAmBA,gBAAgB,QAAQ,EAAE;QAC/C,MAAM,EACJ,SAASE,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,OAASA,KAAK,EAAE,GACtCD,SAASN,gBAAgB,QAAQ,EAAE,CAACO,OAASA,KAAK,EAAE,GACpDb,UACA;YACE,eAAe;YACf,kBAAkBc;YAClB,gBAAgBC,kBAAkBtB;QACpC;QAGFY,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,IAAIH,qBAAqBA,kBAAkB,QAAQ,EAAE;QACnD,MAAM,EACJ,SAASC,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,OAASA,KAAK,EAAE,GACtCD,SAASL,kBAAkB,QAAQ,EAAE,CAACM,OAASA,KAAK,EAAE,GACtDb,UACA;YACE,eAAe;YACf,kBAAkBgB;YAClB,gBAAgBD,kBAAkBtB;QACpC;QAGFY,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,MAAMA,aAAyB;QAC7B,GAAGN,cAAc,CAAC,EAAE;QACpB,YAAYA,eAAe,OAAO,CAAC,CAACa,IAAMA,EAAE,UAAU;QACtD,YAAYb,eAAe,MAAM,CAAC,CAACc,MAAMC,MAAS;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU;YAAC,IAAI,CAAC;IACtF;IAEA,OAAO;QACL,GAAGxB,MAAM;QACT,SAASU;QACT,oBAAoB;YAClB;gBACE,IAAIe,OAAOnB;gBACX,OAAO;gBACP,UAAUE,YAAY,CAAC,EAAE;gBACzB,cAAcA;gBACd,YAAYO;YACd;SACD;IACH;AACF"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding, FoldPrimaryMeasureValue, FoldSecondaryMeasureValue } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport type {\n AdvancedPipe,\n AdvancedVSeed,\n ColumnParallel,\n Dataset,\n Encoding,\n FoldInfo,\n MeasureGroup,\n UnfoldInfo,\n} from 'src/types'\n\nexport const reshapeWithDualEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed\n\n if (measures.length > 2) {\n throw new Error('measures can not be more than 2 groups in dualAxis')\n }\n const foldInfoList: FoldInfo[] = []\n const unfoldInfoList: UnfoldInfo[] = []\n\n const datasets: Dataset[] = []\n const primaryMeasures = measures[0] as MeasureGroup\n const secondaryMeasures = (measures[1] || []) as MeasureGroup\n\n if (primaryMeasures && primaryMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(primaryMeasures.children, (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n foldMeasureValue: FoldPrimaryMeasureValue,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n if (secondaryMeasures && secondaryMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(secondaryMeasures.children, (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n foldMeasureValue: FoldSecondaryMeasureValue,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n const unfoldInfo: UnfoldInfo = {\n ...unfoldInfoList[0],\n colorItems: unfoldInfoList.flatMap((d) => d.colorItems),\n colorIdMap: unfoldInfoList.reduce((prev, cur) => ({ ...prev, ...cur.colorIdMap }), {}),\n }\n\n return {\n ...result,\n dataset: datasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo: foldInfoList[0],\n foldInfoList: foldInfoList,\n unfoldInfo: unfoldInfo,\n },\n ],\n }\n}\n"],"names":["reshapeWithDualEncoding","advancedVSeed","context","result","vseed","dataset","dimensions","measures","encoding","chartType","Error","foldInfoList","unfoldInfoList","datasets","primaryMeasures","secondaryMeasures","newDataset","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","item","FoldPrimaryMeasureValue","getColorMeasureId","FoldSecondaryMeasureValue","d","prev","cur","String"],"mappings":";;;AAcO,MAAMA,0BAAwC,CAACC,eAAeC;IACnE,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAE,GAAGD;IACpB,MAAM,EAAEE,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGR;IAEhE,IAAIM,SAAS,MAAM,GAAG,GACpB,MAAM,IAAIG,MAAM;IAElB,MAAMC,eAA2B,EAAE;IACnC,MAAMC,iBAA+B,EAAE;IAEvC,MAAMC,WAAsB,EAAE;IAC9B,MAAMC,kBAAkBP,QAAQ,CAAC,EAAE;IACnC,MAAMQ,oBAAqBR,QAAQ,CAAC,EAAE,IAAI,EAAE;IAE5C,IAAIO,mBAAmBA,gBAAgB,QAAQ,EAAE;QAC/C,MAAM,EACJ,SAASE,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,OAASA,KAAK,EAAE,GACtCD,SAASN,gBAAgB,QAAQ,EAAE,CAACO,OAASA,KAAK,EAAE,GACpDb,UACA;YACE,eAAe;YACf,kBAAkBc;YAClB,gBAAgBC,kBAAkBtB,eAAgCG;QACpE;QAGFS,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,IAAIH,qBAAqBA,kBAAkB,QAAQ,EAAE;QACnD,MAAM,EACJ,SAASC,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,OAASA,KAAK,EAAE,GACtCD,SAASL,kBAAkB,QAAQ,EAAE,CAACM,OAASA,KAAK,EAAE,GACtDb,UACA;YACE,eAAe;YACf,kBAAkBgB;YAClB,gBAAgBD,kBAAkBtB,eAAgCG;QACpE;QAGFS,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,MAAMA,aAAyB;QAC7B,GAAGN,cAAc,CAAC,EAAE;QACpB,YAAYA,eAAe,OAAO,CAAC,CAACa,IAAMA,EAAE,UAAU;QACtD,YAAYb,eAAe,MAAM,CAAC,CAACc,MAAMC,MAAS;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU;YAAC,IAAI,CAAC;IACtF;IAEA,OAAO;QACL,GAAGxB,MAAM;QACT,SAASU;QACT,oBAAoB;YAClB;gBACE,IAAIe,OAAOnB;gBACX,OAAO;gBACP,UAAUE,YAAY,CAAC,EAAE;gBACzB,cAAcA;gBACd,YAAYO;YACd;SACD;IACH;AACF"}
@@ -9,9 +9,10 @@ const reshapeWithEncoding = (advancedVSeed, context)=>{
9
9
  const { vseed } = context;
10
10
  const { dataset, chartType } = vseed;
11
11
  const { dimensions = [], measures = [], encoding } = advancedVSeed;
12
+ const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
12
13
  const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, uniqueBy(dimensions, (item)=>item.id), uniqueBy(findAllMeasures(measures), (item)=>item.id), encoding, {
13
14
  colorItemAsId: false,
14
- colorMeasureId: getColorMeasureId(advancedVSeed)
15
+ colorMeasureId
15
16
  });
16
17
  return {
17
18
  ...result,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Encoding } from 'src/types'\n\nexport const reshapeWithEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding } = advancedVSeed\n\n const {\n dataset: newDatasets,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(findAllMeasures(measures), (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed),\n },\n )\n\n return {\n ...result,\n dataset: newDatasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo,\n unfoldInfo,\n },\n ],\n dimensions,\n measures,\n }\n}\n"],"names":["reshapeWithEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","newDatasets","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","item","findAllMeasures","getColorMeasureId","String"],"mappings":";;;;AAMO,MAAMA,sBAAoC,CAACC,eAAeC;IAC/D,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAE,GAAGR;IAErD,MAAM,EACJ,SAASS,WAAW,EACpBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFR,SACAS,SAASP,YAAY,CAACQ,OAASA,KAAK,EAAE,GACtCD,SAASE,gBAAgBR,WAAW,CAACO,OAASA,KAAK,EAAE,GACrDN,UACA;QACE,eAAe;QACf,gBAAgBQ,kBAAkBhB;IACpC;IAGF,OAAO;QACL,GAAGE,MAAM;QACT,SAASO;QACT,oBAAoB;YAClB;gBACE,IAAIQ,OAAOZ;gBACX,OAAO;gBACPK;gBACAC;YACF;SACD;QACDL;QACAC;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { dataReshapeByEncoding } from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedPipe, AdvancedVSeed, ColumnParallel, Encoding } from 'src/types'\n\nexport const reshapeWithEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset, chartType } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding } = advancedVSeed\n\n const colorMeasureId = getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed)\n const {\n dataset: newDatasets,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (item) => item.id),\n uniqueBy(findAllMeasures(measures), (item) => item.id),\n encoding as Encoding,\n {\n colorItemAsId: false,\n colorMeasureId,\n },\n )\n\n return {\n ...result,\n dataset: newDatasets,\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo,\n unfoldInfo,\n },\n ],\n dimensions,\n measures,\n }\n}\n"],"names":["reshapeWithEncoding","advancedVSeed","context","result","vseed","dataset","chartType","dimensions","measures","encoding","colorMeasureId","getColorMeasureId","newDatasets","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","item","findAllMeasures","String"],"mappings":";;;;AAMO,MAAMA,sBAAoC,CAACC,eAAeC;IAC/D,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAE,GAAGF;IAC/B,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAE,GAAGR;IAErD,MAAMS,iBAAiBC,kBAAkBV,eAAgCG;IACzE,MAAM,EACJ,SAASQ,WAAW,EACpBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFV,SACAW,SAAST,YAAY,CAACU,OAASA,KAAK,EAAE,GACtCD,SAASE,gBAAgBV,WAAW,CAACS,OAASA,KAAK,EAAE,GACrDR,UACA;QACE,eAAe;QACfC;IACF;IAGF,OAAO;QACL,GAAGP,MAAM;QACT,SAASS;QACT,oBAAoB;YAClB;gBACE,IAAIO,OAAOb;gBACX,OAAO;gBACPO;gBACAC;YACF;SACD;QACDP;QACAC;IACF;AACF"}
@@ -19,7 +19,7 @@ const reshapeWithScatterEncoding = (advancedVSeed, context)=>{
19
19
  foldMeasureValue: FoldXMeasureValue,
20
20
  foldMeasureId: FoldXMeasureId,
21
21
  colorItemAsId: true,
22
- colorMeasureId: getColorMeasureId(advancedVSeed)
22
+ colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
23
23
  });
24
24
  datasets.push(newDataset);
25
25
  foldInfoList.push(foldInfo);
@@ -30,7 +30,7 @@ const reshapeWithScatterEncoding = (advancedVSeed, context)=>{
30
30
  foldMeasureValue: FoldYMeasureValue,
31
31
  foldMeasureId: FoldYMeasureId,
32
32
  colorItemAsId: true,
33
- colorMeasureId: getColorMeasureId(advancedVSeed)
33
+ colorMeasureId: getColorMeasureId(advancedVSeed, vseed)
34
34
  });
35
35
  datasets[0] = newDataset;
36
36
  foldInfoList.push(foldInfo);
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport {\n dataReshapeByEncoding,\n FoldXMeasureId,\n FoldXMeasureValue,\n FoldYMeasureId,\n FoldYMeasureValue,\n} from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport type {\n AdvancedPipe,\n AdvancedVSeed,\n ColumnParallel,\n Dataset,\n Encoding,\n FoldInfo,\n MeasureGroup,\n UnfoldInfo,\n} from 'src/types'\n\nexport const reshapeWithScatterEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed\n\n if (measures.length > 2) {\n throw new Error('measures can not be more than 2 groups in scatter')\n }\n const foldInfoList: FoldInfo[] = []\n const unfoldInfoList: UnfoldInfo[] = []\n\n const datasets: Dataset[] = []\n const xMeasures = measures[0] as MeasureGroup\n const yMeasures = (measures[1] || xMeasures) as MeasureGroup\n\n if (xMeasures && xMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (d) => d.id),\n uniqueBy(xMeasures.children, (d) => d.id),\n encoding as Encoding,\n {\n foldMeasureValue: FoldXMeasureValue,\n foldMeasureId: FoldXMeasureId,\n colorItemAsId: true,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n if (yMeasures && yMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n datasets[0],\n uniqueBy(dimensions, (d) => d.id),\n uniqueBy(yMeasures.children, (d) => d.id),\n encoding as Encoding,\n {\n foldMeasureValue: FoldYMeasureValue,\n foldMeasureId: FoldYMeasureId,\n colorItemAsId: true,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed),\n },\n )\n\n datasets[0] = newDataset\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n const unfoldInfo: UnfoldInfo = {\n ...unfoldInfoList[0],\n colorItems: unfoldInfoList.flatMap((d) => d.colorItems),\n colorIdMap: unfoldInfoList.reduce((prev, cur) => ({ ...prev, ...cur.colorIdMap }), {}),\n }\n\n return {\n ...result,\n dataset: datasets[0],\n\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo: foldInfoList[0],\n foldInfoList: foldInfoList,\n unfoldInfo: unfoldInfo,\n },\n ],\n }\n}\n"],"names":["reshapeWithScatterEncoding","advancedVSeed","context","result","vseed","dataset","dimensions","measures","encoding","chartType","Error","foldInfoList","unfoldInfoList","datasets","xMeasures","yMeasures","newDataset","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","d","FoldXMeasureValue","FoldXMeasureId","getColorMeasureId","FoldYMeasureValue","FoldYMeasureId","prev","cur","String"],"mappings":";;;AAoBO,MAAMA,6BAA2C,CAACC,eAAeC;IACtE,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAE,GAAGD;IACpB,MAAM,EAAEE,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGR;IAEhE,IAAIM,SAAS,MAAM,GAAG,GACpB,MAAM,IAAIG,MAAM;IAElB,MAAMC,eAA2B,EAAE;IACnC,MAAMC,iBAA+B,EAAE;IAEvC,MAAMC,WAAsB,EAAE;IAC9B,MAAMC,YAAYP,QAAQ,CAAC,EAAE;IAC7B,MAAMQ,YAAaR,QAAQ,CAAC,EAAE,IAAIO;IAElC,IAAIA,aAAaA,UAAU,QAAQ,EAAE;QACnC,MAAM,EACJ,SAASE,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,IAAMA,EAAE,EAAE,GAChCD,SAASN,UAAU,QAAQ,EAAE,CAACO,IAAMA,EAAE,EAAE,GACxCb,UACA;YACE,kBAAkBc;YAClB,eAAeC;YACf,eAAe;YACf,gBAAgBC,kBAAkBvB;QACpC;QAGFY,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,IAAIH,aAAaA,UAAU,QAAQ,EAAE;QACnC,MAAM,EACJ,SAASC,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFN,QAAQ,CAAC,EAAE,EACXO,SAASd,YAAY,CAACe,IAAMA,EAAE,EAAE,GAChCD,SAASL,UAAU,QAAQ,EAAE,CAACM,IAAMA,EAAE,EAAE,GACxCb,UACA;YACE,kBAAkBiB;YAClB,eAAeC;YACf,eAAe;YACf,gBAAgBF,kBAAkBvB;QACpC;QAGFY,QAAQ,CAAC,EAAE,GAAGG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,MAAMA,aAAyB;QAC7B,GAAGN,cAAc,CAAC,EAAE;QACpB,YAAYA,eAAe,OAAO,CAAC,CAACS,IAAMA,EAAE,UAAU;QACtD,YAAYT,eAAe,MAAM,CAAC,CAACe,MAAMC,MAAS;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU;YAAC,IAAI,CAAC;IACtF;IAEA,OAAO;QACL,GAAGzB,MAAM;QACT,SAASU,QAAQ,CAAC,EAAE;QAEpB,oBAAoB;YAClB;gBACE,IAAIgB,OAAOpB;gBACX,OAAO;gBACP,UAAUE,YAAY,CAAC,EAAE;gBACzB,cAAcA;gBACd,YAAYO;YACd;SACD;IACH;AACF"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js","sources":["webpack://@visactor/vseed/./src/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport {\n dataReshapeByEncoding,\n FoldXMeasureId,\n FoldXMeasureValue,\n FoldYMeasureId,\n FoldYMeasureValue,\n} from 'src/dataReshape'\nimport { getColorMeasureId } from 'src/pipeline/spec/chart/pipes'\nimport type {\n AdvancedPipe,\n AdvancedVSeed,\n ColumnParallel,\n Dataset,\n Encoding,\n FoldInfo,\n MeasureGroup,\n UnfoldInfo,\n} from 'src/types'\n\nexport const reshapeWithScatterEncoding: AdvancedPipe = (advancedVSeed, context) => {\n const result = { ...advancedVSeed }\n const { vseed } = context\n const { dataset } = vseed as ColumnParallel\n const { dimensions = [], measures = [], encoding, chartType } = advancedVSeed\n\n if (measures.length > 2) {\n throw new Error('measures can not be more than 2 groups in scatter')\n }\n const foldInfoList: FoldInfo[] = []\n const unfoldInfoList: UnfoldInfo[] = []\n\n const datasets: Dataset[] = []\n const xMeasures = measures[0] as MeasureGroup\n const yMeasures = (measures[1] || xMeasures) as MeasureGroup\n\n if (xMeasures && xMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n dataset,\n uniqueBy(dimensions, (d) => d.id),\n uniqueBy(xMeasures.children, (d) => d.id),\n encoding as Encoding,\n {\n foldMeasureValue: FoldXMeasureValue,\n foldMeasureId: FoldXMeasureId,\n colorItemAsId: true,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed),\n },\n )\n\n datasets.push(newDataset)\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n if (yMeasures && yMeasures.children) {\n const {\n dataset: newDataset,\n foldInfo,\n unfoldInfo,\n } = dataReshapeByEncoding(\n datasets[0],\n uniqueBy(dimensions, (d) => d.id),\n uniqueBy(yMeasures.children, (d) => d.id),\n encoding as Encoding,\n {\n foldMeasureValue: FoldYMeasureValue,\n foldMeasureId: FoldYMeasureId,\n colorItemAsId: true,\n colorMeasureId: getColorMeasureId(advancedVSeed as AdvancedVSeed, vseed),\n },\n )\n\n datasets[0] = newDataset\n foldInfoList.push(foldInfo)\n unfoldInfoList.push(unfoldInfo)\n }\n\n const unfoldInfo: UnfoldInfo = {\n ...unfoldInfoList[0],\n colorItems: unfoldInfoList.flatMap((d) => d.colorItems),\n colorIdMap: unfoldInfoList.reduce((prev, cur) => ({ ...prev, ...cur.colorIdMap }), {}),\n }\n\n return {\n ...result,\n dataset: datasets[0],\n\n datasetReshapeInfo: [\n {\n id: String(chartType),\n index: 0,\n foldInfo: foldInfoList[0],\n foldInfoList: foldInfoList,\n unfoldInfo: unfoldInfo,\n },\n ],\n }\n}\n"],"names":["reshapeWithScatterEncoding","advancedVSeed","context","result","vseed","dataset","dimensions","measures","encoding","chartType","Error","foldInfoList","unfoldInfoList","datasets","xMeasures","yMeasures","newDataset","foldInfo","unfoldInfo","dataReshapeByEncoding","uniqueBy","d","FoldXMeasureValue","FoldXMeasureId","getColorMeasureId","FoldYMeasureValue","FoldYMeasureId","prev","cur","String"],"mappings":";;;AAoBO,MAAMA,6BAA2C,CAACC,eAAeC;IACtE,MAAMC,SAAS;QAAE,GAAGF,aAAa;IAAC;IAClC,MAAM,EAAEG,KAAK,EAAE,GAAGF;IAClB,MAAM,EAAEG,OAAO,EAAE,GAAGD;IACpB,MAAM,EAAEE,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGR;IAEhE,IAAIM,SAAS,MAAM,GAAG,GACpB,MAAM,IAAIG,MAAM;IAElB,MAAMC,eAA2B,EAAE;IACnC,MAAMC,iBAA+B,EAAE;IAEvC,MAAMC,WAAsB,EAAE;IAC9B,MAAMC,YAAYP,QAAQ,CAAC,EAAE;IAC7B,MAAMQ,YAAaR,QAAQ,CAAC,EAAE,IAAIO;IAElC,IAAIA,aAAaA,UAAU,QAAQ,EAAE;QACnC,MAAM,EACJ,SAASE,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFd,SACAe,SAASd,YAAY,CAACe,IAAMA,EAAE,EAAE,GAChCD,SAASN,UAAU,QAAQ,EAAE,CAACO,IAAMA,EAAE,EAAE,GACxCb,UACA;YACE,kBAAkBc;YAClB,eAAeC;YACf,eAAe;YACf,gBAAgBC,kBAAkBvB,eAAgCG;QACpE;QAGFS,SAAS,IAAI,CAACG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,IAAIH,aAAaA,UAAU,QAAQ,EAAE;QACnC,MAAM,EACJ,SAASC,UAAU,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGC,sBACFN,QAAQ,CAAC,EAAE,EACXO,SAASd,YAAY,CAACe,IAAMA,EAAE,EAAE,GAChCD,SAASL,UAAU,QAAQ,EAAE,CAACM,IAAMA,EAAE,EAAE,GACxCb,UACA;YACE,kBAAkBiB;YAClB,eAAeC;YACf,eAAe;YACf,gBAAgBF,kBAAkBvB,eAAgCG;QACpE;QAGFS,QAAQ,CAAC,EAAE,GAAGG;QACdL,aAAa,IAAI,CAACM;QAClBL,eAAe,IAAI,CAACM;IACtB;IAEA,MAAMA,aAAyB;QAC7B,GAAGN,cAAc,CAAC,EAAE;QACpB,YAAYA,eAAe,OAAO,CAAC,CAACS,IAAMA,EAAE,UAAU;QACtD,YAAYT,eAAe,MAAM,CAAC,CAACe,MAAMC,MAAS;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU;YAAC,IAAI,CAAC;IACtF;IAEA,OAAO;QACL,GAAGzB,MAAM;QACT,SAASU,QAAQ,CAAC,EAAE;QAEpB,oBAAoB;YAClB;gBACE,IAAIgB,OAAOpB;gBACX,OAAO;gBACP,UAAUE,YAAY,CAAC,EAAE;gBACzB,cAAcA;gBACd,YAAYO;YACd;SACD;IACH;AACF"}
@@ -1,7 +1,7 @@
1
- import { LINEAR_AXIS_INNER_OFFSET_TOP } from "../../../../utils/constant.js";
2
- import { createNumFormatter } from "../../../../utils/index.js";
1
+ import { LINEAR_AXIS_INNER_OFFSET_TOP, createNumFormatter, isAreaPercent, isBarPercent, isColumnPercent } from "../../../../utils/index.js";
3
2
  import { createLinearFormat } from "./format/linearFormat.js";
4
3
  import { defaultTitleText } from "./title/defaultTitleText.js";
4
+ import { isEmpty, isNullish } from "remeda";
5
5
  const xLinear = (spec, context)=>{
6
6
  const result = {
7
7
  ...spec
@@ -24,6 +24,9 @@ const xLinear = (spec, context)=>{
24
24
  }
25
25
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = config;
26
26
  const formatter = createNumFormatter(numFormat);
27
+ const percentFormatter = createNumFormatter({
28
+ type: 'percent'
29
+ });
27
30
  const linearAxis = {
28
31
  visible,
29
32
  type: log ? 'log' : 'linear',
@@ -36,7 +39,10 @@ const xLinear = (spec, context)=>{
36
39
  min,
37
40
  label: {
38
41
  visible: label?.visible,
39
- formatMethod: (value)=>createLinearFormat(value, autoFormat, numFormat, formatter),
42
+ formatMethod: (value)=>{
43
+ if (isEmpty(numFormat) && (true === autoFormat || isNullish(autoFormat)) && (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed))) return percentFormatter(value);
44
+ return createLinearFormat(value, autoFormat, numFormat, formatter);
45
+ },
40
46
  style: {
41
47
  fill: label?.labelColor,
42
48
  angle: label?.labelAngle,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/xLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/xLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport { LINEAR_AXIS_INNER_OFFSET_TOP } from '../../../../utils/constant'\nimport type { SpecPipe, XLinearAxis } from 'src/types'\nimport { createNumFormatter } from '../../../../utils'\nimport { createLinearFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\n\nexport const xLinear: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { encoding, dimensions, measures } = advancedVSeed\n const { chartType } = vseed\n const config = advancedVSeed.config?.[chartType as 'bar']?.xAxis as XLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n if (!config) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n type: 'linear',\n orient: 'bottom',\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n\n const linearAxis = {\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'bottom',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n right: LINEAR_AXIS_INNER_OFFSET_TOP,\n // left: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["xLinear","spec","context","result","advancedVSeed","vseed","encoding","dimensions","measures","chartType","config","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","linearAxis","value","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;;AAOO,MAAMA,UAAoB,CAACC,MAAMC;IACtC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IAC3C,MAAM,EAAEK,SAAS,EAAE,GAAGJ;IACtB,MAAMK,SAASN,cAAc,MAAM,EAAE,CAACK,UAAmB,EAAE;IAE3D,IAAI,CAACN,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,IAAI,CAACO,QAAQ;QACXP,OAAO,IAAI,GAAG;eACTA,OAAO,IAAI;YACd;gBACE,SAAS;gBACT,MAAM;gBACN,QAAQ;YACV;SACD;QACD,OAAOA;IACT;IAEA,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGf;IAEJ,MAAMgB,YAAYC,mBAAmBF;IAErC,MAAMG,aAAa;QACjBjB;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACAC;QACAC;QACA,OAAO;YACL,SAAST,OAAO;YAChB,cAAc,CAACiB,QACNC,mBAAmBD,OAAOL,YAAYC,WAAWC;YAE1D,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAaiB,iBAAiBvB,UAAUD,YAAYD,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMQ,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,OAAOgB;QAET;IACF;IAEA7B,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAEyB;KAAW;IAE1C,OAAOzB;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/xLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/xLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport type { SpecPipe, XLinearAxis } from 'src/types'\nimport {\n createNumFormatter,\n isAreaPercent,\n isBarPercent,\n isColumnPercent,\n LINEAR_AXIS_INNER_OFFSET_TOP,\n} from 'src/pipeline/utils'\nimport { createLinearFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const xLinear: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { encoding, dimensions, measures } = advancedVSeed\n const { chartType } = vseed\n const config = advancedVSeed.config?.[chartType as 'bar']?.xAxis as XLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n if (!config) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n type: 'linear',\n orient: 'bottom',\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n const percentFormatter = createNumFormatter({\n type: 'percent',\n })\n\n const linearAxis = {\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'bottom',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n if (\n isEmpty(numFormat) &&\n (autoFormat === true || isNullish(autoFormat)) &&\n (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed))\n ) {\n return percentFormatter(value)\n }\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n right: LINEAR_AXIS_INNER_OFFSET_TOP,\n // left: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["xLinear","spec","context","result","advancedVSeed","vseed","encoding","dimensions","measures","chartType","config","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","percentFormatter","linearAxis","value","isEmpty","isNullish","isBarPercent","isColumnPercent","isAreaPercent","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;;AAaO,MAAMA,UAAoB,CAACC,MAAMC;IACtC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IAC3C,MAAM,EAAEK,SAAS,EAAE,GAAGJ;IACtB,MAAMK,SAASN,cAAc,MAAM,EAAE,CAACK,UAAmB,EAAE;IAE3D,IAAI,CAACN,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,IAAI,CAACO,QAAQ;QACXP,OAAO,IAAI,GAAG;eACTA,OAAO,IAAI;YACd;gBACE,SAAS;gBACT,MAAM;gBACN,QAAQ;YACV;SACD;QACD,OAAOA;IACT;IAEA,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGf;IAEJ,MAAMgB,YAAYC,mBAAmBF;IACrC,MAAMG,mBAAmBD,mBAAmB;QAC1C,MAAM;IACR;IAEA,MAAME,aAAa;QACjBlB;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACAC;QACAC;QACA,OAAO;YACL,SAAST,OAAO;YAChB,cAAc,CAACkB;gBACb,IACEC,QAAQN,cACPD,CAAAA,AAAe,SAAfA,cAAuBQ,UAAUR,WAAU,KAC3CS,CAAAA,aAAa5B,UAAU6B,gBAAgB7B,UAAU8B,cAAc9B,MAAK,GAErE,OAAOuB,iBAAiBE;gBAE1B,OAAOM,mBAAmBN,OAAON,YAAYC,WAAWC;YAC1D;YACA,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAauB,iBAAiB7B,UAAUD,YAAYD,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMQ,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,OAAOsB;QAET;IACF;IAEAnC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE0B;KAAW;IAE1C,OAAO1B;AACT"}
@@ -1,7 +1,7 @@
1
- import { LINEAR_AXIS_INNER_OFFSET_TOP } from "../../../../utils/constant.js";
2
- import { createNumFormatter } from "../../../../utils/index.js";
1
+ import { LINEAR_AXIS_INNER_OFFSET_TOP, createNumFormatter, isAreaPercent, isBarPercent, isColumnPercent } from "../../../../utils/index.js";
3
2
  import { createLinearFormat } from "./format/linearFormat.js";
4
3
  import { defaultTitleText } from "./title/defaultTitleText.js";
4
+ import { isEmpty, isNullish } from "remeda";
5
5
  const yLinear = (spec, context)=>{
6
6
  const result = {
7
7
  ...spec
@@ -24,6 +24,9 @@ const yLinear = (spec, context)=>{
24
24
  }
25
25
  const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10, autoFormat, numFormat = {} } = config;
26
26
  const formatter = createNumFormatter(numFormat);
27
+ const percentFormatter = createNumFormatter({
28
+ type: 'percent'
29
+ });
27
30
  const linearAxis = {
28
31
  visible,
29
32
  type: log ? 'log' : 'linear',
@@ -36,7 +39,10 @@ const yLinear = (spec, context)=>{
36
39
  min,
37
40
  label: {
38
41
  visible: label?.visible,
39
- formatMethod: (value)=>createLinearFormat(value, autoFormat, numFormat, formatter),
42
+ formatMethod: (value)=>{
43
+ if ((isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) && isEmpty(numFormat) && (true === autoFormat || isNullish(autoFormat))) return percentFormatter(value);
44
+ return createLinearFormat(value, autoFormat, numFormat, formatter);
45
+ },
40
46
  style: {
41
47
  fill: label?.labelColor,
42
48
  angle: label?.labelAngle,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/yLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/yLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport { LINEAR_AXIS_INNER_OFFSET_TOP } from '../../../../utils/constant'\nimport { createNumFormatter } from '../../../../utils'\nimport type { SpecPipe, YLinearAxis } from 'src/types'\nimport { createLinearFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\n\nexport const yLinear: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding } = advancedVSeed\n const config = advancedVSeed.config?.[chartType as 'column']?.yAxis as YLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n if (!config) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n type: 'linear',\n orient: 'left',\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n\n const linearAxis = {\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'left',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n top: LINEAR_AXIS_INNER_OFFSET_TOP,\n // bottom: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["yLinear","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","config","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","linearAxis","value","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;;AAOO,MAAMA,UAAoB,CAACC,MAAMC;IACtC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGL;IAC3C,MAAMM,SAASN,cAAc,MAAM,EAAE,CAACE,UAAsB,EAAE;IAE9D,IAAI,CAACH,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,IAAI,CAACO,QAAQ;QACXP,OAAO,IAAI,GAAG;eACTA,OAAO,IAAI;YACd;gBACE,SAAS;gBACT,MAAM;gBACN,QAAQ;YACV;SACD;QACD,OAAOA;IACT;IAEA,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGf;IAEJ,MAAMgB,YAAYC,mBAAmBF;IAErC,MAAMG,aAAa;QACjBjB;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACAC;QACAC;QACA,OAAO;YACL,SAAST,OAAO;YAChB,cAAc,CAACiB,QACNC,mBAAmBD,OAAOL,YAAYC,WAAWC;YAE1D,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAaiB,iBAAiBxB,UAAUC,YAAYC,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMK,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,KAAKgB;QAEP;IACF;IAEA7B,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAEyB;KAAW;IAE1C,OAAOzB;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/yLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/yLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport {\n createNumFormatter,\n isAreaPercent,\n isBarPercent,\n isColumnPercent,\n LINEAR_AXIS_INNER_OFFSET_TOP,\n} from 'src/pipeline/utils'\nimport type { SpecPipe, YLinearAxis } from 'src/types'\nimport { createLinearFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const yLinear: SpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding } = advancedVSeed\n const config = advancedVSeed.config?.[chartType as 'column']?.yAxis as YLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n if (!config) {\n result.axes = [\n ...result.axes,\n {\n visible: true,\n type: 'linear',\n orient: 'left',\n },\n ] as ISpec['axes']\n return result\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n const percentFormatter = createNumFormatter({\n type: 'percent',\n })\n\n const linearAxis = {\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'left',\n nice,\n zero: log ? false : zero,\n inverse,\n max,\n min,\n label: {\n visible: label?.visible,\n formatMethod: (value: string) => {\n if (\n (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) &&\n isEmpty(numFormat) &&\n (autoFormat === true || isNullish(autoFormat))\n ) {\n return percentFormatter(value)\n }\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n top: LINEAR_AXIS_INNER_OFFSET_TOP,\n // bottom: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["yLinear","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","config","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","percentFormatter","linearAxis","value","isBarPercent","isColumnPercent","isAreaPercent","isEmpty","isNullish","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;;AAaO,MAAMA,UAAoB,CAACC,MAAMC;IACtC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGL;IAC3C,MAAMM,SAASN,cAAc,MAAM,EAAE,CAACE,UAAsB,EAAE;IAE9D,IAAI,CAACH,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,IAAI,CAACO,QAAQ;QACXP,OAAO,IAAI,GAAG;eACTA,OAAO,IAAI;YACd;gBACE,SAAS;gBACT,MAAM;gBACN,QAAQ;YACV;SACD;QACD,OAAOA;IACT;IAEA,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGf;IAEJ,MAAMgB,YAAYC,mBAAmBF;IACrC,MAAMG,mBAAmBD,mBAAmB;QAC1C,MAAM;IACR;IAEA,MAAME,aAAa;QACjBlB;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACAC;QACAC;QACA,OAAO;YACL,SAAST,OAAO;YAChB,cAAc,CAACkB;gBACb,IACGC,AAAAA,CAAAA,aAAa1B,UAAU2B,gBAAgB3B,UAAU4B,cAAc5B,MAAK,KACrE6B,QAAQT,cACPD,CAAAA,AAAe,SAAfA,cAAuBW,UAAUX,WAAU,GAE5C,OAAOI,iBAAiBE;gBAE1B,OAAOM,mBAAmBN,OAAON,YAAYC,WAAWC;YAC1D;YACA,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAauB,iBAAiB9B,UAAUC,YAAYC,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMK,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,KAAKsB;QAEP;IACF;IAEAnC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE0B;KAAW;IAE1C,OAAO1B;AACT"}
@@ -1,4 +1,4 @@
1
- import type { AdvancedVSeed, SpecPipe } from '../../../../../types';
1
+ import type { AdvancedVSeed, SpecPipe, VSeed } from '../../../../../types';
2
2
  export declare const colorAdapter: (ordinalPipe: SpecPipe, linearPipe: SpecPipe) => SpecPipe;
3
- export declare const isLinearColor: <T extends AdvancedVSeed>(advancedVSeed: T) => boolean;
4
- export declare const getColorMeasureId: <T extends AdvancedVSeed>(advancedVSeed: T) => string | undefined;
3
+ export declare const isLinearColor: <T extends AdvancedVSeed, U extends VSeed>(advancedVSeed: T, vseed: U) => boolean;
4
+ export declare const getColorMeasureId: <T extends AdvancedVSeed, U extends VSeed>(advancedVSeed: T, vseed: U) => string | undefined;
@@ -1,17 +1,19 @@
1
1
  import { findAllMeasures } from "../../../../utils/index.js";
2
2
  const colorAdapter = (ordinalPipe, linearPipe)=>(spec, context)=>{
3
- const { advancedVSeed } = context;
4
- if (isLinearColor(advancedVSeed)) return linearPipe(spec, context);
3
+ const { advancedVSeed, vseed } = context;
4
+ if (isLinearColor(advancedVSeed, vseed)) return linearPipe(spec, context);
5
5
  return ordinalPipe(spec, context);
6
6
  };
7
- const isLinearColor = (advancedVSeed)=>{
8
- const { encoding, measures } = advancedVSeed;
7
+ const isLinearColor = (advancedVSeed, vseed)=>{
8
+ console.log(vseed);
9
+ const { encoding } = advancedVSeed;
10
+ const measures = vseed.measures || advancedVSeed.measures;
9
11
  const measureIdList = findAllMeasures(measures).map((measure)=>measure.id);
10
12
  const { color } = encoding;
11
13
  return color?.length === 1 && measureIdList.includes(color[0]);
12
14
  };
13
- const getColorMeasureId = (advancedVSeed)=>{
14
- if (isLinearColor(advancedVSeed)) {
15
+ const getColorMeasureId = (advancedVSeed, vseed)=>{
16
+ if (isLinearColor(advancedVSeed, vseed)) {
15
17
  const { encoding } = advancedVSeed;
16
18
  const { color } = encoding;
17
19
  return color?.[0];
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorAdapter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorAdapter.ts"],"sourcesContent":["import { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedVSeed, SpecPipe } from 'src/types'\n\nexport const colorAdapter = (ordinalPipe: SpecPipe, linearPipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const { advancedVSeed } = context\n if (isLinearColor(advancedVSeed)) {\n return linearPipe(spec, context)\n }\n return ordinalPipe(spec, context)\n }\n}\n\nexport const isLinearColor = <T extends AdvancedVSeed>(advancedVSeed: T) => {\n const { encoding, measures } = advancedVSeed\n const measureIdList = findAllMeasures(measures).map((measure) => measure.id)\n const { color } = encoding\n return color?.length === 1 && measureIdList.includes(color[0])\n}\n\nexport const getColorMeasureId = <T extends AdvancedVSeed>(advancedVSeed: T): string | undefined => {\n if (isLinearColor(advancedVSeed)) {\n const { encoding } = advancedVSeed\n const { color } = encoding\n return color?.[0]\n }\n return undefined\n}\n"],"names":["colorAdapter","ordinalPipe","linearPipe","spec","context","advancedVSeed","isLinearColor","encoding","measures","measureIdList","findAllMeasures","measure","color","getColorMeasureId"],"mappings":";AAGO,MAAMA,eAAe,CAACC,aAAuBC,aAC3C,CAACC,MAAMC;QACZ,MAAM,EAAEC,aAAa,EAAE,GAAGD;QAC1B,IAAIE,cAAcD,gBAChB,OAAOH,WAAWC,MAAMC;QAE1B,OAAOH,YAAYE,MAAMC;IAC3B;AAGK,MAAME,gBAAgB,CAA0BD;IACrD,MAAM,EAAEE,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IAC/B,MAAMI,gBAAgBC,gBAAgBF,UAAU,GAAG,CAAC,CAACG,UAAYA,QAAQ,EAAE;IAC3E,MAAM,EAAEC,KAAK,EAAE,GAAGL;IAClB,OAAOK,OAAO,WAAW,KAAKH,cAAc,QAAQ,CAACG,KAAK,CAAC,EAAE;AAC/D;AAEO,MAAMC,oBAAoB,CAA0BR;IACzD,IAAIC,cAAcD,gBAAgB;QAChC,MAAM,EAAEE,QAAQ,EAAE,GAAGF;QACrB,MAAM,EAAEO,KAAK,EAAE,GAAGL;QAClB,OAAOK,OAAO,CAAC,EAAE;IACnB;AAEF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorAdapter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorAdapter.ts"],"sourcesContent":["import { findAllMeasures } from 'src/pipeline/utils'\nimport type { AdvancedVSeed, SpecPipe, VSeed } from 'src/types'\n\nexport const colorAdapter = (ordinalPipe: SpecPipe, linearPipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const { advancedVSeed, vseed } = context\n if (isLinearColor(advancedVSeed, vseed)) {\n return linearPipe(spec, context)\n }\n return ordinalPipe(spec, context)\n }\n}\n\nexport const isLinearColor = <T extends AdvancedVSeed, U extends VSeed>(advancedVSeed: T, vseed: U) => {\n console.log(vseed)\n const { encoding } = advancedVSeed\n const measures = vseed.measures || advancedVSeed.measures\n const measureIdList = findAllMeasures(measures).map((measure) => measure.id)\n const { color } = encoding\n return color?.length === 1 && measureIdList.includes(color[0])\n}\n\nexport const getColorMeasureId = <T extends AdvancedVSeed, U extends VSeed>(\n advancedVSeed: T,\n vseed: U,\n): string | undefined => {\n if (isLinearColor(advancedVSeed, vseed)) {\n const { encoding } = advancedVSeed\n const { color } = encoding\n return color?.[0]\n }\n return undefined\n}\n"],"names":["colorAdapter","ordinalPipe","linearPipe","spec","context","advancedVSeed","vseed","isLinearColor","console","encoding","measures","measureIdList","findAllMeasures","measure","color","getColorMeasureId"],"mappings":";AAGO,MAAMA,eAAe,CAACC,aAAuBC,aAC3C,CAACC,MAAMC;QACZ,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;QACjC,IAAIG,cAAcF,eAAeC,QAC/B,OAAOJ,WAAWC,MAAMC;QAE1B,OAAOH,YAAYE,MAAMC;IAC3B;AAGK,MAAMG,gBAAgB,CAA2CF,eAAkBC;IACxFE,QAAQ,GAAG,CAACF;IACZ,MAAM,EAAEG,QAAQ,EAAE,GAAGJ;IACrB,MAAMK,WAAWJ,MAAM,QAAQ,IAAID,cAAc,QAAQ;IACzD,MAAMM,gBAAgBC,gBAAgBF,UAAU,GAAG,CAAC,CAACG,UAAYA,QAAQ,EAAE;IAC3E,MAAM,EAAEC,KAAK,EAAE,GAAGL;IAClB,OAAOK,OAAO,WAAW,KAAKH,cAAc,QAAQ,CAACG,KAAK,CAAC,EAAE;AAC/D;AAEO,MAAMC,oBAAoB,CAC/BV,eACAC;IAEA,IAAIC,cAAcF,eAAeC,QAAQ;QACvC,MAAM,EAAEG,QAAQ,EAAE,GAAGJ;QACrB,MAAM,EAAES,KAAK,EAAE,GAAGL;QAClB,OAAOK,OAAO,CAAC,EAAE;IACnB;AAEF"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorAreaStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.area?.style) result.area.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorAreaStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorAreaStyleFill.ts"],"sourcesContent":["import type { IAreaChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorAreaStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IAreaChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.area?.style) {\n result.area.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorAreaStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorAreaStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorAreaStyleFill.ts"],"sourcesContent":["import type { IAreaChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorAreaStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IAreaChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.area?.style) {\n result.area.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorAreaStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorBarStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.bar?.style) result.bar.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorBarStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorBarStyleFill.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorBarStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IBarChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.bar?.style) {\n result.bar.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorBarStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,oBAAoB,CAACC,YACzB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,KAAK,OACfA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;gBACtB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorBarStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorBarStyleFill.ts"],"sourcesContent":["import type { IBarChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorBarStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IBarChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.bar?.style) {\n result.bar.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorBarStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,oBAAoB,CAACC,YACzB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,KAAK,OACfA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;gBACtB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorCellStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.cell?.style) result.cell.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorCellStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorCellStyleFill.ts"],"sourcesContent":["import type { IHeatmapChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorCellStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IHeatmapChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.cell?.style) {\n result.cell.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorCellStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorCellStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorCellStyleFill.ts"],"sourcesContent":["import type { IHeatmapChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorCellStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IHeatmapChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.cell?.style) {\n result.cell.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorCellStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorFunnelStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.funnel?.style) result.funnel.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorFunnelStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IFunnelChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.funnel?.style) {\n result.funnel.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorFunnelStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,uBAAuB,CAACC,YAC5B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,QAAQ,OAClBA,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG;gBACzB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.ts"],"sourcesContent":["import type { IFunnelChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorFunnelStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IFunnelChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.funnel?.style) {\n result.funnel.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorFunnelStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,uBAAuB,CAACC,YAC5B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,QAAQ,OAClBA,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG;gBACzB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorLineStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.line?.style) result.line.style.stroke = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorLineStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorLineStyleFill.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorLineStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as ILineChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.line?.style) {\n result.line.style.stroke = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorLineStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG;gBACzB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorLineStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorLineStyleFill.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorLineStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as ILineChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.line?.style) {\n result.line.style.stroke = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorLineStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG;gBACzB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorPieStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.pie?.style) result.pie.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorPieStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorPieStyleFill.ts"],"sourcesContent":["import type { IPieChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorPieStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IPieChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.pie?.style) {\n result.pie.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorPieStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,oBAAoB,CAACC,YACzB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,KAAK,OACfA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;gBACtB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorPieStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorPieStyleFill.ts"],"sourcesContent":["import type { IPieChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorPieStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IPieChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.pie?.style) {\n result.pie.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorPieStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,oBAAoB,CAACC,YACzB,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,KAAK,OACfA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;gBACtB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorPointStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.point?.style) result.point.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorPointStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorPointStyleFill.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorPointStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as ILineChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.point?.style) {\n result.point.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorPointStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,sBAAsB,CAACC,YAC3B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,OAAO,OACjBA,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG;gBACxB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorPointStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorPointStyleFill.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorPointStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as ILineChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.point?.style) {\n result.point.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorPointStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,sBAAsB,CAACC,YAC3B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,OAAO,OACjBA,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG;gBACxB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -1,10 +1,10 @@
1
1
  import { isLinearColor } from "./colorAdapter.js";
2
2
  const colorRoseStyleFill = (stylePipe)=>(spec, context)=>{
3
3
  const result = stylePipe(spec, context);
4
- const { advancedVSeed } = context;
4
+ const { advancedVSeed, vseed } = context;
5
5
  const { datasetReshapeInfo } = advancedVSeed;
6
6
  const { unfoldInfo } = datasetReshapeInfo[0];
7
- if (isLinearColor(advancedVSeed)) {
7
+ if (isLinearColor(advancedVSeed, vseed)) {
8
8
  if (result?.rose?.style) result.rose.style.fill = {
9
9
  field: unfoldInfo.encodingColor,
10
10
  scale: 'color'
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/color/colorRoseStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorRoseStyleFill.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorRoseStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IRoseChartSpec\n\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed)) {\n if (result?.rose?.style) {\n result.rose.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorRoseStyleFill","stylePipe","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAE,GAAGF;QAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;QAC/B,MAAM,EAAEE,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcH,gBAChB;YAAA,IAAID,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOG,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOH;IACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/color/colorRoseStyleFill.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/color/colorRoseStyleFill.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from './colorAdapter'\n\nexport const colorRoseStyleFill = (stylePipe: SpecPipe): SpecPipe => {\n return (spec, context) => {\n const result = stylePipe(spec, context) as IRoseChartSpec\n\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo } = datasetReshapeInfo[0]\n\n if (isLinearColor(advancedVSeed, vseed)) {\n if (result?.rose?.style) {\n result.rose.style.fill = {\n field: unfoldInfo.encodingColor,\n scale: 'color',\n }\n }\n }\n\n return result\n }\n}\n"],"names":["colorRoseStyleFill","stylePipe","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,qBAAqB,CAACC,YAC1B,CAACC,MAAMC;QACZ,MAAMC,SAASH,UAAUC,MAAMC;QAE/B,MAAM,EAAEE,aAAa,EAAEC,KAAK,EAAE,GAAGH;QACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;QAC/B,MAAM,EAAEG,UAAU,EAAE,GAAGD,kBAAkB,CAAC,EAAE;QAE5C,IAAIE,cAAcJ,eAAeC,QAC/B;YAAA,IAAIF,QAAQ,MAAM,OAChBA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG;gBACvB,OAAOI,WAAW,aAAa;gBAC/B,OAAO;YACT;QACF;QAGF,OAAOJ;IACT"}
@@ -3,14 +3,14 @@ const initArea = (spec, context)=>{
3
3
  const result = {
4
4
  ...spec
5
5
  };
6
- const { advancedVSeed } = context;
6
+ const { advancedVSeed, vseed } = context;
7
7
  const { datasetReshapeInfo } = advancedVSeed;
8
8
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
9
9
  result.type = 'area';
10
10
  result.direction = 'vertical';
11
11
  result.yField = foldInfo.measureValue;
12
12
  result.xField = unfoldInfo.encodingX;
13
- result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
13
+ result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
14
14
  result.padding = 0;
15
15
  result.region = [
16
16
  {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/area.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/area.ts"],"sourcesContent":["import type { IAreaChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initArea: SpecPipe = (spec, context) => {\n const result = { ...spec } as IAreaChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n result.type = 'area'\n result.direction = 'vertical'\n result.yField = foldInfo.measureValue\n\n result.xField = unfoldInfo.encodingX\n result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : 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":["initArea","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","foldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,WAAqB,CAACC,MAAMC;IACvC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,UAAU,EAAEC,QAAQ,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAEtDF,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGI,SAAS,YAAY;IAErCJ,OAAO,MAAM,GAAGG,WAAW,SAAS;IACpCH,OAAO,WAAW,GAAGK,cAAcJ,iBAAiBE,WAAW,cAAc,GAAGA,WAAW,eAAe;IAC1GH,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/area.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/area.ts"],"sourcesContent":["import type { IAreaChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initArea: SpecPipe = (spec, context) => {\n const result = { ...spec } as IAreaChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n result.type = 'area'\n result.direction = 'vertical'\n result.yField = foldInfo.measureValue\n\n result.xField = unfoldInfo.encodingX\n result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : 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":["initArea","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","unfoldInfo","foldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,WAAqB,CAACC,MAAMC;IACvC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,UAAU,EAAEC,QAAQ,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAEtDH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGK,SAAS,YAAY;IAErCL,OAAO,MAAM,GAAGI,WAAW,SAAS;IACpCJ,OAAO,WAAW,GAAGM,cAAcL,eAAeC,SAASE,WAAW,cAAc,GAAGA,WAAW,eAAe;IACjHJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IACnB,OAAOA;AACT"}
@@ -19,7 +19,7 @@ const initDualAxisSecondary = (spec, context)=>{
19
19
  const result = {
20
20
  ...spec
21
21
  };
22
- const { advancedVSeed } = context;
22
+ const { advancedVSeed, vseed } = context;
23
23
  const { datasetReshapeInfo } = advancedVSeed;
24
24
  const { unfoldInfo, foldInfoList, id } = datasetReshapeInfo[0];
25
25
  result.id = `${id}-secondary-series`;
@@ -27,7 +27,7 @@ const initDualAxisSecondary = (spec, context)=>{
27
27
  result.direction = 'vertical';
28
28
  result.xField = unfoldInfo.encodingX;
29
29
  if (foldInfoList?.[1]) result.yField = foldInfoList[1].measureValue;
30
- result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
30
+ result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
31
31
  result.animation = true;
32
32
  return result;
33
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/dualAxis.ts"],"sourcesContent":["import type { IBarSeriesSpec, ILineSeriesSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initDualAxisPrimary: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarSeriesSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfoList, id } = datasetReshapeInfo[0]\n\n result.id = `${id}-primary-series`\n result.type = 'bar'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n result.seriesField = unfoldInfo.encodingColorId\n\n result.yField = foldInfoList?.[0].measureValue\n result.animation = true\n\n return result\n}\n\nexport const initDualAxisSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineSeriesSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfoList, id } = datasetReshapeInfo[0]\n\n result.id = `${id}-secondary-series`\n result.type = 'line'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n if (foldInfoList?.[1]) {\n result.yField = foldInfoList[1].measureValue\n }\n\n result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId\n\n result.animation = true\n\n return result\n}\n"],"names":["initDualAxisPrimary","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","foldInfoList","id","initDualAxisSecondary","isLinearColor"],"mappings":";AAIO,MAAMA,sBAAgC,CAACC,MAAMC;IAClD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,UAAU,EAAEC,YAAY,EAAEC,EAAE,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAE9DF,OAAO,EAAE,GAAG,GAAGK,GAAG,eAAe,CAAC;IAClCL,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGG,WAAW,SAAS;IACpCH,OAAO,WAAW,GAAGG,WAAW,eAAe;IAE/CH,OAAO,MAAM,GAAGI,cAAc,CAAC,EAAE,CAAC;IAClCJ,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT;AAEO,MAAMM,wBAAkC,CAACR,MAAMC;IACpD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,UAAU,EAAEC,YAAY,EAAEC,EAAE,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAE9DF,OAAO,EAAE,GAAG,GAAGK,GAAG,iBAAiB,CAAC;IACpCL,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGG,WAAW,SAAS;IACpC,IAAIC,cAAc,CAAC,EAAE,EACnBJ,OAAO,MAAM,GAAGI,YAAY,CAAC,EAAE,CAAC,YAAY;IAG9CJ,OAAO,WAAW,GAAGO,cAAcN,iBAAiBE,WAAW,cAAc,GAAGA,WAAW,eAAe;IAE1GH,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/dualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/dualAxis.ts"],"sourcesContent":["import type { IBarSeriesSpec, ILineSeriesSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initDualAxisPrimary: SpecPipe = (spec, context) => {\n const result = { ...spec } as IBarSeriesSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfoList, id } = datasetReshapeInfo[0]\n\n result.id = `${id}-primary-series`\n result.type = 'bar'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n result.seriesField = unfoldInfo.encodingColorId\n\n result.yField = foldInfoList?.[0].measureValue\n result.animation = true\n\n return result\n}\n\nexport const initDualAxisSecondary: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineSeriesSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { unfoldInfo, foldInfoList, id } = datasetReshapeInfo[0]\n\n result.id = `${id}-secondary-series`\n result.type = 'line'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n if (foldInfoList?.[1]) {\n result.yField = foldInfoList[1].measureValue\n }\n\n result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId\n\n result.animation = true\n\n return result\n}\n"],"names":["initDualAxisPrimary","spec","context","result","advancedVSeed","datasetReshapeInfo","unfoldInfo","foldInfoList","id","initDualAxisSecondary","vseed","isLinearColor"],"mappings":";AAIO,MAAMA,sBAAgC,CAACC,MAAMC;IAClD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,UAAU,EAAEC,YAAY,EAAEC,EAAE,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAE9DF,OAAO,EAAE,GAAG,GAAGK,GAAG,eAAe,CAAC;IAClCL,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGG,WAAW,SAAS;IACpCH,OAAO,WAAW,GAAGG,WAAW,eAAe;IAE/CH,OAAO,MAAM,GAAGI,cAAc,CAAC,EAAE,CAAC;IAClCJ,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT;AAEO,MAAMM,wBAAkC,CAACR,MAAMC;IACpD,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEM,KAAK,EAAE,GAAGR;IACjC,MAAM,EAAEG,kBAAkB,EAAE,GAAGD;IAC/B,MAAM,EAAEE,UAAU,EAAEC,YAAY,EAAEC,EAAE,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAE9DF,OAAO,EAAE,GAAG,GAAGK,GAAG,iBAAiB,CAAC;IACpCL,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGG,WAAW,SAAS;IACpC,IAAIC,cAAc,CAAC,EAAE,EACnBJ,OAAO,MAAM,GAAGI,YAAY,CAAC,EAAE,CAAC,YAAY;IAG9CJ,OAAO,WAAW,GAAGQ,cAAcP,eAAeM,SAASJ,WAAW,cAAc,GAAGA,WAAW,eAAe;IAEjHH,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
@@ -3,14 +3,14 @@ const initLine = (spec, context)=>{
3
3
  const result = {
4
4
  ...spec
5
5
  };
6
- const { advancedVSeed } = context;
6
+ const { advancedVSeed, vseed } = context;
7
7
  const { datasetReshapeInfo } = advancedVSeed;
8
8
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
9
9
  result.type = 'line';
10
10
  result.direction = 'vertical';
11
11
  result.xField = unfoldInfo.encodingX;
12
12
  result.yField = foldInfo.measureValue;
13
- result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
13
+ result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
14
14
  result.padding = 0;
15
15
  result.region = [
16
16
  {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/init/line.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/line.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initLine: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n result.type = 'line'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n result.yField = foldInfo.measureValue\n result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n\n return result\n}\n"],"names":["initLine","spec","context","result","advancedVSeed","datasetReshapeInfo","foldInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,WAAqB,CAACC,MAAMC;IACvC,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,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGI,WAAW,SAAS;IACpCJ,OAAO,MAAM,GAAGG,SAAS,YAAY;IACrCH,OAAO,WAAW,GAAGK,cAAcJ,iBAAiBG,WAAW,cAAc,GAAGA,WAAW,eAAe;IAC1GJ,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/init/line.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/init/line.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport type { SpecPipe } from 'src/types'\nimport { isLinearColor } from '../color/colorAdapter'\n\nexport const initLine: SpecPipe = (spec, context) => {\n const result = { ...spec } as ILineChartSpec\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n result.type = 'line'\n result.direction = 'vertical'\n result.xField = unfoldInfo.encodingX\n result.yField = foldInfo.measureValue\n result.seriesField = isLinearColor(advancedVSeed, vseed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId\n result.padding = 0\n result.region = [\n {\n clip: true,\n },\n ]\n result.animation = true\n\n return result\n}\n"],"names":["initLine","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","foldInfo","unfoldInfo","isLinearColor"],"mappings":";AAIO,MAAMA,WAAqB,CAACC,MAAMC;IACvC,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAE,GAAGF;IAC/B,MAAM,EAAEG,QAAQ,EAAEC,UAAU,EAAE,GAAGF,kBAAkB,CAAC,EAAE;IAEtDH,OAAO,IAAI,GAAG;IACdA,OAAO,SAAS,GAAG;IACnBA,OAAO,MAAM,GAAGK,WAAW,SAAS;IACpCL,OAAO,MAAM,GAAGI,SAAS,YAAY;IACrCJ,OAAO,WAAW,GAAGM,cAAcL,eAAeC,SAASG,WAAW,cAAc,GAAGA,WAAW,eAAe;IACjHL,OAAO,OAAO,GAAG;IACjBA,OAAO,MAAM,GAAG;QACd;YACE,MAAM;QACR;KACD;IACDA,OAAO,SAAS,GAAG;IAEnB,OAAOA;AACT"}