@visactor/vseed 0.1.14 → 0.1.16

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 (169) hide show
  1. package/dist/cjs/index.cjs +3 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/buildAdvanced.js +1 -1
  4. package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
  5. package/dist/esm/builder/builder/buildSpec.js +2 -3
  6. package/dist/esm/builder/builder/buildSpec.js.map +1 -1
  7. package/dist/esm/builder/builder/builder.d.ts +1113 -9
  8. package/dist/esm/dataReshape/foldMeasures.d.ts +1 -0
  9. package/dist/esm/dataReshape/foldMeasures.js +5 -1
  10. package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
  11. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultDimensions.js +4 -3
  12. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultDimensions.js.map +1 -1
  13. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js +12 -9
  14. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js.map +1 -1
  15. package/dist/esm/pipeline/advanced/chart/pipes/init/initAdvancedVSeed.js +2 -0
  16. package/dist/esm/pipeline/advanced/chart/pipes/init/initAdvancedVSeed.js.map +1 -1
  17. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +4 -6
  18. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
  19. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +2 -5
  20. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
  21. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +2 -4
  22. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
  23. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +4 -6
  24. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
  25. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +2 -5
  26. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
  27. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +2 -4
  28. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
  29. package/dist/esm/pipeline/advanced/table/pipes/default/defaultDimensions.js +13 -7
  30. package/dist/esm/pipeline/advanced/table/pipes/default/defaultDimensions.js.map +1 -1
  31. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js +13 -9
  32. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
  33. package/dist/esm/pipeline/advanced/table/pipes/init/initAdvancedVSeed.js +2 -0
  34. package/dist/esm/pipeline/advanced/table/pipes/init/initAdvancedVSeed.js.map +1 -1
  35. package/dist/esm/pipeline/advanced/table/pipes/reshape/reshapePivotTable.js +2 -1
  36. package/dist/esm/pipeline/advanced/table/pipes/reshape/reshapePivotTable.js.map +1 -1
  37. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +1 -3
  38. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
  39. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -3
  40. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  41. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.d.ts +2 -0
  42. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.js +11 -0
  43. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.js.map +1 -0
  44. package/dist/esm/pipeline/spec/chart/pipes/axes/title/defaultTitleText.d.ts +2 -0
  45. package/dist/esm/pipeline/spec/chart/pipes/axes/title/defaultTitleText.js +14 -0
  46. package/dist/esm/pipeline/spec/chart/pipes/axes/title/defaultTitleText.js.map +1 -0
  47. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +3 -1
  48. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
  49. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +8 -5
  50. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
  51. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +3 -1
  52. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
  53. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +8 -5
  54. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
  55. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +8 -5
  56. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
  57. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +8 -5
  58. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
  59. package/dist/esm/pipeline/spec/chart/pipes/label/index.d.ts +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipes/label/index.js +2 -2
  61. package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +5 -1
  62. package/dist/esm/pipeline/spec/chart/pipes/label/label.js +41 -33
  63. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  64. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js +15 -52
  65. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
  66. package/dist/esm/pipeline/spec/chart/pipes/label/{labelColorInversion.d.ts → labelScatter.d.ts} +1 -1
  67. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js +19 -0
  68. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -0
  69. package/dist/esm/pipeline/spec/chart/pipes/series/series.js +1 -0
  70. package/dist/esm/pipeline/spec/chart/pipes/series/series.js.map +1 -1
  71. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +3 -3
  72. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +13 -30
  73. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
  74. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +6 -6
  75. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
  76. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +6 -18
  77. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
  78. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +6 -18
  79. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
  80. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js +8 -11
  81. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
  82. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js +8 -13
  83. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
  84. package/dist/esm/pipeline/utils/constant.d.ts +1 -0
  85. package/dist/esm/pipeline/utils/constant.js +2 -1
  86. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  87. package/dist/esm/pipeline/utils/format/createFormatter.d.ts +1 -1
  88. package/dist/esm/pipeline/utils/format/createFormatter.js +3 -2
  89. package/dist/esm/pipeline/utils/format/createFormatter.js.map +1 -1
  90. package/dist/esm/pipeline/utils/format/createFormatterByMeasure.d.ts +2 -0
  91. package/dist/esm/pipeline/utils/format/createFormatterByMeasure.js +14 -0
  92. package/dist/esm/pipeline/utils/format/createFormatterByMeasure.js.map +1 -0
  93. package/dist/esm/pipeline/utils/format/createNumFormatter.d.ts +1 -1
  94. package/dist/esm/pipeline/utils/format/createNumFormatter.js.map +1 -1
  95. package/dist/esm/pipeline/utils/format/index.d.ts +1 -0
  96. package/dist/esm/pipeline/utils/format/index.js +1 -0
  97. package/dist/esm/pipeline/utils/index.d.ts +1 -0
  98. package/dist/esm/pipeline/utils/index.js +1 -0
  99. package/dist/esm/pipeline/utils/valid/checkVSeed.d.ts +2 -0
  100. package/dist/esm/pipeline/utils/valid/checkVSeed.js +11 -0
  101. package/dist/esm/pipeline/utils/valid/checkVSeed.js.map +1 -0
  102. package/dist/esm/pipeline/utils/valid/index.d.ts +1 -0
  103. package/dist/esm/pipeline/utils/valid/index.js +2 -0
  104. package/dist/esm/theme/dark.js +5 -1
  105. package/dist/esm/theme/dark.js.map +1 -1
  106. package/dist/esm/theme/light.js +23 -4
  107. package/dist/esm/theme/light.js.map +1 -1
  108. package/dist/esm/types/advancedVSeed.d.ts +947 -17
  109. package/dist/esm/types/chartType/area/zArea.d.ts +60 -0
  110. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +60 -0
  111. package/dist/esm/types/chartType/bar/zBar.d.ts +60 -0
  112. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +60 -0
  113. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +60 -0
  114. package/dist/esm/types/chartType/column/zColumn.d.ts +60 -0
  115. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +60 -0
  116. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +60 -0
  117. package/dist/esm/types/chartType/donut/zDonut.d.ts +30 -0
  118. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +270 -0
  119. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +30 -0
  120. package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +30 -0
  121. package/dist/esm/types/chartType/line/zLine.d.ts +60 -0
  122. package/dist/esm/types/chartType/pie/zPie.d.ts +30 -0
  123. package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +30 -0
  124. package/dist/esm/types/chartType/radar/zRadar.d.ts +30 -0
  125. package/dist/esm/types/chartType/rose/zRose.d.ts +30 -0
  126. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +30 -0
  127. package/dist/esm/types/chartType/scatter/zScatter.d.ts +210 -0
  128. package/dist/esm/types/chartType/table/zTable.d.ts +30 -0
  129. package/dist/esm/types/properties/config/axes/bandAxis.d.ts +146 -3
  130. package/dist/esm/types/properties/config/axes/index.d.ts +0 -2
  131. package/dist/esm/types/properties/config/axes/index.js +0 -1
  132. package/dist/esm/types/properties/config/axes/linearAxis.d.ts +149 -3
  133. package/dist/esm/types/properties/config/axes/zLinearAxis.d.ts +60 -0
  134. package/dist/esm/types/properties/config/axes/zLinearAxis.js +2 -0
  135. package/dist/esm/types/properties/config/axes/zLinearAxis.js.map +1 -1
  136. package/dist/esm/types/properties/config/config.d.ts +916 -16
  137. package/dist/esm/types/properties/config/label/label.d.ts +3 -3
  138. package/dist/esm/types/properties/config/label/zLabel.js +1 -1
  139. package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
  140. package/dist/esm/types/properties/format/numFormat.js.map +1 -0
  141. package/dist/esm/types/properties/index.d.ts +1 -0
  142. package/dist/esm/types/properties/index.js +1 -0
  143. package/dist/esm/types/properties/measures/index.d.ts +0 -1
  144. package/dist/esm/types/properties/measures/index.js +0 -1
  145. package/dist/esm/types/properties/measures/measures.d.ts +6 -2
  146. package/dist/esm/types/properties/measures/zDualMeasures.d.ts +240 -0
  147. package/dist/esm/types/properties/measures/zMeasures.d.ts +90 -0
  148. package/dist/esm/types/properties/measures/zMeasures.js +2 -1
  149. package/dist/esm/types/properties/measures/zMeasures.js.map +1 -1
  150. package/dist/esm/types/properties/measures/zScatterMeasures.d.ts +240 -0
  151. package/dist/esm/types/properties/theme/customTheme.d.ts +916 -16
  152. package/dist/esm/types/zVseed.d.ts +1389 -99
  153. package/dist/umd/index.js +308 -366
  154. package/dist/umd/index.js.map +1 -1
  155. package/package.json +1 -1
  156. package/dist/esm/pipeline/spec/chart/pipes/label/labelColorInversion.js +0 -13
  157. package/dist/esm/pipeline/spec/chart/pipes/label/labelColorInversion.js.map +0 -1
  158. package/dist/esm/types/properties/config/axes/axis.d.ts +0 -208
  159. package/dist/esm/types/properties/config/axes/axis.js +0 -0
  160. package/dist/esm/types/properties/config/axes/zAxis.d.ts +0 -47
  161. package/dist/esm/types/properties/config/axes/zAxis.js +0 -54
  162. package/dist/esm/types/properties/config/axes/zAxis.js.map +0 -1
  163. package/dist/esm/types/properties/measures/format/numFormat.js.map +0 -1
  164. /package/dist/esm/types/properties/{measures/format → format}/formatter.d.ts +0 -0
  165. /package/dist/esm/types/properties/{measures/format → format}/formatter.js +0 -0
  166. /package/dist/esm/types/properties/{measures/format → format}/index.d.ts +0 -0
  167. /package/dist/esm/types/properties/{measures/format → format}/index.js +0 -0
  168. /package/dist/esm/types/properties/{measures/format → format}/numFormat.d.ts +0 -0
  169. /package/dist/esm/types/properties/{measures/format → format}/numFormat.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.ts"],"sourcesContent":["import { isEmpty, uniqueBy } from 'remeda'\nimport { autoFormatter, createFormatter, findAllMeasures, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, SpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\n\nexport const tooltipHeatmap: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, findAllMeasures(vseed.measures), locale, foldInfo),\n },\n dimension: {\n visible: false,\n },\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures,\n locale: Locale,\n foldInfo: FoldInfo,\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n const { format = {}, autoFormat = true } = measure\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n return String(value)\n },\n }))\n\n const foldMeaContent = [foldInfo].map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n const datum = v as Datum\n const id = datum[measureId] as string\n return foldMap[id] || id\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n\n const { format = {}, autoFormat = true } = measure\n\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n return String(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipHeatmap","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfo","createMarkContent","findAllMeasures","measures","dims","uniqueBy","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","String","format","autoFormat","isEmpty","formatter","createFormatter","autoFormatter","foldMeaContent","measureId","foldMap","measureValue"],"mappings":";;;AAKO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGN;IACxE,MAAMO,aAAaP,cAAc,MAAM,CAACG,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,QAAQ,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAK1CH,OAAO,OAAO,GAAG;QACf,SAASU;QAET,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASE,kBAAkBL,SAAS,OAAO,IAAI,EAAE,EAAED,YAAYO,gBAAgBX,MAAM,QAAQ,GAAGG,QAAQM;QAC1G;QACA,WAAW;YACT,SAAS;QACX;IACF;IACA,OAAOX;AACT;AAEO,MAAMY,oBAAoB,CAC/BH,SACAH,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G,YAAYC,gBAAgBJ;oBAClC,OAAOG,UAAUP;gBACnB;gBACA,IAAIK,YACF,OAAOI,cAAcT,OAAOrB;gBAE9B,OAAOwB,OAAOH;YAChB;QACF;IAEA,MAAMU,iBAAiB;QAACzB;KAAS,CAAC,GAAG,CAAC,CAACA,WAC9B;YACL,SAAS;YACT,UAAU;YACV,WAAW;YACX,KAAK,CAACS;gBACJ,MAAM,EAAEiB,SAAS,EAAEC,OAAO,EAAE,GAAG3B;gBAC/B,MAAMU,QAAQD;gBACd,MAAMG,KAAKF,KAAK,CAACgB,UAAU;gBAC3B,OAAOC,OAAO,CAACf,GAAG,IAAIA;YACxB;YACA,OAAO,CAACH;gBACN,MAAM,EAAEiB,SAAS,EAAEE,YAAY,EAAE,GAAG5B;gBAEpC,MAAMU,QAAQD;gBACd,IAAI,CAACC,OACH,OAAO;gBAET,MAAMK,QAAQL,KAAK,CAACkB,aAAa;gBACjC,MAAMhB,KAAKF,KAAK,CAACgB,UAAU;gBAC3B,MAAMV,UAAUC,gBAAgBd,UAAUS;gBAC1C,IAAI,CAACI,SACH,OAAOE,OAAOH;gBAGhB,MAAM,EAAEI,SAAS,CAAC,CAAC,EAAEC,aAAa,IAAI,EAAE,GAAGJ;gBAE3C,IAAI,CAACK,QAAQF,SAAS;oBACpB,MAAMG,YAAYC,gBAAgBJ;oBAClC,OAAOG,UAAUP;gBACnB;gBACA,IAAIK,YACF,OAAOI,cAAcT,OAAOrB;gBAE9B,OAAOwB,OAAOH;YAChB;QACF;IAEF,OAAO;WAAIP;WAAeiB;WAAmBd;KAAW;AAC1D"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findAllMeasures, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, SpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\n\nexport const tooltipHeatmap: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfo } = datasetReshapeInfo[0] as unknown as {\n foldInfo: FoldInfo\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(encoding.tooltip || [], dimensions, findAllMeasures(vseed.measures), locale, foldInfo),\n },\n dimension: {\n visible: false,\n },\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures,\n locale: Locale,\n foldInfo: FoldInfo,\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = [foldInfo].map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n const datum = v as Datum\n const id = datum[measureId] as string\n return foldMap[id] || id\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipHeatmap","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfo","createMarkContent","findAllMeasures","measures","dims","uniqueBy","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","formatter","createFormatterByMeasure","foldMeaContent","measureId","foldMap","measureValue"],"mappings":";;;AAKO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGN;IACxE,MAAMO,aAAaP,cAAc,MAAM,CAACG,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,QAAQ,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAK1CH,OAAO,OAAO,GAAG;QACf,SAASU;QAET,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASE,kBAAkBL,SAAS,OAAO,IAAI,EAAE,EAAED,YAAYO,gBAAgBX,MAAM,QAAQ,GAAGG,QAAQM;QAC1G;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AMK,iBAAiB;QAACpB;KAAS,CAAC,GAAG,CAAC,CAACA,WAC9B;YACL,SAAS;YACT,UAAU;YACV,WAAW;YACX,KAAK,CAACS;gBACJ,MAAM,EAAEY,SAAS,EAAEC,OAAO,EAAE,GAAGtB;gBAC/B,MAAMU,QAAQD;gBACd,MAAMG,KAAKF,KAAK,CAACW,UAAU;gBAC3B,OAAOC,OAAO,CAACV,GAAG,IAAIA;YACxB;YACA,OAAO,CAACH;gBACN,MAAM,EAAEY,SAAS,EAAEE,YAAY,EAAE,GAAGvB;gBAEpC,MAAMU,QAAQD;gBACd,IAAI,CAACC,OACH,OAAO;gBAET,MAAMK,QAAQL,KAAK,CAACa,aAAa;gBACjC,MAAMX,KAAKF,KAAK,CAACW,UAAU;gBAC3B,MAAML,UAAUC,gBAAgBd,UAAUS;gBAC1C,MAAMM,YAAYC,yBAAyBH;gBAC3C,OAAOE,UAAUH;YACnB;QACF;IAEF,OAAO;WAAIP;WAAeY;WAAmBT;KAAW;AAC1D"}
