@visactor/vseed 0.1.43 → 0.1.45

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 (474) hide show
  1. package/dist/cjs/index.cjs +3 -3
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/buildSpec.js.map +1 -1
  4. package/dist/esm/builder/builder/builder.d.ts +4620 -0
  5. package/dist/esm/dataSelector/selector.d.ts +1 -1
  6. package/dist/esm/dataSelector/selector.js +1 -2
  7. package/dist/esm/dataSelector/selector.js.map +1 -1
  8. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +2 -0
  9. package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -1
  10. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.d.ts +1 -0
  11. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js +35 -2
  12. package/dist/esm/pipeline/advanced/chart/pipes/config/histogram.js.map +1 -1
  13. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js +1 -1
  14. package/dist/esm/pipeline/advanced/chart/pipes/regressionLine/regressionLine.js.map +1 -1
  15. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +22 -2
  16. package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
  17. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +22 -3
  18. package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
  19. package/dist/esm/pipeline/advanced/table/pipeline/pivotTable.js +3 -2
  20. package/dist/esm/pipeline/advanced/table/pipeline/pivotTable.js.map +1 -1
  21. package/dist/esm/pipeline/advanced/table/pipeline/table.js +2 -1
  22. package/dist/esm/pipeline/advanced/table/pipeline/table.js.map +1 -1
  23. package/dist/esm/pipeline/advanced/table/pipes/{default/defaultMeasureName.d.ts → cellStyle/cellStyle.d.ts} +1 -1
  24. package/dist/esm/pipeline/advanced/table/pipes/cellStyle/cellStyle.js +16 -0
  25. package/dist/esm/pipeline/advanced/table/pipes/cellStyle/cellStyle.js.map +1 -0
  26. package/dist/esm/pipeline/advanced/table/pipes/cellStyle/index.d.ts +1 -0
  27. package/dist/esm/pipeline/advanced/table/pipes/cellStyle/index.js +2 -0
  28. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureId.d.ts +2 -0
  29. package/dist/esm/pipeline/advanced/table/pipes/default/{defaultMeasureName.js → defaultMeasureId.js} +5 -5
  30. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureId.js.map +1 -0
  31. package/dist/esm/pipeline/advanced/table/pipes/default/index.d.ts +1 -1
  32. package/dist/esm/pipeline/advanced/table/pipes/default/index.js +2 -2
  33. package/dist/esm/pipeline/advanced/table/pipes/index.d.ts +1 -0
  34. package/dist/esm/pipeline/advanced/table/pipes/index.js +1 -0
  35. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  36. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  37. package/dist/esm/pipeline/spec/chart/pipeline/bar.d.ts +1 -2
  38. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  39. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.d.ts +1 -2
  40. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  41. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.d.ts +1 -2
  42. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  43. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.d.ts +1 -2
  44. package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
  45. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  46. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.d.ts +1 -2
  47. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  48. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.d.ts +1 -2
  49. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  50. package/dist/esm/pipeline/spec/chart/pipeline/donut.d.ts +1 -2
  51. package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
  52. package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.d.ts +1 -2
  53. package/dist/esm/pipeline/spec/chart/pipeline/dualAxis.js.map +1 -1
  54. package/dist/esm/pipeline/spec/chart/pipeline/funnel.d.ts +1 -2
  55. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
  56. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.d.ts +1 -2
  57. package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
  58. package/dist/esm/pipeline/spec/chart/pipeline/histogram.d.ts +1 -2
  59. package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipeline/line.d.ts +1 -2
  61. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  62. package/dist/esm/pipeline/spec/chart/pipeline/pie.d.ts +1 -2
  63. package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
  64. package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
  65. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  66. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.d.ts +1 -2
  67. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  68. package/dist/esm/pipeline/spec/chart/pipeline/scatter.d.ts +1 -2
  69. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  70. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.d.ts +2 -2
  71. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js +16 -13
  72. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js.map +1 -1
  73. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.d.ts +2 -2
  74. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js +14 -19
  75. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
  76. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.d.ts +2 -2
  77. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +6 -2
  78. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
  79. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.d.ts +2 -2
  80. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js +2 -0
  81. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPoint.js.map +1 -1
  82. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.d.ts +2 -2
  83. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +5 -1
  84. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
  85. package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.d.ts +2 -2
  86. package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js +26 -10
  87. package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -1
  88. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.d.ts +34 -0
  89. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js +35 -1
  90. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
  91. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.d.ts +2 -2
  92. package/dist/esm/pipeline/spec/chart/pipes/axes/radarAngle.js.map +1 -1
  93. package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.d.ts +2 -2
  94. package/dist/esm/pipeline/spec/chart/pipes/axes/radarRadius.js.map +1 -1
  95. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.d.ts +2 -2
  96. package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
  97. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.d.ts +2 -2
  98. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js +2 -1
  99. package/dist/esm/pipeline/spec/chart/pipes/axes/xBand.js.map +1 -1
  100. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.d.ts +2 -2
  101. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js +2 -1
  102. package/dist/esm/pipeline/spec/chart/pipes/axes/xLinear.js.map +1 -1
  103. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.d.ts +2 -2
  104. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js +2 -1
  105. package/dist/esm/pipeline/spec/chart/pipes/axes/yBand.js.map +1 -1
  106. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.d.ts +2 -2
  107. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js +2 -1
  108. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinear.js.map +1 -1
  109. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.d.ts +2 -2
  110. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js +2 -1
  111. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearPrimary.js.map +1 -1
  112. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.d.ts +2 -2
  113. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js +2 -1
  114. package/dist/esm/pipeline/spec/chart/pipes/axes/yLinearSecondary.js.map +1 -1
  115. package/dist/esm/pipeline/spec/chart/pipes/backgroundColor/background.d.ts +2 -2
  116. package/dist/esm/pipeline/spec/chart/pipes/backgroundColor/background.js.map +1 -1
  117. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barGapInGroup.d.ts +2 -2
  118. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barGapInGroup.js.map +1 -1
  119. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barMaxWidth.d.ts +2 -2
  120. package/dist/esm/pipeline/spec/chart/pipes/barWidth/barMaxWidth.js.map +1 -1
  121. package/dist/esm/pipeline/spec/chart/pipes/color/color.d.ts +2 -2
  122. package/dist/esm/pipeline/spec/chart/pipes/color/color.js.map +1 -1
  123. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +3 -2
  124. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js +3 -1
  125. package/dist/esm/pipeline/spec/chart/pipes/color/colorAdapter.js.map +1 -1
  126. package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.d.ts +2 -2
  127. package/dist/esm/pipeline/spec/chart/pipes/color/colorAreaStyleFill.js.map +1 -1
  128. package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.d.ts +2 -2
  129. package/dist/esm/pipeline/spec/chart/pipes/color/colorBarStyleFill.js.map +1 -1
  130. package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.d.ts +2 -2
  131. package/dist/esm/pipeline/spec/chart/pipes/color/colorCellStyleFill.js.map +1 -1
  132. package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.d.ts +2 -2
  133. package/dist/esm/pipeline/spec/chart/pipes/color/colorFunnelStyleFill.js.map +1 -1
  134. package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.d.ts +2 -2
  135. package/dist/esm/pipeline/spec/chart/pipes/color/colorLineStyleFill.js.map +1 -1
  136. package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.d.ts +2 -2
  137. package/dist/esm/pipeline/spec/chart/pipes/color/colorPieStyleFill.js.map +1 -1
  138. package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.d.ts +2 -2
  139. package/dist/esm/pipeline/spec/chart/pipes/color/colorPointStyleFill.js.map +1 -1
  140. package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.d.ts +2 -2
  141. package/dist/esm/pipeline/spec/chart/pipes/color/colorRoseStyleFill.js.map +1 -1
  142. package/dist/esm/pipeline/spec/chart/pipes/color/linearColor.d.ts +2 -2
  143. package/dist/esm/pipeline/spec/chart/pipes/color/linearColor.js.map +1 -1
  144. package/dist/esm/pipeline/spec/chart/pipes/color/linearColorForDualAxis.d.ts +2 -2
  145. package/dist/esm/pipeline/spec/chart/pipes/color/linearColorForDualAxis.js.map +1 -1
  146. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.d.ts +2 -2
  147. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairLine.js.map +1 -1
  148. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.d.ts +2 -2
  149. package/dist/esm/pipeline/spec/chart/pipes/crosshair/horizontalCrosshairRect.js.map +1 -1
  150. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.d.ts +2 -2
  151. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairLine.js.map +1 -1
  152. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.d.ts +2 -2
  153. package/dist/esm/pipeline/spec/chart/pipes/crosshair/verticalCrosshairRect.js.map +1 -1
  154. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.d.ts +2 -2
  155. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetBoxplot.js.map +1 -1
  156. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetDualAxis.d.ts +3 -3
  157. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetDualAxis.js.map +1 -1
  158. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.d.ts +2 -2
  159. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetHistogram.js.map +1 -1
  160. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.d.ts +2 -2
  161. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetPivot.js.map +1 -1
  162. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetScatter.d.ts +2 -2
  163. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetScatter.js.map +1 -1
  164. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetXY.d.ts +2 -2
  165. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetXY.js.map +1 -1
  166. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetYX.d.ts +2 -2
  167. package/dist/esm/pipeline/spec/chart/pipes/dataset/datasetYX.js.map +1 -1
  168. package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.d.ts +2 -2
  169. package/dist/esm/pipeline/spec/chart/pipes/dataset/progressive.js.map +1 -1
  170. package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.d.ts +3 -3
  171. package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
  172. package/dist/esm/pipeline/spec/chart/pipes/init/area.d.ts +2 -2
  173. package/dist/esm/pipeline/spec/chart/pipes/init/area.js.map +1 -1
  174. package/dist/esm/pipeline/spec/chart/pipes/init/bar.d.ts +2 -2
  175. package/dist/esm/pipeline/spec/chart/pipes/init/bar.js.map +1 -1
  176. package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.d.ts +2 -2
  177. package/dist/esm/pipeline/spec/chart/pipes/init/barParallel.js.map +1 -1
  178. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.d.ts +2 -2
  179. package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
  180. package/dist/esm/pipeline/spec/chart/pipes/init/column.d.ts +2 -2
  181. package/dist/esm/pipeline/spec/chart/pipes/init/column.js.map +1 -1
  182. package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.d.ts +2 -2
  183. package/dist/esm/pipeline/spec/chart/pipes/init/columnParallel.js.map +1 -1
  184. package/dist/esm/pipeline/spec/chart/pipes/init/donut.d.ts +2 -2
  185. package/dist/esm/pipeline/spec/chart/pipes/init/donut.js.map +1 -1
  186. package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.d.ts +3 -3
  187. package/dist/esm/pipeline/spec/chart/pipes/init/dualAxis.js.map +1 -1
  188. package/dist/esm/pipeline/spec/chart/pipes/init/funnel.d.ts +2 -2
  189. package/dist/esm/pipeline/spec/chart/pipes/init/funnel.js.map +1 -1
  190. package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.d.ts +2 -2
  191. package/dist/esm/pipeline/spec/chart/pipes/init/heatmap.js.map +1 -1
  192. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.d.ts +2 -2
  193. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js +4 -0
  194. package/dist/esm/pipeline/spec/chart/pipes/init/histogram.js.map +1 -1
  195. package/dist/esm/pipeline/spec/chart/pipes/init/line.d.ts +2 -2
  196. package/dist/esm/pipeline/spec/chart/pipes/init/line.js.map +1 -1
  197. package/dist/esm/pipeline/spec/chart/pipes/init/pie.d.ts +2 -2
  198. package/dist/esm/pipeline/spec/chart/pipes/init/pie.js.map +1 -1
  199. package/dist/esm/pipeline/spec/chart/pipes/init/pivot.d.ts +2 -2
  200. package/dist/esm/pipeline/spec/chart/pipes/init/pivot.js.map +1 -1
  201. package/dist/esm/pipeline/spec/chart/pipes/init/radar.d.ts +2 -2
  202. package/dist/esm/pipeline/spec/chart/pipes/init/radar.js.map +1 -1
  203. package/dist/esm/pipeline/spec/chart/pipes/init/rose.d.ts +2 -2
  204. package/dist/esm/pipeline/spec/chart/pipes/init/rose.js.map +1 -1
  205. package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.d.ts +2 -2
  206. package/dist/esm/pipeline/spec/chart/pipes/init/roseParallel.js.map +1 -1
  207. package/dist/esm/pipeline/spec/chart/pipes/init/scatter.d.ts +2 -2
  208. package/dist/esm/pipeline/spec/chart/pipes/init/scatter.js.map +1 -1
  209. package/dist/esm/pipeline/spec/chart/pipes/label/label.d.ts +2 -2
  210. package/dist/esm/pipeline/spec/chart/pipes/label/label.js +2 -1
  211. package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
  212. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.d.ts +3 -3
  213. package/dist/esm/pipeline/spec/chart/pipes/label/labelDualAxis.js.map +1 -1
  214. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.d.ts +2 -2
  215. package/dist/esm/pipeline/spec/chart/pipes/label/labelPie.js.map +1 -1
  216. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.d.ts +2 -2
  217. package/dist/esm/pipeline/spec/chart/pipes/label/labelScatter.js.map +1 -1
  218. package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -2
  219. package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +7 -0
  220. package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
  221. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.d.ts +2 -2
  222. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +19 -3
  223. package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
  224. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.d.ts +2 -2
  225. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js.map +1 -1
  226. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.d.ts +2 -2
  227. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
  228. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.d.ts +2 -2
  229. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +1 -0
  230. package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
  231. package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.d.ts +2 -2
  232. package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.js.map +1 -1
  233. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.d.ts +2 -2
  234. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js +5 -7
  235. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js.map +1 -1
  236. package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.d.ts +2 -2
  237. package/dist/esm/pipeline/spec/chart/pipes/markStyle/cellStyle.js.map +1 -1
  238. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.d.ts +2 -2
  239. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelStyle.js.map +1 -1
  240. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.d.ts +2 -2
  241. package/dist/esm/pipeline/spec/chart/pipes/markStyle/funnelTransformStyle.js.map +1 -1
  242. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.d.ts +2 -2
  243. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js.map +1 -1
  244. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pieStyle.d.ts +2 -2
  245. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pieStyle.js.map +1 -1
  246. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.d.ts +3 -3
  247. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
  248. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.d.ts +2 -2
  249. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.js.map +1 -1
  250. package/dist/esm/pipeline/spec/chart/pipes/markStyle/roseStyle.d.ts +2 -2
  251. package/dist/esm/pipeline/spec/chart/pipes/markStyle/roseStyle.js.map +1 -1
  252. package/dist/esm/pipeline/spec/chart/pipes/percent/percent.d.ts +2 -2
  253. package/dist/esm/pipeline/spec/chart/pipes/percent/percent.js.map +1 -1
  254. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.d.ts +2 -2
  255. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.js +4 -1
  256. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAdapter.js.map +1 -1
  257. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.d.ts +2 -2
  258. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js +23 -6
  259. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotAxisStyle.js.map +1 -1
  260. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.d.ts +2 -2
  261. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotColumnDimensions.js.map +1 -1
  262. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.d.ts +2 -2
  263. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +39 -34
  264. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
  265. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.d.ts +2 -2
  266. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js.map +1 -1
  267. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.d.ts +4 -4
  268. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js +10 -3
  269. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotIndicators.js.map +1 -1
  270. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.d.ts +2 -2
  271. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotRowDimensions.js.map +1 -1
  272. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.d.ts +2 -2
  273. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotTitle.js.map +1 -1
  274. package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.d.ts +2 -2
  275. package/dist/esm/pipeline/spec/chart/pipes/region/addRegionPadding.js.map +1 -1
  276. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.d.ts +2 -2
  277. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/columnRegressionLine.js.map +1 -1
  278. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.d.ts +2 -2
  279. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +2 -2
  280. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
  281. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.d.ts +2 -2
  282. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js +2 -2
  283. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/kdeRegressionLine.js.map +1 -1
  284. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.d.ts +6 -6
  285. package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -1
  286. package/dist/esm/pipeline/spec/chart/pipes/series/series.d.ts +3 -3
  287. package/dist/esm/pipeline/spec/chart/pipes/series/series.js.map +1 -1
  288. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.d.ts +2 -2
  289. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js.map +1 -1
  290. package/dist/esm/pipeline/spec/chart/pipes/stack/stack.d.ts +2 -2
  291. package/dist/esm/pipeline/spec/chart/pipes/stack/stack.js.map +1 -1
  292. package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.d.ts +2 -2
  293. package/dist/esm/pipeline/spec/chart/pipes/stack/stackCornerRadius.js.map +1 -1
  294. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +2 -2
  295. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +4 -2
  296. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
  297. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.d.ts +2 -2
  298. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +2 -0
  299. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
  300. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.d.ts +3 -3
  301. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js +2 -0
  302. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.js.map +1 -1
  303. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.d.ts +2 -2
  304. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js +2 -0
  305. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.js.map +1 -1
  306. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.d.ts +2 -2
  307. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +2 -0
  308. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
  309. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.d.ts +2 -2
  310. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js +2 -0
  311. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipScatter.js.map +1 -1
  312. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.d.ts +3 -0
  313. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.js +31 -0
  314. package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipStyle.js.map +1 -0
  315. package/dist/esm/pipeline/spec/table/pipeline/pivotTable.js +3 -2
  316. package/dist/esm/pipeline/spec/table/pipeline/pivotTable.js.map +1 -1
  317. package/dist/esm/pipeline/spec/table/pipeline/table.js +3 -2
  318. package/dist/esm/pipeline/spec/table/pipeline/table.js.map +1 -1
  319. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.d.ts +2 -0
  320. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js +14 -0
  321. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js.map +1 -0
  322. package/dist/esm/pipeline/spec/table/pipes/cellStyle/index.d.ts +2 -0
  323. package/dist/esm/pipeline/spec/table/pipes/cellStyle/index.js +2 -0
  324. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.d.ts +2 -0
  325. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js +49 -0
  326. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js.map +1 -0
  327. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.d.ts +2 -0
  328. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js +41 -0
  329. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js.map +1 -0
  330. package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.d.ts +2 -2
  331. package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js.map +1 -1
  332. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.d.ts +2 -2
  333. package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
  334. package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.d.ts +2 -2
  335. package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js.map +1 -1
  336. package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.d.ts +2 -2
  337. package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.js.map +1 -1
  338. package/dist/esm/pipeline/spec/table/pipes/index.d.ts +1 -0
  339. package/dist/esm/pipeline/spec/table/pipes/index.js +1 -0
  340. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.d.ts +2 -2
  341. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
  342. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.d.ts +2 -2
  343. package/dist/esm/pipeline/spec/table/pipes/indicators/pivotIndicators.js.map +1 -1
  344. package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.d.ts +2 -2
  345. package/dist/esm/pipeline/spec/table/pipes/init/pivotTable.js.map +1 -1
  346. package/dist/esm/pipeline/spec/table/pipes/init/table.d.ts +2 -2
  347. package/dist/esm/pipeline/spec/table/pipes/init/table.js.map +1 -1
  348. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.d.ts +2 -2
  349. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js +13 -3
  350. package/dist/esm/pipeline/spec/table/pipes/rows/pivotRows.js.map +1 -1
  351. package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.d.ts +2 -2
  352. package/dist/esm/pipeline/spec/table/pipes/theme/bodyStyle.js.map +1 -1
  353. package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.d.ts +2 -2
  354. package/dist/esm/pipeline/spec/table/pipes/theme/cornerHeaderStyle.js.map +1 -1
  355. package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.d.ts +2 -2
  356. package/dist/esm/pipeline/spec/table/pipes/theme/frameStyle.js.map +1 -1
  357. package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.d.ts +2 -2
  358. package/dist/esm/pipeline/spec/table/pipes/theme/headerStyle.js.map +1 -1
  359. package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.d.ts +2 -2
  360. package/dist/esm/pipeline/spec/table/pipes/theme/rowHeaderStyle.js.map +1 -1
  361. package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.d.ts +2 -2
  362. package/dist/esm/pipeline/spec/table/pipes/theme/scrollStyle.js.map +1 -1
  363. package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.d.ts +2 -2
  364. package/dist/esm/pipeline/spec/table/pipes/theme/selectionStyle.js.map +1 -1
  365. package/dist/esm/pipeline/utils/constant.d.ts +3 -1
  366. package/dist/esm/pipeline/utils/constant.js +4 -2
  367. package/dist/esm/pipeline/utils/constant.js.map +1 -1
  368. package/dist/esm/pipeline/utils/measures/depth.js.map +1 -1
  369. package/dist/esm/pipeline/utils/measures/find.js.map +1 -1
  370. package/dist/esm/pipeline/utils/tree/traverse.d.ts +1 -11
  371. package/dist/esm/pipeline/utils/tree/traverse.js +3 -4
  372. package/dist/esm/pipeline/utils/tree/traverse.js.map +1 -1
  373. package/dist/esm/theme/common/annotaion.js +7 -7
  374. package/dist/esm/theme/common/annotaion.js.map +1 -1
  375. package/dist/esm/theme/common/axes.js +18 -18
  376. package/dist/esm/theme/common/axes.js.map +1 -1
  377. package/dist/esm/theme/common/legend.d.ts +2 -0
  378. package/dist/esm/theme/common/legend.js +13 -2
  379. package/dist/esm/theme/common/legend.js.map +1 -1
  380. package/dist/esm/theme/common/table.d.ts +30 -22
  381. package/dist/esm/theme/common/table.js +10 -2
  382. package/dist/esm/theme/common/table.js.map +1 -1
  383. package/dist/esm/theme/common/tooltip.d.ts +3 -2
  384. package/dist/esm/theme/common/tooltip.js +24 -2
  385. package/dist/esm/theme/common/tooltip.js.map +1 -1
  386. package/dist/esm/theme/dark/dark.js +4 -4
  387. package/dist/esm/theme/dark/dark.js.map +1 -1
  388. package/dist/esm/theme/light/light.js +4 -4
  389. package/dist/esm/theme/light/light.js.map +1 -1
  390. package/dist/esm/types/advancedVSeed.d.ts +3522 -0
  391. package/dist/esm/types/advancedVSeed.js +2 -0
  392. package/dist/esm/types/advancedVSeed.js.map +1 -1
  393. package/dist/esm/types/chartType/area/zArea.d.ts +82 -0
  394. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +82 -0
  395. package/dist/esm/types/chartType/bar/zBar.d.ts +82 -0
  396. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +82 -0
  397. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +82 -0
  398. package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +82 -0
  399. package/dist/esm/types/chartType/column/zColumn.d.ts +84 -0
  400. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +82 -0
  401. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +82 -0
  402. package/dist/esm/types/chartType/donut/zDonut.d.ts +82 -0
  403. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +82 -0
  404. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +80 -0
  405. package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +80 -0
  406. package/dist/esm/types/chartType/histogram/histogram.d.ts +2 -2
  407. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +90 -4
  408. package/dist/esm/types/chartType/histogram/zHistogram.js +2 -2
  409. package/dist/esm/types/chartType/histogram/zHistogram.js.map +1 -1
  410. package/dist/esm/types/chartType/line/zLine.d.ts +82 -0
  411. package/dist/esm/types/chartType/pie/zPie.d.ts +82 -0
  412. package/dist/esm/types/chartType/pivotTable/pivotTable.d.ts +5 -1
  413. package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +76 -0
  414. package/dist/esm/types/chartType/pivotTable/zPivotTable.js +2 -1
  415. package/dist/esm/types/chartType/pivotTable/zPivotTable.js.map +1 -1
  416. package/dist/esm/types/chartType/radar/zRadar.d.ts +82 -0
  417. package/dist/esm/types/chartType/rose/zRose.d.ts +82 -0
  418. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +82 -0
  419. package/dist/esm/types/chartType/scatter/zScatter.d.ts +90 -0
  420. package/dist/esm/types/chartType/table/table.d.ts +5 -1
  421. package/dist/esm/types/chartType/table/zTable.d.ts +76 -0
  422. package/dist/esm/types/chartType/table/zTable.js +2 -1
  423. package/dist/esm/types/chartType/table/zTable.js.map +1 -1
  424. package/dist/esm/types/pipeline/spec/spec.d.ts +11 -2
  425. package/dist/esm/types/properties/cellStyle/bodyCellStyle.d.ts +138 -0
  426. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js +16 -0
  427. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js.map +1 -0
  428. package/dist/esm/types/properties/cellStyle/cellStyle.d.ts +80 -0
  429. package/dist/esm/types/properties/cellStyle/cellStyle.js +8 -0
  430. package/dist/esm/types/properties/cellStyle/cellStyle.js.map +1 -0
  431. package/dist/esm/types/properties/cellStyle/index.d.ts +1 -0
  432. package/dist/esm/types/properties/cellStyle/index.js +1 -0
  433. package/dist/esm/types/properties/config/area.d.ts +168 -0
  434. package/dist/esm/types/properties/config/bar.d.ts +252 -0
  435. package/dist/esm/types/properties/config/boxplot.d.ts +84 -0
  436. package/dist/esm/types/properties/config/column.d.ts +264 -0
  437. package/dist/esm/types/properties/config/config.d.ts +1716 -0
  438. package/dist/esm/types/properties/config/dualAxis.d.ts +84 -0
  439. package/dist/esm/types/properties/config/funnel.d.ts +84 -0
  440. package/dist/esm/types/properties/config/heatmap.d.ts +84 -0
  441. package/dist/esm/types/properties/config/histogram.d.ts +96 -0
  442. package/dist/esm/types/properties/config/label/label.d.ts +5 -0
  443. package/dist/esm/types/properties/config/label/zLabel.d.ts +69 -0
  444. package/dist/esm/types/properties/config/label/zLabel.js +6 -1
  445. package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
  446. package/dist/esm/types/properties/config/label/zPieLabel.d.ts +69 -0
  447. package/dist/esm/types/properties/config/legend/legend.d.ts +10 -0
  448. package/dist/esm/types/properties/config/legend/legend.js +2 -0
  449. package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
  450. package/dist/esm/types/properties/config/line.d.ts +84 -0
  451. package/dist/esm/types/properties/config/pie.d.ts +252 -0
  452. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.d.ts +2 -0
  453. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js +3 -1
  454. package/dist/esm/types/properties/config/pivotGrid/pivotGrid.js.map +1 -1
  455. package/dist/esm/types/properties/config/rose.d.ts +168 -0
  456. package/dist/esm/types/properties/config/scatter.d.ts +96 -0
  457. package/dist/esm/types/properties/config/tooltip/tooltip.d.ts +12 -0
  458. package/dist/esm/types/properties/config/tooltip/tooltip.js +12 -1
  459. package/dist/esm/types/properties/config/tooltip/tooltip.js.map +1 -1
  460. package/dist/esm/types/properties/index.d.ts +1 -0
  461. package/dist/esm/types/properties/index.js +1 -0
  462. package/dist/esm/types/properties/markStyle/barStyle.d.ts +5 -0
  463. package/dist/esm/types/properties/markStyle/barStyle.js.map +1 -1
  464. package/dist/esm/types/properties/regressionLine/ecdfRegressionLine.d.ts +4 -0
  465. package/dist/esm/types/properties/regressionLine/kdeRegressionLine.d.ts +4 -0
  466. package/dist/esm/types/properties/regressionLine/zRegressionLine.d.ts +18 -0
  467. package/dist/esm/types/properties/regressionLine/zRegressionLine.js +1 -0
  468. package/dist/esm/types/properties/regressionLine/zRegressionLine.js.map +1 -1
  469. package/dist/esm/types/properties/theme/customTheme.d.ts +3432 -0
  470. package/dist/esm/types/zVseed.d.ts +1926 -124
  471. package/dist/umd/index.js +884 -439
  472. package/dist/umd/index.js.map +1 -1
  473. package/package.json +5 -5
  474. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasureName.js.map +0 -1
