@visactor/vseed 0.2.0 → 0.2.1

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 (451) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/advanced/colorItems.js.map +1 -1
  4. package/dist/esm/builder/builder/build.js.map +1 -1
  5. package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
  6. package/dist/esm/builder/builder/buildSpec.js.map +1 -1
  7. package/dist/esm/builder/builder/builder.d.ts +12 -0
  8. package/dist/esm/builder/builder/builder.js.map +1 -1
  9. package/dist/esm/builder/register/all.js.map +1 -1
  10. package/dist/esm/builder/register/chartType/area.js.map +1 -1
  11. package/dist/esm/builder/register/chartType/areaPercent.js.map +1 -1
  12. package/dist/esm/builder/register/chartType/bar.js.map +1 -1
  13. package/dist/esm/builder/register/chartType/barParallel.js.map +1 -1
  14. package/dist/esm/builder/register/chartType/barPercent.js.map +1 -1
  15. package/dist/esm/builder/register/chartType/boxplot.js.map +1 -1
  16. package/dist/esm/builder/register/chartType/column.js.map +1 -1
  17. package/dist/esm/builder/register/chartType/columnParallel.js.map +1 -1
  18. package/dist/esm/builder/register/chartType/columnPercent.js.map +1 -1
  19. package/dist/esm/builder/register/chartType/donut.js.map +1 -1
  20. package/dist/esm/builder/register/chartType/dualAxis.js.map +1 -1
  21. package/dist/esm/builder/register/chartType/funnel.js.map +1 -1
  22. package/dist/esm/builder/register/chartType/heatmap.js.map +1 -1
  23. package/dist/esm/builder/register/chartType/histogram.js.map +1 -1
  24. package/dist/esm/builder/register/chartType/line.js.map +1 -1
  25. package/dist/esm/builder/register/chartType/pie.js.map +1 -1
  26. package/dist/esm/builder/register/chartType/pivotTable.js.map +1 -1
  27. package/dist/esm/builder/register/chartType/radar.js.map +1 -1
  28. package/dist/esm/builder/register/chartType/rose.js.map +1 -1
  29. package/dist/esm/builder/register/chartType/roseParallel.js.map +1 -1
  30. package/dist/esm/builder/register/chartType/scatter.js.map +1 -1
  31. package/dist/esm/builder/register/chartType/table.js.map +1 -1
  32. package/dist/esm/builder/register/custom.js.map +1 -1
  33. package/dist/esm/builder/register/theme/custom.js.map +1 -1
  34. package/dist/esm/builder/register/theme/dark.js.map +1 -1
  35. package/dist/esm/builder/register/theme/light.js.map +1 -1
  36. package/dist/esm/dataReshape/constant.js.map +1 -1
  37. package/dist/esm/dataReshape/dataReshapeByEncoding.js.map +1 -1
  38. package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
  39. package/dist/esm/dataReshape/unfoldDimensions.js.map +1 -1
  40. package/dist/esm/dataSelector/selector.js.map +1 -1
  41. package/dist/esm/i18n/i18n.js.map +1 -1
  42. package/dist/esm/i18n/i18nData.js +9 -9
  43. package/dist/esm/i18n/i18nData.js.map +1 -1
  44. package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
  45. package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
  46. package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
  47. package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
  48. package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
  49. package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -1
  50. package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
  51. package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
  52. package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
  53. package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
  54. package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
  55. package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
  56. package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
  57. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -1
  58. package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
  59. package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
  60. package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
  61. package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
  62. package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
  63. package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
  64. package/dist/esm/pipeline/advanced/chart/pipes/analysis/common.js.map +1 -1
  65. package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortLegend.js.map +1 -1
  66. package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortXBand.js.map +1 -1
  67. package/dist/esm/pipeline/advanced/chart/pipes/analysis/sortYBand.js.map +1 -1
  68. package/dist/esm/pipeline/advanced/chart/pipes/annotation/annotation.js.map +1 -1
  69. package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js +2 -0
  70. package/dist/esm/pipeline/advanced/chart/pipes/config/boxplot.js.map +1 -1
  71. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
  72. package/dist/esm/pipeline/advanced/chart/pipes/config/dualAxis.js.map +1 -1
  73. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
  74. package/dist/esm/pipeline/advanced/chart/pipes/config/index.js.map +1 -1
  75. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
  76. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
  77. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
  78. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultDimensions.js.map +1 -1
  79. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasureId.js.map +1 -1
  80. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js +2 -2
  81. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js.map +1 -1
  82. package/dist/esm/pipeline/advanced/chart/pipes/dimensions/pickDimensionsForReshape.js.map +1 -1
  83. package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/encodingAdapter.js.map +1 -1
  84. package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
  85. package/dist/esm/pipeline/advanced/chart/pipes/encoding/boxplot.js.map +1 -1
  86. package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js.map +1 -1
  87. package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
  88. package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
  89. package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
  90. package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
  91. package/dist/esm/pipeline/advanced/chart/pipes/encoding/histogram.js.map +1 -1
  92. package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
  93. package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
  94. package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
  95. package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
  96. package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
  97. package/dist/esm/pipeline/advanced/chart/pipes/init/initAdvancedVSeed.js.map +1 -1
  98. package/dist/esm/pipeline/advanced/chart/pipes/markStyle/markStyle.js.map +1 -1
  99. package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasures.js +3 -0
  100. package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasures.js.map +1 -1
  101. package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForDualAxis.js.map +1 -1
  102. package/dist/esm/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.js.map +1 -1
  103. package/dist/esm/pipeline/advanced/chart/pipes/measures/pickMeasuresForReshape.js.map +1 -1
  104. package/dist/esm/pipeline/advanced/chart/pipes/measures/utils.js.map +1 -1
  105. package/dist/esm/pipeline/advanced/chart/pipes/pivot/pivotAdapter.js.map +1 -1
  106. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
  107. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
  108. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
  109. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
  110. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
  111. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
  112. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -1
  113. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
  114. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
  115. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
  116. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
  117. package/dist/esm/pipeline/advanced/chart/pipes/theme/theme.js.map +1 -1
  118. package/dist/esm/pipeline/advanced/table/pipeline/pivotTable.js.map +1 -1
  119. package/dist/esm/pipeline/advanced/table/pipeline/table.js.map +1 -1
  120. package/dist/esm/pipeline/advanced/table/pipes/cellStyle/cellStyle.js.map +1 -1
  121. package/dist/esm/pipeline/advanced/table/pipes/config/pivotTableConfig.js.map +1 -1
  122. package/dist/esm/pipeline/advanced/table/pipes/config/tableConfig.js.map +1 -1
  123. package/dist/esm/pipeline/advanced/table/pipes/default/defaultDimensions.js.map +1 -1
  124. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureId.js.map +1 -1
  125. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
  126. package/dist/esm/pipeline/advanced/table/pipes/encoding/pivotTable.js.map +1 -1
  127. package/dist/esm/pipeline/advanced/table/pipes/init/initAdvancedVSeed.js.map +1 -1
  128. package/dist/esm/pipeline/advanced/table/pipes/records/records.js.map +1 -1
  129. package/dist/esm/pipeline/advanced/table/pipes/reshape/reshapePivotTable.js.map +1 -1
  130. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  131. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  132. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  133. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  134. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  135. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +5 -1
  136. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
  137. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  138. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  139. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  140. package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
  141. package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
  142. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
  143. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
  144. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
  145. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  146. package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
  147. package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
  148. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  149. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  150. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  151. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js.map +1 -1
  152. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
  153. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
  154. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
  155. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
  156. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
  157. package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -1
  158. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
  159. package/dist/esm/pipeline/spec/chart/pipes/axes/format/linearFormat.js.map +1 -1
  160. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js.map +1 -1
  161. package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.js.map +1 -1
  162. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
  163. package/dist/esm/pipeline/spec/chart/pipes/axes/title/defaultTitleText.js.map +1 -1
  164. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
  165. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
  166. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
  167. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
  168. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
  169. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
  170. package/dist/esm/pipeline/spec/chart/pipes/backgroundColor/background.js.map +1 -1
  171. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barGapInGroup.js.map +1 -1
  172. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barMaxWidth.js.map +1 -1
  173. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxGapInGroup.d.ts +2 -0
  174. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxGapInGroup.js +14 -0
  175. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxGapInGroup.js.map +1 -0
  176. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxMaxWidth.d.ts +2 -0
  177. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxMaxWidth.js +14 -0
  178. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/boxMaxWidth.js.map +1 -0
  179. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/index.d.ts +2 -0
  180. package/dist/esm/pipeline/spec/chart/pipes/boxWidth/index.js +2 -0
  181. package/dist/esm/pipeline/spec/chart/pipes/color/color.js.map +1 -1
  182. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
  183. package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.js.map +1 -1
  184. package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.js.map +1 -1
  185. package/dist/esm/pipeline/spec/chart/pipes/color/colorBoxPlotStyleFill.js.map +1 -1
  186. package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +1 -1
  187. package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js.map +1 -1
  188. package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.js.map +1 -1
  189. package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.js.map +1 -1
  190. package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.js.map +1 -1
  191. package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.js.map +1 -1
  192. package/dist/esm/pipeline/spec/chart/pipes/color/linearColor.js.map +1 -1
  193. package/dist/esm/pipeline/spec/chart/pipes/color/linearColorForDualAxis.js.map +1 -1
  194. package/dist/esm/pipeline/spec/chart/pipes/crosshair/histogramCrosshair.js.map +1 -1
  195. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.js.map +1 -1
  196. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.js.map +1 -1
  197. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.js.map +1 -1
  198. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.js.map +1 -1
  199. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js.map +1 -1
  200. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetDualAxis.js.map +1 -1
  201. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js.map +1 -1
  202. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.js.map +1 -1
  203. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetScatter.js.map +1 -1
  204. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetXY.js.map +1 -1
  205. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetYX.js.map +1 -1
  206. package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js.map +1 -1
  207. package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
  208. package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
  209. package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
  210. package/dist/esm/pipeline/spec/chart/pipes/init/area.js.map +1 -1
  211. package/dist/esm/pipeline/spec/chart/pipes/init/bar.js.map +1 -1
  212. package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
  213. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
  214. package/dist/esm/pipeline/spec/chart/pipes/init/column.js.map +1 -1
  215. package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
  216. package/dist/esm/pipeline/spec/chart/pipes/init/donut.js.map +1 -1
  217. package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.js.map +1 -1
  218. package/dist/esm/pipeline/spec/chart/pipes/init/funnel.js.map +1 -1
  219. package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js.map +1 -1
  220. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js.map +1 -1
  221. package/dist/esm/pipeline/spec/chart/pipes/init/line.js.map +1 -1
  222. package/dist/esm/pipeline/spec/chart/pipes/init/pie.js.map +1 -1
  223. package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
  224. package/dist/esm/pipeline/spec/chart/pipes/init/radar.js.map +1 -1
  225. package/dist/esm/pipeline/spec/chart/pipes/init/rose.js.map +1 -1
  226. package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
  227. package/dist/esm/pipeline/spec/chart/pipes/init/scatter.js.map +1 -1
  228. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  229. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
  230. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
  231. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
  232. package/dist/esm/pipeline/spec/chart/pipes/legend/boxLegend.js.map +1 -1
  233. package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
  234. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
  235. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js.map +1 -1
  236. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
  237. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
  238. package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.js.map +1 -1
  239. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js.map +1 -1
  240. package/dist/esm/pipeline/spec/chart/pipes/markStyle/boxPlotStyle.js.map +1 -1
  241. package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
  242. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/curve.js.map +1 -1
  243. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.js.map +1 -1
  244. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js.map +1 -1
  245. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js.map +1 -1
  246. package/dist/esm/pipeline/spec/chart/pipes/markStyle/outlierStyle.js.map +1 -1
  247. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pieStyle.js.map +1 -1
  248. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
  249. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.js.map +1 -1
  250. package/dist/esm/pipeline/spec/chart/pipes/markStyle/roseStyle.js.map +1 -1
  251. package/dist/esm/pipeline/spec/chart/pipes/percent/percent.js.map +1 -1
  252. package/dist/esm/pipeline/spec/chart/pipes/pipeFilter/areaStyleFilter.js.map +1 -1
  253. package/dist/esm/pipeline/spec/chart/pipes/pipeFilter/barStyleFilter.js.map +1 -1
  254. package/dist/esm/pipeline/spec/chart/pipes/pipeFilter/lineStyleFilter.js.map +1 -1
  255. package/dist/esm/pipeline/spec/chart/pipes/pipeFilter/pointStyleFilter.js.map +1 -1
  256. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/dimensionLinkage.js.map +1 -1
  257. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.js.map +1 -1
  258. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -1
  259. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
  260. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
  261. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js +7 -3
  262. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js.map +1 -1
  263. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
  264. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
  265. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -1
  266. package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js.map +1 -1
  267. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js +3 -1
  268. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -1
  269. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/common.js.map +1 -1
  270. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
  271. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -1
  272. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +1 -1
  273. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +7 -6
  274. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -1
  275. package/dist/esm/pipeline/spec/chart/pipes/series/series.js.map +1 -1
  276. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js.map +1 -1
  277. package/dist/esm/pipeline/spec/chart/pipes/stack/stack.js.map +1 -1
  278. package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js.map +1 -1
  279. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
  280. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
  281. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
  282. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
  283. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
  284. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
  285. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.js.map +1 -1
  286. package/dist/esm/pipeline/spec/chart/utils/histogram.js.map +1 -1
  287. package/dist/esm/pipeline/spec/table/pipeline/pivotTable.js.map +1 -1
  288. package/dist/esm/pipeline/spec/table/pipeline/table.js.map +1 -1
  289. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js.map +1 -1
  290. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js.map +1 -1
  291. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js.map +1 -1
  292. package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js.map +1 -1
  293. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
  294. package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js.map +1 -1
  295. package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.js.map +1 -1
  296. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
  297. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
  298. package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.js.map +1 -1
  299. package/dist/esm/pipeline/spec/table/pipes/init/table.js.map +1 -1
  300. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js.map +1 -1
  301. package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js.map +1 -1
  302. package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.js.map +1 -1
  303. package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.js.map +1 -1
  304. package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.js.map +1 -1
  305. package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.js.map +1 -1
  306. package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.js.map +1 -1
  307. package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.js.map +1 -1
  308. package/dist/esm/pipeline/utils/chatType.js.map +1 -1
  309. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  310. package/dist/esm/pipeline/utils/dimensions/delete.js.map +1 -1
  311. package/dist/esm/pipeline/utils/dimensions/typeGuard.js.map +1 -1
  312. package/dist/esm/pipeline/utils/format/createFormatter.js.map +1 -1
  313. package/dist/esm/pipeline/utils/format/createFormatterByMeasure.js.map +1 -1
  314. package/dist/esm/pipeline/utils/format/createNumFormatter.js +1 -1
  315. package/dist/esm/pipeline/utils/format/createNumFormatter.js.map +1 -1
  316. package/dist/esm/pipeline/utils/measures/delete.js.map +1 -1
  317. package/dist/esm/pipeline/utils/measures/depth.js.map +1 -1
  318. package/dist/esm/pipeline/utils/measures/find.js.map +1 -1
  319. package/dist/esm/pipeline/utils/measures/typeGuard.js.map +1 -1
  320. package/dist/esm/pipeline/utils/pipeline.js.map +1 -1
  321. package/dist/esm/pipeline/utils/replaceNullToUndefined.js.map +1 -1
  322. package/dist/esm/pipeline/utils/tree/traverse.js.map +1 -1
  323. package/dist/esm/pipeline/utils/valid/checkVSeed.js.map +1 -1
  324. package/dist/esm/theme/common/annotaion.js.map +1 -1
  325. package/dist/esm/theme/common/axes.js.map +1 -1
  326. package/dist/esm/theme/common/boxPlot.js.map +1 -1
  327. package/dist/esm/theme/common/color.js.map +1 -1
  328. package/dist/esm/theme/common/crosshair.js.map +1 -1
  329. package/dist/esm/theme/common/funnelTransform.js.map +1 -1
  330. package/dist/esm/theme/common/heatmapCell.js.map +1 -1
  331. package/dist/esm/theme/common/label.js.map +1 -1
  332. package/dist/esm/theme/common/legend.js.map +1 -1
  333. package/dist/esm/theme/common/regressionLine.js.map +1 -1
  334. package/dist/esm/theme/common/table.js.map +1 -1
  335. package/dist/esm/theme/common/tooltip.js.map +1 -1
  336. package/dist/esm/theme/dark/dark.js.map +1 -1
  337. package/dist/esm/theme/light/light.js.map +1 -1
  338. package/dist/esm/types/advancedVSeed.d.ts +4 -0
  339. package/dist/esm/types/advancedVSeed.js.map +1 -1
  340. package/dist/esm/types/builder/builder.js.map +1 -1
  341. package/dist/esm/types/chartType/area/zArea.js.map +1 -1
  342. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
  343. package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
  344. package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
  345. package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
  346. package/dist/esm/types/chartType/boxplot/boxplot.d.ts +8 -0
  347. package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +2 -0
  348. package/dist/esm/types/chartType/boxplot/zBoxplot.js +4 -2
  349. package/dist/esm/types/chartType/boxplot/zBoxplot.js.map +1 -1
  350. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  351. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
  352. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
  353. package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
  354. package/dist/esm/types/chartType/dualAxis/zDualAxis.js.map +1 -1
  355. package/dist/esm/types/chartType/funnel/zFunnel.js.map +1 -1
  356. package/dist/esm/types/chartType/heatmap/zHeatmap.js.map +1 -1
  357. package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
  358. package/dist/esm/types/chartType/line/zLine.js.map +1 -1
  359. package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
  360. package/dist/esm/types/chartType/pivotTable/zPivotTable.js.map +1 -1
  361. package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
  362. package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
  363. package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
  364. package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
  365. package/dist/esm/types/chartType/table/zTable.js.map +1 -1
  366. package/dist/esm/types/dataSelector/selector.js.map +1 -1
  367. package/dist/esm/types/i18n/i18n.js.map +1 -1
  368. package/dist/esm/types/properties/analysis/analysis.js.map +1 -1
  369. package/dist/esm/types/properties/analysis/sort.js.map +1 -1
  370. package/dist/esm/types/properties/analysis/sortLegend.js.map +1 -1
  371. package/dist/esm/types/properties/annotation/annotation.js.map +1 -1
  372. package/dist/esm/types/properties/annotation/zAnnotationArea.js.map +1 -1
  373. package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js.map +1 -1
  374. package/dist/esm/types/properties/annotation/zAnnotationPoint.js.map +1 -1
  375. package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js.map +1 -1
  376. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js.map +1 -1
  377. package/dist/esm/types/properties/cellStyle/cellStyle.js.map +1 -1
  378. package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
  379. package/dist/esm/types/properties/chartType/dualChartType.js.map +1 -1
  380. package/dist/esm/types/properties/config/annotation/zAnnotaion.js.map +1 -1
  381. package/dist/esm/types/properties/config/area.js.map +1 -1
  382. package/dist/esm/types/properties/config/axes/zBandAxis.js.map +1 -1
  383. package/dist/esm/types/properties/config/axes/zLinearAxis.js.map +1 -1
  384. package/dist/esm/types/properties/config/backgroundColor/backgroundColor.js.map +1 -1
  385. package/dist/esm/types/properties/config/bar.js.map +1 -1
  386. package/dist/esm/types/properties/config/barWidth/index.js.map +1 -1
  387. package/dist/esm/types/properties/config/boxWidth/boxWidth.d.ts +8 -0
  388. package/dist/esm/types/properties/config/boxWidth/boxWidth.js +0 -0
  389. package/dist/esm/types/properties/config/boxWidth/index.d.ts +2 -0
  390. package/dist/esm/types/properties/config/boxWidth/index.js +1 -0
  391. package/dist/esm/types/properties/config/boxWidth/zBoxWidth.d.ts +3 -0
  392. package/dist/esm/types/properties/config/boxWidth/zBoxWidth.js +6 -0
  393. package/dist/esm/types/properties/config/boxWidth/zBoxWidth.js.map +1 -0
  394. package/dist/esm/types/properties/config/boxplot.d.ts +2 -0
  395. package/dist/esm/types/properties/config/boxplot.js +4 -1
  396. package/dist/esm/types/properties/config/boxplot.js.map +1 -1
  397. package/dist/esm/types/properties/config/color/color.js.map +1 -1
  398. package/dist/esm/types/properties/config/column.js.map +1 -1
  399. package/dist/esm/types/properties/config/config.d.ts +2 -0
  400. package/dist/esm/types/properties/config/config.js.map +1 -1
  401. package/dist/esm/types/properties/config/crosshair/zCrosshair.js.map +1 -1
  402. package/dist/esm/types/properties/config/dimensionLinkage/dimensionLinkage.js.map +1 -1
  403. package/dist/esm/types/properties/config/dualAxis.js.map +1 -1
  404. package/dist/esm/types/properties/config/funnel.js.map +1 -1
  405. package/dist/esm/types/properties/config/funnelTransform/zFunnelTransform.js.map +1 -1
  406. package/dist/esm/types/properties/config/heatmap/zHeatmap.js.map +1 -1
  407. package/dist/esm/types/properties/config/heatmap.js.map +1 -1
  408. package/dist/esm/types/properties/config/histogram.js.map +1 -1
  409. package/dist/esm/types/properties/config/index.d.ts +1 -0
  410. package/dist/esm/types/properties/config/index.js +1 -0
  411. package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
  412. package/dist/esm/types/properties/config/label/zPieLabel.js.map +1 -1
  413. package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
  414. package/dist/esm/types/properties/config/line.js.map +1 -1
  415. package/dist/esm/types/properties/config/pie.js.map +1 -1
  416. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
  417. package/dist/esm/types/properties/config/pivotTable.js.map +1 -1
  418. package/dist/esm/types/properties/config/rose.js.map +1 -1
  419. package/dist/esm/types/properties/config/scatter.js.map +1 -1
  420. package/dist/esm/types/properties/config/stackCornerRadius/stackCornerRadius.js.map +1 -1
  421. package/dist/esm/types/properties/config/table.js.map +1 -1
  422. package/dist/esm/types/properties/config/tooltip/tooltip.js.map +1 -1
  423. package/dist/esm/types/properties/config/whiskers/index.js.map +1 -1
  424. package/dist/esm/types/properties/dataset/dataset.js.map +1 -1
  425. package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js.map +1 -1
  426. package/dist/esm/types/properties/dimensions/zDimensions.js.map +1 -1
  427. package/dist/esm/types/properties/encoding/zDimensionEncoding.js.map +1 -1
  428. package/dist/esm/types/properties/encoding/zEncoding.js +1 -1
  429. package/dist/esm/types/properties/encoding/zEncoding.js.map +1 -1
  430. package/dist/esm/types/properties/encoding/zMeasureEncoding.js.map +1 -1
  431. package/dist/esm/types/properties/format/numFormat.js.map +1 -1
  432. package/dist/esm/types/properties/markStyle/barStyle.js.map +1 -1
  433. package/dist/esm/types/properties/markStyle/boxPlotStyle.js.map +1 -1
  434. package/dist/esm/types/properties/markStyle/lineStyle.js.map +1 -1
  435. package/dist/esm/types/properties/markStyle/markStyle.js.map +1 -1
  436. package/dist/esm/types/properties/markStyle/outlierStyle.js.map +1 -1
  437. package/dist/esm/types/properties/markStyle/pointStyle.js.map +1 -1
  438. package/dist/esm/types/properties/markStyle/zAreaStyle.js.map +1 -1
  439. package/dist/esm/types/properties/measures/zDualMeasures.js.map +1 -1
  440. package/dist/esm/types/properties/measures/zMeasures.js.map +1 -1
  441. package/dist/esm/types/properties/measures/zScatterMeasures.js.map +1 -1
  442. package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -1
  443. package/dist/esm/types/properties/theme/customTheme.d.ts +4 -0
  444. package/dist/esm/types/properties/theme/customTheme.js.map +1 -1
  445. package/dist/esm/types/properties/theme/theme.js.map +1 -1
  446. package/dist/esm/types/vseed.d.ts +1 -0
  447. package/dist/esm/types/zVseed.d.ts +2 -0
  448. package/dist/esm/types/zVseed.js.map +1 -1
  449. package/dist/umd/index.js +337 -293
  450. package/dist/umd/index.js.map +1 -1
  451. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n} from '../pipes'\n\nconst scatter: VChartSpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n]\n\nconst pivotScatter: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n pivotAxisStyle(yLinear),\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const scatterSpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","linearRegressionLine","lowessRegressionLine","polynomialRegressionLine","logisticRegressionLine","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","scatterSpecPipeline","pivotAdapter"],"mappings":";AA4CA,MAAMA,UAA8B;IAClCC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAAuC;IAC3CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACA0B,eAAezB;QACfC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACAnC,aAAaoC,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,sBAAsB;IAACC,aAAa1C,SAAS4B;CAAc"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/scatter.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/scatter.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n yLinear,\n backgroundColor,\n tooltipScatter,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n pointStyle,\n verticalCrosshairLine,\n xLinear,\n horizontalCrosshairLine,\n pointStateHover,\n initScatter,\n progressive,\n datasetScatter,\n linearColor,\n colorAdapter,\n colorPointStyleFill,\n colorLegend,\n pivotColorLegend,\n labelScatter,\n scatterSize,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n} from '../pipes'\n\nconst scatter: VChartSpecPipeline = [\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n yLinear,\n scatterSize,\n labelScatter,\n tooltipScatter,\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n]\n\nconst pivotScatter: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n initScatter,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetScatter,\n progressive,\n xLinear,\n pivotAxisStyle(yLinear),\n scatterSize,\n labelScatter,\n tooltipScatter,\n verticalCrosshairLine,\n horizontalCrosshairLine,\n colorPointStyleFill(pointStyle),\n pointStateHover,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationArea,\n linearRegressionLine,\n lowessRegressionLine,\n polynomialRegressionLine,\n logisticRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const scatterSpecPipeline = [pivotAdapter(scatter, pivotScatter)]\n"],"names":["scatter","initScatter","colorAdapter","color","linearColor","backgroundColor","datasetScatter","progressive","xLinear","yLinear","scatterSize","labelScatter","tooltipScatter","discreteLegend","colorLegend","verticalCrosshairLine","horizontalCrosshairLine","colorPointStyleFill","pointStyle","pointStateHover","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationArea","linearRegressionLine","lowessRegressionLine","polynomialRegressionLine","logisticRegressionLine","pivotScatter","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","scatterSpecPipeline","pivotAdapter"],"mappings":";AA4CA,MAAMA,UAA8B;IAClCC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAV,aAAaW,gBAAgBC;IAC7BC;IACAC;IACAC,oBAAoBC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,eAAuC;IAC3CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACA0B,eAAezB;QACfC;QACAC;QACAC;QACAG;QACAC;QACAC,oBAAoBC;QACpBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACAnC,aAAaoC,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,sBAAsB;IAACC,aAAa1C,SAAS4B;CAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationArea.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationArea.ts"],"sourcesContent":["/**\n * @description 适用于线图、面积图等的区块标注,计算标注区块的时候,只考虑点的大小\n */\nimport type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { ANNOTATION_AREA_TEXT_STYLE_BY_POSITION, isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationArea: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultTextPosition = isBarLikeChart(advancedVSeed as VSeed) ? 'right' : 'top'\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const textPosition: string = annotationArea.textPosition ?? defaultTextPosition\n const textAlign =\n annotationArea.textAlign ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textAlign\n const textBaseline =\n annotationArea.textBaseline ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textBaseline\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const regionRect = context.getRegion().getLayoutRect()\n\n const minX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const maxX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n const minY = 0\n const maxY = regionRect.height\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const regionRect = context.getRegion().getLayoutRect()\n\n const minY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const maxY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const minX = 0\n const maxX = regionRect.width\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: (positionMap as any)[textPosition],\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationArea","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationAreaList","Array","positionMap","defaultTextPosition","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","dataset","selectedData","datum","selector","textPosition","textAlign","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION","textBaseline","ANNOTATION_Z_INDEX","data","positionData","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BACL;wBAEA;4BACE,GAAGJ;4BACH,GAAGI;wBACL;qBACD;gBACH;gBAEA,IAAI,AAAqC,cAArC,OAAOP,aAAa,cAA6B;oBACnD,MAAME,aAAa9C,QAAQ,SAAS,GAAG,aAAa;oBAEpD,MAAMkD,OAAOF,KAAK,GAAG,IAAIL,OAAO,GAAG,CAAC,CAACF,OAASA,KAAK,CAAC,KAAMZ,CAAAA,gBAAgB;oBAC1E,MAAMsB,OAAOH,KAAK,GAAG,IAAIL,OAAO,GAAG,CAAC,CAACF,OAASA,KAAK,CAAC,KAAMZ,CAAAA,gBAAgB;oBAC1E,MAAMkB,OAAO;oBACb,MAAME,OAAOH,WAAW,KAAK;oBAE7B,OAAO;wBAEL;4BACE,GAAGC;4BACH,GAAGG;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGC;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGE;wBACL;wBAEA;4BACE,GAAGJ;4BACH,GAAGI;wBACL;qBACD;gBACH;gBAEA,OAAO,EAAE;YACX;YACA,OAAO;gBACL,UAAW3C,WAAmB,CAAC0B,aAAa;gBAC5C,SAAS;gBACT,MAAMrB;gBACN,OAAO;oBACL,SAAS;oBACT,WAAWsB;oBACX,cAAcE;oBACd,MAAMvB;oBACN,QAAQI;oBACR,WAAW;oBACX,UAAUH;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASC;oBACT,SAASK;oBACT,OAAO;wBACL,SAAS;wBACT,cAAcD,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG7B,IAAI;QACP,UAAUY;IACZ;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationArea.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationArea.ts"],"sourcesContent":["/**\n * @description 适用于线图、面积图等的区块标注,计算标注区块的时候,只考虑点的大小\n */\nimport type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { ANNOTATION_AREA_TEXT_STYLE_BY_POSITION, isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationArea: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultTextPosition = isBarLikeChart(advancedVSeed as VSeed) ? 'right' : 'top'\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const textPosition: string = annotationArea.textPosition ?? defaultTextPosition\n const textAlign =\n annotationArea.textAlign ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textAlign\n const textBaseline =\n annotationArea.textBaseline ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textBaseline\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n positions: (data: Datum[], context: ICartesianSeries) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const regionRect = context.getRegion().getLayoutRect()\n\n const minX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const maxX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n const minY = 0\n const maxY = regionRect.height\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const regionRect = context.getRegion().getLayoutRect()\n\n const minY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const maxY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const minX = 0\n const maxX = regionRect.width\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: (positionMap as any)[textPosition],\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationArea","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationAreaList","Array","positionMap","defaultTextPosition","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","dataset","selectedData","datum","selector","textPosition","textAlign","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION","textBaseline","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","yAxisHelper","xAxisHelper","regionRect","minX","Math","maxX","minY","maxY"],"mappings":";;;;AAUO,MAAMA,gCAAiC,CAACC,MAAMC;IACnD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,cAAc,EAAE,GAAGK;IAC3B,MAAMG,qBAAqBC,MAAM,OAAO,CAACT,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMU,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IACA,MAAMC,sBAAsBC,eAAeT,iBAA0B,UAAU;IAE/E,MAAMU,WAAWL,mBAAmB,OAAO,CAAC,CAACR;QAC3C,MAAM,EACJ,UAAUc,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAE7CY,wBAAwBZ,OAAO,yBAAyB,IAAI,EAC5Da,sBAAsBb,OAAO,uBAAuB,SAAS,EAC7Dc,4BAA4Bd,OAAO,6BAA6B,SAAS,EACzEe,4BAA4Bf,OAAO,6BAA6B,CAAC,EACjEgB,6BAA6BhB,OAAO,8BAA8B,CAAC,EACnEiB,wBAAwBjB,OAAO,yBAAyB,CAAC,EAEzDkB,YAAYlB,OAAO,aAAa,SAAS,EACzCmB,mBAAmBnB,OAAO,oBAAoB,IAAI,EAClDoB,kBAAkBpB,OAAO,mBAAmB,SAAS,EACrDqB,mBAAmBrB,OAAO,oBAAoB,CAAC,EA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
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import { type ICartesianSeries, type ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { ANNOTATION_AREA_TEXT_STYLE_BY_POSITION, isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultTextPosition = isBarLikeChart(advancedVSeed as VSeed) ? 'right' : 'top'\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultTextPosition\n const textAlign =\n annotationArea.textAlign ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textAlign\n const textBaseline =\n annotationArea.textBaseline ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textBaseline\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n // coordinates: selectedData,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const regionRect = context.getRegion().getLayoutRect()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = 0\n const maxY = regionRect.height\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const regionRect = context.getRegion().getLayoutRect()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n const minX = 0\n const maxX = regionRect.width\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultTextPosition","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","textAlign","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION","textBaseline","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","regionRect","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAET,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEI,cAAc,EAAE,GAAGH;IAC3B,MAAMI,qBAAqBC,MAAM,OAAO,CAACF,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMG,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IACA,MAAMC,sBAAsBC,eAAeV,iBAA0B,UAAU;IAE/E,MAAMW,WAAWL,mBAAmB,OAAO,CAAC,CAACD;QAC3C,MAAM,EACJ,UAAUO,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYV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,KAAK,GAAG,IAAIR,OAAO,GAAG,CAAC,CAACF,OAASA,KAAK,CAAC,KAAMZ,CAAAA,gBAAgB;oBAC1E,MAAMwB,QAAQQ,OAAOD,SAASD;oBAC9B,MAAMG,UAAWD,AAAAA,CAAAA,OAAOD,MAAK,IAAK,IAAID,aAAc,OAAMf,YAAW;oBAErE,MAAMa,OAAOK,UAAUT,QAAQ;oBAC/B,MAAMK,OAAOI,UAAUT,QAAQ;oBAC/B,MAAME,OAAO;oBACb,MAAMC,OAAOP,WAAW,KAAK;oBAE7B,OAAO;wBAEL;4BACE,GAAGM;4BACH,GAAGE;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGC;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGE;wBACL;wBAEA;4BACE,GAAGH;4BACH,GAAGG;wBACL;qBACD;gBACH;gBAEA,OAAO,EAAE;YACX;YACA,OAAO;gBACL,UAAUlD,WAAW,CAACsB,aAAyB;gBAC/C,SAAS;gBACT,MAAMjB;gBACN,OAAO;oBACL,SAAS;oBACT,WAAWkB;oBACX,cAAcE;oBACd,QAAQf;oBACR,WAAW;oBACX,MAAMJ;oBACN,UAAUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASC;oBACT,SAASK;oBACT,OAAO;wBACL,SAAS;wBACT,cAAcD,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG9B,IAAI;QACP,UAAUa;IACZ;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationAreaBand.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationAreaBand.ts"],"sourcesContent":["import { type ICartesianSeries, type ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { ANNOTATION_AREA_TEXT_STYLE_BY_POSITION, isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationAreaBand: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationArea) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationArea\n const { annotationArea } = annotation\n const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [annotationArea]\n\n const positionMap = {\n top: 'insideTop',\n topRight: 'insideTopRight',\n topLeft: 'insideTopLeft',\n bottom: 'insideBottom',\n bottomLeft: 'insideBottomLeft',\n bottomRight: 'insideBottomRight',\n left: 'insideLeft',\n right: 'insideRight',\n }\n const defaultTextPosition = isBarLikeChart(advancedVSeed as VSeed) ? 'right' : 'top'\n\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#191d24',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24',\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 4,\n\n areaColor = theme?.areaColor ?? '#888888',\n areaColorOpacity = theme?.areaColorOpacity ?? 0.15,\n areaBorderColor = theme?.areaBorderColor ?? '#888888',\n areaBorderRadius = theme?.areaBorderRadius ?? 4,\n areaBorderWidth = theme?.areaBorderWidth ?? 1,\n areaLineDash = theme?.areaLineDash,\n\n outerPadding = theme?.outerPadding ?? 4,\n } = annotationArea\n const textPosition: string = annotationArea.textPosition ?? defaultTextPosition\n const textAlign =\n annotationArea.textAlign ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textAlign\n const textBaseline =\n annotationArea.textBaseline ??\n ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition as keyof typeof ANNOTATION_AREA_TEXT_STYLE_BY_POSITION]\n .textBaseline\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n // coordinates: selectedData,\n positions: (data: Datum[], context: ICartesianSeries & { _scaleConfig?: { bandPosition?: number } }) => {\n const positionData = data.filter((item) => selectedData.some((datum) => isSubset(datum, item)))\n const xyList = positionData.map((datum) => context.dataToPosition(datum) as { x: number; y: number })\n\n const bandPosition = context?._scaleConfig?.bandPosition || 0\n\n const yAxisHelper = context.getYAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n const xAxisHelper = context.getXAxisHelper() as unknown as {\n getBandwidth: (depth?: number) => number\n getScale: () => {\n range: () => number[]\n }\n }\n\n if (typeof xAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldX.length ?? 0\n const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1)\n const regionRect = context.getRegion().getLayoutRect()\n const startX = Math.min(...xyList.map((item) => item.x)) - (outerPadding || 4)\n const endX = Math.max(...xyList.map((item) => item.x)) + (outerPadding || 4)\n\n const width = endX - startX + xBandWidth\n const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition)\n\n const minX = middleX - width / 2\n const maxX = middleX + width / 2\n\n const minY = 0\n const maxY = regionRect.height\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n if (typeof yAxisHelper?.getBandwidth === 'function') {\n const depth = context.fieldY.length ?? 0\n const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1)\n const regionRect = context.getRegion().getLayoutRect()\n\n const startY = Math.min(...xyList.map((item) => item.y)) - (outerPadding || 4)\n const endY = Math.max(...xyList.map((item) => item.y)) + (outerPadding || 4)\n const width = endY - startY + yBandWidth\n const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition)\n\n const minY = middleY - width / 2\n const maxY = middleY + width / 2\n const minX = 0\n const maxX = regionRect.width\n\n return [\n // 左上\n {\n x: minX,\n y: minY,\n },\n // 右上\n {\n x: maxX,\n y: minY,\n },\n // 右下\n {\n x: maxX,\n y: maxY,\n },\n // 左下\n {\n x: minX,\n y: maxY,\n },\n ]\n }\n\n return []\n },\n label: {\n position: positionMap[textPosition as 'bottom'],\n visible: true,\n text: text,\n style: {\n opacity: 0.95,\n textAlign: textAlign,\n textBaseline: textBaseline,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n area: {\n style: {\n visible: true,\n fill: areaColor,\n fillOpacity: areaColorOpacity,\n stroke: areaBorderColor,\n lineWidth: areaBorderWidth,\n cornerRadius: areaBorderRadius,\n lineDash: areaLineDash,\n },\n },\n }\n }) as ILineChartSpec['markArea']\n\n return {\n ...spec,\n markArea: markArea,\n }\n}\n"],"names":["annotationAreaBand","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationArea","annotationAreaList","Array","positionMap","defaultTextPosition","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","textAlign","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION","textBaseline","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","regionRect","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAAqC,CAACC,MAAMC;IACvD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,cAAc,EAC3C,OAAOJ;IAET,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEI,cAAc,EAAE,GAAGH;IAC3B,MAAMI,qBAAqBC,MAAM,OAAO,CAACF,kBAAkBA,iBAAiB;QAACA;KAAe;IAE5F,MAAMG,cAAc;QAClB,KAAK;QACL,UAAU;QACV,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,MAAM;QACN,OAAO;IACT;IACA,MAAMC,sBAAsBC,eAAeV,iBAA0B,UAAU;IAE/E,MAAMW,WAAWL,mBAAmB,OAAO,CAAC,CAACD;QAC3C,MAAM,EACJ,UAAUO,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYV,OAAO,aAAa,SAAS,EACzCW,eAAeX,OAAO,gBAAgB,EAAE,EACxCY,iBAAiBZ,OAAO,kBAAkB,GAAG,EAE7Ca,wBAAwBb,OAAO,yBAAyB,IAAI,EAC5Dc,sBAA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,AAAAA,CAAAA,OAAOD,MAAK,IAAK,IAAID,aAAc,OAAMf,YAAW;oBAErE,MAAMa,OAAOK,UAAUT,QAAQ;oBAC/B,MAAMK,OAAOI,UAAUT,QAAQ;oBAC/B,MAAME,OAAO;oBACb,MAAMC,OAAOP,WAAW,KAAK;oBAE7B,OAAO;wBAEL;4BACE,GAAGM;4BACH,GAAGE;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGC;wBACL;wBAEA;4BACE,GAAGD;4BACH,GAAGE;wBACL;wBAEA;4BACE,GAAGH;4BACH,GAAGG;wBACL;qBACD;gBACH;gBAEA,OAAO,EAAE;YACX;YACA,OAAO;gBACL,UAAUlD,WAAW,CAACsB,aAAyB;gBAC/C,SAAS;gBACT,MAAMjB;gBACN,OAAO;oBACL,SAAS;oBACT,WAAWkB;oBACX,cAAcE;oBACd,QAAQf;oBACR,WAAW;oBACX,MAAMJ;oBACN,UAAUC;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASC;oBACT,SAASK;oBACT,OAAO;wBACL,SAAS;wBACT,cAAcD,8BAA8B;wBAC5C,MAAMH;wBACN,QAAQC;wBACR,WAAWC;wBACX,aAAa;oBACf;gBACF;YACF;YACA,MAAM;gBACJ,OAAO;oBACL,SAAS;oBACT,MAAMG;oBACN,aAAaC;oBACb,QAAQC;oBACR,WAAWE;oBACX,cAAcD;oBACd,UAAUE;gBACZ;YACF;QACF;IACF;IAEA,OAAO;QACL,GAAG9B,IAAI;QACP,UAAUa;IACZ;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { VChartSpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationHorizontalLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationHorizontalLine\n const { annotationHorizontalLine } = annotation\n const annotationHorizontalLineList = Array.isArray(annotationHorizontalLine)\n ? annotationHorizontalLine\n : [annotationHorizontalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n\n const markLine = annotationHorizontalLineList.flatMap((annotationHorizontalLine) => {\n const {\n selector: selectorPoint,\n yValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'right',\n textBaseline = 'bottom',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationHorizontalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (y: string | number) => {\n return {\n y,\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: (positionMap as any)[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n visible: true,\n dy: 4,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dy: 4,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dx: 3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dx: -4,\n fill: lineColor,\n },\n },\n }\n }\n if ((!selectorPoint && isArray(yValue)) || isString(yValue) || isNumber(yValue)) {\n const yValueArr = Array.isArray(yValue) ? yValue : [yValue]\n return yValueArr.map(generateOneMarkLine)\n }\n\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return selectedData.map((datum) => {\n if (datum[unfoldInfo.encodingY]) {\n return generateOneMarkLine(datum[unfoldInfo.encodingY] as string)\n }\n if (datum[foldInfo.measureValue]) {\n return generateOneMarkLine(datum[foldInfo.measureValue] as string)\n }\n return {}\n })\n }) as IMarkLineSpec[]\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationHorizontalLine","spec","context","advancedVSeed","vseed","annotation","datasetReshapeInfo","config","foldInfo","unfoldInfo","theme","annotationHorizontalLineList","Array","positionMap","markLine","selectorPoint","yValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","dataset","generateOneMarkLine","y","ANNOTATION_Z_INDEX","isArray","isString","isNumber","yValueArr","selectedData","datum","selector","specMarkLine","newMarkLine"],"mappings":";;;AAMO,MAAMA,oDAA2C,CAACC,MAAMC;IAC7D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGJ;IACnD,MAAM,EAAEK,QAAQ,EAAEC,UAAU,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,IAAI,CAACD,cAAc,CAACA,WAAW,wBAAwB,EACrD,OAAOJ;IAET,MAAMS,QAAQH,QAAQ,CAACH,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,wBAAwB,EAAE,GAAGK;IACrC,MAAMM,+BAA+BC,MAAM,OAAO,CAACZ,4BAC/CA,2BACA;QAACA;KAAyB;IAE9B,MAAMa,cAAc;QAClB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,aAAa;QACb,cAAc;QACd,WAAW;IACb;IAEA,MAAMC,WAAWH,6BAA6B,OAAO,CAAC,CAACX;QACrD,MAAM,EACJ,UAAUe,aAAa,EACvBC,MAAM,EACNC,OAAO,EAAE,EACTC,eAAe,WAAW,EAC1BC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAY,OAAO,EACnBC,eAAe,QAAQ,EAEvBC,YAAYd,OAAO,aAAa,SAAS,EACzCe,YAAYf,OAAO,aAAa,Q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oBACpC,YAAYA,OAAO,iBAAiB;oBACpC,MAAM,KAAMiB,CAAAA,aAAa;oBACzB,OAAO;wBACL,IAAI;wBACJ,MAAMH;oBACR;gBACF;YACF;QAEF,IAAK,CAACT,iBAAiBuB,QAAQtB,WAAYuB,SAASvB,WAAWwB,SAASxB,SAAS;YAC/E,MAAMyB,YAAY7B,MAAM,OAAO,CAACI,UAAUA,SAAS;gBAACA;aAAO;YAC3D,OAAOyB,UAAU,GAAG,CAACN;QACvB;QAEA,MAAMO,eAAe3B,gBAAgBmB,QAAQ,MAAM,CAAC,CAACS,QAAUC,SAASD,OAAO5B,kBAAkB,EAAE;QAEnG,OAAO2B,aAAa,GAAG,CAAC,CAACC;YACvB,IAAIA,KAAK,CAAClC,WAAW,SAAS,CAAC,EAC7B,OAAO0B,oBAAoBQ,KAAK,CAAClC,WAAW,SAAS,CAAC;YAExD,IAAIkC,KAAK,CAACnC,SAAS,YAAY,CAAC,EAC9B,OAAO2B,oBAAoBQ,KAAK,CAACnC,SAAS,YAAY,CAAC;YAEzD,OAAO,CAAC;QACV;IACF;IACA,MAAMqC,eAAiB5C,KAAwB,QAAQ,IAAwB,EAAE;IACjF,MAAM6C,cAAc;WAAID;WAAkB/B,YAAY,EAAE;KAAE;IAC1D,OAAO;QACL,GAAGb,IAAI;QACP,UAAU6C;IACZ;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { VChartSpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationHorizontalLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n const { foldInfo, unfoldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationHorizontalLine\n const { annotationHorizontalLine } = annotation\n const annotationHorizontalLineList = Array.isArray(annotationHorizontalLine)\n ? annotationHorizontalLine\n : [annotationHorizontalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n\n const markLine = annotationHorizontalLineList.flatMap((annotationHorizontalLine) => {\n const {\n selector: selectorPoint,\n yValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'right',\n textBaseline = 'bottom',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationHorizontalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (y: string | number) => {\n return {\n y,\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: (positionMap as any)[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n visible: true,\n dy: 4,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dy: 4,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n fillOpacity: 1,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dx: 3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dx: -4,\n fill: lineColor,\n },\n },\n }\n }\n if ((!selectorPoint && isArray(yValue)) || isString(yValue) || isNumber(yValue)) {\n const yValueArr = Array.isArray(yValue) ? yValue : [yValue]\n return yValueArr.map(generateOneMarkLine)\n }\n\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return selectedData.map((datum) => {\n if (datum[unfoldInfo.encodingY]) {\n return generateOneMarkLine(datum[unfoldInfo.encodingY] as string)\n }\n if (datum[foldInfo.measureValue]) {\n return generateOneMarkLine(datum[foldInfo.measureValue] as string)\n }\n return {}\n })\n }) as IMarkLineSpec[]\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationHorizontalLine","spec","context","advancedVSeed","vseed","annotation","datasetReshapeInfo","config","foldInfo","unfoldInfo","theme","annotationHorizontalLineList","Array","positionMap","markLine","selectorPoint","yValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","dataset","generateOneMarkLine","y","ANNOTATION_Z_INDEX","isArray","isString","isNumber","yValueArr","selectedData","datum","selector","specMarkLine","newMarkLine"],"mappings":";;;AAMO,MAAMA,oDAA2C,CAACC,MAAMC;IAC7D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGJ;IACnD,MAAM,EAAEK,QAAQ,EAAEC,UAAU,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,IAAI,CAACD,cAAc,CAACA,WAAW,wBAAwB,EACrD,OAAOJ;IAET,MAAMS,QAAQH,QAAQ,CAACH,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,wBAAwB,EAAE,GAAGK;IACrC,MAAMM,+BAA+BC,MAAM,OAAO,CAACZ,4BAC/CA,2BACA;QAACA;KAAyB;IAE9B,MAAMa,cAAc;QAClB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,aAAa;QACb,cAAc;QACd,WAAW;IACb;IAEA,MAAMC,WAAWH,6BAA6B,OAAO,CAAC,CAACX;QACrD,MAAM,EACJ,UAAUe,aAAa,EACvBC,MAAM,EACNC,OAAO,EAAE,EACTC,eAAe,WAAW,EAC1BC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAY,OAAO,EACnBC,eAAe,QAAQ,EAEvBC,YAAYd,OAAO,aAAa,SAAS,EACzCe,YAAYf,OAAO,aAAa,QAAQ,EACxCgB,cAAchB,OAAO,aAAa,IAAI,EACtCiB,YAAYjB,OAAO,aAAa,CAAC,EAEjCkB,wBAAwBlB,OAAO,yBAAyB,IAAI,EAC5DmB,sBAAsB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CAACT,iBAAiBuB,QAAQtB,WAAYuB,SAASvB,WAAWwB,SAASxB,SAAS;YAC/E,MAAMyB,YAAY7B,MAAM,OAAO,CAACI,UAAUA,SAAS;gBAACA;aAAO;YAC3D,OAAOyB,UAAU,GAAG,CAACN;QACvB;QAEA,MAAMO,eAAe3B,gBAAgBmB,QAAQ,MAAM,CAAC,CAACS,QAAUC,SAASD,OAAO5B,kBAAkB,EAAE;QAEnG,OAAO2B,aAAa,GAAG,CAAC,CAACC;YACvB,IAAIA,KAAK,CAAClC,WAAW,SAAS,CAAC,EAC7B,OAAO0B,oBAAoBQ,KAAK,CAAClC,WAAW,SAAS,CAAC;YAExD,IAAIkC,KAAK,CAACnC,SAAS,YAAY,CAAC,EAC9B,OAAO2B,oBAAoBQ,KAAK,CAACnC,SAAS,YAAY,CAAC;YAEzD,OAAO,CAAC;QACV;IACF;IACA,MAAMqC,eAAiB5C,KAAwB,QAAQ,IAAwB,EAAE;IACjF,MAAM6C,cAAc;WAAID;WAAkB/B,YAAY,EAAE;KAAE;IAC1D,OAAO;QACL,GAAGb,IAAI;QACP,UAAU6C;IACZ;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPoint.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","datum","selector","dx","dy","ANNOTATION_Z_INDEX","data","item","isSubset"],"mappings":";;;;AAOO,MAAMA,kCAAkC,CAACC,MAAMC;IACpD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,eAAe,EAAE,GAAGK;IAC5B,MAAMG,sBAAsBC,MAAM,OAAO,CAACT,mBAAmBA,kBAAkB;QAACA;KAAgB;IAChG,MAAMU,kBAAkBC,eAAeR;IACvC,MAAMS,eAAeF,kBACjB;QACE,WAAW;QACX,cAAc;IAChB,IACA;QACE,WAAW;QACX,cAAc;IAChB;IAEJ,MAAMG,YAAYL,oBAAoB,OAAO,CAAC,CAACR;QAC7C,MAAM,EACJ,UAAUc,aAAa,EACvBC,OAAO,EAAE,EACTC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAYP,aAAa,SAAS,EAClCQ,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.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPoint.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\n\nexport const annotationPoint: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n\n return selectedData.map((datum) => {\n return {\n zIndex: ANNOTATION_Z_INDEX,\n regionRelative: true,\n coordinate: (data: Datum[]) => {\n return data.find((item) => isSubset(datum, item))\n },\n\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n })\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPoint","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","datum","selector","dx","dy","ANNOTATION_Z_INDEX","data","item","isSubset"],"mappings":";;;;AAOO,MAAMA,kCAAkC,CAACC,MAAMC;IACpD,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MA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oBACA,SAAS;oBACT,MAAM;wBACJ,MAAMZ;wBACN,OAAO;4BACL,SAAS;4BACT,SAAS;4BACT,WAAWI;4BACX,cAAcC;4BACd,MAAMJ;4BACN,QAAQQ;4BACR,WAAW;4BACX,UAAUP;4BACV,YAAYC;4BACZe;4BACAC;wBACF;wBACA,iBAAiB;4BACf,SAASR;4BACT,SAASD;4BACT,OAAO;gCACL,SAAS;gCACT,cAAcH,8BAA8B;gCAC5C,MAAME;gCACN,QAAQH;gCACR,WAAWE;gCACXU;gCACAC;4BACF;wBACF;oBACF;gBACF;YACF;IAEJ;IAEA,OAAO;QACL,GAAGjC,IAAI;QACPY;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape/constant'\nimport { pickWithout } from '@visactor/vutils'\n\nexport const annotationPointOfDualAxis: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m) => m.id)\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint\n ? dataset.reduce((res: Datum[], d: Datum) => {\n const pickedDatum = pickWithout(\n d,\n allMeasureIds.filter((id) => id !== d[MeasureId]),\n )\n\n if (selector(pickedDatum, selectorPoint)) {\n res.push(pickedDatum)\n }\n\n return res\n }, [])\n : []\n\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n const baseConfig = {\n zIndex: ANNOTATION_Z_INDEX,\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n\n return spec.series?.reduce((res: any[], s: any, index: number) => {\n selectedData.forEach((datum: Datum) => {\n res.push({\n ...baseConfig,\n relativeSeriesIndex: index,\n coordinate: (data: Datum[]) => {\n return data.find((item) => {\n return isSubset(\n datum,\n item,\n allMeasureIds.filter((id) => id !== item[MeasureId]),\n )\n })\n },\n })\n })\n\n return res\n }, [] as any[])\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPointOfDualAxis","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPoint","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","allMeasureIds","findAllMeasures","m","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","res","d","pickedDatum","pickWithout","id","MeasureId","selector","dx","dy","baseConfig","ANNOTATION_Z_INDEX","s","index","datum","data","item","isSubset"],"mappings":";;;;;;;AAUO,MAAMA,4BAA4C,CAACC,MAAMC;IAC9D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAACF,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEI,eAAe,EAAE,GAAGH;IAC5B,MAAMI,sBAAsBC,MAAM,OAAO,CAACF,mBAAmBA,kBAAkB;QAACA;KAAgB;IAChG,MAAMG,kBAAkBC,eAAeT;IACvC,MAAMU,eAAeF,kBACjB;QACE,WAAW;QACX,cAAc;IAChB,IACA;QACE,WAAW;QACX,cA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ACL,SAAS;wBACT,SAAS;wBACT,WAAWI;wBACX,cAAcC;wBACd,MAAMJ;wBACN,QAAQQ;wBACR,WAAW;wBACX,UAAUP;wBACV,YAAYC;wBACZoB;wBACAC;oBACF;oBACA,iBAAiB;wBACf,SAASb;wBACT,SAASD;wBACT,OAAO;4BACL,SAAS;4BACT,cAAcH,8BAA8B;4BAC5C,MAAME;4BACN,QAAQH;4BACR,WAAWE;4BACXe;4BACAC;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAO1C,KAAK,MAAM,EAAE,OAAO,CAACkC,KAAYW,GAAQC;YAC9Cb,aAAa,OAAO,CAAC,CAACc;gBACpBb,IAAI,IAAI,CAAC;oBACP,GAAGS,UAAU;oBACb,qBAAqBG;oBACrB,YAAY,CAACE,OACJA,KAAK,IAAI,CAAC,CAACC,OACTC,SACLH,OACAE,MACApC,cAAc,MAAM,CAAC,CAACyB,KAAOA,OAAOW,IAAI,CAACV,UAAU;gBAI3D;YACF;YAEA,OAAOL;QACT,GAAG,EAAE;IACP;IAEA,OAAO;QACL,GAAGlC,IAAI;QACPgB;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.ts"],"sourcesContent":["import type { ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, VChartSpecPipe, VSeed } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport { isBarLikeChart } from 'src/pipeline/utils/chatType'\nimport { findAllMeasures } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape/constant'\nimport { pickWithout } from '@visactor/vutils'\n\nexport const annotationPointOfDualAxis: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, config } = advancedVSeed\n\n if (!annotation || !annotation.annotationPoint) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationPoint\n const { annotationPoint } = annotation\n const annotationPointList = Array.isArray(annotationPoint) ? annotationPoint : [annotationPoint]\n const isHorizontalBar = isBarLikeChart(advancedVSeed as VSeed)\n const defaultStyle = isHorizontalBar\n ? {\n textAlign: 'right',\n textBaseline: 'middle',\n }\n : {\n textAlign: 'center',\n textBaseline: 'top',\n }\n const allMeasureIds = findAllMeasures(advancedVSeed.reshapeMeasures ?? advancedVSeed.measures).map((m) => m.id)\n\n const markPoint = annotationPointList.flatMap((annotationPoint) => {\n const {\n selector: selectorPoint,\n text = '',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = defaultStyle.textAlign,\n textBaseline = defaultStyle.textBaseline,\n textBackgroundBorderColor = theme?.textBackgroundBorderColor,\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n offsetX = theme?.offsetX ?? 0,\n offsetY = theme?.offsetY ?? 0,\n } = annotationPoint\n\n const dataset = advancedVSeed.dataset.flat()\n const selectedData = selectorPoint\n ? dataset.reduce((res: Datum[], d: Datum) => {\n const pickedDatum = pickWithout(\n d,\n allMeasureIds.filter((id) => id !== d[MeasureId]),\n )\n\n if (selector(pickedDatum, selectorPoint)) {\n res.push(pickedDatum)\n }\n\n return res\n }, [])\n : []\n\n const dx = -10 - (isHorizontalBar ? (textFontSize as number) : 0) // 由于vchart tag实现问题,需要设置这个强制偏移量\n const dy = isHorizontalBar ? 0 : (textFontSize as number)\n const baseConfig = {\n zIndex: ANNOTATION_Z_INDEX,\n itemLine: {\n visible: false,\n },\n itemContent: {\n offsetY,\n offsetX,\n confine: true,\n text: {\n text: text,\n style: {\n opacity: 0.95,\n visible: true,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n stroke: textBackgroundColor,\n lineWidth: 1,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n dx,\n dy,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n cornerRadius: textBackgroundBorderRadius ?? 4,\n fill: textBackgroundColor,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n dx,\n dy,\n },\n },\n },\n },\n }\n\n return spec.series?.reduce((res: any[], s: any, index: number) => {\n selectedData.forEach((datum: Datum) => {\n res.push({\n ...baseConfig,\n relativeSeriesIndex: index,\n coordinate: (data: Datum[]) => {\n return data.find((item) => {\n return isSubset(\n datum,\n item,\n allMeasureIds.filter((id) => id !== item[MeasureId]),\n )\n })\n },\n })\n })\n\n return res\n }, [] as any[])\n }) as ILineChartSpec['markPoint']\n\n return {\n ...spec,\n markPoint,\n }\n}\n"],"names":["annotationPointOfDualAxis","spec","context","advancedVSeed","vseed","annotation","config","theme","annotationPoint","annotationPointList","Array","isHorizontalBar","isBarLikeChart","defaultStyle","allMeasureIds","findAllMeasures","m","markPoint","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundColor","textBackgroundPadding","textBackgroundVisible","offsetX","offsetY","dataset","selectedData","res","d","pickedDatum","pickWithout","id","MeasureId","selector","dx","dy","baseConfig","ANNOTATION_Z_INDEX","s","index","datum","data","item","isSubset"],"mappings":";;;;;;;AAUO,MAAMA,4BAA4C,CAACC,MAAMC;IAC9D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/B,IAAI,CAACE,cAAc,CAACA,WAAW,eAAe,EAC5C,OAAOJ;IAGT,MAAMM,QAAQD,QAAQ,CAAC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AG,EAAE,IACL,EAAE;QAEN,MAAMO,KAAK,MAAO/B,CAAAA,kBAAmBU,eAA0B;QAC/D,MAAMsB,KAAKhC,kBAAkB,IAAKU;QAClC,MAAMuB,aAAa;YACjB,QAAQC;YACR,UAAU;gBACR,SAAS;YACX;YACA,aAAa;gBACXb;gBACAD;gBACA,SAAS;gBACT,MAAM;oBACJ,MAAMZ;oBACN,OAAO;wBACL,SAAS;wBACT,SAAS;wBACT,WAAWI;wBACX,cAAcC;wBACd,MAAMJ;wBACN,QAAQQ;wBACR,WAAW;wBACX,UAAUP;wBACV,YAAYC;wBACZoB;wBACAC;oBACF;oBACA,iBAAiB;wBACf,SAASb;wBACT,SAASD;wBACT,OAAO;4BACL,SAAS;4BACT,cAAcH,8BAA8B;4BAC5C,MAAME;4BACN,QAAQH;4BACR,WAAWE;4BACXe;4BACAC;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAO1C,KAAK,MAAM,EAAE,OAAO,CAACkC,KAAYW,GAAQC;YAC9Cb,aAAa,OAAO,CAAC,CAACc;gBACpBb,IAAI,IAAI,CAAC;oBACP,GAAGS,UAAU;oBACb,qBAAqBG;oBACrB,YAAY,CAACE,OACJA,KAAK,IAAI,CAAC,CAACC,OACTC,SACLH,OACAE,MACApC,cAAc,MAAM,CAAC,CAACyB,KAAOA,OAAOW,IAAI,CAACV,UAAU;gBAI3D;YACF;YAEA,OAAOL;QACT,GAAG,EAAE;IACP;IAEA,OAAO;QACL,GAAGlC,IAAI;QACPgB;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { VChartSpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationVerticalLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationVerticalLine) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationVerticalLine\n const { annotationVerticalLine } = annotation\n const annotationVerticalLineList = Array.isArray(annotationVerticalLine)\n ? annotationVerticalLine\n : [annotationVerticalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine) => {\n const {\n selector: selectorPoint,\n xValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationVerticalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (x: number | string) => ({\n x,\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineStyle: lineStyle,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: (positionMap as any)[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n dx: 5,\n visible: true,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dx: 5,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n fillOpacity: 1,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dy: -3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dy: 4,\n fill: lineColor,\n },\n },\n })\n\n if ((!selectorPoint && isArray(xValue)) || isString(xValue) || isNumber(xValue)) {\n const xValueArr = Array.isArray(xValue) ? xValue : [xValue]\n return xValueArr.map(generateOneMarkLine)\n }\n\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return selectedData.map((datum) => {\n if (datum[unfoldInfo.encodingX]) {\n return generateOneMarkLine(datum[unfoldInfo.encodingX] as string)\n }\n if (datum[foldInfo.measureValue]) {\n return generateOneMarkLine(datum[foldInfo.measureValue] as string)\n }\n return {}\n })\n }) as IMarkLineSpec[]\n\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationVerticalLine","spec","context","advancedVSeed","vseed","annotation","datasetReshapeInfo","config","unfoldInfo","foldInfo","theme","annotationVerticalLineList","Array","positionMap","markLine","selectorPoint","xValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","dataset","generateOneMarkLine","x","ANNOTATION_Z_INDEX","isArray","isString","isNumber","xValueArr","selectedData","datum","selector","specMarkLine","newMarkLine"],"mappings":";;;AAMO,MAAMA,gDAAyC,CAACC,MAAMC;IAC3D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGJ;IAEnD,MAAM,EAAEK,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,IAAI,CAACD,cAAc,CAACA,WAAW,sBAAsB,EACnD,OAAOJ;IAGT,MAAMS,QAAQH,QAAQ,CAACH,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,sBAAsB,EAAE,GAAGK;IACnC,MAAMM,6BAA6BC,MAAM,OAAO,CAACZ,0BAC7CA,yBACA;QAACA;KAAuB;IAE5B,MAAMa,cAAc;QAClB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,aAAa;QACb,cAAc;QACd,WAAW;IACb;IACA,MAAMC,WAAWH,2BAA2B,OAAO,CAAC,CAACX;QACnD,MAAM,EACJ,UAAUe,aAAa,EACvBC,MAAM,EACNC,OAAO,EAAE,EACTC,eAAe,WAAW,EAC1BC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAY,QAAQ,EACpBC,eAAe,KAAK,EAEpBC,YAAYd,OAAO,aAAa,SAAS,EACzCe,YAAYf,OAAO,aAAa,QAA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AAO,oBAAoB;oBACpC,YAAYA,OAAO,iBAAiB;oBACpC,MAAM,KAAMiB,CAAAA,aAAa;oBACzB,OAAO;wBACL,IAAI;wBACJ,MAAMH;oBACR;gBACF;YACF;QAEA,IAAK,CAACT,iBAAiBuB,QAAQtB,WAAYuB,SAASvB,WAAWwB,SAASxB,SAAS;YAC/E,MAAMyB,YAAY7B,MAAM,OAAO,CAACI,UAAUA,SAAS;gBAACA;aAAO;YAC3D,OAAOyB,UAAU,GAAG,CAACN;QACvB;QAEA,MAAMO,eAAe3B,gBAAgBmB,QAAQ,MAAM,CAAC,CAACS,QAAUC,SAASD,OAAO5B,kBAAkB,EAAE;QAEnG,OAAO2B,aAAa,GAAG,CAAC,CAACC;YACvB,IAAIA,KAAK,CAACnC,WAAW,SAAS,CAAC,EAC7B,OAAO2B,oBAAoBQ,KAAK,CAACnC,WAAW,SAAS,CAAC;YAExD,IAAImC,KAAK,CAAClC,SAAS,YAAY,CAAC,EAC9B,OAAO0B,oBAAoBQ,KAAK,CAAClC,SAAS,YAAY,CAAC;YAEzD,OAAO,CAAC;QACV;IACF;IAEA,MAAMoC,eAAiB5C,KAAwB,QAAQ,IAAwB,EAAE;IACjF,MAAM6C,cAAc;WAAID;WAAkB/B,YAAY,EAAE;KAAE;IAE1D,OAAO;QACL,GAAGb,IAAI;QACP,UAAU6C;IACZ;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.ts"],"sourcesContent":["import type { ILineChartSpec, IMarkLineSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { VChartSpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationVerticalLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const { annotation, datasetReshapeInfo, config } = advancedVSeed\n\n const { unfoldInfo, foldInfo } = datasetReshapeInfo[0]\n\n if (!annotation || !annotation.annotationVerticalLine) {\n return spec\n }\n\n const theme = config?.[vseed.chartType as 'column']?.annotation?.annotationVerticalLine\n const { annotationVerticalLine } = annotation\n const annotationVerticalLineList = Array.isArray(annotationVerticalLine)\n ? annotationVerticalLine\n : [annotationVerticalLine]\n\n const positionMap = {\n outsideStart: 'start',\n outsideEnd: 'end',\n outsideMiddle: 'middle',\n insideStart: 'insideStartTop',\n insideMiddle: 'insideMiddleTop',\n insideEnd: 'insideEndTop',\n }\n const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine) => {\n const {\n selector: selectorPoint,\n xValue,\n text = '',\n textPosition = 'insideEnd',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\n\n lineColor = theme?.lineColor ?? '#212121',\n lineStyle = theme?.lineStyle ?? 'dashed',\n lineVisible = theme?.lineStyle ?? true,\n lineWidth = theme?.lineWidth ?? 1,\n\n textBackgroundVisible = theme?.textBackgroundVisible ?? true,\n textBackgroundColor = theme?.textBackgroundColor ?? '#212121',\n textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121',\n textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4,\n textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1,\n textBackgroundPadding = theme?.textBackgroundPadding ?? 2,\n } = annotationVerticalLine\n\n const dataset = advancedVSeed.dataset.flat()\n\n const generateOneMarkLine = (x: number | string) => ({\n x,\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n line: {\n style: {\n visible: lineVisible,\n stroke: lineColor,\n lineStyle: lineStyle,\n lineWidth: lineWidth,\n lineDash: lineStyle === 'dashed' ? [5, 2] : lineStyle === 'dotted' ? [2, 5] : [0],\n },\n },\n label: {\n confine: true,\n text: text,\n position: (positionMap as any)[textPosition || 'insideEnd'],\n style: {\n opacity: 0.95,\n dx: 5,\n visible: true,\n stroke: textBackgroundColor,\n lineWidth: 1,\n textAlign: textAlign,\n textBaseline: textBaseline,\n fill: textColor,\n fontSize: textFontSize,\n fontWeight: textFontWeight,\n },\n labelBackground: {\n visible: textBackgroundVisible,\n padding: textBackgroundPadding,\n style: {\n opacity: 0.95,\n dx: 5,\n cornerRadius: textBackgroundBorderRadius,\n fill: textBackgroundColor,\n fillOpacity: 1,\n stroke: textBackgroundBorderColor,\n lineWidth: textBackgroundBorderWidth,\n },\n },\n },\n startSymbol: {\n visible: theme?.startSymbolVisible ?? true,\n symbolType: theme?.startSymbolType ?? 'triangleDown',\n size: 5 + (lineWidth || 1),\n style: {\n dy: -3,\n fill: lineColor,\n },\n },\n endSymbol: {\n visible: theme?.endSymbolVisible ?? false,\n symbolType: theme?.endSymbolType ?? 'arrow',\n size: 10 + (lineWidth || 1),\n style: {\n dy: 4,\n fill: lineColor,\n },\n },\n })\n\n if ((!selectorPoint && isArray(xValue)) || isString(xValue) || isNumber(xValue)) {\n const xValueArr = Array.isArray(xValue) ? xValue : [xValue]\n return xValueArr.map(generateOneMarkLine)\n }\n\n const selectedData = selectorPoint ? dataset.filter((datum) => selector(datum, selectorPoint)) : []\n\n return selectedData.map((datum) => {\n if (datum[unfoldInfo.encodingX]) {\n return generateOneMarkLine(datum[unfoldInfo.encodingX] as string)\n }\n if (datum[foldInfo.measureValue]) {\n return generateOneMarkLine(datum[foldInfo.measureValue] as string)\n }\n return {}\n })\n }) as IMarkLineSpec[]\n\n const specMarkLine = ((spec as ILineChartSpec).markLine as IMarkLineSpec[]) || []\n const newMarkLine = [...specMarkLine, ...(markLine || [])]\n\n return {\n ...spec,\n markLine: newMarkLine,\n }\n}\n"],"names":["annotationVerticalLine","spec","context","advancedVSeed","vseed","annotation","datasetReshapeInfo","config","unfoldInfo","foldInfo","theme","annotationVerticalLineList","Array","positionMap","markLine","selectorPoint","xValue","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","lineColor","lineStyle","lineVisible","lineWidth","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderRadius","textBackgroundBorderWidth","textBackgroundPadding","dataset","generateOneMarkLine","x","ANNOTATION_Z_INDEX","isArray","isString","isNumber","xValueArr","selectedData","datum","selector","specMarkLine","newMarkLine"],"mappings":";;;AAMO,MAAMA,gDAAyC,CAACC,MAAMC;IAC3D,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGJ;IAEnD,MAAM,EAAEK,UAAU,EAAEC,QAAQ,EAAE,GAAGH,kBAAkB,CAAC,EAAE;IAEtD,IAAI,CAACD,cAAc,CAACA,WAAW,sBAAsB,EACnD,OAAOJ;IAGT,MAAMS,QAAQH,QAAQ,CAACH,MAAM,SAAS,CAAa,EAAE,YAAY;IACjE,MAAM,EAAEJ,sBAAsB,EAAE,GAAGK;IACnC,MAAMM,6BAA6BC,MAAM,OAAO,CAACZ,0BAC7CA,yBACA;QAACA;KAAuB;IAE5B,MAAMa,cAAc;QAClB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,aAAa;QACb,cAAc;QACd,WAAW;IACb;IACA,MAAMC,WAAWH,2BAA2B,OAAO,CAAC,CAACX;QACnD,MAAM,EACJ,UAAUe,aAAa,EACvBC,MAAM,EACNC,OAAO,EAAE,EACTC,eAAe,WAAW,EAC1BC,YAAYT,OAAO,aAAa,SAAS,EACzCU,eAAeV,OAAO,gBAAgB,EAAE,EACxCW,iBAAiBX,OAAO,kBAAkB,GAAG,EAC7CY,YAAY,QAAQ,EACpBC,eAAe,KAAK,EAEpBC,YAAYd,OAAO,aAAa,SAAS,EACzCe,YAAYf,OAAO,aAAa,QAAQ,EACxCgB,cAAchB,OAAO,aAAa,IAAI,EACtCiB,YAAYjB,OAAO,aAAa,CAAC,EAEjCkB,wBAAwBlB,OAAO,yBAAyB,IAAI,EAC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oBACR;gBACF;YACF;QAEA,IAAK,CAACT,iBAAiBuB,QAAQtB,WAAYuB,SAASvB,WAAWwB,SAASxB,SAAS;YAC/E,MAAMyB,YAAY7B,MAAM,OAAO,CAACI,UAAUA,SAAS;gBAACA;aAAO;YAC3D,OAAOyB,UAAU,GAAG,CAACN;QACvB;QAEA,MAAMO,eAAe3B,gBAAgBmB,QAAQ,MAAM,CAAC,CAACS,QAAUC,SAASD,OAAO5B,kBAAkB,EAAE;QAEnG,OAAO2B,aAAa,GAAG,CAAC,CAACC;YACvB,IAAIA,KAAK,CAACnC,WAAW,SAAS,CAAC,EAC7B,OAAO2B,oBAAoBQ,KAAK,CAACnC,WAAW,SAAS,CAAC;YAExD,IAAImC,KAAK,CAAClC,SAAS,YAAY,CAAC,EAC9B,OAAO0B,oBAAoBQ,KAAK,CAAClC,SAAS,YAAY,CAAC;YAEzD,OAAO,CAAC;QACV;IACF;IAEA,MAAMoC,eAAiB5C,KAAwB,QAAQ,IAAwB,EAAE;IACjF,MAAM6C,cAAc;WAAID;WAAkB/B,YAAY,EAAE;KAAE;IAE1D,OAAO;QACL,GAAGb,IAAI;QACP,UAAU6C;IACZ;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/splitLine.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/splitLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, ILineChartSpec, IVChart } from '@visactor/vchart'\nimport { array, clamper, Color as VUtilColor } from '@visactor/vutils'\nimport { isNullish, isNumber, isPlainObject } from 'remeda'\nimport type { AnnotationHorizontalLine, VChartSpecPipe, Color } from 'src/types'\n\ninterface SplitConfig {\n points: { x: number; y: number }[]\n splitCoordinate: number\n lineStroke: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n areaFill: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n}\n\nconst formatGradientStops = (stops: { color: string; offset: number }[]) => {\n const firstInvalidateIndex = stops.findIndex((stop) => stop.offset < 0 || stop.offset > 1)\n\n if (firstInvalidateIndex >= 0) {\n if (stops[firstInvalidateIndex].offset > 1) {\n const newStops = stops.slice(0, firstInvalidateIndex + 1)\n newStops[newStops.length - 1].offset = 1\n\n return newStops\n }\n const newStops = stops.slice(firstInvalidateIndex + 1)\n\n newStops[0].offset = 0\n return newStops\n }\n\n return stops\n}\n\nexport const splitLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { annotation, chartType, datasetReshapeInfo } = advancedVSeed\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const baseConfig = advancedVSeed.config[chartType] as { color: Color }\n\n const splitLineConfig = array(annotation.annotationHorizontalLine).find(\n (item) => !!(item as AnnotationHorizontalLine).splitLine,\n ) as AnnotationHorizontalLine | undefined\n\n const splitValue = +(splitLineConfig?.yValue as number | string)\n\n if (Number.isNaN(splitValue) || !isNumber(splitValue)) {\n return spec\n }\n const result = { ...spec } as Partial<ILineChartSpec>\n const colorTheme = baseConfig?.color ?? {}\n const colorConfig = {\n positiveColor: colorTheme.positiveColor || 'red',\n negativeColor: colorTheme.negativeColor || 'green',\n ...(isPlainObject(splitLineConfig?.splitLine) ? splitLineConfig?.splitLine : {}),\n }\n\n const groupMark = {\n type: 'group',\n name: 'annotationHorizontalLine-splitLine',\n zIndex: 300,\n style: {\n splitConfig: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const lineSeries = chart.getAllSeries().find((s) => s.type === 'line' || s.type === 'area') as ICartesianSeries\n\n if (!lineSeries) {\n return\n }\n const lineMark = lineSeries.getMarkInName('line') ?? lineSeries.getMarkInName('area')\n\n if (!lineMark) {\n return\n }\n const lineGraphics = lineMark.getGraphics()\n\n if (!lineGraphics || lineGraphics.length !== 1 || !lineGraphics[0]) {\n return\n }\n const points = ((lineGraphics[0].attribute as any).points ?? []) as { x: number; y: number }[]\n\n if ((lineGraphics[0].attribute as any).segments?.length) {\n ;((lineGraphics[0].attribute as any).segments as any[]).forEach(\n (seg: { points: { x: number; y: number }[] }) => {\n seg.points.forEach((pt: { x: number; y: number }) => {\n points.push({ x: pt.x, y: pt.y })\n })\n },\n )\n }\n\n if (!points || !points.length) {\n return\n }\n const scale = lineSeries.getYAxisHelper().getScale!(0)\n const splitCoordinate = scale.scale(splitValue)\n const minY = Math.min(...points.map((p) => p.y))\n const maxY = Math.max(...points.map((p) => p.y))\n const ratio = (splitCoordinate - minY) / (maxY - minY)\n\n const lineStroke = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: formatGradientStops([\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: colorConfig.positiveColor,\n offset: ratio,\n },\n {\n color: colorConfig.negativeColor,\n offset: ratio + 0.0000001,\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ]),\n }\n const areaFill = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: formatGradientStops([\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: new VUtilColor(colorConfig.positiveColor).setOpacity(0).toRGBA(),\n offset: ratio,\n },\n {\n offset: ratio + 0.0000001,\n color: new VUtilColor(colorConfig.negativeColor).setOpacity(0).toRGBA(),\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ]),\n }\n const attrs: any = {\n segments: null,\n points,\n }\n\n if (lineGraphics[0].type === 'area') {\n attrs.stroke = lineStroke\n attrs.fill = areaFill\n } else {\n attrs.stroke = lineStroke\n }\n\n lineGraphics[0].setAttributes(attrs as unknown as Record<string, any>)\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n lineGraphics[0].setFinalAttributes?.(attrs)\n const start = lineSeries.getRegion().getLayoutStartPoint()\n const range = scale.range() as number[]\n\n return {\n points: points.map((entry) => ({ x: entry.x + start.x, y: entry.y + start.y })),\n splitCoordinate: clamper(range[0], range[range.length - 1])(splitCoordinate as number) + start.y,\n areaFill,\n lineStroke,\n } as SplitConfig\n },\n },\n children: [\n {\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n fillOpacity: 0.5,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { points, splitCoordinate } = parentNode.attribute.splitConfig as SplitConfig\n\n return points.map((entry: { x: number; y: number }) => {\n return {\n ...entry,\n y1: splitCoordinate,\n }\n })\n }\n\n return []\n },\n fill: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { areaFill } = parentNode.attribute.splitConfig as SplitConfig\n\n return areaFill\n }\n\n return\n },\n },\n },\n ],\n }\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n ;(result.customMark as any[]).push(groupMark)\n\n const seriesSpec =\n result.type === 'line' || result.type === 'area'\n ? result\n : result.series?.find((s) => s.type === 'line' || s.type === 'area')\n\n if (seriesSpec) {\n if (!seriesSpec.point) {\n seriesSpec.point = {}\n }\n if (!seriesSpec.line) {\n seriesSpec.line = {}\n }\n\n if (!seriesSpec.point.style) {\n seriesSpec.point.style = {}\n }\n if (!seriesSpec.line.style) {\n seriesSpec.line.style = {}\n }\n\n const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue\n\n seriesSpec.point.style.fill = (datum) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n }\n seriesSpec.line.style.stroke = (datum) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n }\n if (seriesSpec.label && (seriesSpec.label as any).visible && isNullish((seriesSpec.label as any).style?.fill)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ;(seriesSpec.label as any).style = {\n ...(seriesSpec.label as any).style,\n fill: (datum: any) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n },\n }\n }\n }\n\n return result\n}\n"],"names":["formatGradientStops","stops","firstInvalidateIndex","stop","newStops","splitLine","spec","context","advancedVSeed","annotation","chartType","datasetReshapeInfo","baseConfig","splitLineConfig","array","item","splitValue","Number","isNumber","result","colorTheme","colorConfig","isPlainObject","groupMark","datum","ctx","vchart","chart","lineSeries","s","lineMark","lineGraphics","points","seg","pt","scale","splitCoordinate","minY","Math","p","maxY","ratio","lineStroke","areaFill","VUtilColor","attrs","start","range","entry","clamper","opt","parentNode","seriesSpec","measureValueKey","isNullish"],"mappings":";;AAgCA,MAAMA,sBAAsB,CAACC;IAC3B,MAAMC,uBAAuBD,MAAM,SAAS,CAAC,CAACE,OAASA,KAAK,MAAM,GAAG,KAAKA,KAAK,MAAM,GAAG;IAExF,IAAID,wBAAwB,GAAG;QAC7B,IAAID,KAAK,CAACC,qBAAqB,CAAC,MAAM,GAAG,GAAG;YAC1C,MAAME,WAAWH,MAAM,KAAK,CAAC,GAAGC,uBAAuB;YACvDE,QAAQ,CAACA,SAAS,MAAM,GAAG,EAAE,CAAC,MAAM,GAAG;YAEvC,OAAOA;QACT;QACA,MAAMA,WAAWH,MAAM,KAAK,CAACC,uBAAuB;QAEpDE,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG;QACrB,OAAOA;IACT;IAEA,OAAOH;AACT;AAEO,MAAMI,YAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,UAAU,EAAEC,SAAS,EAAEC,kBAAkB,EAAE,GAAGH;IAEtD,IAAI,CAACC,cAAc,CAACA,WAAW,wBAAwB,EACrD,OAAOH;IAET,MAAMM,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAElD,MAAMG,kBAAkBC,MAAML,WAAW,wBAAwB,EAAE,IAAI,CACrE,CAACM,OAAS,CAAC,CAAEA,KAAkC,SAAS;IAG1D,MAAMC,aA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AAOF;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/splitLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/splitLine.ts"],"sourcesContent":["import type { ICartesianSeries, IChart, ILineChartSpec, IVChart } from '@visactor/vchart'\nimport { array, clamper, Color as VUtilColor } from '@visactor/vutils'\nimport { isNullish, isNumber, isPlainObject } from 'remeda'\nimport type { AnnotationHorizontalLine, VChartSpecPipe, Color } from 'src/types'\n\ninterface SplitConfig {\n points: { x: number; y: number }[]\n splitCoordinate: number\n lineStroke: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n areaFill: {\n gradient: string\n x0: number\n x1: number\n y0: number\n y1: number\n stops: {\n color: string\n offset: number\n }[]\n }\n}\n\nconst formatGradientStops = (stops: { color: string; offset: number }[]) => {\n const firstInvalidateIndex = stops.findIndex((stop) => stop.offset < 0 || stop.offset > 1)\n\n if (firstInvalidateIndex >= 0) {\n if (stops[firstInvalidateIndex].offset > 1) {\n const newStops = stops.slice(0, firstInvalidateIndex + 1)\n newStops[newStops.length - 1].offset = 1\n\n return newStops\n }\n const newStops = stops.slice(firstInvalidateIndex + 1)\n\n newStops[0].offset = 0\n return newStops\n }\n\n return stops\n}\n\nexport const splitLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { annotation, chartType, datasetReshapeInfo } = advancedVSeed\n\n if (!annotation || !annotation.annotationHorizontalLine) {\n return spec\n }\n const baseConfig = advancedVSeed.config[chartType] as { color: Color }\n\n const splitLineConfig = array(annotation.annotationHorizontalLine).find(\n (item) => !!(item as AnnotationHorizontalLine).splitLine,\n ) as AnnotationHorizontalLine | undefined\n\n const splitValue = +(splitLineConfig?.yValue as number | string)\n\n if (Number.isNaN(splitValue) || !isNumber(splitValue)) {\n return spec\n }\n const result = { ...spec } as Partial<ILineChartSpec>\n const colorTheme = baseConfig?.color ?? {}\n const colorConfig = {\n positiveColor: colorTheme.positiveColor || 'red',\n negativeColor: colorTheme.negativeColor || 'green',\n ...(isPlainObject(splitLineConfig?.splitLine) ? splitLineConfig?.splitLine : {}),\n }\n\n const groupMark = {\n type: 'group',\n name: 'annotationHorizontalLine-splitLine',\n zIndex: 300,\n style: {\n splitConfig: (datum: any, ctx: any) => {\n const vchart = ctx.vchart as IVChart\n const chart = vchart.getChart() as IChart\n const lineSeries = chart.getAllSeries().find((s) => s.type === 'line' || s.type === 'area') as ICartesianSeries\n\n if (!lineSeries) {\n return\n }\n const lineMark = lineSeries.getMarkInName('line') ?? lineSeries.getMarkInName('area')\n\n if (!lineMark) {\n return\n }\n const lineGraphics = lineMark.getGraphics()\n\n if (!lineGraphics || lineGraphics.length !== 1 || !lineGraphics[0]) {\n return\n }\n const points = ((lineGraphics[0].attribute as any).points ?? []) as { x: number; y: number }[]\n\n if ((lineGraphics[0].attribute as any).segments?.length) {\n ;((lineGraphics[0].attribute as any).segments as any[]).forEach(\n (seg: { points: { x: number; y: number }[] }) => {\n seg.points.forEach((pt: { x: number; y: number }) => {\n points.push({ x: pt.x, y: pt.y })\n })\n },\n )\n }\n\n if (!points || !points.length) {\n return\n }\n const scale = lineSeries.getYAxisHelper().getScale!(0)\n const splitCoordinate = scale.scale(splitValue)\n const minY = Math.min(...points.map((p) => p.y))\n const maxY = Math.max(...points.map((p) => p.y))\n const ratio = (splitCoordinate - minY) / (maxY - minY)\n\n const lineStroke = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: formatGradientStops([\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: colorConfig.positiveColor,\n offset: ratio,\n },\n {\n color: colorConfig.negativeColor,\n offset: ratio + 0.0000001,\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ]),\n }\n const areaFill = {\n gradient: 'linear',\n x0: 0,\n x1: 0,\n y0: 0,\n y1: 1,\n stops: formatGradientStops([\n {\n color: colorConfig.positiveColor,\n offset: 0,\n },\n {\n color: new VUtilColor(colorConfig.positiveColor).setOpacity(0).toRGBA(),\n offset: ratio,\n },\n {\n offset: ratio + 0.0000001,\n color: new VUtilColor(colorConfig.negativeColor).setOpacity(0).toRGBA(),\n },\n {\n color: colorConfig.negativeColor,\n offset: 1,\n },\n ]),\n }\n const attrs: any = {\n segments: null,\n points,\n }\n\n if (lineGraphics[0].type === 'area') {\n attrs.stroke = lineStroke\n attrs.fill = areaFill\n } else {\n attrs.stroke = lineStroke\n }\n\n lineGraphics[0].setAttributes(attrs as unknown as Record<string, any>)\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n lineGraphics[0].setFinalAttributes?.(attrs)\n const start = lineSeries.getRegion().getLayoutStartPoint()\n const range = scale.range() as number[]\n\n return {\n points: points.map((entry) => ({ x: entry.x + start.x, y: entry.y + start.y })),\n splitCoordinate: clamper(range[0], range[range.length - 1])(splitCoordinate as number) + start.y,\n areaFill,\n lineStroke,\n } as SplitConfig\n },\n },\n children: [\n {\n type: 'area',\n interactive: false,\n zIndex: 500,\n style: {\n fillOpacity: 0.5,\n points: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { points, splitCoordinate } = parentNode.attribute.splitConfig as SplitConfig\n\n return points.map((entry: { x: number; y: number }) => {\n return {\n ...entry,\n y1: splitCoordinate,\n }\n })\n }\n\n return []\n },\n fill: (datum: any, ctx: any, opt: any) => {\n const parentNode = opt.mark?._product?.parent\n\n if (parentNode?.attribute?.splitConfig) {\n const { areaFill } = parentNode.attribute.splitConfig as SplitConfig\n\n return areaFill\n }\n\n return\n },\n },\n },\n ],\n }\n\n if (!result.customMark) {\n result.customMark = []\n }\n\n ;(result.customMark as any[]).push(groupMark)\n\n const seriesSpec =\n result.type === 'line' || result.type === 'area'\n ? result\n : result.series?.find((s) => s.type === 'line' || s.type === 'area')\n\n if (seriesSpec) {\n if (!seriesSpec.point) {\n seriesSpec.point = {}\n }\n if (!seriesSpec.line) {\n seriesSpec.line = {}\n }\n\n if (!seriesSpec.point.style) {\n seriesSpec.point.style = {}\n }\n if (!seriesSpec.line.style) {\n seriesSpec.line.style = {}\n }\n\n const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue\n\n seriesSpec.point.style.fill = (datum) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n }\n seriesSpec.line.style.stroke = (datum) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n }\n if (seriesSpec.label && (seriesSpec.label as any).visible && isNullish((seriesSpec.label as any).style?.fill)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ;(seriesSpec.label as any).style = {\n ...(seriesSpec.label as any).style,\n fill: (datum: any) => {\n return datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor\n },\n }\n }\n }\n\n return result\n}\n"],"names":["formatGradientStops","stops","firstInvalidateIndex","stop","newStops","splitLine","spec","context","advancedVSeed","annotation","chartType","datasetReshapeInfo","baseConfig","splitLineConfig","array","item","splitValue","Number","isNumber","result","colorTheme","colorConfig","isPlainObject","groupMark","datum","ctx","vchart","chart","lineSeries","s","lineMark","lineGraphics","points","seg","pt","scale","splitCoordinate","minY","Math","p","maxY","ratio","lineStroke","areaFill","VUtilColor","attrs","start","range","entry","clamper","opt","parentNode","seriesSpec","measureValueKey","isNullish"],"mappings":";;AAgCA,MAAMA,sBAAsB,CAACC;IAC3B,MAAMC,uBAAuBD,MAAM,SAAS,CAAC,CAACE,OAASA,KAAK,MAAM,GAAG,KAAKA,KAAK,MAAM,GAAG;IAExF,IAAID,wBAAwB,GAAG;QAC7B,IAAID,KAAK,CAACC,qBAAqB,CAAC,MAAM,GAAG,GAAG;YAC1C,MAAME,WAAWH,MAAM,KAAK,CAAC,GAAGC,uBAAuB;YACvDE,QAAQ,CAACA,SAAS,MAAM,GAAG,EAAE,CAAC,MAAM,GAAG;YAEvC,OAAOA;Q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C6B,gBAAgB,GAAGrC,aAAaK,YAAY,aAAa,GAAGA,YAAY,aAAa;QAEtG+B,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC5B,QACvBA,OAAO,CAAC6B,gBAAgB,GAAGrC,aAAaK,YAAY,aAAa,GAAGA,YAAY,aAAa;QAEtG,IAAI+B,WAAW,KAAK,IAAKA,WAAW,KAAK,CAAS,OAAO,IAAIE,UAAWF,WAAW,KAAK,CAAS,KAAK,EAAE,OAEpGA,WAAW,KAAK,CAAS,KAAK,GAAG;YACjC,GAAIA,WAAW,KAAK,CAAS,KAAK;YAClC,MAAM,CAAC5B,QACEA,OAAO,CAAC6B,gBAAgB,GAAGrC,aAAaK,YAAY,aAAa,GAAGA,YAAY,aAAa;QAExG;IAEJ;IAEA,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/annotation/utils.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/annotation/utils.ts"],"sourcesContent":["import type { Datum } from 'src/types'\n\nexport const isSubset = (sub: Datum, obj: Datum, excludeMeasuresIds?: string[]) => {\n return Object.entries(sub).every(([key, value]) => {\n if (excludeMeasuresIds && excludeMeasuresIds.includes(key)) {\n return false\n }\n\n if (typeof value === 'string') {\n return obj[key] === value\n }\n if (typeof value === 'number') {\n return obj[key] === value\n }\n return true\n })\n}\n\nexport const ANNOTATION_AREA_TEXT_STYLE_BY_POSITION = {\n top: {\n textAlign: 'center',\n textBaseline: 'top',\n },\n topRight: {\n textAlign: 'right',\n textBaseline: 'top',\n },\n topLeft: {\n textAlign: 'left',\n textBaseline: 'top',\n },\n bottom: {\n textAlign: 'center',\n textBaseline: 'bottom',\n },\n bottomLeft: {\n textAlign: 'left',\n textBaseline: 'bottom',\n },\n bottomRight: {\n textAlign: 'right',\n textBaseline: 'bottom',\n },\n left: {\n textAlign: 'left',\n textBaseline: 'middle',\n },\n right: {\n textAlign: 'right',\n textBaseline: 'middle',\n },\n}\n"],"names":["isSubset","sub","obj","excludeMeasuresIds","Object","key","value","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION"],"mappings":"AAEO,MAAMA,WAAW,CAACC,KAAYC,KAAYC,qBACxCC,OAAO,OAAO,CAACH,KAAK,KAAK,CAAC,CAAC,CAACI,KAAKC,MAAM;QAC5C,IAAIH,sBAAsBA,mBAAmB,QAAQ,CAACE,MACpD,OAAO;QAGT,IAAI,AAAiB,YAAjB,OAAOC,OACT,OAAOJ,GAAG,CAACG,IAAI,KAAKC;QAEtB,IAAI,AAAiB,YAAjB,OAAOA,OACT,OAAOJ,GAAG,CAACG,IAAI,KAAKC;QAEtB,OAAO;IACT;AAGK,MAAMC,yCAAyC;IACpD,KAAK;QACH,WAAW;QACX,cAAc;IAChB;IACA,UAAU;QACR,WAAW;QACX,cAAc;IAChB;IACA,SAAS;QACP,WAAW;QACX,cAAc;IAChB;IACA,QAAQ;QACN,WAAW;QACX,cAAc;IAChB;IACA,YAAY;QACV,WAAW;QACX,cAAc;IAChB;IACA,aAAa;QACX,WAAW;QACX,cAAc;IAChB;IACA,MAAM;QACJ,WAAW;QACX,cAAc;IAChB;IACA,OAAO;QACL,WAAW;QACX,cAAc;IAChB;AACF"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/utils.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/utils.ts"],"sourcesContent":["import type { Datum } from 'src/types'\n\nexport const isSubset = (sub: Datum, obj: Datum, excludeMeasuresIds?: string[]) => {\n return Object.entries(sub).every(([key, value]) => {\n if (excludeMeasuresIds && excludeMeasuresIds.includes(key)) {\n return false\n }\n\n if (typeof value === 'string') {\n return obj[key] === value\n }\n if (typeof value === 'number') {\n return obj[key] === value\n }\n return true\n })\n}\n\nexport const ANNOTATION_AREA_TEXT_STYLE_BY_POSITION = {\n top: {\n textAlign: 'center',\n textBaseline: 'top',\n },\n topRight: {\n textAlign: 'right',\n textBaseline: 'top',\n },\n topLeft: {\n textAlign: 'left',\n textBaseline: 'top',\n },\n bottom: {\n textAlign: 'center',\n textBaseline: 'bottom',\n },\n bottomLeft: {\n textAlign: 'left',\n textBaseline: 'bottom',\n },\n bottomRight: {\n textAlign: 'right',\n textBaseline: 'bottom',\n },\n left: {\n textAlign: 'left',\n textBaseline: 'middle',\n },\n right: {\n textAlign: 'right',\n textBaseline: 'middle',\n },\n}\n"],"names":["isSubset","sub","obj","excludeMeasuresIds","Object","key","value","ANNOTATION_AREA_TEXT_STYLE_BY_POSITION"],"mappings":"AAEO,MAAMA,WAAW,CAACC,KAAYC,KAAYC,qBACxCC,OAAO,OAAO,CAACH,KAAK,KAAK,CAAC,CAAC,CAACI,KAAKC,MAAM;QAC5C,IAAIH,sBAAsBA,mBAAmB,QAAQ,CAACE,MACpD,OAAO;QAGT,IAAI,AAAiB,YAAjB,OAAOC,OACT,OAAOJ,GAAG,CAACG,IAAI,KAAKC;QAEtB,IAAI,AAAiB,YAAjB,OAAOA,OACT,OAAOJ,GAAG,CAACG,IAAI,KAAKC;QAEtB,OAAO;IACT;AAGK,MAAMC,yCAAyC;IACpD,KAAK;QACH,WAAW;QACX,cAAc;IAChB;IACA,UAAU;QACR,WAAW;QACX,cAAc;IAChB;IACA,SAAS;QACP,WAAW;QACX,cAAc;IAChB;IACA,QAAQ;QACN,WAAW;QACX,cAAc;IAChB;IACA,YAAY;QACV,WAAW;QACX,cAAc;IAChB;IACA,aAAa;QACX,WAAW;QACX,cAAc;IAChB;IACA,MAAM;QACJ,WAAW;QACX,cAAc;IAChB;IACA,OAAO;QACL,WAAW;QACX,cAAc;IAChB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/format/linearFormat.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/format/linearFormat.ts"],"sourcesContent":["import { isEmpty, isNullish } from 'remeda'\nimport { autoFormatter } from 'src/pipeline/utils'\nimport type { Formatter, NumFormat } from 'src/types'\n\nexport const createLinearFormat = (\n value: string | number,\n autoFormat: boolean | undefined,\n numFormat: NumFormat,\n formatter: Formatter,\n) => {\n if (isNullish(autoFormat) && isEmpty(numFormat)) {\n return autoFormatter(value)\n }\n\n if (autoFormat === true) {\n return autoFormatter(value)\n }\n\n if (!isEmpty(numFormat)) {\n return formatter(value)\n }\n\n return String(value)\n}\n\nexport const createLinearPercentFormat = (\n value: string | number,\n autoFormat: boolean | undefined,\n numFormat: NumFormat,\n formatter: Formatter,\n percentFormatter: Formatter,\n) => {\n if (isNullish(autoFormat) && isEmpty(numFormat)) {\n return percentFormatter(value)\n }\n\n if (autoFormat === true) {\n return percentFormatter(value)\n }\n\n if (!isEmpty(numFormat)) {\n return formatter(value)\n }\n\n return String(value)\n}\n"],"names":["createLinearFormat","value","autoFormat","numFormat","formatter","isNullish","isEmpty","autoFormatter","String","createLinearPercentFormat","percentFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAChCC,OACAC,YACAC,WACAC;IAEA,IAAIC,UAAUH,eAAeI,QAAQH,YACnC,OAAOI,cAAcN;IAGvB,IAAIC,AAAe,SAAfA,YACF,OAAOK,cAAcN;IAGvB,IAAI,CAACK,QAAQH,YACX,OAAOC,UAAUH;IAGnB,OAAOO,OAAOP;AAChB;AAEO,MAAMQ,4BAA4B,CACvCR,OACAC,YACAC,WACAC,WACAM;IAEA,IAAIL,UAAUH,eAAeI,QAAQH,YACnC,OAAOO,iBAAiBT;IAG1B,IAAIC,AAAe,SAAfA,YACF,OAAOQ,iBAAiBT;IAG1B,IAAI,CAACK,QAAQH,YACX,OAAOC,UAAUH;IAGnB,OAAOO,OAAOP;AAChB"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/format/linearFormat.js","sources":["../../../../../../../../src/pipeline/spec/chart/pipes/axes/format/linearFormat.ts"],"sourcesContent":["import { isEmpty, isNullish } from 'remeda'\nimport { autoFormatter } from 'src/pipeline/utils'\nimport type { Formatter, NumFormat } from 'src/types'\n\nexport const createLinearFormat = (\n value: string | number,\n autoFormat: boolean | undefined,\n numFormat: NumFormat,\n formatter: Formatter,\n) => {\n if (isNullish(autoFormat) && isEmpty(numFormat)) {\n return autoFormatter(value)\n }\n\n if (autoFormat === true) {\n return autoFormatter(value)\n }\n\n if (!isEmpty(numFormat)) {\n return formatter(value)\n }\n\n return String(value)\n}\n\nexport const createLinearPercentFormat = (\n value: string | number,\n autoFormat: boolean | undefined,\n numFormat: NumFormat,\n formatter: Formatter,\n percentFormatter: Formatter,\n) => {\n if (isNullish(autoFormat) && isEmpty(numFormat)) {\n return percentFormatter(value)\n }\n\n if (autoFormat === true) {\n return percentFormatter(value)\n }\n\n if (!isEmpty(numFormat)) {\n return formatter(value)\n }\n\n return String(value)\n}\n"],"names":["createLinearFormat","value","autoFormat","numFormat","formatter","isNullish","isEmpty","autoFormatter","String","createLinearPercentFormat","percentFormatter"],"mappings":";;AAIO,MAAMA,qBAAqB,CAChCC,OACAC,YACAC,WACAC;IAEA,IAAIC,UAAUH,eAAeI,QAAQH,YACnC,OAAOI,cAAcN;IAGvB,IAAIC,AAAe,SAAfA,YACF,OAAOK,cAAcN;IAGvB,IAAI,CAACK,QAAQH,YACX,OAAOC,UAAUH;IAGnB,OAAOO,OAAOP;AAChB;AAEO,MAAMQ,4BAA4B,CACvCR,OACAC,YACAC,WACAC,WACAM;IAEA,IAAIL,UAAUH,eAAeI,QAAQH,YACnC,OAAOO,iBAAiBT;IAG1B,IAAIC,AAAe,SAAfA,YACF,OAAOQ,iBAAiBT;IAG1B,IAAI,CAACK,QAAQH,YACX,OAAOC,UAAUH;IAGnB,OAAOO,OAAOP;AAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/radarAngle.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/radarAngle.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radarAngleAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n orient: 'angle',\n visible: true,\n zero: true,\n nice: true,\n grid: {\n visible: true,\n },\n domainLine: {\n visible: true,\n },\n tick: {\n visible: true,\n },\n })\n\n return result\n}\n"],"names":["radarAngleAxis","spec","result"],"mappings":"AAGO,MAAMA,iBAAiC,CAACC;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;QACN,MAAM;YACJ,SAAS;QACX;QACA,YAAY;YACV,SAAS;QACX;QACA,MAAM;YACJ,SAAS;QACX;IACF;IAEA,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/radarAngle.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/radarAngle.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radarAngleAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n orient: 'angle',\n visible: true,\n zero: true,\n nice: true,\n grid: {\n visible: true,\n },\n domainLine: {\n visible: true,\n },\n tick: {\n visible: true,\n },\n })\n\n return result\n}\n"],"names":["radarAngleAxis","spec","result"],"mappings":"AAGO,MAAMA,iBAAiC,CAACC;IAC7C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;QACN,MAAM;YACJ,SAAS;QACX;QACA,YAAY;YACV,SAAS;QACX;QACA,MAAM;YACJ,SAAS;QACX;IACF;IAEA,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/radarRadius.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/radarRadius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radarRadiusAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n orient: 'radius',\n visible: true,\n zero: true,\n nice: true,\n grid: {\n visible: true,\n },\n tick: {\n visible: true,\n },\n label: {\n visible: true,\n },\n domainLine: {\n visible: true,\n },\n })\n\n return result\n}\n"],"names":["radarRadiusAxis","spec","result"],"mappings":"AAGO,MAAMA,kBAAkC,CAACC;IAC9C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;QACN,MAAM;YACJ,SAAS;QACX;QACA,MAAM;YACJ,SAAS;QACX;QACA,OAAO;YACL,SAAS;QACX;QACA,YAAY;YACV,SAAS;QACX;IACF;IAEA,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/radarRadius.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/radarRadius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radarRadiusAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n orient: 'radius',\n visible: true,\n zero: true,\n nice: true,\n grid: {\n visible: true,\n },\n tick: {\n visible: true,\n },\n label: {\n visible: true,\n },\n domainLine: {\n visible: true,\n },\n })\n\n return result\n}\n"],"names":["radarRadiusAxis","spec","result"],"mappings":"AAGO,MAAMA,kBAAkC,CAACC;IAC9C,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;QACN,MAAM;YACJ,SAAS;QACX;QACA,MAAM;YACJ,SAAS;QACX;QACA,OAAO;YACL,SAAS;QACX;QACA,YAAY;YACV,SAAS;QACX;IACF;IAEA,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/radius.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/radius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radiusAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n type: 'linear',\n orient: 'radius',\n visible: false,\n zero: true,\n nice: false,\n })\n\n return result\n}\n"],"names":["radiusAxis","spec","result"],"mappings":"AAGO,MAAMA,aAA6B,CAACC;IACzC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,MAAM;QACN,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;IACR;IAEA,OAAOA;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/radius.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/radius.ts"],"sourcesContent":["import type { IRoseChartSpec } from '@visactor/vchart'\nimport type { VChartSpecPipe } from 'src/types'\n\nexport const radiusAxis: VChartSpecPipe = (spec) => {\n const result = { ...spec } as IRoseChartSpec\n\n if (!result.axes) {\n result.axes = []\n }\n\n result.axes.push({\n type: 'linear',\n orient: 'radius',\n visible: false,\n zero: true,\n nice: false,\n })\n\n return result\n}\n"],"names":["radiusAxis","spec","result"],"mappings":"AAGO,MAAMA,aAA6B,CAACC;IACzC,MAAMC,SAAS;QAAE,GAAGD,IAAI;IAAC;IAEzB,IAAI,CAACC,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlBA,OAAO,IAAI,CAAC,IAAI,CAAC;QACf,MAAM;QACN,QAAQ;QACR,SAAS;QACT,MAAM;QACN,MAAM;IACR;IAEA,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/title/defaultTitleText.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/title/defaultTitleText.ts"],"sourcesContent":["import { findAllMeasures } from 'src/pipeline/utils'\nimport type { Dimensions, MeasureTree } from 'src/types'\n\nexport const defaultTitleText = (measures: MeasureTree, dimensions: Dimensions, idList: string[] = []) => {\n const allMeasures = findAllMeasures(measures)\n return idList\n .map((id) => {\n const alias = [...allMeasures, ...dimensions].find((f) => f.id === id)?.alias || ''\n return alias\n })\n .join(' & ')\n}\n"],"names":["defaultTitleText","measures","dimensions","idList","allMeasures","findAllMeasures","id","alias","f"],"mappings":";AAGO,MAAMA,mBAAmB,CAACC,UAAuBC,YAAwBC,SAAmB,EAAE;IACnG,MAAMC,cAAcC,gBAAgBJ;IACpC,OAAOE,OACJ,GAAG,CAAC,CAACG;QACJ,MAAMC,QAAQ;eAAIH;eAAgBF;SAAW,CAAC,IAAI,CAAC,CAACM,IAAMA,EAAE,EAAE,KAAKF,KAAK,SAAS;QACjF,OAAOC;IACT,GACC,IAAI,CAAC;AACV"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/title/defaultTitleText.js","sources":["../../../../../../../../src/pipeline/spec/chart/pipes/axes/title/defaultTitleText.ts"],"sourcesContent":["import { findAllMeasures } from 'src/pipeline/utils'\nimport type { Dimensions, MeasureTree } from 'src/types'\n\nexport const defaultTitleText = (measures: MeasureTree, dimensions: Dimensions, idList: string[] = []) => {\n const allMeasures = findAllMeasures(measures)\n return idList\n .map((id) => {\n const alias = [...allMeasures, ...dimensions].find((f) => f.id === id)?.alias || ''\n return alias\n })\n .join(' & ')\n}\n"],"names":["defaultTitleText","measures","dimensions","idList","allMeasures","findAllMeasures","id","alias","f"],"mappings":";AAGO,MAAMA,mBAAmB,CAACC,UAAuBC,YAAwBC,SAAmB,EAAE;IACnG,MAAMC,cAAcC,gBAAgBJ;IACpC,OAAOE,OACJ,GAAG,CAAC,CAACG;QACJ,MAAMC,QAAQ;eAAIH;eAAgBF;SAAW,CAAC,IAAI,CAAC,CAACM,IAAMA,EAAE,EAAE,KAAKF,KAAK,SAAS;QACjF,OAAOC;IACT,GACC,IAAI,CAAC;AACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/xBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/xBand.ts"],"sourcesContent":["import type { ICartesianBandAxisSpec, ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XBandAxis } from 'src/types'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { AXIS_LABEL_SPACE } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape'\nimport { isArray } from '@visactor/vutils'\n\nexport const xBand: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed\n const config = (advancedVSeed.config?.[chartType as 'column']?.xAxis ?? {}) as XBandAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n labelAutoHide,\n labelAutoHideGap,\n labelAutoLimit,\n labelAutoLimitLength = 80,\n labelAutoRotate,\n labelAutoRotateAngleRange,\n } = config\n\n const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit)\n const onlyMeasureId = (encoding.x || []).filter((v) => v !== MeasureId).length === 0\n\n const bandAxis = {\n visible,\n type: 'band',\n orient: 'bottom',\n maxHeight: labelAutoLimitLength + 60,\n sampling,\n hover: true,\n label: {\n visible: label?.visible,\n flush: true,\n space: AXIS_LABEL_SPACE,\n style: {\n maxLineWidth: labelAutoLimitLength,\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n\n // 防重叠相关\n minGap: labelAutoHideGap,\n autoHide: labelAutoHide,\n autoHideMethod: 'greedy',\n autoHideSeparation: labelAutoHideGap,\n autoLimit: labelAutoLimit,\n autoRotate: labelAutoRotate,\n autoRotateAngle: labelAutoRotateAngleRange,\n lastVisible: true,\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n paddingInner: [0.15, 0.1],\n paddingOuter: [0.075, 0.1],\n } as ICartesianBandAxisSpec\n if (onlyMeasureId && bandAxis.label) {\n const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo\n const colorIdMap = allDatasetReshapeInfo.reduce<Record<string, { id: string; alias: string }>>((prev, cur) => {\n return { ...prev, ...cur.unfoldInfo.colorIdMap }\n }, {})\n\n bandAxis.label.formatMethod = (text: string | string[]) => {\n return isArray(text) ? text : (colorIdMap[String(text)]?.alias ?? text)\n }\n }\n\n result.axes = [...result.axes, bandAxis] as ISpec['axes']\n return result\n}\n"],"names":["xBand","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","datasetReshapeInfo","pivotAllDatasetReshapeInfo","config","visible","label","tick","title","grid","line","labelAutoHide","labelAutoHideGap","labelAutoLimit","labelAutoLimitLength","labelAutoRotate","labelAutoRotateAngleRange","sampling","onlyMeasureId","v","MeasureId","bandAxis","AXIS_LABEL_SPACE","defaultTitleText","allDatasetReshapeInfo","colorIdMap","prev","cur","text","isArray","String"],"mappings":";;;;AAOO,MAAMA,QAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,0BAA0B,EAAE,GAAGP;IAC3F,MAAMQ,SAAUR,cAAc,MAAM,EAAE,CAACE,UAAsB,EAAE,SAAS,CAAC;IAEzE,IAAI,CAACH,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,MAAM,EACJU,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,uBAAuB,EAAE,EACzBC,eAAe,EACfC,yBAAyB,EAC1B,GAAGZ;IAEJ,MAAMa,WAAW,CAAEN,CAAAA,iBAAiBI,mBAAmBF,cAAa;IACpE,MAAMK,gBAAiBjB,AAA4D,MAA5DA,AAAAA,CAAAA,SAAS,CAAC,IAAI,EAAC,EAAG,MAAM,CAAC,CAACkB,IAAMA,MAAMC,WAAW,MAAM;IAE9E,MAAMC,WAAW;QACfhB;QACA,MAAM;QACN,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OAAO,IAAI;QAAE0B;KAAS;IACxC,OAAO1B;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/xBand.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/xBand.ts"],"sourcesContent":["import type { ICartesianBandAxisSpec, ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XBandAxis } from 'src/types'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { AXIS_LABEL_SPACE } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape'\nimport { isArray } from '@visactor/vutils'\n\nexport const xBand: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed\n const config = (advancedVSeed.config?.[chartType as 'column']?.xAxis ?? {}) as XBandAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n labelAutoHide,\n labelAutoHideGap,\n labelAutoLimit,\n labelAutoLimitLength = 80,\n labelAutoRotate,\n labelAutoRotateAngleRange,\n } = config\n\n const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit)\n const onlyMeasureId = (encoding.x || []).filter((v) => v !== MeasureId).length === 0\n\n const bandAxis = {\n visible,\n type: 'band',\n orient: 'bottom',\n maxHeight: labelAutoLimitLength + 60,\n sampling,\n hover: true,\n label: {\n visible: label?.visible,\n flush: true,\n space: AXIS_LABEL_SPACE,\n style: {\n maxLineWidth: labelAutoLimitLength,\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n\n // 防重叠相关\n minGap: labelAutoHideGap,\n autoHide: labelAutoHide,\n autoHideMethod: 'greedy',\n autoHideSeparation: labelAutoHideGap,\n autoLimit: labelAutoLimit,\n autoRotate: labelAutoRotate,\n autoRotateAngle: labelAutoRotateAngleRange,\n lastVisible: true,\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n paddingInner: [0.15, 0.1],\n paddingOuter: [0.075, 0.1],\n } as ICartesianBandAxisSpec\n if (onlyMeasureId && bandAxis.label) {\n const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo\n const colorIdMap = allDatasetReshapeInfo.reduce<Record<string, { id: string; alias: string }>>((prev, cur) => {\n return { ...prev, ...cur.unfoldInfo.colorIdMap }\n }, {})\n\n bandAxis.label.formatMethod = (text: string | string[]) => {\n return isArray(text) ? text : (colorIdMap[String(text)]?.alias ?? text)\n }\n }\n\n result.axes = [...result.axes, bandAxis] as ISpec['axes']\n return result\n}\n"],"names":["xBand","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","datasetReshapeInfo","pivotAllDatasetReshapeInfo","config","visible","label","tick","title","grid","line","labelAutoHide","labelAutoHideGap","labelAutoLimit","labelAutoLimitLength","labelAutoRotate","labelAutoRotateAngleRange","sampling","onlyMeasureId","v","MeasureId","bandAxis","AXIS_LABEL_SPACE","defaultTitleText","allDatasetReshapeInfo","colorIdMap","prev","cur","text","isArray","String"],"mappings":";;;;AAOO,MAAMA,QAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAE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A,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;gBACd,UAAUA,MAAM;YAClB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,cAAc;YAAC;YAAM;SAAI;QACzB,cAAc;YAAC;YAAO;SAAI;IAC5B;IACA,IAAIQ,iBAAiBG,SAAS,KAAK,EAAE;QACnC,MAAMG,wBAAwBrB,8BAA8BD;QAC5D,MAAMuB,aAAaD,sBAAsB,MAAM,CAAgD,CAACE,MAAMC,MAC7F;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU,CAAC,UAAU;YAAC,IAC9C,CAAC;QAEJN,SAAS,KAAK,CAAC,YAAY,GAAG,CAACO,OACtBC,QAAQD,QAAQA,OAAQH,UAAU,CAACK,OAAOF,MAAM,EAAE,SAASA;IAEtE;IAEAjC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE0B;KAAS;IACxC,OAAO1B;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/xLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/xLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XLinearAxis } from 'src/types'\nimport {\n AXIS_LABEL_SPACE,\n createNumFormatter,\n isAreaPercent,\n isBarPercent,\n isColumnPercent,\n isPivotChart,\n LINEAR_AXIS_INNER_OFFSET_TOP,\n} from 'src/pipeline/utils'\nimport { createLinearFormat, createLinearPercentFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\n\nexport const xLinear: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { encoding, dimensions, measures } = advancedVSeed\n const { chartType } = vseed\n const config = (advancedVSeed.config?.[chartType as 'bar']?.xAxis ?? {}) as XLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n const isPivot = isPivotChart(vseed)\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n const percentFormatter = createNumFormatter({\n type: 'percent',\n })\n\n const linearAxis = {\n ...(isPivot\n ? {\n range: {\n min,\n max,\n },\n }\n : {\n min,\n max,\n }),\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'bottom',\n nice,\n zero: log ? false : zero,\n inverse,\n label: {\n space: AXIS_LABEL_SPACE,\n visible: label?.visible,\n formatMethod: (value: string) => {\n if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) {\n return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter)\n }\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n right: LINEAR_AXIS_INNER_OFFSET_TOP,\n // left: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["xLinear","spec","context","result","advancedVSeed","vseed","encoding","dimensions","measures","chartType","config","isPivot","isPivotChart","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","percentFormatter","linearAxis","AXIS_LABEL_SPACE","value","isBarPercent","isColumnPercent","isAreaPercent","createLinearPercentFormat","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;AAcO,MAAMA,UAA0B,CAACC,MAAMC;IAC5C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IAC3C,MAAM,EAAEK,SAAS,EAAE,GAAGJ;IACtB,MAAMK,SAAUN,cAAc,MAAM,EAAE,CAACK,UAAmB,EAAE,SAAS,CAAC;IAEtE,IAAI,CAACN,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAElB,MAAMQ,UAAUC,aAAaP;IAE7B,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGjB;IAEJ,MAAMkB,YAAYC,mBAAmBF;IACrC,MAAMG,mBAAmBD,mBAAmB;QAC1C,MAAM;IACR;IAEA,MAAME,aAAa;QACjB,GAAIpB,UACA;YACE,OAAO;gBACLY;gBACAD;YACF;QACF,IACA;YACEC;YACAD;QACF,CAAC;QACLT;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACA,OAAO;YACL,OAAOW;YACP,SAASlB,OAAO;YAChB,cAAc,CAACmB;gBACb,IAAIC,aAAa7B,UAAU8B,gBAAgB9B,UAAU+B,cAAc/B,QACjE,OAAOgC,0BAA0BJ,OAAOP,YAAYC,WAAWC,WAAWE;gBAE5E,OAAOQ,mBAAmBL,OAAOP,YAAYC,WAAWC;YAC1D;YACA,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAauB,iBAAiB/B,UAAUD,YAAYD,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMU,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;gBACd,UAAUA,MAAM;YAClB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,OAAOsB;QAET;IACF;IAEArC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE4B;KAAW;IAE1C,OAAO5B;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/xLinear.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/xLinear.ts"],"sourcesContent":["import type { ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XLinearAxis } from 'src/types'\nimport {\n AXIS_LABEL_SPACE,\n createNumFormatter,\n isAreaPercent,\n isBarPercent,\n isColumnPercent,\n isPivotChart,\n LINEAR_AXIS_INNER_OFFSET_TOP,\n} from 'src/pipeline/utils'\nimport { createLinearFormat, createLinearPercentFormat } from './format/linearFormat'\nimport { defaultTitleText } from './title/defaultTitleText'\n\nexport const xLinear: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { encoding, dimensions, measures } = advancedVSeed\n const { chartType } = vseed\n const config = (advancedVSeed.config?.[chartType as 'bar']?.xAxis ?? {}) as XLinearAxis\n\n if (!result.axes) {\n result.axes = []\n }\n const isPivot = isPivotChart(vseed)\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n\n zero,\n nice,\n inverse,\n max,\n min,\n log,\n logBase = 10,\n autoFormat,\n numFormat = {},\n } = config\n\n const formatter = createNumFormatter(numFormat)\n const percentFormatter = createNumFormatter({\n type: 'percent',\n })\n\n const linearAxis = {\n ...(isPivot\n ? {\n range: {\n min,\n max,\n },\n }\n : {\n min,\n max,\n }),\n visible,\n type: log ? 'log' : 'linear',\n base: logBase,\n orient: 'bottom',\n nice,\n zero: log ? false : zero,\n inverse,\n label: {\n space: AXIS_LABEL_SPACE,\n visible: label?.visible,\n formatMethod: (value: string) => {\n if (isBarPercent(vseed) || isColumnPercent(vseed) || isAreaPercent(vseed)) {\n return createLinearPercentFormat(value, autoFormat, numFormat, formatter, percentFormatter)\n }\n return createLinearFormat(value, autoFormat, numFormat, formatter)\n },\n style: {\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.x as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n innerOffset: {\n right: LINEAR_AXIS_INNER_OFFSET_TOP,\n // left: LINEAR_AXIS_INNER_OFFSET_TOP,\n },\n }\n\n result.axes = [...result.axes, linearAxis] as ISpec['axes']\n\n return result\n}\n"],"names":["xLinear","spec","context","result","advancedVSeed","vseed","encoding","dimensions","measures","chartType","config","isPivot","isPivotChart","visible","label","tick","title","grid","line","zero","nice","inverse","max","min","log","logBase","autoFormat","numFormat","formatter","createNumFormatter","percentFormatter","linearAxis","AXIS_LABEL_SPACE","value","isBarPercent","isColumnPercent","isAreaPercent","createLinearPercentFormat","createLinearFormat","defaultTitleText","LINEAR_AXIS_INNER_OFFSET_TOP"],"mappings":";;;AAcO,MAAMA,UAA0B,CAACC,MAAMC;IAC5C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IAC3C,MAAM,EAAEK,SAAS,EAAE,GAAGJ;IACtB,MAAMK,SAAUN,cAAc,MAAM,EAAE,CAACK,UAAmB,EAAE,SAAS,CAAC;IAEtE,IAAI,CAACN,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAElB,MAAMQ,UAAUC,aAAaP;IAE7B,MAAM,EACJQ,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EAEJC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,UAAU,EAAE,EACZC,UAAU,EACVC,YAAY,CAAC,CAAC,EACf,GAAGjB;IAEJ,MAAMkB,YAAYC,mBAAmBF;IACrC,MAAMG,mBAAmBD,mBAAmB;QAC1C,MAAM;IACR;IAEA,MAAME,aAAa;QACjB,GAAIpB,UACA;YACE,OAAO;gBACLY;gBACAD;YACF;QACF,IACA;YACEC;YACAD;QACF,CAAC;QACLT;QACA,MAAMW,MAAM,QAAQ;QACpB,MAAMC;QACN,QAAQ;QACRL;QACA,MAAMI,MAAM,QAAQL;QACpBE;QACA,OAAO;YACL,OAAOW;YACP,SAASlB,OAAO;YAChB,cAAc,CAACmB;gBACb,IAAIC,aAAa7B,UAAU8B,gBAAgB9B,UAAU+B,cAAc/B,QACjE,OAAOgC,0BAA0BJ,OAAOP,YAAYC,WAAWC,WAAWE;gBAE5E,OAAOQ,mBAAmBL,OAAOP,YAAYC,WAAWC;YAC1D;YACA,OAAO;gBACL,MAAMd,OAAO;gBACb,OAAOA,OAAO;gBACd,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,OAAO;YACL,SAASE,OAAO;YAChB,MAAMA,OAAO,aAAauB,iBAAiB/B,UAAUD,YAAYD,SAAS,CAAC;YAC3E,OAAO;gBACL,MAAMU,OAAO;gBACb,UAAUA,OAAO;gBACjB,YAAYA,OAAO;YACrB;QACF;QACA,MAAM;YACJ,SAASD,MAAM;YACf,UAAUA,MAAM;YAChB,QAAQA,MAAM;YACd,OAAO;gBACL,QAAQA,MAAM;YAChB;QACF;QACA,MAAM;YACJ,SAASE,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;gBACd,UAAUA,MAAM;YAClB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,aAAa;YACX,OAAOsB;QAET;IACF;IAEArC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE4B;KAAW;IAE1C,OAAO5B;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipes/axes/yBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/axes/yBand.ts"],"sourcesContent":["import type { ICartesianBandAxisSpec, ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XBandAxis } from 'src/types'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { AXIS_LABEL_SPACE } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape'\nimport { isArray } from '@visactor/vutils'\n\nexport const yBand: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed\n const config = (advancedVSeed.config?.[chartType as 'bar']?.yAxis ?? {}) as XBandAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n labelAutoHide,\n labelAutoHideGap,\n labelAutoLimit,\n labelAutoLimitLength = 80,\n labelAutoRotate,\n labelAutoRotateAngleRange,\n } = config\n\n const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit)\n const onlyMeasureId = (encoding.y || []).filter((v) => v !== MeasureId).length === 0\n\n const bandAxis = {\n visible,\n type: 'band',\n orient: 'left',\n maxWidth: labelAutoLimitLength + 60,\n sampling,\n hover: true,\n label: {\n visible: label?.visible,\n flush: true,\n containerAlign: 'right',\n space: AXIS_LABEL_SPACE,\n style: {\n maxLineWidth: labelAutoLimitLength,\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n // 防重叠相关\n minGap: labelAutoHideGap,\n autoHide: labelAutoHide,\n autoHideMethod: 'greedy',\n autoHideSeparation: labelAutoHideGap,\n autoLimit: labelAutoLimit,\n autoRotate: labelAutoRotate,\n autoRotateAngle: labelAutoRotateAngleRange,\n lastVisible: true,\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n paddingInner: [0.15, 0.1],\n paddingOuter: [0.075, 0.1],\n } as ICartesianBandAxisSpec\n if (onlyMeasureId && bandAxis.label) {\n const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo\n const colorIdMap = allDatasetReshapeInfo.reduce<Record<string, { id: string; alias: string }>>((prev, cur) => {\n return { ...prev, ...cur.unfoldInfo.colorIdMap }\n }, {})\n\n bandAxis.label.formatMethod = (text: string | string[]) => {\n return isArray(text) ? text : (colorIdMap[String(text)]?.alias ?? text)\n }\n }\n\n result.axes = [...result.axes, bandAxis] as ISpec['axes']\n return result\n}\n"],"names":["yBand","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","datasetReshapeInfo","pivotAllDatasetReshapeInfo","config","visible","label","tick","title","grid","line","labelAutoHide","labelAutoHideGap","labelAutoLimit","labelAutoLimitLength","labelAutoRotate","labelAutoRotateAngleRange","sampling","onlyMeasureId","v","MeasureId","bandAxis","AXIS_LABEL_SPACE","defaultTitleText","allDatasetReshapeInfo","colorIdMap","prev","cur","text","isArray","String"],"mappings":";;;;AAOO,MAAMA,QAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,0BAA0B,EAAE,GAAGP;IAC3F,MAAMQ,SAAUR,cAAc,MAAM,E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MAAM;YAClB;QACF;QACA,YAAY;YACV,SAASC,MAAM;YACf,OAAO;gBACL,WAAWA,MAAM;gBACjB,QAAQA,MAAM;YAChB;QACF;QACA,cAAc;YAAC;YAAM;SAAI;QACzB,cAAc;YAAC;YAAO;SAAI;IAC5B;IACA,IAAIQ,iBAAiBG,SAAS,KAAK,EAAE;QACnC,MAAMG,wBAAwBrB,8BAA8BD;QAC5D,MAAMuB,aAAaD,sBAAsB,MAAM,CAAgD,CAACE,MAAMC,MAC7F;gBAAE,GAAGD,IAAI;gBAAE,GAAGC,IAAI,UAAU,CAAC,UAAU;YAAC,IAC9C,CAAC;QAEJN,SAAS,KAAK,CAAC,YAAY,GAAG,CAACO,OACtBC,QAAQD,QAAQA,OAAQH,UAAU,CAACK,OAAOF,MAAM,EAAE,SAASA;IAEtE;IAEAjC,OAAO,IAAI,GAAG;WAAIA,OAAO,IAAI;QAAE0B;KAAS;IACxC,OAAO1B;AACT"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/axes/yBand.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/axes/yBand.ts"],"sourcesContent":["import type { ICartesianBandAxisSpec, ISpec } from '@visactor/vchart'\nimport type { VChartSpecPipe, XBandAxis } from 'src/types'\nimport { defaultTitleText } from './title/defaultTitleText'\nimport { AXIS_LABEL_SPACE } from 'src/pipeline/utils'\nimport { MeasureId } from 'src/dataReshape'\nimport { isArray } from '@visactor/vutils'\n\nexport const yBand: VChartSpecPipe = (spec, context) => {\n const result = { ...spec } as ISpec\n const { advancedVSeed, vseed } = context\n const { chartType } = vseed\n const { measures, dimensions, encoding, datasetReshapeInfo, pivotAllDatasetReshapeInfo } = advancedVSeed\n const config = (advancedVSeed.config?.[chartType as 'bar']?.yAxis ?? {}) as XBandAxis\n\n if (!result.axes) {\n result.axes = []\n }\n\n const {\n visible = true,\n label,\n tick,\n title,\n grid,\n line,\n labelAutoHide,\n labelAutoHideGap,\n labelAutoLimit,\n labelAutoLimitLength = 80,\n labelAutoRotate,\n labelAutoRotateAngleRange,\n } = config\n\n const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit)\n const onlyMeasureId = (encoding.y || []).filter((v) => v !== MeasureId).length === 0\n\n const bandAxis = {\n visible,\n type: 'band',\n orient: 'left',\n maxWidth: labelAutoLimitLength + 60,\n sampling,\n hover: true,\n label: {\n visible: label?.visible,\n flush: true,\n containerAlign: 'right',\n space: AXIS_LABEL_SPACE,\n style: {\n maxLineWidth: labelAutoLimitLength,\n fill: label?.labelColor,\n angle: label?.labelAngle,\n fontSize: label?.labelFontSize,\n fontWeight: label?.labelFontWeight,\n },\n // 防重叠相关\n minGap: labelAutoHideGap,\n autoHide: labelAutoHide,\n autoHideMethod: 'greedy',\n autoHideSeparation: labelAutoHideGap,\n autoLimit: labelAutoLimit,\n autoRotate: labelAutoRotate,\n autoRotateAngle: labelAutoRotateAngleRange,\n lastVisible: true,\n },\n title: {\n visible: title?.visible,\n text: title?.titleText || defaultTitleText(measures, dimensions, encoding.y as string[]),\n style: {\n fill: title?.titleColor,\n fontSize: title?.titleFontSize,\n fontWeight: title?.titleFontWeight,\n },\n },\n tick: {\n visible: tick?.visible,\n tickSize: tick?.tickSize,\n inside: tick?.tickInside,\n style: {\n stroke: tick?.tickColor,\n },\n },\n grid: {\n visible: grid?.visible,\n style: {\n lineWidth: grid?.gridWidth,\n stroke: grid?.gridColor,\n lineDash: grid?.gridLineDash,\n },\n },\n domainLine: {\n visible: line?.visible,\n style: {\n lineWidth: line?.lineWidth,\n stroke: line?.lineColor,\n },\n },\n paddingInner: [0.15, 0.1],\n paddingOuter: [0.075, 0.1],\n } as ICartesianBandAxisSpec\n if (onlyMeasureId && bandAxis.label) {\n const allDatasetReshapeInfo = pivotAllDatasetReshapeInfo || datasetReshapeInfo\n const colorIdMap = allDatasetReshapeInfo.reduce<Record<string, { id: string; alias: string }>>((prev, cur) => {\n return { ...prev, ...cur.unfoldInfo.colorIdMap }\n }, {})\n\n bandAxis.label.formatMethod = (text: string | string[]) => {\n return isArray(text) ? text : (colorIdMap[String(text)]?.alias ?? text)\n }\n }\n\n result.axes = [...result.axes, bandAxis] as ISpec['axes']\n return result\n}\n"],"names":["yBand","spec","context","result","advancedVSeed","vseed","chartType","measures","dimensions","encoding","datasetReshapeInfo","pivotAllDatasetReshapeInfo","config","visible","label","tick","title","grid","line","labelAutoHide","labelAutoHideGap","labelAutoLimit","labelAutoLimitLength","labelAutoRotate","labelAutoRotateAngleRange","sampling","onlyMeasureId","v","MeasureId","bandAxis","AXIS_LABEL_SPACE","defaultTitleText","allDatasetReshapeInfo","colorIdMap","prev","cur","text","isArray","String"],"mappings":";;;;AAOO,MAAMA,QAAwB,CAACC,MAAMC;IAC1C,MAAMC,SAAS;QAAE,GAAGF,IAAI;IAAC;IACzB,MAAM,EAAEG,aAAa,EAAEC,KAAK,EAAE,GAAGH;IACjC,MAAM,EAAEI,SAAS,EAAE,GAAGD;IACtB,MAAM,EAAEE,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,0BAA0B,EAAE,GAAGP;IAC3F,MAAMQ,SAAUR,cAAc,MAAM,EAAE,CAACE,UAAmB,EAAE,SAAS,CAAC;IAEtE,IAAI,CAACH,OAAO,IAAI,EACdA,OAAO,IAAI,GAAG,EAAE;IAGlB,MAAM,EACJU,UAAU,IAAI,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,uBAAuB,EAAE,EACzBC,eAAe,EACfC,yBAAyB,EAC1B,GAAGZ;IAEJ,MAAMa,WAAW,CAAEN,CAAAA,iBAAiBI,mBAAmBF,cAAa;IACpE,MAAMK,gBAAiBjB,AAA4D,MAA5DA,AAAAA,CAAAA,SAAS,CAAC,IAAI,EAAC,EAAG,MAAM,CAAC,CAACkB,IAAMA,MAAMC,WAAW,MAAM;IAE9E,MAAMC,WAAW;QACfhB;QACA,MAAM;QACN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