@@ -1,5 +1,5 @@
1
- import { isEmpty, uniqueBy } from "remeda";
2
- import { autoFormatter, createFormatter, findAllMeasures, findMeasureById } from "../../../../utils/index.js";
1
+ import { uniqueBy } from "remeda";
2
+ import { createFormatterByMeasure, findAllMeasures, findMeasureById } from "../../../../utils/index.js";
3
3
  import { ORIGINAL_DATA } from "../../../../../dataReshape/index.js";
4
4
  const tooltipScatter = (spec, context)=>{
5
5
  const result = {
@@ -57,14 +57,8 @@ const createMarkContent = (tooltip, dimensions, measures, locale, foldInfoList)=
57
57
  const originalData = datum[ORIGINAL_DATA];
58
58
  const value = originalData[id];
59
59
  const measure = findMeasureById(measures, id);
60
- if (!measure) return String(value);
61
- const { format = {}, autoFormat = true } = measure;
62
- if (!isEmpty(format)) {
63
- const formatter = createFormatter(format);
64
- return formatter(value);
65
- }
66
- if (autoFormat) return autoFormatter(value, locale);
67
- return String(value);
60
+ const formatter = createFormatterByMeasure(measure);
61
+ return formatter(value);
68
62
  }
69
63
  }));
70
64
  const foldMeaContent = foldInfoList.map((foldInfo)=>({
@@ -84,14 +78,8 @@ const createMarkContent = (tooltip, dimensions, measures, locale, foldInfoList)=
84
78
  const value = datum[measureValue];
85
79
  const id = datum[measureId];
86
80
  const measure = findMeasureById(measures, id);
87
- if (!measure) return String(value);
88
- const { format = {}, autoFormat = true } = measure;
89
- if (!isEmpty(format)) {
90
- const formatter = createFormatter(format);
91
- return formatter(value);
92
- }
93
- if (autoFormat) return autoFormatter(value, locale);
94
- return String(value);
81
+ const formatter = createFormatterByMeasure(measure);
82
+ return formatter(value);
95
83
  }
96
84
  }));