@@ -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":["import type { ICartesianSeries, ILineChartSpec } from '@visactor/vchart'\nimport { selector } from '../../../../../dataSelector'\nimport type { Datum, SpecPipe } from 'src/types'\nimport { isSubset } from './utils'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationArea: SpecPipe = (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\n const markArea = annotationAreaList.flatMap((annotationArea) => {\n const {\n selector: selectorPoint,\n text = '',\n textPosition = 'top',\n textColor = theme?.textColor ?? '#ffffff',\n textFontSize = theme?.textFontSize ?? 12,\n textFontWeight = theme?.textFontWeight ?? 400,\n textAlign = 'center',\n textBaseline = 'top',\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\n const labelPosition = positionMap[textPosition || 'top']\n const isBottom = labelPosition.toLocaleLowerCase().includes('bottom')\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 yScale = yAxisHelper.getScale()\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 = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\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 xScale = xAxisHelper.getScale()\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 = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\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: labelPosition,\n visible: true,\n text: text,\n style: {\n dy: isBottom ? -(textFontSize || 12) * 2 : 0,\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 dy: isBottom ? -(textFontSize || 12) * 2 : 0,\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","markArea","selectorPoint","text","textPosition","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","dataset","selectedData","datum","selector","labelPosition","isBottom","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","yAxisHelper","xAxisHelper","yScale","minX","Math","maxX","minY","maxY","xScale"],"mappings":";;;AAMO,MAAMA,gCAA2B,CAACC,MAAMC;IAC7C,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;IAEA,MAAMC,WAAWH,mBAAmB,OAAO,CAAC,CAACR;QAC3C,MAAM,EACJ,UAAUY,aAAa,EACvBC,OAAO,EAAE,EACTC,eAAe,KAAK,EACpBC,YAAYR,OAAO,aAAa,SAAS,EACzCS,eAAeT,OAAO,gBAAgB,EAAE,EACxCU,iBAAiBV,OAAO,kBAAkB,GAAG,EAC7CW,YA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cC;oBACd,MAAMJ;oBACN,QAAQM;oBACR,WAAW;oBACX,UAAUL;oBACV,YAAYC;gBACd;gBAEA,iBAAiB;oBACf,SAASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIa,WAAW,AAAwB,IAAxB,CAAEtB,CAAAA,gBAAgB,EAAC,IAAS;wBAC3C,cAAcQ,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,UAAUU;IACZ;AACF"}
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","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,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C,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,2 +1,2 @@
1
- import type { SpecPipe } from '../../../../../types';
2
- export declare const annotationAreaBand: SpecPipe;
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const annotationAreaBand: VChartSpecPipe;
@@ -1,5 +1,5 @@
1
1
  import { selector } from "../../../../../dataSelector/index.js";
2
- import { isSubset } from "./utils.js";
2
+ import { ANNOTATION_AREA_TEXT_STYLE_BY_POSITION, isSubset } from "./utils.js";
3
3
  import { ANNOTATION_Z_INDEX } from "../../../../utils/constant.js";
4
4
  import { isBarLikeChart } from "../../../../utils/chatType.js";
5
5
  const annotationAreaBand = (spec, context)=>{
@@ -21,17 +21,12 @@ const annotationAreaBand = (spec, context)=>{
21
21
  left: 'insideLeft',
22
22
  right: 'insideRight'
23
23
  };
24
- const defaultOptions = isBarLikeChart(advancedVSeed) ? {
25
- textPosition: 'right',
26
- textAlign: 'right'
27
- } : {
28
- textPosition: 'top',
29
- textAlign: 'center'
30
- };
24
+ const defaultTextPosition = isBarLikeChart(advancedVSeed) ? 'right' : 'top';
31
25
  const markArea = annotationAreaList.flatMap((annotationArea)=>{
32
- const { selector: selectorPoint, text = '', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = defaultOptions.textAlign, textBaseline = 'middle', textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#191d24', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24', textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundPadding = theme?.textBackgroundPadding ?? 4, areaColor = theme?.areaColor ?? '#888888', areaColorOpacity = theme?.areaColorOpacity ?? 0.15, areaBorderColor = theme?.areaBorderColor ?? '#888888', areaBorderRadius = theme?.areaBorderRadius ?? 4, areaBorderWidth = theme?.areaBorderWidth ?? 1, areaLineDash = theme?.areaLineDash, outerPadding = theme?.outerPadding ?? 4 } = annotationArea;
33
- const textPosition = annotationArea.textPosition ?? defaultOptions.textPosition;
34
- const dy = textPosition.includes('bottom') ? -1 * textFontSize : 0;
26
+ const { selector: selectorPoint, text = '', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#191d24', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#191d24', textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundPadding = theme?.textBackgroundPadding ?? 4, areaColor = theme?.areaColor ?? '#888888', areaColorOpacity = theme?.areaColorOpacity ?? 0.15, areaBorderColor = theme?.areaBorderColor ?? '#888888', areaBorderRadius = theme?.areaBorderRadius ?? 4, areaBorderWidth = theme?.areaBorderWidth ?? 1, areaLineDash = theme?.areaLineDash, outerPadding = theme?.outerPadding ?? 4 } = annotationArea;
27
+ const textPosition = annotationArea.textPosition ?? defaultTextPosition;
28
+ const textAlign = annotationArea.textAlign ?? ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition].textAlign;
29
+ const textBaseline = annotationArea.textBaseline ?? ANNOTATION_AREA_TEXT_STYLE_BY_POSITION[textPosition].textBaseline;
35
30
  const dataset = advancedVSeed.dataset.flat();
36
31
  const selectedData = selectorPoint ? dataset.filter((datum)=>selector(datum, selectorPoint)) : [];
37
32
  return {
@@ -46,15 +41,15 @@ const annotationAreaBand = (spec, context)=>{
46
41
  if ('function' == typeof xAxisHelper?.getBandwidth) {
47
42
  const depth = context.fieldX.length ?? 0;
48
43
  const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1);
49
- const yScale = yAxisHelper.getScale();
44
+ const regionRect = context.getRegion().getLayoutRect();
50
45
  const startX = Math.min(...xyList.map((item)=>item.x)) - (outerPadding || 4);
51
46
  const endX = Math.max(...xyList.map((item)=>item.x)) + (outerPadding || 4);
52
47
  const width = endX - startX + xBandWidth;
53
48
  const middleX = (endX + startX) / 2 + xBandWidth * (0.5 - bandPosition);
54
49
  const minX = middleX - width / 2;
55
50
  const maxX = middleX + width / 2;
56
- const minY = Math.min(...yScale.range());
57
- const maxY = Math.max(...yScale.range());
51
+ const minY = 0;
52
+ const maxY = regionRect.height;
58
53
  return [
59
54
  {
60
55
  x: minX,
@@ -77,15 +72,15 @@ const annotationAreaBand = (spec, context)=>{
77
72
  if ('function' == typeof yAxisHelper?.getBandwidth) {
78
73
  const depth = context.fieldY.length ?? 0;
79
74
  const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1);
80
- const xScale = xAxisHelper.getScale();
75
+ const regionRect = context.getRegion().getLayoutRect();
81
76
  const startY = Math.min(...xyList.map((item)=>item.y)) - (outerPadding || 4);
82
77
  const endY = Math.max(...xyList.map((item)=>item.y)) + (outerPadding || 4);
83
78
  const width = endY - startY + yBandWidth;
84
79
  const middleY = (endY + startY) / 2 + yBandWidth * (0.5 - bandPosition);
85
80
  const minY = middleY - width / 2;
86
81
  const maxY = middleY + width / 2;
87
- const minX = Math.min(...xScale.range());
88
- const maxX = Math.max(...xScale.range());
82
+ const minX = 0;
83
+ const maxX = regionRect.width;
89
84
  return [
90
85
  {
91
86
  x: minX,
@@ -112,7 +107,7 @@ const annotationAreaBand = (spec, context)=>{
112
107
  visible: true,
113
108
  text: text,
114
109
  style: {
115
- dy: dy,
110
+ opacity: 0.95,
116
111
  textAlign: textAlign,
117
112
  textBaseline: textBaseline,
118
113
  stroke: textBackgroundColor,
@@ -125,7 +120,7 @@ const annotationAreaBand = (spec, context)=>{
125
120
  visible: textBackgroundVisible,
126
121
  padding: textBackgroundPadding,
127
122
  style: {
128
- dy: dy,
123
+ opacity: 0.95,
129
124
  cornerRadius: textBackgroundBorderRadius ?? 4,
130
125
  fill: textBackgroundColor,
131
126
  stroke: textBackgroundBorderColor,
@@ -1 +1 @@
1
- {"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, SpecPipe, 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 annotationAreaBand: SpecPipe = (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 defaultOptions = isBarLikeChart(advancedVSeed as VSeed)\n ? {\n textPosition: 'right',\n textAlign: 'right',\n }\n : {\n textPosition: 'top',\n textAlign: 'center',\n }\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 textAlign = defaultOptions.textAlign,\n textBaseline = 'middle',\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 ?? defaultOptions.textPosition\n\n const dy = textPosition.includes('bottom') ? -1 * textFontSize! : 0\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 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 yScale = yAxisHelper.getScale()\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 = Math.min(...yScale.range())\n const maxY = Math.max(...yScale.range())\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 xScale = xAxisHelper.getScale()\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\n const minX = Math.min(...xScale.range())\n const maxX = Math.max(...xScale.range())\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 dy: dy,\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 dy: dy,\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","defaultOptions","isBarLikeChart","markArea","selectorPoint","text","textColor","textFontSize","textFontWeight","textAlign","textBaseline","textBackgroundVisible","textBackgroundColor","textBackgroundBorderColor","textBackgroundBorderWidth","textBackgroundBorderRadius","textBackgroundPadding","areaColor","areaColorOpacity","areaBorderColor","areaBorderRadius","areaBorderWidth","areaLineDash","outerPadding","textPosition","dy","dataset","selectedData","datum","selector","ANNOTATION_Z_INDEX","data","positionData","item","isSubset","xyList","bandPosition","yAxisHelper","xAxisHelper","depth","xBandWidth","yScale","startX","Math","endX","width","middleX","minX","maxX","minY","maxY","yBandWidth","xScale","startY","endY","middleY"],"mappings":";;;;AAOO,MAAMA,qBAA+B,CAACC,MAAMC;IACjD,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,EAA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ASG;oBACT,SAASK;oBACT,OAAO;wBACL,IAAIS;wBACJ,cAAcV,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,GAAGhC,IAAI;QACP,UAAUa;IACZ;AACF"}
1
+ {"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,MAAM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,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,2 +1,2 @@
1
- import type { SpecPipe } from '../../../../../types';
2
- export declare const annotationHorizontalLine: SpecPipe;
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const annotationHorizontalLine: VChartSpecPipe;
@@ -24,6 +24,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
24
24
  const dataset = advancedVSeed.dataset.flat();
25
25
  const generateOneMarkLine = (y)=>({
26
26
  y,
27
+ autoRange: true,
27
28
  zIndex: ANNOTATION_Z_INDEX,
28
29
  line: {
29
30
  style: {
@@ -42,9 +43,11 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
42
43
  }
43
44
  },
44
45
  label: {
46
+ confine: true,
45
47
  text: text,
46
48
  position: positionMap[textPosition || 'insideEnd'],
47
49
  style: {
50
+ opacity: 0.95,
48
51
  visible: true,
49
52
  dy: 4,
50
53
  stroke: textBackgroundColor,
@@ -59,6 +62,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
59
62
  visible: textBackgroundVisible,
60
63
  padding: textBackgroundPadding,
61
64
  style: {
65
+ opacity: 0.95,
62
66
  dy: 4,
63
67
  cornerRadius: textBackgroundBorderRadius,
64
68
  fill: textBackgroundColor,
@@ -71,9 +75,9 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
71
75
  startSymbol: {
72
76
  visible: theme?.startSymbolVisible ?? true,
73
77
  symbolType: theme?.startSymbolType ?? 'triangleDown',
74
- size: 5,
78
+ size: 5 + (lineWidth || 1),
75
79
  style: {
76
- dx: 0,
80
+ dx: 3,
77
81
  fill: lineColor
78
82
  }
79
83
  },
@@ -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 { SpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationHorizontalLine: SpecPipe = (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 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 text: text,\n position: positionMap[textPosition || 'insideEnd'],\n style: {\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 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,\n style: {\n dx: 0,\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,oDAAqC,CAACC,MAAMC;IACvD,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,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O,mBAAmB;oBACtC,MAAM;oBACN,OAAO;wBACL,IAAI;wBACJ,MAAMc;oBACR;gBACF;gBACA,WAAW;oBACT,SAASd,OAAO,oBAAoB;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":["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,QAAQ,EACxC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YA,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,2 +1,2 @@
1
- import type { SpecPipe } from '../../../../../types';
2
- export declare const annotationPoint: SpecPipe;
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const annotationPoint: VChartSpecPipe;
@@ -39,6 +39,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
39
39
  text: {
40
40
  text: text,
41
41
  style: {
42
+ opacity: 0.95,
42
43
  visible: true,
43
44
  textAlign: textAlign,
44
45
  textBaseline: textBaseline,
@@ -54,6 +55,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
54
55
  visible: textBackgroundVisible,
55
56
  padding: textBackgroundPadding,
56
57
  style: {
58
+ opacity: 0.95,
57
59
  cornerRadius: textBackgroundBorderRadius ?? 4,
58
60
  fill: textBackgroundColor,
59
61
  stroke: textBackgroundBorderColor,
@@ -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, SpecPipe, 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: SpecPipe = (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 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 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,kCAA4B,CAACC,MAAMC;IAC9C,MAAM,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGF;IACjC,MAAM,EAAEG,UAAU,EAAEC,MAAM,EAAE,GAAGH;IAE/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BAChB,YAAY,CAACC,OACJA,KAAK,IAAI,CAAC,CAACC,OAASC,SAASP,OAAOM;gBAG7C,UAAU;oBACR,SAAS;gBACX;gBACA,aAAa;oBACXT;oBACAD;oBACA,SAAS;oBACT,MAAM;wBACJ,MAAMZ;wBACN,OAAO;4BACL,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,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
+ {"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,eAAeR,aAAa,YAAY,EACxCS,4BAA4Bd,OAAO,yBAAyB,EAC5De,6BAA6Bf,OAAO,8BAA8B,CAAC,EACnEgB,4BAA4BhB,OAAO,6BAA6B,CAAC,EACjEiB,sBAAsBjB,OAAO,uBAAuB,SAAS,EAC7DkB,wBAAwBlB,OAAO,yBAAyB,CAAC,EACzDmB,wBAAwBnB,OAAO,yBAAyB,IAAI,EAC5DoB,UAAUpB,OAAO,WAAW,CAAC,EAC7BqB,UAAUrB,OAAO,WAAW,CAAC,EAC9B,GAAGP;QAEJ,MAAM6B,UAAU1B,cAAc,OAAO,CAAC,IAAI;QAC1C,MAAM2B,eAAehB,gBAAgBe,QAAQ,MAAM,CAAC,CAACE,QAAUC,SAASD,OAAOjB,kBAAkB,EAAE;QACnG,MAAMmB,KAAK,MAAOvB,CAAAA,kBAAmBO,eAA0B;QAC/D,MAAMiB,KAAKxB,kBAAkB,IAAKO;QAElC,OAAOa,aAAa,GAAG,CAAC,CAACC,QAChB;gBACL,QAAQI;gBACR,gBAAgB;gBAChB,YAAY,CAACC,OACJA,KAAK,IAAI,CAAC,CAACC,OAASC,SAASP,OAAOM;gBAG7C,UAAU;oBACR,SAAS;gBACX;gBACA,aAAa;oBACXT;oBACAD;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,2 +1,2 @@
1
- import type { SpecPipe } from '../../../../../types';
2
- export declare const annotationVerticalLine: SpecPipe;
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const annotationVerticalLine: VChartSpecPipe;
@@ -23,7 +23,8 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
23
23
  const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = theme?.textColor ?? '#ffffff', textFontSize = theme?.textFontSize ?? 12, textFontWeight = theme?.textFontWeight ?? 400, textAlign = 'center', textBaseline = 'top', lineColor = theme?.lineColor ?? '#212121', lineStyle = theme?.lineStyle ?? 'dashed', lineVisible = theme?.lineStyle ?? true, lineWidth = theme?.lineWidth ?? 1, textBackgroundVisible = theme?.textBackgroundVisible ?? true, textBackgroundColor = theme?.textBackgroundColor ?? '#212121', textBackgroundBorderColor = theme?.textBackgroundBorderColor ?? '#212121', textBackgroundBorderRadius = theme?.textBackgroundBorderRadius ?? 4, textBackgroundBorderWidth = theme?.textBackgroundBorderWidth ?? 1, textBackgroundPadding = theme?.textBackgroundPadding ?? 2 } = annotationVerticalLine;
24
24
  const dataset = advancedVSeed.dataset.flat();
25
25
  const generateOneMarkLine = (x)=>({
26
- x: x,
26
+ x,
27
+ autoRange: true,
27
28
  zIndex: ANNOTATION_Z_INDEX,
28
29
  line: {
29
30
  style: {
@@ -43,9 +44,11 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
43
44
  }
44
45
  },
45
46
  label: {
47
+ confine: true,
46
48
  text: text,
47
49
  position: positionMap[textPosition || 'insideEnd'],
48
50
  style: {
51
+ opacity: 0.95,
49
52
  dx: 5,
50
53
  visible: true,
51
54
  stroke: textBackgroundColor,
@@ -60,6 +63,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
60
63
  visible: textBackgroundVisible,
61
64
  padding: textBackgroundPadding,
62
65
  style: {
66
+ opacity: 0.95,
63
67
  dx: 5,
64
68
  cornerRadius: textBackgroundBorderRadius,
65
69
  fill: textBackgroundColor,
@@ -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 { SpecPipe } from 'src/types'\nimport { isArray, isNumber, isString } from 'remeda'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\n\nexport const annotationVerticalLine: SpecPipe = (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: x as string,\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 text: text,\n position: positionMap[textPosition || 'insideEnd'],\n style: {\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 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,gDAAmC,CAACC,MAAMC;IACrD,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,YAAY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,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":["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,QAAQ,EACxCgB,cAAchB,OAAO,aAAa,IAAI,EACtCiB,YAAYjB,OAAO,aAAa,CAAC,EAEjCkB,wBAAwBlB,OAAO,yBAAyB,IAAI,EAC5DmB,sBAAsBnB,O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AEA,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,2 +1,2 @@
1
- import type { SpecPipe } from '../../../../../types';
2
- export declare const splitLine: SpecPipe;
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const splitLine: VChartSpecPipe;
@@ -1,5 +1,19 @@
1
- import { Color, array } from "@visactor/vutils";
1
+ import { Color, array, clamper } from "@visactor/vutils";
2
2
  import { isNullish, isNumber, isPlainObject } from "remeda";
3
+ const formatGradientStops = (stops)=>{
4
+ const firstInvalidateIndex = stops.findIndex((stop)=>stop.offset < 0 || stop.offset > 1);
5
+ if (firstInvalidateIndex >= 0) {
6
+ if (stops[firstInvalidateIndex].offset > 1) {
7
+ const newStops = stops.slice(0, firstInvalidateIndex + 1);
8
+ newStops[newStops.length - 1].offset = 1;
9
+ return newStops;
10
+ }
11
+ const newStops = stops.slice(firstInvalidateIndex + 1);
12
+ newStops[0].offset = 0;
13
+ return newStops;
14
+ }
15
+ return stops;
16
+ };
3
17
  const splitLine = (spec, context)=>{
4
18
  const { advancedVSeed } = context;
5
19
  const { annotation, chartType, datasetReshapeInfo } = advancedVSeed;
@@ -41,7 +55,8 @@ const splitLine = (spec, context)=>{
41
55
  });
42
56
  });
43
57
  if (!points || !points.length) return;
44
- const splitCoordinate = lineSeries.getYAxisHelper().getScale(0).scale(splitValue);
58
+ const scale = lineSeries.getYAxisHelper().getScale(0);
59
+ const splitCoordinate = scale.scale(splitValue);
45
60
  const minY = Math.min(...points.map((p)=>p.y));
46
61
  const maxY = Math.max(...points.map((p)=>p.y));
47
62
  const ratio = (splitCoordinate - minY) / (maxY - minY);
@@ -51,7 +66,7 @@ const splitLine = (spec, context)=>{
51
66
  x1: 0,
52
67
  y0: 0,
53
68
  y1: 1,
54
- stops: [
69
+ stops: formatGradientStops([
55
70
  {
56
71
  color: colorConfig.positiveColor,
57
72
  offset: 0
@@ -68,7 +83,7 @@ const splitLine = (spec, context)=>{
68
83
  color: colorConfig.negativeColor,
69
84
  offset: 1
70
85
  }
71
- ]
86
+ ])
72
87
  };
73
88
  const areaFill = {
74
89
  gradient: 'linear',
@@ -76,7 +91,7 @@ const splitLine = (spec, context)=>{
76
91
  x1: 0,
77
92
  y0: 0,
78
93
  y1: 1,
79
- stops: [
94
+ stops: formatGradientStops([
80
95
  {
81
96
  color: colorConfig.positiveColor,
82
97
  offset: 0
@@ -93,7 +108,7 @@ const splitLine = (spec, context)=>{
93
108
  color: colorConfig.negativeColor,
94
109
  offset: 1
95
110
  }
96
- ]
111
+ ])
97
112
  };
98
113
  const attrs = {
99
114
  segments: null,
@@ -106,12 +121,13 @@ const splitLine = (spec, context)=>{
106
121
  lineGraphics[0].setAttributes(attrs);
107
122
  lineGraphics[0].setFinalAttributes?.(attrs);
108
123
  const start = lineSeries.getRegion().getLayoutStartPoint();
124
+ const range = scale.range();
109
125
  return {
110
126
  points: points.map((entry)=>({
111
127
  x: entry.x + start.x,
112
128
  y: entry.y + start.y
113
129
  })),
114
- splitCoordinate,
130
+ splitCoordinate: clamper(range[0], range[range.length - 1])(splitCoordinate) + start.y,
115
131
  areaFill,
116
132
  lineStroke
117
133
  };
@@ -155,11 +171,11 @@ const splitLine = (spec, context)=>{
155
171
  if (!seriesSpec.point.style) seriesSpec.point.style = {};
156
172
  if (!seriesSpec.line.style) seriesSpec.line.style = {};
157
173
  const measureValueKey = datasetReshapeInfo[0].foldInfo.measureValue;
158
- seriesSpec.point.style.fill = (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
159
- seriesSpec.line.style.stroke = (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor;
174
+ seriesSpec.point.style.fill = (datum)=>datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor;
175
+ seriesSpec.line.style.stroke = (datum)=>datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor;
160
176
  if (seriesSpec.label && seriesSpec.label.visible && isNullish(seriesSpec.label.style?.fill)) seriesSpec.label.style = {
161
177
  ...seriesSpec.label.style,
162
- fill: (datum)=>datum?.[measureValueKey] >= splitValue ? colorConfig.positiveColor : colorConfig.negativeColor
178
+ fill: (datum)=>datum?.[measureValueKey] < splitValue ? colorConfig.negativeColor : colorConfig.positiveColor
163
179
  };
164
180
  }
165
181
  return result;