97
85
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { isEmpty, uniqueBy } from 'remeda'\nimport { autoFormatter, createFormatter, findAllMeasures, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, SpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\n\nexport const tooltipScatter: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(\n encoding.tooltip || [],\n dimensions,\n findAllMeasures(vseed.measures),\n locale,\n foldInfoList,\n ),\n },\n dimension: {\n visible: false,\n },\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures,\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n const { format = {}, autoFormat = true } = measure\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n return String(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n const datum = v as Datum\n const id = datum[measureId] as string\n return foldMap[id] || id\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n if (!measure) {\n return String(value)\n }\n\n const { format = {}, autoFormat = true } = measure\n\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n return String(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","createMarkContent","findAllMeasures","measures","dims","uniqueBy","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","String","format","autoFormat","isEmpty","formatter","createFormatter","autoFormatter","foldMeaContent","foldInfo","measureId","foldMap","measureValue"],"mappings":";;;AAKO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGN;IACxE,MAAMO,aAAaP,cAAc,MAAM,CAACG,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,YAAY,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAK9CH,OAAO,OAAO,GAAG;QACf,SAASU;QAET,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASE,kBACPL,SAAS,OAAO,IAAI,EAAE,EACtBD,YACAO,gBAAgBX,MAAM,QAAQ,GAC9BG,QACAM;QAEJ;QACA,WAAW;YACT,SAAS;QACX;IACF;IACA,OAAOX;AACT;AAEO,MAAMY,oBAAoB,CAC/BH,SACAH,YACAQ,UACAT,QACAM;IAEA,MAAMI,OAAOC,SACXV,WAAW,MAAM,CAAC,CAACW,OAASR,QAAQ,QAAQ,CAACQ,KAAK,EAAE,IACpD,CAACA,OAASA,KAAK,EAAE;IAEnB,MAAMC,OAAOF,SACXF,SAAS,MAAM,CAAC,CAACG,OAASR,QAAQ,QAAQ,CAACQ,KAAK,EAAE,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;gBACJ,MAAM,EAAEkB,SAAS,EAAEC,OAAO,EAAE,GAAGF;gBAC/B,MAAMhB,QAAQD;gBACd,MAAMG,KAAKF,KAAK,CAACiB,UAAU;gBAC3B,OAAOC,OAAO,CAAChB,GAAG,IAAIA;YACxB;YACA,OAAO,CAACH;gBACN,MAAM,EAAEkB,SAAS,EAAEE,YAAY,EAAE,GAAGH;gBAEpC,MAAMhB,QAAQD;gBACd,IAAI,CAACC,OACH,OAAO;gBAET,MAAMK,QAAQL,KAAK,CAACmB,aAAa;gBACjC,MAAMjB,KAAKF,KAAK,CAACiB,UAAU;gBAC3B,MAAMX,UAAUC,gBAAgBd,UAAUS;gBAC1C,IAAI,CAACI,SACH,OAAOE,OAAOH;gBAGhB,MAAM,EAAEI,SAAS,CAAC,CAAC,EAAEC,aAAa,IAAI,EAAE,GAAGJ;gBAE3C,IAAI,CAACK,QAAQF,SAAS;oBACpB,MAAMG,YAAYC,gBAAgBJ;oBAClC,OAAOG,UAAUP;gBACnB;gBACA,IAAIK,YACF,OAAOI,cAAcT,OAAOrB;gBAE9B,OAAOwB,OAAOH;YAChB;QACF;IAEF,OAAO;WAAIP;WAAeiB;WAAmBd;KAAW;AAC1D"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/tooltip/tooltipScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/tooltip/tooltipScatter.ts"],"sourcesContent":["import { uniqueBy } from 'remeda'\nimport { createFormatterByMeasure, findAllMeasures, findMeasureById } from '../../../../utils'\nimport type { Datum, Dimensions, FoldInfo, Locale, Measures, SpecPipe, Tooltip, UnfoldInfo } from 'src/types'\nimport { ORIGINAL_DATA } from 'src/dataReshape'\n\nexport const tooltipScatter: SpecPipe = (spec, context) => {\n const result = { ...spec }\n const { advancedVSeed, vseed } = context\n const { datasetReshapeInfo, chartType, locale, dimensions, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { tooltip: Tooltip }\n const { tooltip = { enable: true } } = baseConfig\n const { enable } = tooltip\n const { foldInfoList } = datasetReshapeInfo[0] as unknown as {\n foldInfoList: FoldInfo[]\n unfoldInfo: UnfoldInfo\n }\n\n result.tooltip = {\n visible: enable,\n\n mark: {\n title: {\n visible: false,\n },\n content: createMarkContent(\n encoding.tooltip || [],\n dimensions,\n findAllMeasures(vseed.measures),\n locale,\n foldInfoList,\n ),\n },\n dimension: {\n visible: false,\n },\n }\n return result\n}\n\nexport const createMarkContent = (\n tooltip: string[],\n dimensions: Dimensions,\n measures: Measures,\n locale: Locale,\n foldInfoList: FoldInfo[],\n) => {\n const dims = uniqueBy(\n dimensions.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n const meas = uniqueBy(\n measures.filter((item) => tooltip.includes(item.id)),\n (item) => item.id,\n )\n\n const dimContent = dims.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const datum = v as Datum\n if (item.alias || item.id) {\n return item.alias || item.id\n }\n return datum && (datum[item.id] as string)\n },\n value: (v: unknown) => {\n const datum = v as Datum\n return datum && (datum[item.id] as string)\n },\n }))\n\n const meaContent = meas.map((item) => ({\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: item.alias || item.id,\n value: (v: unknown) => {\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const id = item.id\n if (!datum || !datum[ORIGINAL_DATA] || !datum[ORIGINAL_DATA]) {\n return ''\n }\n const originalData = datum[ORIGINAL_DATA] as Datum\n const value = originalData[id] as string | number\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }))\n\n const foldMeaContent = foldInfoList.map((foldInfo) => {\n return {\n visible: true,\n hasShape: true,\n shapeType: 'rectRound',\n key: (v: unknown) => {\n const { measureId, foldMap } = foldInfo\n const datum = v as Datum\n const id = datum[measureId] as string\n return foldMap[id] || id\n },\n value: (v: unknown) => {\n const { measureId, measureValue } = foldInfo\n\n const datum = v as Datum\n if (!datum) {\n return ''\n }\n const value = datum[measureValue] as string | number\n const id = datum[measureId] as string\n const measure = findMeasureById(measures, id)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n },\n }\n })\n return [...dimContent, ...foldMeaContent, ...meaContent]\n}\n"],"names":["tooltipScatter","spec","context","result","advancedVSeed","vseed","datasetReshapeInfo","chartType","locale","dimensions","encoding","baseConfig","tooltip","enable","foldInfoList","createMarkContent","findAllMeasures","measures","dims","uniqueBy","item","meas","dimContent","v","datum","meaContent","id","ORIGINAL_DATA","originalData","value","measure","findMeasureById","formatter","createFormatterByMeasure","foldMeaContent","foldInfo","measureId","foldMap","measureValue"],"mappings":";;;AAKO,MAAMA,iBAA2B,CAACC,MAAMC;IAC7C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,kBAAkB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGN;IACxE,MAAMO,aAAaP,cAAc,MAAM,CAACG,UAAU;IAClD,MAAM,EAAEK,UAAU;QAAE,QAAQ;IAAK,CAAC,EAAE,GAAGD;IACvC,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAM,EAAEE,YAAY,EAAE,GAAGR,kBAAkB,CAAC,EAAE;IAK9CH,OAAO,OAAO,GAAG;QACf,SAASU;QAET,MAAM;YACJ,OAAO;gBACL,SAAS;YACX;YACA,SAASE,kBACPL,SAAS,OAAO,IAAI,EAAE,EACtBD,YACAO,gBAAgBX,MAAM,QAAQ,GAC9BG,QACAM;QAEJ;QACA,WAAW;YACT,SAAS;QACX;IACF;IACA,OAAOX;AACT;AAEO,MAAMY,oBAAoB,CAC/BH,SACAH,YACAQ,UACAT,QACAM;IAEA,MAAMI,OAAOC,SACXV,WAAW,MAAM,CAAC,CAACW,OAASR,QAAQ,QAAQ,CAACQ,KAAK,EAAE,IACpD,CAACA,OAASA,KAAK,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B,OAAOC,OAAO,CAACX,GAAG,IAAIA;YACxB;YACA,OAAO,CAACH;gBACN,MAAM,EAAEa,SAAS,EAAEE,YAAY,EAAE,GAAGH;gBAEpC,MAAMX,QAAQD;gBACd,IAAI,CAACC,OACH,OAAO;gBAET,MAAMK,QAAQL,KAAK,CAACc,aAAa;gBACjC,MAAMZ,KAAKF,KAAK,CAACY,UAAU;gBAC3B,MAAMN,UAAUC,gBAAgBd,UAAUS;gBAC1C,MAAMM,YAAYC,yBAAyBH;gBAC3C,OAAOE,UAAUH;YACnB;QACF;IAEF,OAAO;WAAIP;WAAeY;WAAmBT;KAAW;AAC1D"}
@@ -1,8 +1,6 @@
1
- import { isEmpty } from "remeda";
2
- import { autoFormatter, createFormatter, isMeasure } from "../../../../utils/index.js";
1
+ import { createFormatterByMeasure, isMeasure } from "../../../../utils/index.js";
3
2
  const measureTreeToColumns = (spec, context)=>{
4
3
  const { advancedVSeed } = context;
5
- const { locale } = advancedVSeed;
6
4
  const measures = advancedVSeed.measures;
7
5
  const result = {
8
6
  ...spec
@@ -10,7 +8,7 @@ const measureTreeToColumns = (spec, context)=>{
10
8
  const eachNode = (node)=>{
11
9
  if (isMeasure(node)) return {
12
10
  width: 'auto',
13
- fieldFormat: fieldFormat(node, locale)
11
+ fieldFormat: fieldFormat(node)
14
12
  };
15
13
  return {};
16
14
  };
@@ -23,15 +21,14 @@ const measureTreeToColumns = (spec, context)=>{
23
21
  ]
24
22
  };
25
23
  };
26
- const fieldFormat = (node, locale)=>(datum)=>{
27
- const { format = {}, autoFormat = true, id } = node;
24
+ const fieldFormat = (node)=>{
25
+ const formatter = createFormatterByMeasure(node);
26
+ return (datum)=>{
27
+ const { id } = node;
28
28
  const value = datum[id];
29
- if (!isEmpty(format)) {
30
- const formatter = createFormatter(format);
31
- return formatter(value);
32
- }
33
- if (autoFormat) return autoFormatter(value, locale);
29
+ return formatter(value);
34
30
  };
31
+ };
35
32
  const treeTreeToColumns = (tree, callback)=>{
36
33
  const result = tree.map((item)=>{
37
34
  if ('children' in item && Array.isArray(item.children)) {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/columns/measuresToColumns.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/columns/measuresToColumns.ts"],"sourcesContent":["import type { ColumnsDefine, ListTableConstructorOptions } from '@visactor/vtable'\nimport type { FieldFormat } from '@visactor/vtable/es/ts-types'\nimport { isEmpty } from 'remeda'\nimport { autoFormatter, createFormatter, isMeasure } from 'src/pipeline/utils'\nimport type { MeasureGroup, Measure, MeasureTree, SpecPipe, Datum, Locale } from 'src/types'\n\nexport const measureTreeToColumns: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { locale } = advancedVSeed\n const measures = (advancedVSeed as unknown as { measures: MeasureTree }).measures\n const result = { ...spec } as ListTableConstructorOptions\n\n const eachNode = (node: Measure | MeasureGroup) => {\n if (isMeasure(node)) {\n return {\n width: 'auto',\n fieldFormat: fieldFormat(node, locale),\n }\n }\n\n return {}\n }\n const columns = treeTreeToColumns<Measure, MeasureGroup>(measures, eachNode)\n return {\n ...result,\n columns: [...(result.columns || []), ...columns] as ListTableConstructorOptions['columns'],\n }\n}\n\nconst fieldFormat =\n (node: Measure, locale: Locale): FieldFormat =>\n (datum: Datum) => {\n const { format = {}, autoFormat = true, id } = node\n const value = datum[id] as number | string | undefined\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n\n return\n }\n\nconst treeTreeToColumns = <\n T extends { id: string; alias?: string },\n U extends { id: string; alias?: string; children?: (T | U)[] },\n>(\n tree: (T | U)[],\n callback?: (node: T | U) => object,\n): ColumnsDefine[] => {\n const result = tree.map((item) => {\n if ('children' in item && Array.isArray(item.children)) {\n const groupNode = item as unknown as U\n const field = groupNode.id\n const title = groupNode.alias ?? groupNode.id\n const props = callback?.(groupNode) || {}\n // group\n return {\n field,\n title,\n columns: treeTreeToColumns(item.children, callback),\n ...props,\n }\n } else {\n const field = item.id\n const title = item.alias ?? item.id\n const props = callback?.(item) || {}\n // leaf\n return {\n field,\n title,\n ...props,\n }\n }\n }) as unknown as ColumnsDefine[]\n\n return result || []\n}\n"],"names":["measureTreeToColumns","spec","context","advancedVSeed","locale","measures","result","eachNode","node","isMeasure","fieldFormat","columns","treeTreeToColumns","datum","format","autoFormat","id","value","isEmpty","formatter","createFormatter","autoFormatter","tree","callback","item","Array","groupNode","field","title","props"],"mappings":";;AAMO,MAAMA,uBAAiC,CAACC,MAAMC;IACnD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,MAAM,EAAE,GAAGD;IACnB,MAAME,WAAYF,cAAuD,QAAQ;IACjF,MAAMG,SAAS;QAAE,GAAGL,IAAI;IAAC;IAEzB,MAAMM,WAAW,CAACC;QAChB,IAAIC,UAAUD,OACZ,OAAO;YACL,OAAO;YACP,aAAaE,YAAYF,MAAMJ;QACjC;QAGF,OAAO,CAAC;IACV;IACA,MAAMO,UAAUC,kBAAyCP,UAAUE;IACnE,OAAO;QACL,GAAGD,MAAM;QACT,SAAS;eAAKA,OAAO,OAAO,IAAI,EAAE;eAAMK;SAAQ;IAClD;AACF;AAEA,MAAMD,cACJ,CAACF,MAAeJ,SAChB,CAACS;QACC,MAAM,EAAEC,SAAS,CAAC,CAAC,EAAEC,aAAa,IAAI,EAAEC,EAAE,EAAE,GAAGR;QAC/C,MAAMS,QAAQJ,KAAK,CAACG,GAAG;QACvB,IAAI,CAACE,QAAQJ,SAAS;YACpB,MAAMK,YAAYC,gBAAgBN;YAClC,OAAOK,UAAUF;QACnB;QAEA,IAAIF,YACF,OAAOM,cAAcJ,OAAOb;IAIhC;AAEF,MAAMQ,oBAAoB,CAIxBU,MACAC;IAEA,MAAMjB,SAASgB,KAAK,GAAG,CAAC,CAACE;QACvB,IAAI,cAAcA,QAAQC,MAAM,OAAO,CAACD,KAAK,QAAQ,GAAG;YACtD,MAAME,YAAYF;YAClB,MAAMG,QAAQD,UAAU,EAAE;YAC1B,MAAME,QAAQF,UAAU,KAAK,IAAIA,UAAU,EAAE;YAC7C,MAAMG,QAAQN,WAAWG,cAAc,CAAC;YAExC,OAAO;gBACLC;gBACAC;gBACA,SAAShB,kBAAkBY,KAAK,QAAQ,EAAED;gBAC1C,GAAGM,KAAK;YACV;QACF;QAAO;YACL,MAAMF,QAAQH,KAAK,EAAE;YACrB,MAAMI,QAAQJ,KAAK,KAAK,IAAIA,KAAK,EAAE;YACnC,MAAMK,QAAQN,WAAWC,SAAS,CAAC;YAEnC,OAAO;gBACLG;gBACAC;gBACA,GAAGC,KAAK;YACV;QACF;IACF;IAEA,OAAOvB,UAAU,EAAE;AACrB"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/columns/measuresToColumns.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/columns/measuresToColumns.ts"],"sourcesContent":["import type { ColumnsDefine, ListTableConstructorOptions } from '@visactor/vtable'\nimport type { FieldFormat } from '@visactor/vtable/es/ts-types'\nimport { createFormatterByMeasure, isMeasure } from 'src/pipeline/utils'\nimport type { MeasureGroup, Measure, MeasureTree, SpecPipe, Datum } from 'src/types'\n\nexport const measureTreeToColumns: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const measures = (advancedVSeed as unknown as { measures: MeasureTree }).measures\n const result = { ...spec } as ListTableConstructorOptions\n\n const eachNode = (node: Measure | MeasureGroup) => {\n if (isMeasure(node)) {\n return {\n width: 'auto',\n fieldFormat: fieldFormat(node),\n }\n }\n\n return {}\n }\n const columns = treeTreeToColumns<Measure, MeasureGroup>(measures, eachNode)\n return {\n ...result,\n columns: [...(result.columns || []), ...columns] as ListTableConstructorOptions['columns'],\n }\n}\n\nconst fieldFormat = (node: Measure): FieldFormat => {\n const formatter = createFormatterByMeasure(node)\n\n return (datum: Datum) => {\n const { id } = node\n const value = datum[id] as number | string | undefined\n return formatter(value)\n }\n}\nconst treeTreeToColumns = <\n T extends { id: string; alias?: string },\n U extends { id: string; alias?: string; children?: (T | U)[] },\n>(\n tree: (T | U)[],\n callback?: (node: T | U) => object,\n): ColumnsDefine[] => {\n const result = tree.map((item) => {\n if ('children' in item && Array.isArray(item.children)) {\n const groupNode = item as unknown as U\n const field = groupNode.id\n const title = groupNode.alias ?? groupNode.id\n const props = callback?.(groupNode) || {}\n // group\n return {\n field,\n title,\n columns: treeTreeToColumns(item.children, callback),\n ...props,\n }\n } else {\n const field = item.id\n const title = item.alias ?? item.id\n const props = callback?.(item) || {}\n // leaf\n return {\n field,\n title,\n ...props,\n }\n }\n }) as unknown as ColumnsDefine[]\n\n return result || []\n}\n"],"names":["measureTreeToColumns","spec","context","advancedVSeed","measures","result","eachNode","node","isMeasure","fieldFormat","columns","treeTreeToColumns","formatter","createFormatterByMeasure","datum","id","value","tree","callback","item","Array","groupNode","field","title","props"],"mappings":";AAKO,MAAMA,uBAAiC,CAACC,MAAMC;IACnD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAME,WAAYD,cAAuD,QAAQ;IACjF,MAAME,SAAS;QAAE,GAAGJ,IAAI;IAAC;IAEzB,MAAMK,WAAW,CAACC;QAChB,IAAIC,UAAUD,OACZ,OAAO;YACL,OAAO;YACP,aAAaE,YAAYF;QAC3B;QAGF,OAAO,CAAC;IACV;IACA,MAAMG,UAAUC,kBAAyCP,UAAUE;IACnE,OAAO;QACL,GAAGD,MAAM;QACT,SAAS;eAAKA,OAAO,OAAO,IAAI,EAAE;eAAMK;SAAQ;IAClD;AACF;AAEA,MAAMD,cAAc,CAACF;IACnB,MAAMK,YAAYC,yBAAyBN;IAE3C,OAAO,CAACO;QACN,MAAM,EAAEC,EAAE,EAAE,GAAGR;QACf,MAAMS,QAAQF,KAAK,CAACC,GAAG;QACvB,OAAOH,UAAUI;IACnB;AACF;AACA,MAAML,oBAAoB,CAIxBM,MACAC;IAEA,MAAMb,SAASY,KAAK,GAAG,CAAC,CAACE;QACvB,IAAI,cAAcA,QAAQC,MAAM,OAAO,CAACD,KAAK,QAAQ,GAAG;YACtD,MAAME,YAAYF;YAClB,MAAMG,QAAQD,UAAU,EAAE;YAC1B,MAAME,QAAQF,UAAU,KAAK,IAAIA,UAAU,EAAE;YAC7C,MAAMG,QAAQN,WAAWG,cAAc,CAAC;YAExC,OAAO;gBACLC;gBACAC;gBACA,SAASZ,kBAAkBQ,KAAK,QAAQ,EAAED;gBAC1C,GAAGM,KAAK;YACV;QACF;QAAO;YACL,MAAMF,QAAQH,KAAK,EAAE;YACrB,MAAMI,QAAQJ,KAAK,KAAK,IAAIA,KAAK,EAAE;YACnC,MAAMK,QAAQN,WAAWC,SAAS,CAAC;YAEnC,OAAO;gBACLG;gBACAC;gBACA,GAAGC,KAAK;YACV;QACF;IACF;IAEA,OAAOnB,UAAU,EAAE;AACrB"}
@@ -1,9 +1,9 @@
1
- import { isEmpty, isNumber } from "remeda";
1
+ import { isNumber } from "remeda";
2
2
  import { intl } from "../../../../../i18n/index.js";
3
- import { autoFormatter, createFormatter, findMeasureById } from "../../../../utils/index.js";
3
+ import { createFormatterByMeasure, findMeasureById } from "../../../../utils/index.js";
4
4
  const pivotIndicators = (spec, context)=>{
5
5
  const { advancedVSeed } = context;
6
- const { locale, measures, datasetReshapeInfo } = advancedVSeed;
6
+ const { measures, datasetReshapeInfo } = advancedVSeed;
7
7
  const { foldInfo } = datasetReshapeInfo[0];
8
8
  return {
9
9
  ...spec,
@@ -16,25 +16,20 @@ const pivotIndicators = (spec, context)=>{
16
16
  indicatorKey: foldInfo.measureValue,
17
17
  title: 'indicator',
18
18
  width: 'auto',
19
- format: fieldFormat(measures, foldInfo, locale)
19
+ format: fieldFormat(measures, foldInfo)
20
20
  }
21
21
  ]
22
22
  };
23
23
  };
24
- const fieldFormat = (measures, foldInfo, locale)=>(value, col, row, table)=>{
24
+ const fieldFormat = (measures, foldInfo)=>(value, col, row, table)=>{
25
25
  if (!isNumber(col) || !isNumber(row) || !table) return value;
26
26
  const datum = table.getCellOriginRecord(col, row);
27
27
  if (!datum[0]) return value;
28
28
  const { measureId: foldMeasureId } = foldInfo;
29
29
  const measureId = datum[0][foldMeasureId];
30
- const node = findMeasureById(measures, measureId);
31
- if (!node) return value;
32
- const { format = {}, autoFormat = true } = node;
33
- if (!isEmpty(format)) {
34
- const formatter = createFormatter(format);
35
- return formatter(value);
36
- }
37
- if (autoFormat) return autoFormatter(value, locale);
30
+ const measure = findMeasureById(measures, measureId);
31
+ const formatter = createFormatterByMeasure(measure);
32
+ return formatter(value);
38
33
  };
39
34
  export { pivotIndicators };
40
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/indicators/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/indicators/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { BaseTableAPI, FieldFormat } from '@visactor/vtable/es/ts-types'\nimport { isEmpty, isNumber } from 'remeda'\nimport { intl } from 'src/i18n'\nimport { autoFormatter, createFormatter, findMeasureById } from 'src/pipeline/utils'\nimport type { Datum, FoldInfo, Locale, MeasureTree, SpecPipe } from 'src/types'\n\nexport const pivotIndicators: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { locale, measures, datasetReshapeInfo } = advancedVSeed\n const { foldInfo } = datasetReshapeInfo[0]\n\n return {\n ...spec,\n indicatorsAsCol: true,\n indicatorTitle: intl.i18n`指标名称`,\n hideIndicatorName: true,\n indicators: [\n {\n cellType: 'text',\n indicatorKey: foldInfo.measureValue,\n title: 'indicator',\n width: 'auto',\n format: fieldFormat(measures, foldInfo as FoldInfo, locale),\n },\n ] as unknown as PivotChartConstructorOptions['indicators'],\n }\n}\n\nconst fieldFormat =\n (measures: MeasureTree, foldInfo: FoldInfo, locale: Locale): FieldFormat =>\n (value: number | string, col?: number, row?: number, table?: BaseTableAPI) => {\n if (!isNumber(col) || !isNumber(row) || !table) {\n return value\n }\n\n const datum = table.getCellOriginRecord(col, row) as Datum[]\n if (!datum[0]) {\n return value\n }\n const { measureId: foldMeasureId } = foldInfo\n const measureId = datum[0][foldMeasureId] as string\n const node = findMeasureById(measures, measureId)\n if (!node) {\n return value\n }\n const { format = {}, autoFormat = true } = node\n if (!isEmpty(format)) {\n const formatter = createFormatter(format)\n return formatter(value)\n }\n\n if (autoFormat) {\n return autoFormatter(value, locale)\n }\n\n return\n }\n"],"names":["pivotIndicators","spec","context","advancedVSeed","locale","measures","datasetReshapeInfo","foldInfo","intl","fieldFormat","value","col","row","table","isNumber","datum","foldMeasureId","measureId","node","findMeasureById","format","autoFormat","isEmpty","formatter","createFormatter","autoFormatter"],"mappings":";;;AAOO,MAAMA,kBAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,MAAM,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE,GAAGH;IACjD,MAAM,EAAEI,QAAQ,EAAE,GAAGD,kBAAkB,CAAC,EAAE;IAE1C,OAAO;QACL,GAAGL,IAAI;QACP,iBAAiB;QACjB,gBAAgBO,KAAK,IAAI,CAAC,IAAI,CAAC;QAC/B,mBAAmB;QACnB,YAAY;YACV;gBACE,UAAU;gBACV,cAAcD,SAAS,YAAY;gBACnC,OAAO;gBACP,OAAO;gBACP,QAAQE,YAAYJ,UAAUE,UAAsBH;YACtD;SACD;IACH;AACF;AAEA,MAAMK,cACJ,CAACJ,UAAuBE,UAAoBH,SAC5C,CAACM,OAAwBC,KAAcC,KAAcC;QACnD,IAAI,CAACC,SAASH,QAAQ,CAACG,SAASF,QAAQ,CAACC,OACvC,OAAOH;QAGT,MAAMK,QAAQF,MAAM,mBAAmB,CAACF,KAAKC;QAC7C,IAAI,CAACG,KAAK,CAAC,EAAE,EACX,OAAOL;QAET,MAAM,EAAE,WAAWM,aAAa,EAAE,GAAGT;QACrC,MAAMU,YAAYF,KAAK,CAAC,EAAE,CAACC,cAAc;QACzC,MAAME,OAAOC,gBAAgBd,UAAUY;QACvC,IAAI,CAACC,MACH,OAAOR;QAET,MAAM,EAAEU,SAAS,CAAC,CAAC,EAAEC,aAAa,IAAI,EAAE,GAAGH;QAC3C,IAAI,CAACI,QAAQF,SAAS;YACpB,MAAMG,YAAYC,gBAAgBJ;YAClC,OAAOG,UAAUb;QACnB;QAEA,IAAIW,YACF,OAAOI,cAAcf,OAAON;IAIhC"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/indicators/pivotIndicators.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/indicators/pivotIndicators.ts"],"sourcesContent":["import type { PivotChartConstructorOptions } from '@visactor/vtable'\nimport type { BaseTableAPI, FieldFormat } from '@visactor/vtable/es/ts-types'\nimport { isNumber } from 'remeda'\nimport { intl } from 'src/i18n'\nimport { createFormatterByMeasure, findMeasureById } from 'src/pipeline/utils'\nimport type { Datum, FoldInfo, MeasureTree, SpecPipe } from 'src/types'\n\nexport const pivotIndicators: SpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { measures, datasetReshapeInfo } = advancedVSeed\n const { foldInfo } = datasetReshapeInfo[0]\n\n return {\n ...spec,\n indicatorsAsCol: true,\n indicatorTitle: intl.i18n`指标名称`,\n hideIndicatorName: true,\n indicators: [\n {\n cellType: 'text',\n indicatorKey: foldInfo.measureValue,\n title: 'indicator',\n width: 'auto',\n format: fieldFormat(measures, foldInfo as FoldInfo),\n },\n ] as unknown as PivotChartConstructorOptions['indicators'],\n }\n}\n\nconst fieldFormat = (measures: MeasureTree, foldInfo: FoldInfo): FieldFormat => {\n return (value: number | string, col?: number, row?: number, table?: BaseTableAPI) => {\n if (!isNumber(col) || !isNumber(row) || !table) {\n return value\n }\n\n const datum = table.getCellOriginRecord(col, row) as Datum[]\n if (!datum[0]) {\n return value\n }\n const { measureId: foldMeasureId } = foldInfo\n const measureId = datum[0][foldMeasureId] as string\n const measure = findMeasureById(measures, measureId)\n const formatter = createFormatterByMeasure(measure)\n return formatter(value)\n }\n}\n"],"names":["pivotIndicators","spec","context","advancedVSeed","measures","datasetReshapeInfo","foldInfo","intl","fieldFormat","value","col","row","table","isNumber","datum","foldMeasureId","measureId","measure","findMeasureById","formatter","createFormatterByMeasure"],"mappings":";;;AAOO,MAAMA,kBAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,QAAQ,EAAEC,kBAAkB,EAAE,GAAGF;IACzC,MAAM,EAAEG,QAAQ,EAAE,GAAGD,kBAAkB,CAAC,EAAE;IAE1C,OAAO;QACL,GAAGJ,IAAI;QACP,iBAAiB;QACjB,gBAAgBM,KAAK,IAAI,CAAC,IAAI,CAAC;QAC/B,mBAAmB;QACnB,YAAY;YACV;gBACE,UAAU;gBACV,cAAcD,SAAS,YAAY;gBACnC,OAAO;gBACP,OAAO;gBACP,QAAQE,YAAYJ,UAAUE;YAChC;SACD;IACH;AACF;AAEA,MAAME,cAAc,CAACJ,UAAuBE,WACnC,CAACG,OAAwBC,KAAcC,KAAcC;QAC1D,IAAI,CAACC,SAASH,QAAQ,CAACG,SAASF,QAAQ,CAACC,OACvC,OAAOH;QAGT,MAAMK,QAAQF,MAAM,mBAAmB,CAACF,KAAKC;QAC7C,IAAI,CAACG,KAAK,CAAC,EAAE,EACX,OAAOL;QAET,MAAM,EAAE,WAAWM,aAAa,EAAE,GAAGT;QACrC,MAAMU,YAAYF,KAAK,CAAC,EAAE,CAACC,cAAc;QACzC,MAAME,UAAUC,gBAAgBd,UAAUY;QAC1C,MAAMG,YAAYC,yBAAyBH;QAC3C,OAAOE,UAAUV;IACnB"}
@@ -2,4 +2,5 @@ export declare const ANNOTATION_Z_INDEX = 1000;
2
2
  export declare const LINEAR_AXIS_INNER_OFFSET_TOP = 7;
3
3
  export declare const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000;
4
4
  export declare const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001;
5
+ export declare const DUAL_AXIS_LABEL_Z_INDEX = 1002;
5
6
  export declare const DEFAULT_PARENT_ID = "__DefaultParentId__";
@@ -2,7 +2,8 @@ const ANNOTATION_Z_INDEX = 1000;
2
2
  const LINEAR_AXIS_INNER_OFFSET_TOP = 7;
3
3
  const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000;
4
4
  const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001;
5
+ const DUAL_AXIS_LABEL_Z_INDEX = 1002;
5
6
  const DEFAULT_PARENT_ID = '__DefaultParentId__';
6
- export { ANNOTATION_Z_INDEX, DEFAULT_PARENT_ID, DUAL_AXIS_CHART_COLUMN_Z_INDEX, DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX, LINEAR_AXIS_INNER_OFFSET_TOP };
7
+ export { ANNOTATION_Z_INDEX, DEFAULT_PARENT_ID, DUAL_AXIS_CHART_COLUMN_Z_INDEX, DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX, DUAL_AXIS_LABEL_Z_INDEX, LINEAR_AXIS_INNER_OFFSET_TOP };
7
8
 
8
9
  //# sourceMappingURL=constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/utils/constant.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/constant.ts"],"sourcesContent":["// 标注层 z-index\nexport const ANNOTATION_Z_INDEX = 1000\n// 线性轴 顶部空隙 预留5px\nexport const LINEAR_AXIS_INNER_OFFSET_TOP = 7\n// 双轴图 柱图 ZIndex\nexport const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000\n// 双轴图 非柱图 ZIndex\nexport const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001\n// 默认父级id\nexport const DEFAULT_PARENT_ID = '__DefaultParentId__'\n"],"names":["ANNOTATION_Z_INDEX","LINEAR_AXIS_INNER_OFFSET_TOP","DUAL_AXIS_CHART_COLUMN_Z_INDEX","DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX","DEFAULT_PARENT_ID"],"mappings":"AACO,MAAMA,qBAAqB;AAE3B,MAAMC,+BAA+B;AAErC,MAAMC,iCAAiC;AAEvC,MAAMC,qCAAqC;AAE3C,MAAMC,oBAAoB"}
1
+ {"version":3,"file":"pipeline/utils/constant.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/constant.ts"],"sourcesContent":["// 标注层 z-index\nexport const ANNOTATION_Z_INDEX = 1000\n// 线性轴 顶部空隙 预留5px\nexport const LINEAR_AXIS_INNER_OFFSET_TOP = 7\n// 双轴图 柱图 ZIndex\nexport const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000\n// 双轴图 非柱图 ZIndex\nexport const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001\n// 双轴图 标注层 ZIndex\nexport const DUAL_AXIS_LABEL_Z_INDEX = 1002\n// 默认父级id\nexport const DEFAULT_PARENT_ID = '__DefaultParentId__'\n"],"names":["ANNOTATION_Z_INDEX","LINEAR_AXIS_INNER_OFFSET_TOP","DUAL_AXIS_CHART_COLUMN_Z_INDEX","DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX","DUAL_AXIS_LABEL_Z_INDEX","DEFAULT_PARENT_ID"],"mappings":"AACO,MAAMA,qBAAqB;AAE3B,MAAMC,+BAA+B;AAErC,MAAMC,iCAAiC;AAEvC,MAAMC,qCAAqC;AAE3C,MAAMC,0BAA0B;AAEhC,MAAMC,oBAAoB"}
@@ -1,3 +1,3 @@
1
1
  import type { Formatter, Locale, NumFormat } from '../../../types';
2
- export declare const createFormatter: (format: Partial<NumFormat>) => Formatter;
2
+ export declare const createFormatter: (format: Partial<NumFormat>, locale?: Locale) => Formatter;
3
3
  export declare const autoFormatter: (value?: number | string, locale?: Locale) => string;
@@ -1,6 +1,7 @@
1
1
  import { autoNumFormatter, createNumFormatter } from "./createNumFormatter.js";
2
- const createFormatter = (format)=>createNumFormatter(format);
3
- const autoFormatter = (value, locale)=>autoNumFormatter(value, locale);
2
+ import { intl } from "../../../i18n/index.js";
3
+ const createFormatter = (format, locale)=>createNumFormatter(format, locale);
4
+ const autoFormatter = (value, locale = intl.getLocale())=>autoNumFormatter(value, locale);
4
5
  export { autoFormatter, createFormatter };
5
6
 
6
7
  //# sourceMappingURL=createFormatter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/utils/format/createFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createFormatter.ts"],"sourcesContent":["import type { Formatter, Locale, NumFormat } from 'src/types'\nimport { autoNumFormatter, createNumFormatter } from './createNumFormatter'\n\nexport const createFormatter = (format: Partial<NumFormat>): Formatter => {\n return createNumFormatter(format)\n}\n\nexport const autoFormatter = (value?: number | string, locale?: Locale): string => {\n return autoNumFormatter(value, locale)\n}\n"],"names":["createFormatter","format","createNumFormatter","autoFormatter","value","locale","autoNumFormatter"],"mappings":";AAGO,MAAMA,kBAAkB,CAACC,SACvBC,mBAAmBD;AAGrB,MAAME,gBAAgB,CAACC,OAAyBC,SAC9CC,iBAAiBF,OAAOC"}
1
+ {"version":3,"file":"pipeline/utils/format/createFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createFormatter.ts"],"sourcesContent":["import type { Formatter, Locale, NumFormat } from 'src/types'\nimport { autoNumFormatter, createNumFormatter } from './createNumFormatter'\nimport { intl } from 'src/i18n'\n\nexport const createFormatter = (format: Partial<NumFormat>, locale?: Locale): Formatter => {\n return createNumFormatter(format, locale)\n}\n\nexport const autoFormatter = (value?: number | string, locale: Locale = intl.getLocale()): string => {\n return autoNumFormatter(value, locale)\n}\n"],"names":["createFormatter","format","locale","createNumFormatter","autoFormatter","value","intl","autoNumFormatter"],"mappings":";;AAIO,MAAMA,kBAAkB,CAACC,QAA4BC,SACnDC,mBAAmBF,QAAQC;AAG7B,MAAME,gBAAgB,CAACC,OAAyBH,SAAiBI,KAAK,SAAS,EAAE,GAC/EC,iBAAiBF,OAAOH"}
@@ -0,0 +1,2 @@
1
+ import type { Formatter, Measure } from '../../../types';
2
+ export declare const createFormatterByMeasure: (measure?: Measure) => Formatter;
@@ -0,0 +1,14 @@
1
+ import { autoFormatter, createFormatter } from "./createFormatter.js";
2
+ import { isEmpty, isNullish } from "remeda";
3
+ const createFormatterByMeasure = (measure)=>{
4
+ if (!measure) return (v)=>String(v);
5
+ const { numFormat, format, autoFormat } = measure;
6
+ const formatterFormat = numFormat || format || {};
7
+ if (true === autoFormat) return autoFormatter;
8
+ if (isNullish(autoFormat) && isEmpty(formatterFormat)) return autoFormatter;
9
+ if (!isEmpty(formatterFormat)) return createFormatter(formatterFormat);
10
+ return (v)=>String(v);
11
+ };
12
+ export { createFormatterByMeasure };
13
+
14
+ //# sourceMappingURL=createFormatterByMeasure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/utils/format/createFormatterByMeasure.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createFormatterByMeasure.ts"],"sourcesContent":["import type { Formatter, Measure } from 'src/types'\nimport { autoFormatter, createFormatter } from './createFormatter'\nimport { isEmpty, isNullish } from 'remeda'\n\nexport const createFormatterByMeasure = (measure?: Measure): Formatter => {\n if (!measure) {\n return (v) => String(v)\n }\n const { numFormat, format, autoFormat } = measure\n\n const formatterFormat = numFormat || format || {}\n\n if (autoFormat === true) {\n return autoFormatter\n }\n\n if (isNullish(autoFormat) && isEmpty(formatterFormat)) {\n return autoFormatter\n }\n\n if (!isEmpty(formatterFormat)) {\n return createFormatter(formatterFormat)\n }\n\n return (v) => String(v)\n}\n"],"names":["createFormatterByMeasure","measure","v","String","numFormat","format","autoFormat","formatterFormat","autoFormatter","isNullish","isEmpty","createFormatter"],"mappings":";;AAIO,MAAMA,2BAA2B,CAACC;IACvC,IAAI,CAACA,SACH,OAAO,CAACC,IAAMC,OAAOD;IAEvB,MAAM,EAAEE,SAAS,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGL;IAE1C,MAAMM,kBAAkBH,aAAaC,UAAU,CAAC;IAEhD,IAAIC,AAAe,SAAfA,YACF,OAAOE;IAGT,IAAIC,UAAUH,eAAeI,QAAQH,kBACnC,OAAOC;IAGT,IAAI,CAACE,QAAQH,kBACX,OAAOI,gBAAgBJ;IAGzB,OAAO,CAACL,IAAMC,OAAOD;AACvB"}
@@ -1,3 +1,3 @@
1
1
  import type { Formatter, Locale, NumFormat } from '../../../types';
2
- export declare const createNumFormatter: (format: NumFormat, locale?: Locale) => Formatter;
2
+ export declare const createNumFormatter: (format?: Partial<NumFormat>, locale?: Locale) => Formatter;
3
3
  export declare const autoNumFormatter: (value?: number | string, locale?: Locale) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/utils/format/createNumFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createNumFormatter.ts"],"sourcesContent":["import { isNumber } from 'remeda'\nimport { intl } from '../../../i18n'\nimport type { Formatter, Locale, NumFormat } from 'src/types'\n\nexport const createNumFormatter = (format: NumFormat, locale: Locale = intl.getLocale()): Formatter => {\n const {\n type = 'number',\n ratio = 1,\n symbol = '',\n thousandSeparator = true,\n prefix = '',\n suffix = '',\n\n fractionDigits = 2,\n significantDigits,\n roundingMode = 'halfExpand',\n roundingPriority = 'auto',\n } = format || {}\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: type === 'scientific' ? 'scientific' : 'standard',\n // @ts-expect-error roundingMode is not in NumberFormatOptions\n roundingMode,\n roundingPriority,\n }\n\n if (isNumber(fractionDigits)) {\n if (fractionDigits >= 0) {\n numFormatterOptions.minimumFractionDigits = fractionDigits\n numFormatterOptions.maximumFractionDigits = fractionDigits\n }\n }\n if (isNumber(significantDigits) && significantDigits > 0) {\n if (significantDigits > 0) {\n numFormatterOptions.minimumSignificantDigits = significantDigits\n numFormatterOptions.maximumSignificantDigits = significantDigits\n }\n }\n\n const numFormatter = new Intl.NumberFormat(locale, numFormatterOptions)\n\n return (value?: number | string) => {\n let num = Number(value)\n let typeSymbol = ''\n if (Number.isNaN(num)) {\n return String(value)\n }\n\n // apply ratio for percent/permille\n if (type === 'percent') {\n num *= 100\n typeSymbol = '%'\n } else if (type === 'permille') {\n num *= 1000\n typeSymbol = '‰'\n } else if (type === 'number') {\n num = num / (ratio || 1)\n }\n\n // format value\n let numStr = numFormatter.format(num)\n\n // add thousand separator\n if (thousandSeparator) {\n const parts = numStr.split('.')\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n numStr = parts.join('.')\n }\n\n // add symbol, typeSymbol, prefix and suffix\n return `${prefix}${numStr}${typeSymbol}${symbol}${suffix}`\n }\n}\n\nexport const autoNumFormatter = (value?: number | string, locale: Locale = intl.getLocale()): string => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: 'compact',\n }\n numFormatterOptions.minimumFractionDigits = 0\n numFormatterOptions.maximumFractionDigits = 2\n\n const numFormatter = new Intl.NumberFormat(locale, { ...numFormatterOptions })\n\n return numFormatter.format(Number(value))\n}\n"],"names":["createNumFormatter","format","locale","intl","type","ratio","symbol","thousandSeparator","prefix","suffix","fractionDigits","significantDigits","roundingMode","roundingPriority","numFormatterOptions","isNumber","numFormatter","Intl","value","num","Number","typeSymbol","String","numStr","parts","autoNumFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAACC,QAAmBC,SAAiBC,KAAK,SAAS,EAAE;IACrF,MAAM,EACJC,OAAO,QAAQ,EACfC,QAAQ,CAAC,EACTC,SAAS,EAAE,EACXC,oBAAoB,IAAI,EACxBC,SAAS,EAAE,EACXC,SAAS,EAAE,EAEXC,iBAAiB,CAAC,EAClBC,iBAAiB,EACjBC,eAAe,YAAY,EAC3BC,mBAAmB,MAAM,EAC1B,GAAGZ,UAAU,CAAC;IAEf,MAAMa,sBAAgD;QACpD,OAAO;QACP,UAAUV,AAAS,iBAATA,OAAwB,eAAe;QAEjDQ;QACAC;IACF;IAEA,IAAIE,SAASL,iBACX;QAAA,IAAIA,kBAAkB,GAAG;YACvBI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OAAOE,aAAa,MAAM,CAACI,OAAOF;AACpC"}
1
+ {"version":3,"file":"pipeline/utils/format/createNumFormatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/format/createNumFormatter.ts"],"sourcesContent":["import { isNumber } from 'remeda'\nimport { intl } from '../../../i18n'\nimport type { Formatter, Locale, NumFormat } from 'src/types'\n\nexport const createNumFormatter = (format?: Partial<NumFormat>, locale: Locale = intl.getLocale()): Formatter => {\n const {\n type = 'number',\n ratio = 1,\n symbol = '',\n thousandSeparator = true,\n prefix = '',\n suffix = '',\n\n fractionDigits = 2,\n significantDigits,\n roundingMode = 'halfExpand',\n roundingPriority = 'auto',\n } = format || {}\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: type === 'scientific' ? 'scientific' : 'standard',\n // @ts-expect-error roundingMode is not in NumberFormatOptions\n roundingMode,\n roundingPriority,\n }\n\n if (isNumber(fractionDigits)) {\n if (fractionDigits >= 0) {\n numFormatterOptions.minimumFractionDigits = fractionDigits\n numFormatterOptions.maximumFractionDigits = fractionDigits\n }\n }\n if (isNumber(significantDigits) && significantDigits > 0) {\n if (significantDigits > 0) {\n numFormatterOptions.minimumSignificantDigits = significantDigits\n numFormatterOptions.maximumSignificantDigits = significantDigits\n }\n }\n\n const numFormatter = new Intl.NumberFormat(locale, numFormatterOptions)\n\n return (value?: number | string) => {\n let num = Number(value)\n let typeSymbol = ''\n if (Number.isNaN(num)) {\n return String(value)\n }\n\n // apply ratio for percent/permille\n if (type === 'percent') {\n num *= 100\n typeSymbol = '%'\n } else if (type === 'permille') {\n num *= 1000\n typeSymbol = '‰'\n } else if (type === 'number') {\n num = num / (ratio || 1)\n }\n\n // format value\n let numStr = numFormatter.format(num)\n\n // add thousand separator\n if (thousandSeparator) {\n const parts = numStr.split('.')\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n numStr = parts.join('.')\n }\n\n // add symbol, typeSymbol, prefix and suffix\n return `${prefix}${numStr}${typeSymbol}${symbol}${suffix}`\n }\n}\n\nexport const autoNumFormatter = (value?: number | string, locale: Locale = intl.getLocale()): string => {\n if (value === undefined || value === null) return String(value)\n const num = Number(value)\n if (Number.isNaN(num)) return String(value)\n\n const numFormatterOptions: Intl.NumberFormatOptions = {\n style: 'decimal',\n notation: 'compact',\n }\n numFormatterOptions.minimumFractionDigits = 0\n numFormatterOptions.maximumFractionDigits = 2\n\n const numFormatter = new Intl.NumberFormat(locale, { ...numFormatterOptions })\n\n return numFormatter.format(Number(value))\n}\n"],"names":["createNumFormatter","format","locale","intl","type","ratio","symbol","thousandSeparator","prefix","suffix","fractionDigits","significantDigits","roundingMode","roundingPriority","numFormatterOptions","isNumber","numFormatter","Intl","value","num","Number","typeSymbol","String","numStr","parts","autoNumFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAACC,QAA6BC,SAAiBC,KAAK,SAAS,EAAE;IAC/F,MAAM,EACJC,OAAO,QAAQ,EACfC,QAAQ,CAAC,EACTC,SAAS,EAAE,EACXC,oBAAoB,IAAI,EACxBC,SAAS,EAAE,EACXC,SAAS,EAAE,EAEXC,iBAAiB,CAAC,EAClBC,iBAAiB,EACjBC,eAAe,YAAY,EAC3BC,mBAAmB,MAAM,EAC1B,GAAGZ,UAAU,CAAC;IAEf,MAAMa,sBAAgD;QACpD,OAAO;QACP,UAAUV,AAAS,iBAATA,OAAwB,eAAe;QAEjDQ;QACAC;IACF;IAEA,IAAIE,SAASL,iBACX;QAAA,IAAIA,kBAAkB,GAAG;YACvBI,oBAAoB,qBAAqB,GAAGJ;YAC5CI,oBAAoB,qBAAqB,GAAGJ;QAC9C;IAAA;IAEF,IAAIK,SAASJ,sBAAsBA,oBAAoB,GACrD;QAAA,IAAIA,oBAAoB,GAAG;YACzBG,oBAAoB,wBAAwB,GAAGH;YAC/CG,oBAAoB,wBAAwB,GAAGH;QACjD;IAAA;IAGF,MAAMK,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQY;IAEnD,OAAO,CAACI;QACN,IAAIC,MAAMC,OAAOF;QACjB,IAAIG,aAAa;QACjB,IAAID,OAAO,KAAK,CAACD,MACf,OAAOG,OAAOJ;QAIhB,IAAId,AAAS,cAATA,MAAoB;YACtBe,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,eAATA,MAAqB;YAC9Be,OAAO;YACPE,aAAa;QACf,OAAO,IAAIjB,AAAS,aAATA,MACTe,OAAad,SAAS;QAIxB,IAAIkB,SAASP,aAAa,MAAM,CAACG;QAGjC,IAAIZ,mBAAmB;YACrB,MAAMiB,QAAQD,OAAO,KAAK,CAAC;YAC3BC,KAAK,CAAC,EAAE,GAAGA,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,yBAAyB;YACrDD,SAASC,MAAM,IAAI,CAAC;QACtB;QAGA,OAAO,GAAGhB,SAASe,SAASF,aAAaf,SAASG,QAAQ;IAC5D;AACF;AAEO,MAAMgB,mBAAmB,CAACP,OAAyBhB,SAAiBC,KAAK,SAAS,EAAE;IACzF,IAAIe,QAAAA,OAAuC,OAAOI,OAAOJ;IACzD,MAAMC,MAAMC,OAAOF;IACnB,IAAIE,OAAO,KAAK,CAACD,MAAM,OAAOG,OAAOJ;IAErC,MAAMJ,sBAAgD;QACpD,OAAO;QACP,UAAU;IACZ;IACAA,oBAAoB,qBAAqB,GAAG;IAC5CA,oBAAoB,qBAAqB,GAAG;IAE5C,MAAME,eAAe,IAAIC,KAAK,YAAY,CAACf,QAAQ;QAAE,GAAGY,mBAAmB;IAAC;IAE5E,OAAOE,aAAa,MAAM,CAACI,OAAOF;AACpC"}
@@ -1,2 +1,3 @@
1
1
  export * from './createNumFormatter';
2
2
  export * from './createFormatter';
3
+ export * from './createFormatterByMeasure';
@@ -1,2 +1,3 @@
1
1
  export * from "./createNumFormatter.js";
2
2
  export * from "./createFormatter.js";
3
+ export * from "./createFormatterByMeasure.js";
@@ -5,3 +5,4 @@ export * from './measures';
5
5
  export * from './dimensions';
6
6
  export * from './tree';
7
7
  export * from './replaceNullToUndefined';
8
+ export * from './valid';
@@ -5,3 +5,4 @@ export * from "./measures/index.js";
5
5
  export * from "./dimensions/index.js";
6
6
  export * from "./tree/index.js";
7
7
  export * from "./replaceNullToUndefined.js";
8
+ export * from "./valid/index.js";
@@ -0,0 +1,2 @@
1
+ import type { VSeed } from '../../../types';
2
+ export declare const checkVSeed: (vseed: VSeed) => void;
@@ -0,0 +1,11 @@
1
+ import { isEmpty } from "remeda";
2
+ const checkVSeed = (vseed)=>{
3
+ const { chartType, dataset, dimensions, measures } = vseed;
4
+ if (!chartType) throw new Error('chartType is required');
5
+ if (!dataset || isEmpty(dataset)) throw new Error('dataset is required, and must be an array');
6
+ if (dimensions && !Array.isArray(dimensions)) throw new Error('dimensions must be an array');
7
+ if (measures && !Array.isArray(measures)) throw new Error('measures must be an array');
8
+ };
9
+ export { checkVSeed };
10
+
11
+ //# sourceMappingURL=checkVSeed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/utils/valid/checkVSeed.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/valid/checkVSeed.ts"],"sourcesContent":["import { isEmpty } from 'remeda'\nimport type { VSeed } from 'src/types'\n\nexport const checkVSeed = (vseed: VSeed) => {\n const { chartType, dataset, dimensions, measures } = vseed\n if (!chartType) {\n throw new Error('chartType is required')\n }\n if (!dataset || isEmpty(dataset)) {\n throw new Error('dataset is required, and must be an array')\n }\n if (dimensions && !Array.isArray(dimensions)) {\n throw new Error('dimensions must be an array')\n }\n if (measures && !Array.isArray(measures)) {\n throw new Error('measures must be an array')\n }\n}\n"],"names":["checkVSeed","vseed","chartType","dataset","dimensions","measures","Error","isEmpty","Array"],"mappings":";AAGO,MAAMA,aAAa,CAACC;IACzB,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IACrD,IAAI,CAACC,WACH,MAAM,IAAII,MAAM;IAElB,IAAI,CAACH,WAAWI,QAAQJ,UACtB,MAAM,IAAIG,MAAM;IAElB,IAAIF,cAAc,CAACI,MAAM,OAAO,CAACJ,aAC/B,MAAM,IAAIE,MAAM;IAElB,IAAID,YAAY,CAACG,MAAM,OAAO,CAACH,WAC7B,MAAM,IAAIC,MAAM;AAEpB"}
@@ -0,0 +1 @@
1
+ export { checkVSeed } from './checkVSeed';
@@ -0,0 +1,2 @@
1
+ import { checkVSeed } from "./checkVSeed.js";
2
+ export { checkVSeed };
@@ -318,7 +318,11 @@ const darkTheme = ()=>{
318
318
  ...baseConfig
319
319
  },
320
320
  heatmap: {
321
- ...baseConfig
321
+ ...baseConfig,
322
+ label: {
323
+ ...baseConfig.label,
324
+ labelColorSmartInvert: true
325
+ }
322
326
  }
323
327
  }
324
328
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theme/dark.js","sources":["webpack://@visactor/vseed/./src/theme/dark.ts"],"sourcesContent":["import type {\n BackgroundColor,\n Color,\n CustomThemeConfig,\n Label,\n Legend,\n TableConfig,\n Tooltip,\n YBandAxis,\n YLinearAxis,\n} from 'src/types'\n\nexport const darkTheme = (): CustomThemeConfig => {\n const linearAxis: YLinearAxis = {\n nice: true,\n zero: true,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#E2E3E6',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#FDFDFD',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#404349',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#4B4F54',\n },\n line: {\n visible: false,\n lineColor: '#4B4F54',\n lineWidth: 1,\n },\n }\n const bandAxis: YBandAxis = {\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#E2E3E6',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#FDFDFD',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#404349',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#4B4F54',\n },\n line: {\n visible: true,\n lineColor: '#4B4F54',\n lineWidth: 1,\n },\n }\n const barBandAxis: YBandAxis = {\n ...bandAxis,\n labelAutoHide: false,\n labelAutoHideGap: 1,\n labelAutoLimit: false,\n labelAutoLimitLength: undefined,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n }\n const crosshairLine = {\n visible: true,\n labelVisible: true,\n lineColor: '#E2E3E6',\n labelColor: '#4B4F54',\n labelBackgroundColor: '#ffffff',\n }\n const crosshairRect = {\n visible: true,\n labelVisible: true,\n lineColor: '#E2E3E6',\n labelColor: '#4B4F54',\n labelBackgroundColor: '#ffffff',\n }\n\n const baseConfig: {\n backgroundColor?: BackgroundColor\n color?: Color\n label?: Label\n tooltip?: Tooltip\n legend?: Legend\n } = {\n backgroundColor: 'transparent',\n color: {\n linearColorScheme: ['#A0CEFF', '#2E62F1'],\n colorScheme: [\n '#2E62F1',\n '#4DC36A',\n '#FF8406',\n '#FFCC00',\n '#4F44CF',\n '#5AC8FA',\n '#003A8C',\n '#B08AE2',\n '#FF6341',\n '#98DD62',\n ],\n },\n label: {\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n },\n tooltip: {\n enable: true,\n },\n legend: {\n enable: true,\n border: true,\n maxSize: 1,\n position: 'rt',\n shapeType: 'rectRound',\n labelColor: '#FDFDFD',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n }\n\n const tableConfig: TableConfig = {\n borderColor: '#4b4e53',\n\n bodyFontSize: 12,\n bodyFontColor: '#fdfdfd',\n bodyBackgroundColor: 'transparent',\n\n headerFontSize: 12,\n headerFontColor: '#fdfdfd',\n headerBackgroundColor: '#36393e',\n\n hoverBodyBackgroundColor: '#4284ff66',\n hoverBodyInlineBackgroundColor: '#4284ff10',\n hoverHeaderBackgroundColor: '#6f7984cc',\n hoverHeaderInlineBackgroundColor: '#4b4f54',\n\n selectedBorderColor: '#3073f2',\n selectedBackgroundColor: '#4284ff33',\n }\n\n return {\n config: {\n table: tableConfig,\n pivotTable: tableConfig,\n\n // cartesian\n line: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n column: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnParallel: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnPercent: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n bar: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barParallel: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barPercent: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n area: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n areaPercent: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n scatter: {\n ...baseConfig,\n\n xAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n yAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n crosshairLine,\n },\n dualAxis: {\n ...baseConfig,\n xAxis: bandAxis,\n primaryYAxis: linearAxis,\n secondaryYAxis: { ...linearAxis, grid: { visible: false } },\n dualChartType: {\n primary: 'column',\n secondary: 'line',\n },\n crosshairRect,\n },\n // polar\n pie: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n donut: {\n ...baseConfig,\n },\n radar: {\n ...baseConfig,\n },\n rose: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n roseParallel: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n // other\n funnel: {\n ...baseConfig,\n },\n heatmap: {\n ...baseConfig,\n },\n },\n }\n}\n"],"names":["darkTheme","linearAxis","bandAxis","barBandAxis","undefined","crosshairLine","crosshairRect","baseConfig","tableConfig"],"mappings":"AAYO,MAAMA,YAAY;IACvB,MAAMC,aAA0B;QAC9B,MAAM;QACN,MAAM;QACN,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;IACA,MAAMC,WAAsB;QAC1B,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;SAAI;QACxC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,e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BAAgB;oBAAE,GAAGA,UAAU;oBAAE,MAAM;wBAAE,SAAS;oBAAM;gBAAE;gBAC1D,eAAe;oBACb,SAAS;oBACT,WAAW;gBACb;gBACAK;YACF;YAEA,KAAK;gBACH,GAAGC,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YACA,OAAO;gBACL,GAAGA,UAAU;YACf;YACA,OAAO;gBACL,GAAGA,UAAU;YACf;YACA,MAAM;gBACJ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YACA,cAAc;gBACZ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YAEA,QAAQ;gBACN,GAAGA,UAAU;YACf;YACA,SAAS;gBACP,GAAGA,UAAU;YACf;QACF;IACF;AACF"}
1
+ {"version":3,"file":"theme/dark.js","sources":["webpack://@visactor/vseed/./src/theme/dark.ts"],"sourcesContent":["import type {\n BackgroundColor,\n Color,\n CustomThemeConfig,\n Label,\n Legend,\n TableConfig,\n Tooltip,\n YBandAxis,\n YLinearAxis,\n} from 'src/types'\n\nexport const darkTheme = (): CustomThemeConfig => {\n const linearAxis: YLinearAxis = {\n nice: true,\n zero: true,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#E2E3E6',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#FDFDFD',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#404349',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#4B4F54',\n },\n line: {\n visible: false,\n lineColor: '#4B4F54',\n lineWidth: 1,\n },\n }\n const bandAxis: YBandAxis = {\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#E2E3E6',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#FDFDFD',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#404349',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#4B4F54',\n },\n line: {\n visible: true,\n lineColor: '#4B4F54',\n lineWidth: 1,\n },\n }\n const barBandAxis: YBandAxis = {\n ...bandAxis,\n labelAutoHide: false,\n labelAutoHideGap: 1,\n labelAutoLimit: false,\n labelAutoLimitLength: undefined,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n }\n const crosshairLine = {\n visible: true,\n labelVisible: true,\n lineColor: '#E2E3E6',\n labelColor: '#4B4F54',\n labelBackgroundColor: '#ffffff',\n }\n const crosshairRect = {\n visible: true,\n labelVisible: true,\n lineColor: '#E2E3E6',\n labelColor: '#4B4F54',\n labelBackgroundColor: '#ffffff',\n }\n\n const baseConfig: {\n backgroundColor?: BackgroundColor\n color?: Color\n label?: Label\n tooltip?: Tooltip\n legend?: Legend\n } = {\n backgroundColor: 'transparent',\n color: {\n linearColorScheme: ['#A0CEFF', '#2E62F1'],\n colorScheme: [\n '#2E62F1',\n '#4DC36A',\n '#FF8406',\n '#FFCC00',\n '#4F44CF',\n '#5AC8FA',\n '#003A8C',\n '#B08AE2',\n '#FF6341',\n '#98DD62',\n ],\n },\n label: {\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n },\n tooltip: {\n enable: true,\n },\n legend: {\n enable: true,\n border: true,\n maxSize: 1,\n position: 'rt',\n shapeType: 'rectRound',\n labelColor: '#FDFDFD',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n }\n\n const tableConfig: TableConfig = {\n borderColor: '#4b4e53',\n\n bodyFontSize: 12,\n bodyFontColor: '#fdfdfd',\n bodyBackgroundColor: 'transparent',\n\n headerFontSize: 12,\n headerFontColor: '#fdfdfd',\n headerBackgroundColor: '#36393e',\n\n hoverBodyBackgroundColor: '#4284ff66',\n hoverBodyInlineBackgroundColor: '#4284ff10',\n hoverHeaderBackgroundColor: '#6f7984cc',\n hoverHeaderInlineBackgroundColor: '#4b4f54',\n\n selectedBorderColor: '#3073f2',\n selectedBackgroundColor: '#4284ff33',\n }\n\n return {\n config: {\n table: tableConfig,\n pivotTable: tableConfig,\n\n // cartesian\n line: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n column: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnParallel: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnPercent: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n bar: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barParallel: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barPercent: {\n ...baseConfig,\n\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect: crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n area: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n areaPercent: {\n ...baseConfig,\n\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine: crosshairLine,\n },\n scatter: {\n ...baseConfig,\n\n xAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n yAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n crosshairLine,\n },\n dualAxis: {\n ...baseConfig,\n xAxis: bandAxis,\n primaryYAxis: linearAxis,\n secondaryYAxis: { ...linearAxis, grid: { visible: false } },\n dualChartType: {\n primary: 'column',\n secondary: 'line',\n },\n crosshairRect,\n },\n // polar\n pie: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n donut: {\n ...baseConfig,\n },\n radar: {\n ...baseConfig,\n },\n rose: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n roseParallel: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n // other\n funnel: {\n ...baseConfig,\n },\n heatmap: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n labelColorSmartInvert: true,\n },\n },\n },\n }\n}\n"],"names":["darkTheme","linearAxis","bandAxis","barBandAxis","undefined","crosshairLine","crosshairRect","baseConfig","tableConfig"],"mappings":"AAYO,MAAMA,YAAY;IACvB,MAAMC,aAA0B;QAC9B,MAAM;QACN,MAAM;QACN,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;IACA,MAAMC,WAAsB;QAC1B,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;S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AAM;wBACJ,GAAGA,WAAW,IAAI;wBAClB,SAAS;oBACX;gBACF;gBACAI;YACF;YACA,UAAU;gBACR,GAAGE,UAAU;gBACb,OAAOL;gBACP,cAAcD;gBACd,gBAAgB;oBAAE,GAAGA,UAAU;oBAAE,MAAM;wBAAE,SAAS;oBAAM;gBAAE;gBAC1D,eAAe;oBACb,SAAS;oBACT,WAAW;gBACb;gBACAK;YACF;YAEA,KAAK;gBACH,GAAGC,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YACA,OAAO;gBACL,GAAGA,UAAU;YACf;YACA,OAAO;gBACL,GAAGA,UAAU;YACf;YACA,MAAM;gBACJ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YACA,cAAc;gBACZ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YAEA,QAAQ;gBACN,GAAGA,UAAU;YACf;YACA,SAAS;gBACP,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,uBAAuB;gBACzB;YACF;QACF;IACF;AACF"}
@@ -198,7 +198,12 @@ const lightTheme = ()=>{
198
198
  columnPercent: {
199
199
  ...baseConfig,
200
200
  xAxis: bandAxis,
201
- yAxis: linearAxis,
201
+ yAxis: {
202
+ ...linearAxis,
203
+ numFormat: {
204
+ type: 'percent'
205
+ }
206
+ },
202
207
  crosshairRect,
203
208
  stackCornerRadius: [
204
209
  4,
@@ -233,7 +238,12 @@ const lightTheme = ()=>{
233
238
  },
234
239
  barPercent: {
235
240
  ...baseConfig,
236
- xAxis: linearAxis,
241
+ xAxis: {
242
+ ...linearAxis,
243
+ numFormat: {
244
+ type: 'percent'
245
+ }
246
+ },
237
247
  yAxis: barBandAxis,
238
248
  crosshairRect,
239
249
  stackCornerRadius: [
@@ -252,7 +262,12 @@ const lightTheme = ()=>{
252
262
  areaPercent: {
253
263
  ...baseConfig,
254
264
  xAxis: bandAxis,
255
- yAxis: linearAxis,
265
+ yAxis: {
266
+ ...linearAxis,
267
+ numFormat: {
268
+ type: 'percent'
269
+ }
270
+ },
256
271
  crosshairLine
257
272
  },
258
273
  scatter: {
@@ -320,7 +335,11 @@ const lightTheme = ()=>{
320
335
  ...baseConfig
321
336
  },
322
337
  heatmap: {
323
- ...baseConfig
338
+ ...baseConfig,
339
+ label: {
340
+ ...baseConfig.label,
341
+ labelColorSmartInvert: true
342
+ }
324
343
  }
325
344
  }
326
345
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theme/light.js","sources":["webpack://@visactor/vseed/./src/theme/light.ts"],"sourcesContent":["import type {\n BackgroundColor,\n Color,\n CustomThemeConfig,\n Label,\n Legend,\n TableConfig,\n Tooltip,\n YBandAxis,\n YLinearAxis,\n} from 'src/types'\n\nexport const lightTheme = (): CustomThemeConfig => {\n const linearAxis: YLinearAxis = {\n nice: true,\n zero: true,\n inverse: false,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#797B85',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#646A73',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#36415926',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#3641594d',\n },\n line: {\n visible: false,\n lineColor: '#3641594d',\n lineWidth: 1,\n },\n }\n const bandAxis: YBandAxis = {\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#797B85',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#646A73',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#36415926',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#3641594d',\n },\n line: {\n visible: true,\n lineColor: '#3641594d',\n lineWidth: 1,\n },\n }\n const barBandAxis: YBandAxis = {\n ...bandAxis,\n labelAutoHide: false,\n labelAutoHideGap: 1,\n labelAutoLimit: false,\n labelAutoLimitLength: undefined,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n }\n\n const crosshairLine = {\n visible: true,\n labelVisible: true,\n lineColor: '#3641594d',\n labelColor: '#ffffff',\n labelBackgroundColor: '#364159',\n }\n const crosshairRect = {\n visible: true,\n labelVisible: true,\n rectColor: '#3641594d',\n labelColor: '#ffffff',\n labelBackgroundColor: '#364159',\n }\n\n const baseConfig: {\n backgroundColor?: BackgroundColor\n color?: Color\n label?: Label\n tooltip?: Tooltip\n legend?: Legend\n } = {\n backgroundColor: 'transparent',\n color: {\n linearColorScheme: ['#C2CEFF', '#5766EC'],\n colorScheme: [\n '#8D72F6',\n '#5766EC',\n '#66A3FE',\n '#51D5E6',\n '#4EC0B3',\n '#F9DF90',\n '#F9AD71',\n '#ED8888',\n '#E9A0C3',\n '#D77DD3',\n ],\n },\n label: {\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n },\n tooltip: {\n enable: true,\n },\n legend: {\n enable: true,\n border: true,\n maxSize: 1,\n shapeType: 'rectRound',\n position: 'rt',\n labelColor: '#646A73',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n }\n const tableConfig: TableConfig = {\n borderColor: '#e3e5eb',\n\n bodyFontSize: 12,\n bodyFontColor: '#141414',\n bodyBackgroundColor: 'transparent',\n\n headerFontSize: 12,\n headerFontColor: '#21252c',\n headerBackgroundColor: '#f6f7f9',\n\n hoverBodyBackgroundColor: '#bedaff',\n hoverBodyInlineBackgroundColor: '#bedaff33',\n hoverHeaderBackgroundColor: '#D9DDE4',\n hoverHeaderInlineBackgroundColor: '#D9DDE455',\n\n selectedBorderColor: '#4080ff',\n selectedBackgroundColor: '#bedaff33',\n\n backgroundColor: 'transparent',\n }\n\n return {\n config: {\n // table\n table: tableConfig,\n pivotTable: tableConfig,\n // cartesian\n line: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine,\n },\n column: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnParallel: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnPercent: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n bar: {\n ...baseConfig,\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barParallel: {\n ...baseConfig,\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barPercent: {\n ...baseConfig,\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n area: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine,\n },\n areaPercent: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine,\n },\n scatter: {\n ...baseConfig,\n xAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n yAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n crosshairLine,\n },\n dualAxis: {\n ...baseConfig,\n xAxis: bandAxis,\n primaryYAxis: linearAxis,\n secondaryYAxis: { ...linearAxis, grid: { visible: false } },\n dualChartType: {\n primary: 'column',\n secondary: 'line',\n },\n crosshairRect,\n },\n // polar\n pie: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n donut: {\n ...baseConfig,\n },\n radar: {\n ...baseConfig,\n },\n rose: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n roseParallel: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n // other\n funnel: {\n ...baseConfig,\n },\n heatmap: {\n ...baseConfig,\n },\n },\n }\n}\n"],"names":["lightTheme","linearAxis","bandAxis","barBandAxis","undefined","crosshairLine","crosshairRect","baseConfig","tableConfig"],"mappings":"AAYO,MAAMA,aAAa;IACxB,MAAMC,aAA0B;QAC9B,MAAM;QACN,MAAM;QACN,SAAS;QACT,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;IACA,MAAMC,WAAsB;QAC1B,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;SAAI;QACxC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;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GA,UAAU;YACf;YACA,OAAO;gBACL,GAAGA,UAAU;YACf;YACA,MAAM;gBACJ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YACA,cAAc;gBACZ,GAAGA,UAAU;gBACb,OAAO;oBACL,GAAGA,WAAW,KAAK;oBACnB,kBAAkB;gBACpB;YACF;YAEA,QAAQ;gBACN,GAAGA,UAAU;YACf;YACA,SAAS;gBACP,GAAGA,UAAU;YACf;QACF;IACF;AACF"}
1
+ {"version":3,"file":"theme/light.js","sources":["webpack://@visactor/vseed/./src/theme/light.ts"],"sourcesContent":["import type {\n BackgroundColor,\n Color,\n CustomThemeConfig,\n Label,\n Legend,\n TableConfig,\n Tooltip,\n YBandAxis,\n YLinearAxis,\n} from 'src/types'\n\nexport const lightTheme = (): CustomThemeConfig => {\n const linearAxis: YLinearAxis = {\n nice: true,\n zero: true,\n inverse: false,\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#797B85',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#646A73',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: true,\n gridColor: '#36415926',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#3641594d',\n },\n line: {\n visible: false,\n lineColor: '#3641594d',\n lineWidth: 1,\n },\n }\n const bandAxis: YBandAxis = {\n labelAutoHide: true,\n labelAutoHideGap: 4,\n labelAutoLimit: true,\n labelAutoLimitLength: 80,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n label: {\n visible: true,\n labelAngle: 0,\n labelColor: '#797B85',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n title: {\n visible: false,\n titleText: '',\n titleColor: '#646A73',\n titleFontSize: 12,\n titleFontWeight: 400,\n },\n grid: {\n visible: false,\n gridColor: '#36415926',\n gridWidth: 0.5,\n },\n tick: {\n visible: false,\n tickInside: false,\n tickSize: 4,\n tickColor: '#3641594d',\n },\n line: {\n visible: true,\n lineColor: '#3641594d',\n lineWidth: 1,\n },\n }\n const barBandAxis: YBandAxis = {\n ...bandAxis,\n labelAutoHide: false,\n labelAutoHideGap: 1,\n labelAutoLimit: false,\n labelAutoLimitLength: undefined,\n labelAutoRotate: false,\n labelAutoRotateAngleRange: [0, -45, -90],\n }\n\n const crosshairLine = {\n visible: true,\n labelVisible: true,\n lineColor: '#3641594d',\n labelColor: '#ffffff',\n labelBackgroundColor: '#364159',\n }\n const crosshairRect = {\n visible: true,\n labelVisible: true,\n rectColor: '#3641594d',\n labelColor: '#ffffff',\n labelBackgroundColor: '#364159',\n }\n\n const baseConfig: {\n backgroundColor?: BackgroundColor\n color?: Color\n label?: Label\n tooltip?: Tooltip\n legend?: Legend\n } = {\n backgroundColor: 'transparent',\n color: {\n linearColorScheme: ['#C2CEFF', '#5766EC'],\n colorScheme: [\n '#8D72F6',\n '#5766EC',\n '#66A3FE',\n '#51D5E6',\n '#4EC0B3',\n '#F9DF90',\n '#F9AD71',\n '#ED8888',\n '#E9A0C3',\n '#D77DD3',\n ],\n },\n label: {\n enable: true,\n wrap: true,\n showValue: true,\n showValuePercent: false,\n labelColorSmartInvert: false,\n labelOverlap: true,\n },\n tooltip: {\n enable: true,\n },\n legend: {\n enable: true,\n border: true,\n maxSize: 1,\n shapeType: 'rectRound',\n position: 'rt',\n labelColor: '#646A73',\n labelFontSize: 12,\n labelFontWeight: 400,\n },\n }\n const tableConfig: TableConfig = {\n borderColor: '#e3e5eb',\n\n bodyFontSize: 12,\n bodyFontColor: '#141414',\n bodyBackgroundColor: 'transparent',\n\n headerFontSize: 12,\n headerFontColor: '#21252c',\n headerBackgroundColor: '#f6f7f9',\n\n hoverBodyBackgroundColor: '#bedaff',\n hoverBodyInlineBackgroundColor: '#bedaff33',\n hoverHeaderBackgroundColor: '#D9DDE4',\n hoverHeaderInlineBackgroundColor: '#D9DDE455',\n\n selectedBorderColor: '#4080ff',\n selectedBackgroundColor: '#bedaff33',\n\n backgroundColor: 'transparent',\n }\n\n return {\n config: {\n // table\n table: tableConfig,\n pivotTable: tableConfig,\n // cartesian\n line: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine,\n },\n column: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnParallel: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n columnPercent: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: {\n ...linearAxis,\n numFormat: {\n type: 'percent',\n },\n },\n crosshairRect,\n stackCornerRadius: [4, 4, 0, 0],\n },\n bar: {\n ...baseConfig,\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barParallel: {\n ...baseConfig,\n xAxis: linearAxis,\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n barPercent: {\n ...baseConfig,\n xAxis: {\n ...linearAxis,\n numFormat: {\n type: 'percent',\n },\n },\n yAxis: barBandAxis,\n crosshairRect,\n stackCornerRadius: [0, 4, 4, 0],\n },\n area: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: linearAxis,\n crosshairLine,\n },\n areaPercent: {\n ...baseConfig,\n xAxis: bandAxis,\n yAxis: {\n ...linearAxis,\n numFormat: {\n type: 'percent',\n },\n },\n crosshairLine,\n },\n scatter: {\n ...baseConfig,\n xAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n yAxis: {\n ...linearAxis,\n line: {\n ...linearAxis.line,\n visible: true,\n },\n },\n crosshairLine,\n },\n dualAxis: {\n ...baseConfig,\n xAxis: bandAxis,\n primaryYAxis: linearAxis,\n secondaryYAxis: { ...linearAxis, grid: { visible: false } },\n dualChartType: {\n primary: 'column',\n secondary: 'line',\n },\n crosshairRect,\n },\n // polar\n pie: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n donut: {\n ...baseConfig,\n },\n radar: {\n ...baseConfig,\n },\n rose: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n roseParallel: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n showValuePercent: true,\n },\n },\n // other\n funnel: {\n ...baseConfig,\n },\n heatmap: {\n ...baseConfig,\n label: {\n ...baseConfig.label,\n labelColorSmartInvert: true,\n },\n },\n },\n }\n}\n"],"names":["lightTheme","linearAxis","bandAxis","barBandAxis","undefined","crosshairLine","crosshairRect","baseConfig","tableConfig"],"mappings":"AAYO,MAAMA,aAAa;IACxB,MAAMC,aAA0B;QAC9B,MAAM;QACN,MAAM;QACN,SAAS;QACT,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,YAAY;YACZ,UAAU;YACV,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;IACF;IACA,MAAMC,WAAsB;QAC1B,eAAe;QACf,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,iBAAiB;QACjB,2BAA2B;YAAC;YAAG;YAAK;SAAI;QACxC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,OAAO;YACL,SAAS;YACT,WAAW;YACX,YAAY;YACZ,eAAe;YACf,iBAAiB;QACnB;QACA,MAAM;YACJ,SAAS;YACT,WAAW;YACX,WAAW;QACb;QACA,MAAM;YACJ,SAAS;YAC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