@visactor/vchart 1.0.1-alpha.2 → 1.1.0-beta.0

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 (438) hide show
  1. package/build/index.js +6014 -5864
  2. package/build/index.min.js +2 -2
  3. package/cjs/chart/area/area.d.ts +1 -0
  4. package/cjs/chart/area/area.js +4 -1
  5. package/cjs/chart/area/area.js.map +1 -1
  6. package/cjs/chart/bar/bar.d.ts +1 -0
  7. package/cjs/chart/bar/bar.js +4 -1
  8. package/cjs/chart/bar/bar.js.map +1 -1
  9. package/cjs/chart/base-chart.js +2 -1
  10. package/cjs/chart/base-chart.js.map +1 -1
  11. package/cjs/chart/box-plot/box-plot.js +2 -2
  12. package/cjs/chart/box-plot/box-plot.js.map +1 -1
  13. package/cjs/chart/histogram/histogram.d.ts +1 -0
  14. package/cjs/chart/histogram/histogram.js +4 -1
  15. package/cjs/chart/histogram/histogram.js.map +1 -1
  16. package/cjs/chart/line/line.d.ts +1 -0
  17. package/cjs/chart/line/line.js +4 -1
  18. package/cjs/chart/line/line.js.map +1 -1
  19. package/cjs/chart/range-area/range-area.d.ts +1 -0
  20. package/cjs/chart/range-area/range-area.js +4 -1
  21. package/cjs/chart/range-area/range-area.js.map +1 -1
  22. package/cjs/chart/range-column/range-column.d.ts +1 -0
  23. package/cjs/chart/range-column/range-column.js +4 -1
  24. package/cjs/chart/range-column/range-column.js.map +1 -1
  25. package/cjs/chart/sequence/sequence.js +1 -1
  26. package/cjs/chart/sequence/sequence.js.map +1 -1
  27. package/cjs/chart/util.d.ts +2 -0
  28. package/cjs/chart/util.js +23 -0
  29. package/cjs/chart/util.js.map +1 -0
  30. package/cjs/chart/waterfall/waterfall.js +2 -2
  31. package/cjs/chart/waterfall/waterfall.js.map +1 -1
  32. package/cjs/compile/grammar-item.js +2 -1
  33. package/cjs/component/axis/cartesian/axis.js +1 -1
  34. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  35. package/cjs/component/crosshair/base.js +1 -2
  36. package/cjs/component/crosshair/base.js.map +1 -1
  37. package/cjs/component/crosshair/interface/spec.d.ts +1 -1
  38. package/cjs/component/crosshair/interface/spec.js.map +1 -1
  39. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  40. package/cjs/component/index.js +1 -2
  41. package/cjs/component/legend/base-legend.js +7 -3
  42. package/cjs/component/legend/base-legend.js.map +1 -1
  43. package/cjs/component/legend/util.d.ts +1 -1
  44. package/cjs/component/player/utils/transform.js +1 -3
  45. package/cjs/component/player/utils/transform.js.map +1 -1
  46. package/cjs/component/tooltip/handler/base.d.ts +5 -4
  47. package/cjs/component/tooltip/handler/base.js +44 -34
  48. package/cjs/component/tooltip/handler/base.js.map +1 -1
  49. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +2 -2
  50. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
  51. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  52. package/cjs/component/tooltip/handler/constants.d.ts +4 -0
  53. package/cjs/component/tooltip/handler/constants.js +5 -2
  54. package/cjs/component/tooltip/handler/constants.js.map +1 -1
  55. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +6 -2
  56. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +20 -13
  57. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  58. package/cjs/component/tooltip/handler/dom/interface.d.ts +16 -5
  59. package/cjs/component/tooltip/handler/dom/interface.js.map +1 -1
  60. package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +7 -13
  61. package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.js +12 -27
  62. package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.js.map +1 -1
  63. package/cjs/component/tooltip/handler/dom/model/content-column-model.d.ts +13 -3
  64. package/cjs/component/tooltip/handler/dom/model/content-column-model.js +46 -26
  65. package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
  66. package/cjs/component/tooltip/handler/dom/model/content-model.d.ts +4 -3
  67. package/cjs/component/tooltip/handler/dom/model/content-model.js +4 -4
  68. package/cjs/component/tooltip/handler/dom/model/content-model.js.map +1 -1
  69. package/cjs/component/tooltip/handler/dom/model/interface.d.ts +4 -0
  70. package/cjs/component/tooltip/handler/dom/model/interface.js.map +1 -1
  71. package/cjs/component/tooltip/handler/dom/model/shape-model.d.ts +5 -5
  72. package/cjs/component/tooltip/handler/dom/model/shape-model.js +4 -4
  73. package/cjs/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
  74. package/cjs/component/tooltip/handler/dom/model/style-constants.d.ts +4 -4
  75. package/cjs/component/tooltip/handler/dom/model/style-constants.js +16 -18
  76. package/cjs/component/tooltip/handler/dom/model/style-constants.js.map +1 -1
  77. package/cjs/component/tooltip/handler/dom/model/text-model.js +1 -0
  78. package/cjs/component/tooltip/handler/dom/model/text-model.js.map +1 -1
  79. package/cjs/component/tooltip/handler/dom/model/title-model.d.ts +3 -2
  80. package/cjs/component/tooltip/handler/dom/model/title-model.js +15 -19
  81. package/cjs/component/tooltip/handler/dom/model/title-model.js.map +1 -1
  82. package/cjs/component/tooltip/handler/dom/model/tooltip-model.d.ts +1 -2
  83. package/cjs/component/tooltip/handler/dom/model/tooltip-model.js +21 -16
  84. package/cjs/component/tooltip/handler/dom/model/tooltip-model.js.map +1 -1
  85. package/cjs/component/tooltip/handler/dom/util.d.ts +5 -0
  86. package/cjs/component/tooltip/handler/dom/{utils/style.js → util.js} +32 -20
  87. package/cjs/component/tooltip/handler/dom/util.js.map +1 -0
  88. package/cjs/component/tooltip/handler/interface/index.d.ts +0 -1
  89. package/cjs/component/tooltip/handler/interface/index.js +1 -1
  90. package/cjs/component/tooltip/handler/interface/index.js.map +1 -1
  91. package/cjs/component/tooltip/handler/utils/attribute.js +12 -8
  92. package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
  93. package/cjs/component/tooltip/handler/utils/common.d.ts +6 -2
  94. package/cjs/component/tooltip/handler/utils/common.js +30 -5
  95. package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
  96. package/cjs/component/tooltip/handler/utils/compose.d.ts +3 -2
  97. package/cjs/component/tooltip/handler/utils/compose.js +56 -45
  98. package/cjs/component/tooltip/handler/utils/compose.js.map +1 -1
  99. package/cjs/component/tooltip/handler/utils/get-spec.js +64 -28
  100. package/cjs/component/tooltip/handler/utils/get-spec.js.map +1 -1
  101. package/cjs/component/tooltip/handler/utils/style.d.ts +2 -1
  102. package/cjs/component/tooltip/handler/utils/style.js +4 -4
  103. package/cjs/component/tooltip/handler/utils/style.js.map +1 -1
  104. package/cjs/component/tooltip/tooltip.d.ts +3 -1
  105. package/cjs/component/tooltip/tooltip.js +33 -18
  106. package/cjs/component/tooltip/tooltip.js.map +1 -1
  107. package/cjs/component/tooltip/utils/common.js +4 -2
  108. package/cjs/component/tooltip/utils/common.js.map +1 -1
  109. package/cjs/constant/marker.js +2 -1
  110. package/cjs/core/factory.js +1 -2
  111. package/cjs/core/index.d.ts +1 -1
  112. package/cjs/core/index.js +1 -1
  113. package/cjs/core/index.js.map +1 -1
  114. package/cjs/core/instance-manager.d.ts +1 -1
  115. package/cjs/core/instance-manager.js.map +1 -1
  116. package/cjs/core/vchart.d.ts +1 -0
  117. package/cjs/core/vchart.js +10 -2
  118. package/cjs/core/vchart.js.map +1 -1
  119. package/cjs/interaction/interface.js +1 -1
  120. package/cjs/interaction/trigger.js +1 -1
  121. package/cjs/layout/base-layout.js +9 -10
  122. package/cjs/layout/base-layout.js.map +1 -1
  123. package/cjs/layout/grid-layout/grid-layout.d.ts +5 -35
  124. package/cjs/layout/grid-layout/grid-layout.js +2 -1
  125. package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
  126. package/cjs/layout/index.d.ts +1 -2
  127. package/cjs/layout/index.js.map +1 -1
  128. package/cjs/layout/interface.d.ts +31 -3
  129. package/cjs/layout/interface.js.map +1 -1
  130. package/cjs/mark/arc-3d.js +1 -1
  131. package/cjs/mark/arc.d.ts +5 -4
  132. package/cjs/mark/arc.js +11 -13
  133. package/cjs/mark/arc.js.map +1 -1
  134. package/cjs/mark/area.js +1 -1
  135. package/cjs/mark/base/base-line.js +3 -3
  136. package/cjs/mark/base/base-line.js.map +1 -1
  137. package/cjs/mark/base/base-mark.d.ts +7 -0
  138. package/cjs/mark/base/base-mark.js +10 -6
  139. package/cjs/mark/base/base-mark.js.map +1 -1
  140. package/cjs/mark/box-plot.js +1 -1
  141. package/cjs/mark/cell.js +1 -1
  142. package/cjs/mark/utils/common.d.ts +0 -12
  143. package/cjs/mark/utils/common.js +2 -13
  144. package/cjs/mark/utils/common.js.map +1 -1
  145. package/cjs/model/base-model.js +1 -1
  146. package/cjs/model/interface.js +1 -1
  147. package/cjs/model/layout-item.js +2 -1
  148. package/cjs/model/model-state-manager.js +1 -1
  149. package/cjs/model/tooltip-helper.d.ts +3 -4
  150. package/cjs/model/tooltip-helper.js +5 -10
  151. package/cjs/model/tooltip-helper.js.map +1 -1
  152. package/cjs/plugin/interface.js +1 -1
  153. package/cjs/region/interface.js +1 -1
  154. package/cjs/region/region.js +6 -11
  155. package/cjs/region/region.js.map +1 -1
  156. package/cjs/series/base/base-series.js +1 -1
  157. package/cjs/series/base/base-series.js.map +1 -1
  158. package/cjs/series/base/tooltip-helper.d.ts +9 -8
  159. package/cjs/series/base/tooltip-helper.js +23 -12
  160. package/cjs/series/base/tooltip-helper.js.map +1 -1
  161. package/cjs/series/dot/dot.js +2 -2
  162. package/cjs/series/dot/dot.js.map +1 -1
  163. package/cjs/series/dot/tooltip-helper.d.ts +1 -2
  164. package/cjs/series/dot/tooltip-helper.js +6 -5
  165. package/cjs/series/dot/tooltip-helper.js.map +1 -1
  166. package/cjs/series/funnel/funnel.d.ts +1 -1
  167. package/cjs/series/funnel/funnel.js +8 -8
  168. package/cjs/series/funnel/funnel.js.map +1 -1
  169. package/cjs/series/funnel/tooltip-helper.d.ts +5 -3
  170. package/cjs/series/funnel/tooltip-helper.js +10 -8
  171. package/cjs/series/funnel/tooltip-helper.js.map +1 -1
  172. package/cjs/series/interface/series.d.ts +2 -1
  173. package/cjs/series/interface/series.js.map +1 -1
  174. package/cjs/series/interface/tooltip-helper.d.ts +6 -6
  175. package/cjs/series/interface/tooltip-helper.js.map +1 -1
  176. package/cjs/series/link/link.js +2 -2
  177. package/cjs/series/link/link.js.map +1 -1
  178. package/cjs/series/treemap/treemap.js.map +1 -1
  179. package/cjs/series/word-cloud/base.js +2 -2
  180. package/cjs/series/word-cloud/base.js.map +1 -1
  181. package/cjs/series/word-cloud/word-cloud-3d.js +3 -3
  182. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  183. package/cjs/theme/buildin-theme/index.d.ts +0 -1
  184. package/cjs/theme/buildin-theme/index.js +3 -3
  185. package/cjs/theme/buildin-theme/index.js.map +1 -1
  186. package/cjs/theme/buildin-theme/light/component/crosshair.js +4 -4
  187. package/cjs/theme/buildin-theme/light/component/crosshair.js.map +1 -1
  188. package/cjs/theme/buildin-theme/light/component/tooltip.js +1 -0
  189. package/cjs/theme/buildin-theme/light/component/tooltip.js.map +1 -1
  190. package/cjs/typings/spec/common.d.ts +1 -1
  191. package/cjs/typings/spec/common.js.map +1 -1
  192. package/cjs/typings/tooltip/common.d.ts +7 -1
  193. package/cjs/typings/tooltip/common.js.map +1 -1
  194. package/cjs/typings/tooltip/handler.d.ts +1 -1
  195. package/cjs/typings/tooltip/handler.js.map +1 -1
  196. package/cjs/typings/tooltip/line.d.ts +6 -4
  197. package/cjs/typings/tooltip/line.js.map +1 -1
  198. package/cjs/typings/tooltip/shape.d.ts +3 -3
  199. package/cjs/typings/tooltip/shape.js.map +1 -1
  200. package/cjs/typings/tooltip/tooltip.d.ts +11 -8
  201. package/cjs/typings/tooltip/tooltip.js.map +1 -1
  202. package/cjs/typings/visual.d.ts +4 -11
  203. package/cjs/typings/visual.js.map +1 -1
  204. package/cjs/util/debug.d.ts +3 -3
  205. package/cjs/util/debug.js +11 -20
  206. package/cjs/util/debug.js.map +1 -1
  207. package/cjs/util/index.d.ts +1 -0
  208. package/cjs/util/index.js +2 -1
  209. package/cjs/util/index.js.map +1 -1
  210. package/cjs/util/style.js +3 -7
  211. package/cjs/util/style.js.map +1 -1
  212. package/esm/chart/area/area.d.ts +1 -0
  213. package/esm/chart/area/area.js +5 -0
  214. package/esm/chart/area/area.js.map +1 -1
  215. package/esm/chart/bar/bar.d.ts +1 -0
  216. package/esm/chart/bar/bar.js +5 -0
  217. package/esm/chart/bar/bar.js.map +1 -1
  218. package/esm/chart/base-chart.js +2 -1
  219. package/esm/chart/base-chart.js.map +1 -1
  220. package/esm/chart/box-plot/box-plot.js +3 -1
  221. package/esm/chart/box-plot/box-plot.js.map +1 -1
  222. package/esm/chart/histogram/histogram.d.ts +1 -0
  223. package/esm/chart/histogram/histogram.js +5 -0
  224. package/esm/chart/histogram/histogram.js.map +1 -1
  225. package/esm/chart/line/line.d.ts +1 -0
  226. package/esm/chart/line/line.js +5 -0
  227. package/esm/chart/line/line.js.map +1 -1
  228. package/esm/chart/range-area/range-area.d.ts +1 -0
  229. package/esm/chart/range-area/range-area.js +5 -0
  230. package/esm/chart/range-area/range-area.js.map +1 -1
  231. package/esm/chart/range-column/range-column.d.ts +1 -0
  232. package/esm/chart/range-column/range-column.js +5 -0
  233. package/esm/chart/range-column/range-column.js.map +1 -1
  234. package/esm/chart/sequence/sequence.js +2 -2
  235. package/esm/chart/sequence/sequence.js.map +1 -1
  236. package/esm/chart/util.d.ts +2 -0
  237. package/esm/chart/util.js +16 -0
  238. package/esm/chart/util.js.map +1 -0
  239. package/esm/chart/waterfall/waterfall.js +3 -1
  240. package/esm/chart/waterfall/waterfall.js.map +1 -1
  241. package/esm/compile/grammar-item.js +2 -1
  242. package/esm/component/axis/cartesian/axis.js +2 -2
  243. package/esm/component/axis/cartesian/axis.js.map +1 -1
  244. package/esm/component/crosshair/base.js +1 -2
  245. package/esm/component/crosshair/base.js.map +1 -1
  246. package/esm/component/crosshair/interface/spec.d.ts +1 -1
  247. package/esm/component/crosshair/interface/spec.js.map +1 -1
  248. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  249. package/esm/component/index.js +1 -2
  250. package/esm/component/legend/base-legend.js +7 -3
  251. package/esm/component/legend/base-legend.js.map +1 -1
  252. package/esm/component/legend/util.d.ts +1 -1
  253. package/esm/component/player/utils/transform.js +1 -3
  254. package/esm/component/player/utils/transform.js.map +1 -1
  255. package/esm/component/tooltip/handler/base.d.ts +5 -4
  256. package/esm/component/tooltip/handler/base.js +45 -35
  257. package/esm/component/tooltip/handler/base.js.map +1 -1
  258. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +2 -2
  259. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -3
  260. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  261. package/esm/component/tooltip/handler/constants.d.ts +4 -0
  262. package/esm/component/tooltip/handler/constants.js +9 -0
  263. package/esm/component/tooltip/handler/constants.js.map +1 -1
  264. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +6 -2
  265. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +20 -12
  266. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  267. package/esm/component/tooltip/handler/dom/interface.d.ts +16 -5
  268. package/esm/component/tooltip/handler/dom/interface.js.map +1 -1
  269. package/esm/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +7 -13
  270. package/esm/component/tooltip/handler/dom/model/base-tooltip-model.js +11 -29
  271. package/esm/component/tooltip/handler/dom/model/base-tooltip-model.js.map +1 -1
  272. package/esm/component/tooltip/handler/dom/model/content-column-model.d.ts +13 -3
  273. package/esm/component/tooltip/handler/dom/model/content-column-model.js +46 -24
  274. package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
  275. package/esm/component/tooltip/handler/dom/model/content-model.d.ts +4 -3
  276. package/esm/component/tooltip/handler/dom/model/content-model.js +5 -5
  277. package/esm/component/tooltip/handler/dom/model/content-model.js.map +1 -1
  278. package/esm/component/tooltip/handler/dom/model/interface.d.ts +4 -0
  279. package/esm/component/tooltip/handler/dom/model/interface.js.map +1 -1
  280. package/esm/component/tooltip/handler/dom/model/shape-model.d.ts +5 -5
  281. package/esm/component/tooltip/handler/dom/model/shape-model.js +4 -4
  282. package/esm/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
  283. package/esm/component/tooltip/handler/dom/model/style-constants.d.ts +4 -4
  284. package/esm/component/tooltip/handler/dom/model/style-constants.js +18 -20
  285. package/esm/component/tooltip/handler/dom/model/style-constants.js.map +1 -1
  286. package/esm/component/tooltip/handler/dom/model/text-model.js +1 -0
  287. package/esm/component/tooltip/handler/dom/model/text-model.js.map +1 -1
  288. package/esm/component/tooltip/handler/dom/model/title-model.d.ts +3 -2
  289. package/esm/component/tooltip/handler/dom/model/title-model.js +15 -19
  290. package/esm/component/tooltip/handler/dom/model/title-model.js.map +1 -1
  291. package/esm/component/tooltip/handler/dom/model/tooltip-model.d.ts +1 -2
  292. package/esm/component/tooltip/handler/dom/model/tooltip-model.js +22 -16
  293. package/esm/component/tooltip/handler/dom/model/tooltip-model.js.map +1 -1
  294. package/esm/component/tooltip/handler/dom/util.d.ts +5 -0
  295. package/esm/component/tooltip/handler/dom/util.js +71 -0
  296. package/esm/component/tooltip/handler/dom/util.js.map +1 -0
  297. package/esm/component/tooltip/handler/interface/index.d.ts +0 -1
  298. package/esm/component/tooltip/handler/interface/index.js +0 -2
  299. package/esm/component/tooltip/handler/interface/index.js.map +1 -1
  300. package/esm/component/tooltip/handler/utils/attribute.js +11 -7
  301. package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
  302. package/esm/component/tooltip/handler/utils/common.d.ts +6 -2
  303. package/esm/component/tooltip/handler/utils/common.js +25 -2
  304. package/esm/component/tooltip/handler/utils/common.js.map +1 -1
  305. package/esm/component/tooltip/handler/utils/compose.d.ts +3 -2
  306. package/esm/component/tooltip/handler/utils/compose.js +52 -43
  307. package/esm/component/tooltip/handler/utils/compose.js.map +1 -1
  308. package/esm/component/tooltip/handler/utils/get-spec.js +60 -23
  309. package/esm/component/tooltip/handler/utils/get-spec.js.map +1 -1
  310. package/esm/component/tooltip/handler/utils/style.d.ts +2 -1
  311. package/esm/component/tooltip/handler/utils/style.js +4 -4
  312. package/esm/component/tooltip/handler/utils/style.js.map +1 -1
  313. package/esm/component/tooltip/tooltip.d.ts +3 -1
  314. package/esm/component/tooltip/tooltip.js +33 -18
  315. package/esm/component/tooltip/tooltip.js.map +1 -1
  316. package/esm/component/tooltip/utils/common.js +4 -2
  317. package/esm/component/tooltip/utils/common.js.map +1 -1
  318. package/esm/constant/marker.js +2 -1
  319. package/esm/core/factory.js +1 -2
  320. package/esm/core/index.d.ts +1 -1
  321. package/esm/core/index.js +1 -1
  322. package/esm/core/index.js.map +1 -1
  323. package/esm/core/instance-manager.d.ts +1 -1
  324. package/esm/core/instance-manager.js.map +1 -1
  325. package/esm/core/vchart.d.ts +1 -0
  326. package/esm/core/vchart.js +9 -2
  327. package/esm/core/vchart.js.map +1 -1
  328. package/esm/interaction/interface.js +1 -1
  329. package/esm/interaction/trigger.js +1 -1
  330. package/esm/layout/base-layout.js +9 -10
  331. package/esm/layout/base-layout.js.map +1 -1
  332. package/esm/layout/grid-layout/grid-layout.d.ts +5 -35
  333. package/esm/layout/grid-layout/grid-layout.js +2 -1
  334. package/esm/layout/grid-layout/grid-layout.js.map +1 -1
  335. package/esm/layout/index.d.ts +1 -2
  336. package/esm/layout/index.js.map +1 -1
  337. package/esm/layout/interface.d.ts +31 -3
  338. package/esm/layout/interface.js.map +1 -1
  339. package/esm/mark/arc-3d.js +1 -1
  340. package/esm/mark/arc.d.ts +5 -4
  341. package/esm/mark/arc.js +11 -13
  342. package/esm/mark/arc.js.map +1 -1
  343. package/esm/mark/area.js +1 -1
  344. package/esm/mark/base/base-line.js +2 -4
  345. package/esm/mark/base/base-line.js.map +1 -1
  346. package/esm/mark/base/base-mark.d.ts +7 -0
  347. package/esm/mark/base/base-mark.js +9 -7
  348. package/esm/mark/base/base-mark.js.map +1 -1
  349. package/esm/mark/box-plot.js +1 -1
  350. package/esm/mark/cell.js +1 -1
  351. package/esm/mark/utils/common.d.ts +0 -12
  352. package/esm/mark/utils/common.js +0 -13
  353. package/esm/mark/utils/common.js.map +1 -1
  354. package/esm/model/base-model.js +1 -1
  355. package/esm/model/interface.js +1 -1
  356. package/esm/model/layout-item.js +2 -1
  357. package/esm/model/model-state-manager.js +1 -1
  358. package/esm/model/tooltip-helper.d.ts +3 -4
  359. package/esm/model/tooltip-helper.js +5 -10
  360. package/esm/model/tooltip-helper.js.map +1 -1
  361. package/esm/plugin/interface.js +1 -1
  362. package/esm/region/interface.js +1 -1
  363. package/esm/region/region.js +7 -11
  364. package/esm/region/region.js.map +1 -1
  365. package/esm/series/base/base-series.js +1 -1
  366. package/esm/series/base/base-series.js.map +1 -1
  367. package/esm/series/base/tooltip-helper.d.ts +9 -8
  368. package/esm/series/base/tooltip-helper.js +23 -12
  369. package/esm/series/base/tooltip-helper.js.map +1 -1
  370. package/esm/series/dot/dot.js +1 -3
  371. package/esm/series/dot/dot.js.map +1 -1
  372. package/esm/series/dot/tooltip-helper.d.ts +1 -2
  373. package/esm/series/dot/tooltip-helper.js +7 -4
  374. package/esm/series/dot/tooltip-helper.js.map +1 -1
  375. package/esm/series/funnel/funnel.d.ts +1 -1
  376. package/esm/series/funnel/funnel.js +8 -8
  377. package/esm/series/funnel/funnel.js.map +1 -1
  378. package/esm/series/funnel/tooltip-helper.d.ts +5 -3
  379. package/esm/series/funnel/tooltip-helper.js +11 -7
  380. package/esm/series/funnel/tooltip-helper.js.map +1 -1
  381. package/esm/series/interface/series.d.ts +2 -1
  382. package/esm/series/interface/series.js.map +1 -1
  383. package/esm/series/interface/tooltip-helper.d.ts +6 -6
  384. package/esm/series/interface/tooltip-helper.js.map +1 -1
  385. package/esm/series/link/link.js +1 -3
  386. package/esm/series/link/link.js.map +1 -1
  387. package/esm/series/treemap/treemap.js.map +1 -1
  388. package/esm/series/word-cloud/base.js +3 -3
  389. package/esm/series/word-cloud/base.js.map +1 -1
  390. package/esm/series/word-cloud/word-cloud-3d.js +2 -4
  391. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  392. package/esm/theme/buildin-theme/index.d.ts +0 -1
  393. package/esm/theme/buildin-theme/index.js +1 -5
  394. package/esm/theme/buildin-theme/index.js.map +1 -1
  395. package/esm/theme/buildin-theme/light/component/crosshair.js +4 -4
  396. package/esm/theme/buildin-theme/light/component/crosshair.js.map +1 -1
  397. package/esm/theme/buildin-theme/light/component/tooltip.js +1 -0
  398. package/esm/theme/buildin-theme/light/component/tooltip.js.map +1 -1
  399. package/esm/typings/spec/common.d.ts +1 -1
  400. package/esm/typings/spec/common.js.map +1 -1
  401. package/esm/typings/tooltip/common.d.ts +7 -1
  402. package/esm/typings/tooltip/common.js.map +1 -1
  403. package/esm/typings/tooltip/handler.d.ts +1 -1
  404. package/esm/typings/tooltip/handler.js.map +1 -1
  405. package/esm/typings/tooltip/line.d.ts +6 -4
  406. package/esm/typings/tooltip/line.js.map +1 -1
  407. package/esm/typings/tooltip/shape.d.ts +3 -3
  408. package/esm/typings/tooltip/shape.js.map +1 -1
  409. package/esm/typings/tooltip/tooltip.d.ts +11 -8
  410. package/esm/typings/tooltip/tooltip.js.map +1 -1
  411. package/esm/typings/visual.d.ts +4 -11
  412. package/esm/typings/visual.js.map +1 -1
  413. package/esm/util/debug.d.ts +3 -3
  414. package/esm/util/debug.js +11 -14
  415. package/esm/util/debug.js.map +1 -1
  416. package/esm/util/index.d.ts +1 -0
  417. package/esm/util/index.js +2 -0
  418. package/esm/util/index.js.map +1 -1
  419. package/esm/util/style.js +3 -8
  420. package/esm/util/style.js.map +1 -1
  421. package/package.json +35 -39
  422. package/cjs/component/tooltip/handler/dom/utils/style.d.ts +0 -3
  423. package/cjs/component/tooltip/handler/dom/utils/style.js.map +0 -1
  424. package/cjs/component/tooltip/handler/interface/cache.d.ts +0 -28
  425. package/cjs/component/tooltip/handler/interface/cache.js +0 -6
  426. package/cjs/component/tooltip/handler/interface/cache.js.map +0 -1
  427. package/cjs/theme/buildin-theme/dark.d.ts +0 -2
  428. package/cjs/theme/buildin-theme/dark.js +0 -16
  429. package/cjs/theme/buildin-theme/dark.js.map +0 -1
  430. package/esm/component/tooltip/handler/dom/utils/style.d.ts +0 -3
  431. package/esm/component/tooltip/handler/dom/utils/style.js +0 -59
  432. package/esm/component/tooltip/handler/dom/utils/style.js.map +0 -1
  433. package/esm/component/tooltip/handler/interface/cache.d.ts +0 -28
  434. package/esm/component/tooltip/handler/interface/cache.js +0 -2
  435. package/esm/component/tooltip/handler/interface/cache.js.map +0 -1
  436. package/esm/theme/buildin-theme/dark.d.ts +0 -2
  437. package/esm/theme/buildin-theme/dark.js +0 -12
  438. package/esm/theme/buildin-theme/dark.js.map +0 -1
@@ -1,15 +1,18 @@
1
- import type { TooltipActiveType, TooltipData } from './handler';
1
+ import type { MaybeArray } from '../common';
2
+ import type { TooltipPatternProperty, TooltipUpdateCallback } from './common';
3
+ import type { TooltipActiveType } from './handler';
2
4
  import type { IToolTipLineActual, IToolTipLinePattern } from './line';
3
5
  import type { ITooltipPositionActual, TooltipPosition } from './position';
4
6
  import type { ITooltipShapePattern } from './shape';
5
7
  export interface ITooltipPattern extends ITooltipShapePattern {
6
- visible?: boolean;
7
- title?: IToolTipLinePattern;
8
- content?: IToolTipLinePattern[];
9
- position?: TooltipPosition;
10
- updateTitle?: (prev: IToolTipLineActual | undefined, data: TooltipData) => IToolTipLineActual | undefined;
11
- updateContent?: (prev: IToolTipLineActual[] | undefined, data: TooltipData) => IToolTipLineActual[] | undefined;
12
- updatePosition?: (prev: ITooltipPositionActual | undefined, data: TooltipData) => ITooltipPositionActual | undefined;
8
+ visible?: TooltipPatternProperty<boolean>;
9
+ title?: TooltipPatternProperty<IToolTipLinePattern>;
10
+ content?: MaybeArray<TooltipPatternProperty<MaybeArray<IToolTipLinePattern>>>;
11
+ position?: TooltipPatternProperty<TooltipPosition>;
12
+ updateTitle?: TooltipUpdateCallback<IToolTipLineActual>;
13
+ updateContent?: TooltipUpdateCallback<IToolTipLineActual[]>;
14
+ updatePosition?: TooltipUpdateCallback<ITooltipPositionActual>;
15
+ maxLineCount?: number;
13
16
  activeType?: TooltipActiveType;
14
17
  }
15
18
  export interface IToolTipActual {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typings/tooltip/tooltip.ts"],"names":[],"mappings":"","file":"tooltip.js","sourcesContent":["import type { TooltipActiveType, TooltipData } from './handler';\nimport type { IToolTipLineActual, IToolTipLinePattern } from './line';\nimport type { ITooltipPositionActual, TooltipPosition } from './position';\nimport type { ITooltipShapePattern } from './shape';\n\nexport interface ITooltipPattern extends ITooltipShapePattern {\n visible?: boolean;\n title?: IToolTipLinePattern;\n content?: IToolTipLinePattern[];\n position?: TooltipPosition;\n updateTitle?: (prev: IToolTipLineActual | undefined, data: TooltipData) => IToolTipLineActual | undefined;\n updateContent?: (prev: IToolTipLineActual[] | undefined, data: TooltipData) => IToolTipLineActual[] | undefined;\n updatePosition?: (prev: ITooltipPositionActual | undefined, data: TooltipData) => ITooltipPositionActual | undefined;\n /** 方便内部逻辑辨别 tooltip 类型,不暴露给用户 */\n activeType?: TooltipActiveType;\n}\n\nexport interface IToolTipActual {\n visible?: boolean;\n title?: IToolTipLineActual;\n content?: IToolTipLineActual[];\n activeType?: TooltipActiveType;\n position?: ITooltipPositionActual;\n}\n"]}
1
+ {"version":3,"sources":["../src/typings/tooltip/tooltip.ts"],"names":[],"mappings":"","file":"tooltip.js","sourcesContent":["import type { MaybeArray } from '../common';\nimport type { TooltipPatternProperty, TooltipUpdateCallback } from './common';\nimport type { TooltipActiveType } from './handler';\nimport type { IToolTipLineActual, IToolTipLinePattern } from './line';\nimport type { ITooltipPositionActual, TooltipPosition } from './position';\nimport type { ITooltipShapePattern } from './shape';\n\nexport interface ITooltipPattern extends ITooltipShapePattern {\n visible?: TooltipPatternProperty<boolean>;\n title?: TooltipPatternProperty<IToolTipLinePattern>;\n content?: MaybeArray<TooltipPatternProperty<MaybeArray<IToolTipLinePattern>>>;\n position?: TooltipPatternProperty<TooltipPosition>;\n\n updateTitle?: TooltipUpdateCallback<IToolTipLineActual>;\n updateContent?: TooltipUpdateCallback<IToolTipLineActual[]>;\n updatePosition?: TooltipUpdateCallback<ITooltipPositionActual>;\n\n /** tooltip content 保留的最大数据行数,默认为 20 */\n maxLineCount?: number;\n\n /** 方便内部逻辑辨别 tooltip 类型,不暴露给用户 */\n activeType?: TooltipActiveType;\n}\n\nexport interface IToolTipActual {\n visible?: boolean;\n title?: IToolTipLineActual;\n content?: IToolTipLineActual[];\n activeType?: TooltipActiveType;\n position?: ITooltipPositionActual;\n}\n"]}
@@ -121,14 +121,12 @@ export interface ITextMarkSpec extends IFillMarkSpec {
121
121
  dx?: number;
122
122
  dy?: number;
123
123
  fontSize?: number;
124
- align?: TextAlign;
125
124
  textAlign?: TextAlign;
126
- baseline?: TextBaseLine;
127
125
  textBaseline?: TextBaseLine;
128
126
  fontFamily?: string;
129
127
  fontWeight?: FontWeight;
130
128
  fontStyle?: FontStyle;
131
- limit?: number;
129
+ maxLineWidth?: number;
132
130
  ellipsis?: string;
133
131
  lineBreak?: string;
134
132
  underline?: boolean;
@@ -137,12 +135,7 @@ export interface ITextMarkSpec extends IFillMarkSpec {
137
135
  }
138
136
  export type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;
139
137
  export interface IRectMarkSpec extends IFillMarkSpec {
140
- cornerRadius?: number;
141
- cornerRadiusTopLeft?: number;
142
- cornerRadiusTopRight?: number;
143
- cornerRadiusBottomLeft?: number;
144
- cornerRadiusBottomRight?: number;
145
- borderRadius?: number | number[];
138
+ cornerRadius?: number | number[];
146
139
  width?: number;
147
140
  height?: number;
148
141
  x1?: number;
@@ -219,11 +212,11 @@ export interface IGroupMarkSpec extends ICommonSpec, IFillMarkSpec {
219
212
  clip?: boolean;
220
213
  width?: number;
221
214
  height?: number;
222
- cornerRadius?: number;
215
+ cornerRadius?: number | number[];
223
216
  }
224
217
  export interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {
225
218
  points?: IPoint[];
226
- borderRadius?: number | number[];
219
+ cornerRadius?: number | number[];
227
220
  scaleX?: number;
228
221
  scaleY?: number;
229
222
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IAttributeOpt, IModelMarkAttributeContext } from '../compile/mark';\nimport type { Datum, StringOrNumber } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n type: ScaleType;\n domain: D[];\n range: T[];\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n dataId: string;\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n id: string;\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (\n datum: Datum,\n context: IModelMarkAttributeContext,\n opt?: IAttributeOpt,\n source?: DataView\n) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\nexport interface ICommonSpec {\n visible?: boolean;\n x?: number;\n y?: number;\n z?: number;\n stroke?: string | IGradient | IColorKey;\n strokeOpacity?: number;\n opacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n\n cursor?: Cursor;\n zIndex?: number;\n borderSize?: number;\n borderColor?: string;\n borderSpacing?: number;\n borderOpacity?: number;\n angle?: number;\n anchor?: [number, number];\n\n // 3d旋转的属性\n beta?: number;\n alpha?: number;\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n boundsMode?: 'accurate' | 'imprecise';\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框\n */\n outerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n /**\n * 内边框\n */\n innerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n fill?: VisualType<string> | IGradient | false | IColorKey;\n fillOpacity?: number;\n}\n\n// export interface IFillImageMarkSpec {\n// fillImage?: string;\n// repeatX?: RepeatXYType;\n// repeatY?: RepeatXYType;\n// imageOrigin?: ImageOriginType;\n// }\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n dx?: number;\n dy?: number;\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /** FIXME: vrender Symbol接收的图形属性,暂时都申明一下 */\n symbolType?: ShapeType | string;\n scaleX?: number;\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n curveType?: InterpolateType;\n defined?: boolean;\n /**\n * @private 一个标志位,用于通知 VGrammar 是否执行 getLineSegmentConfigs 方法\n */\n enableSegments?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n x1?: number;\n y1?: number;\n\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n lineCap?: LineStrokeCap;\n lineJoin?: LineStrokeJoin;\n miterLimit?: number;\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n x1?: number;\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n text?: StringOrNumber | string[]; // todo: text配置支持回调\n dx?: number;\n dy?: number;\n fontSize?: number;\n /** @deprecated 后续需要替换成 textAlign,暂时会兼容两种写法 */\n align?: TextAlign;\n textAlign?: TextAlign;\n /** @deprecated 后续需要替换成 textBaseline,暂时会兼容两种写法 */\n baseline?: TextBaseLine;\n textBaseline?: TextBaseLine;\n /** VRender 升级后,统一通过fontFamily声明,老的font配置不再支持 */\n fontFamily?: string;\n fontWeight?: FontWeight;\n fontStyle?: FontStyle;\n limit?: number;\n ellipsis?: string;\n // TODO: 这些不是常规的文字mark属性,待确认需求背景\n lineBreak?: string;\n underline?: boolean;\n lineThrough?: boolean;\n lineHeight?: number;\n}\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * @deprecated 后续需要替换成 borderRadius\n */\n cornerRadius?: number;\n /**\n * @deprecated 后续需要替换成 borderRadius\n */\n cornerRadiusTopLeft?: number;\n /**\n * @deprecated 后续需要替换成 borderRadius\n */\n cornerRadiusTopRight?: number;\n /**\n * @deprecated 后续需要替换成 borderRadius\n */\n cornerRadiusBottomLeft?: number;\n /**\n * @deprecated 后续需要替换成 borderRadius\n */\n cornerRadiusBottomRight?: number;\n\n borderRadius?: number | number[];\n\n width?: number;\n height?: number;\n x1?: number;\n y1?: number;\n}\n\n// 3d rect,支持length表示长宽高中的长属性(深度属性)\nexport interface IRect3dMarkSpec extends IRectMarkSpec {\n length?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n /**\n * box描边宽度\n */\n lineWidth?: number;\n /**\n * box宽度\n */\n boxWidth?: number;\n /**\n * 最大最小值宽度\n */\n shaftWidth?: number;\n /**\n * 中轴线类型\n */\n shaftShape?: BoxPlotShaftShape;\n /**\n * 盒子填充颜色,为空则不填充\n */\n boxFill?: string;\n // /**\n // * 描边颜色\n // */\n // stroke?: string;\n /**\n * 中轴线透明度,仅当shaftType=bar时生效\n */\n shaftFillOpacity?: number;\n\n min?: (datum: Datum) => number;\n q1?: (datum: Datum) => number;\n median?: (datum: Datum) => number;\n q3?: (datum: Datum) => number;\n max?: (datum: Datum) => number;\n}\n\nexport interface IOutlierMarkSpec {\n //异常点填充颜色\n fill?: string;\n //异常点大小\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n scaleX?: number;\n scaleY?: number;\n scaleCenter?: { x: number; y: number };\n // TODO: 该属性后续可能会删除,未定\n // 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n x0?: number;\n y0?: number;\n x1?: number;\n y1?: number;\n thickness?: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface IArcMarkSpec extends IFillMarkSpec {\n startAngle?: number;\n endAngle?: number;\n padAngle?: number;\n\n outerRadius?: number;\n innerRadius?: number;\n cornerRadius?: number;\n\n /** arc的中心点偏移距离 */\n centerOffset?: number;\n\n /** arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外 */\n cap?: boolean | [boolean, boolean];\n /** arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效 */\n autoCapConical?: boolean;\n}\n\n// 3d arc,有高度配置\nexport interface IArc3dMarkSpec extends IArcMarkSpec {\n height?: number;\n}\n\nexport interface IProgressArcMarkSpec extends IArcMarkSpec {\n /** 进度条内侧 padding(接受负值) */\n innerPadding?: number;\n /** 进度条外侧 padding(接受负值) */\n outerPadding?: number;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends ICommonSpec, IFillMarkSpec {\n clip?: boolean;\n width?: number;\n height?: number;\n cornerRadius?: number;\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n points?: IPoint[];\n borderRadius?: number | number[];\n scaleX?: number;\n scaleY?: number;\n}\n\nexport interface IPyramid3dMarkSpec extends IPolygonMarkSpec {\n // 只能有4个顶点\n points?: IPoint[];\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n offset: GradientPropValue<number>;\n color: GradientPropValue<string>;\n opacity?: number;\n};\nexport interface IGradientLinear {\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n r0?: GradientPropValue<number>;\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n r1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n x?: GradientPropValue<number>;\n y?: GradientPropValue<number>;\n startAngle?: GradientPropValue<number>;\n endAngle?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\n/**\n * text\n */\nexport type TextAlign = 'left' | 'right' | 'center';\nexport type TextBaseLine = 'top' | 'bottom' | 'middle' | 'alphabetic';\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
1
+ {"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IAttributeOpt, IModelMarkAttributeContext } from '../compile/mark';\nimport type { Datum, StringOrNumber } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n type: ScaleType;\n domain: D[];\n range: T[];\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n dataId: string;\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n id: string;\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (\n datum: Datum,\n context: IModelMarkAttributeContext,\n opt?: IAttributeOpt,\n source?: DataView\n) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\nexport interface ICommonSpec {\n visible?: boolean;\n x?: number;\n y?: number;\n z?: number;\n stroke?: string | IGradient | IColorKey;\n strokeOpacity?: number;\n opacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n\n cursor?: Cursor;\n zIndex?: number;\n borderSize?: number;\n borderColor?: string;\n borderSpacing?: number;\n borderOpacity?: number;\n angle?: number;\n anchor?: [number, number];\n\n // 3d旋转的属性\n beta?: number;\n alpha?: number;\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n boundsMode?: 'accurate' | 'imprecise';\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框\n */\n outerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n /**\n * 内边框\n */\n innerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n fill?: VisualType<string> | IGradient | false | IColorKey;\n fillOpacity?: number;\n}\n\n// export interface IFillImageMarkSpec {\n// fillImage?: string;\n// repeatX?: RepeatXYType;\n// repeatY?: RepeatXYType;\n// imageOrigin?: ImageOriginType;\n// }\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n dx?: number;\n dy?: number;\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /** FIXME: vrender Symbol接收的图形属性,暂时都申明一下 */\n symbolType?: ShapeType | string;\n scaleX?: number;\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n curveType?: InterpolateType;\n defined?: boolean;\n /**\n * @private 一个标志位,用于通知 VGrammar 是否执行 getLineSegmentConfigs 方法\n */\n enableSegments?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n x1?: number;\n y1?: number;\n\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n lineCap?: LineStrokeCap;\n lineJoin?: LineStrokeJoin;\n miterLimit?: number;\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n x1?: number;\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: StringOrNumber | string[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number;\n /**\n * 文字对齐方式\n */\n textAlign?: TextAlign;\n /**\n * 文字居中方式\n */\n textBaseline?: TextBaseLine;\n /**\n * 字体\n */\n fontFamily?: string;\n /**\n * 字重\n */\n fontWeight?: FontWeight;\n /**\n * 字体样式\n */\n fontStyle?: FontStyle;\n /**\n * 文字的最大长度\n */\n maxLineWidth?: number;\n /**\n * 文字超出 maxLineWidth 后的省略符\n */\n ellipsis?: string;\n // TODO: 这些不是常规的文字mark属性,待确认需求背景\n lineBreak?: string;\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高\n */\n lineHeight?: number;\n}\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n width?: number;\n height?: number;\n x1?: number;\n y1?: number;\n}\n\n// 3d rect,支持length表示长宽高中的长属性(深度属性)\nexport interface IRect3dMarkSpec extends IRectMarkSpec {\n length?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n /**\n * box描边宽度\n */\n lineWidth?: number;\n /**\n * box宽度\n */\n boxWidth?: number;\n /**\n * 最大最小值宽度\n */\n shaftWidth?: number;\n /**\n * 中轴线类型\n */\n shaftShape?: BoxPlotShaftShape;\n /**\n * 盒子填充颜色,为空则不填充\n */\n boxFill?: string;\n // /**\n // * 描边颜色\n // */\n // stroke?: string;\n /**\n * 中轴线透明度,仅当shaftType=bar时生效\n */\n shaftFillOpacity?: number;\n\n min?: (datum: Datum) => number;\n q1?: (datum: Datum) => number;\n median?: (datum: Datum) => number;\n q3?: (datum: Datum) => number;\n max?: (datum: Datum) => number;\n}\n\nexport interface IOutlierMarkSpec {\n //异常点填充颜色\n fill?: string;\n //异常点大小\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n scaleX?: number;\n scaleY?: number;\n scaleCenter?: { x: number; y: number };\n // TODO: 该属性后续可能会删除,未定\n // 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n x0?: number;\n y0?: number;\n x1?: number;\n y1?: number;\n thickness?: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface IArcMarkSpec extends IFillMarkSpec {\n startAngle?: number;\n endAngle?: number;\n padAngle?: number;\n\n outerRadius?: number;\n innerRadius?: number;\n cornerRadius?: number;\n\n /** arc的中心点偏移距离 */\n centerOffset?: number;\n\n /** arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外 */\n cap?: boolean | [boolean, boolean];\n /** arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效 */\n autoCapConical?: boolean;\n}\n\n// 3d arc,有高度配置\nexport interface IArc3dMarkSpec extends IArcMarkSpec {\n height?: number;\n}\n\nexport interface IProgressArcMarkSpec extends IArcMarkSpec {\n /** 进度条内侧 padding(接受负值) */\n innerPadding?: number;\n /** 进度条外侧 padding(接受负值) */\n outerPadding?: number;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends ICommonSpec, IFillMarkSpec {\n clip?: boolean;\n width?: number;\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n scaleX?: number;\n scaleY?: number;\n}\n\nexport interface IPyramid3dMarkSpec extends IPolygonMarkSpec {\n // 只能有4个顶点\n points?: IPoint[];\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n offset: GradientPropValue<number>;\n color: GradientPropValue<string>;\n opacity?: number;\n};\nexport interface IGradientLinear {\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n r0?: GradientPropValue<number>;\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n r1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n x?: GradientPropValue<number>;\n y?: GradientPropValue<number>;\n startAngle?: GradientPropValue<number>;\n endAngle?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\n/**\n * text\n */\nexport type TextAlign = 'left' | 'right' | 'center';\nexport type TextBaseLine = 'top' | 'bottom' | 'middle' | 'alphabetic';\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
@@ -1,6 +1,6 @@
1
- export declare let log: (msg: string, ...args: any[]) => void;
2
- export declare let warn: (msg: string, detail?: any) => void;
3
- export declare let error: (msg: string, detail?: any, err?: Error) => void;
1
+ export declare const log: (msg: string, ...args: any[]) => any;
2
+ export declare const warn: (msg: string, detail?: any) => any;
3
+ export declare const error: (msg: string, detail?: any, err?: Error) => any;
4
4
  export declare const config: IConfig;
5
5
  export interface IConfig {
6
6
  silent: boolean;
package/cjs/util/debug.js CHANGED
@@ -4,33 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.config = exports.error = exports.warn = exports.log = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils");
8
-
9
- let log = (msg, ...args) => {};
7
+ const vutils_1 = require("@visactor/vutils"), hasConsole = "undefined" != typeof console, log = (msg, ...args) => {
8
+ if (!exports.config.silent) return vutils_1.Logger.logger(vutils_1.Logger.Info, "log").info(msg, ...args);
9
+ };
10
10
 
11
11
  exports.log = log;
12
12
 
13
- let warn = (msg, detail) => {};
13
+ const warn = (msg, detail) => {
14
+ if ((0, vutils_1.isFunction)(exports.config.warnHandler)) exports.config.warnHandler.call(null, msg, detail); else if (hasConsole && !exports.config.silent) return detail ? vutils_1.Logger.logger(vutils_1.Logger.Warn, "warn").warn(`[VChart warn]: ${msg}\n`, detail) : vutils_1.Logger.logger(vutils_1.Logger.Warn, "warn").warn(`[VChart warn]: ${msg}`);
15
+ };
14
16
 
15
17
  exports.warn = warn;
16
18
 
17
- let error = (msg, detail, err) => {};
18
-
19
- exports.error = error;
20
-
21
- {
22
- const hasConsole = "undefined" != typeof console;
23
- exports.log = (msg, ...args) => {
24
- if (!exports.config.silent) return vutils_1.Logger.logger(vutils_1.Logger.Info, "log").info(msg, ...args);
25
- }, exports.warn = (msg, detail) => {
26
- if ((0, vutils_1.isFunction)(exports.config.warnHandler)) exports.config.warnHandler.call(null, msg, detail); else if (hasConsole && !exports.config.silent) return detail ? vutils_1.Logger.logger(vutils_1.Logger.Warn, "warn").warn(`[VChart warn]: ${msg}\n`, detail) : vutils_1.Logger.logger(vutils_1.Logger.Warn, "warn").warn(`[VChart warn]: ${msg}`);
27
- }, exports.error = (msg, detail, err) => {
28
- const errIns = new Error(msg);
29
- if ((0, vutils_1.isFunction)(exports.config.errorHandler)) exports.config.errorHandler.call(null, errIns, detail); else if (!exports.config.silent) return vutils_1.Logger.logger(vutils_1.Logger.Error, "error").error(`[VChart error]: ${errIns}`, detail);
30
- };
31
- }
19
+ const error = (msg, detail, err) => {
20
+ const errIns = new Error(msg);
21
+ if ((0, vutils_1.isFunction)(exports.config.errorHandler)) exports.config.errorHandler.call(null, errIns, detail); else if (!exports.config.silent) return vutils_1.Logger.logger(vutils_1.Logger.Error, "error").error(`[VChart error]: ${errIns}`, detail);
22
+ };
32
23
 
33
- exports.config = {
24
+ exports.error = error, exports.config = {
34
25
  silent: !1,
35
26
  warnHandler: !1,
36
27
  errorHandler: !1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/debug.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAE/C,IAAI,GAAG,GAAG,CAAC,GAAW,EAAE,GAAG,IAAW,EAAE,EAAE;AAEjD,CAAC,CAAC;AAFS,QAAA,GAAG,OAEZ;AACK,IAAI,IAAI,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,EAAE;AAEhD,CAAC,CAAC;AAFS,QAAA,IAAI,QAEb;AACK,IAAI,KAAK,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,GAAW,EAAE,EAAE;AAE9D,CAAC,CAAC;AAFS,QAAA,KAAK,SAEd;AAEF,IAAI,IAAI,EAAE;IACR,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC;IAElD,WAAG,GAAG,CAAC,GAAW,EAAE,GAAG,IAAW,EAAE,EAAE;QACpC,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;YAClB,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;SAC7D;IACH,CAAC,CAAC;IAEF,YAAI,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,EAAE;QACnC,IAAI,IAAA,mBAAU,EAAC,cAAM,CAAC,WAAW,CAAC,EAAE;YAClC,cAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;SAC5C;aAAM,IAAI,UAAU,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;YACvC,IAAI,MAAM,EAAE;gBACV,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;aACnF;YACD,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,CAAC;SACzE;IACH,CAAC,CAAC;IAEF,aAAK,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,GAAW,EAAE,EAAE;QACjD,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,IAAA,mBAAU,EAAC,cAAM,CAAC,YAAY,CAAC,EAAE;YACnC,cAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SAChD;aAAM,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;YACzB,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,mBAAmB,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;SACxF;IACH,CAAC,CAAC;CACH;AAEY,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;CACE,CAAC","file":"debug.js","sourcesContent":["import { Logger, isFunction } from '@visactor/vutils';\n\nexport let log = (msg: string, ...args: any[]) => {\n // do nothing\n};\nexport let warn = (msg: string, detail?: any) => {\n // do nothing\n};\nexport let error = (msg: string, detail?: any, err?: Error) => {\n // do nothing\n};\n\nif (true) {\n const hasConsole = typeof console !== 'undefined';\n\n log = (msg: string, ...args: any[]) => {\n if (!config.silent) {\n return Logger.logger(Logger.Info, 'log').info(msg, ...args);\n }\n };\n\n warn = (msg: string, detail?: any) => {\n if (isFunction(config.warnHandler)) {\n config.warnHandler.call(null, msg, detail);\n } else if (hasConsole && !config.silent) {\n if (detail) {\n return Logger.logger(Logger.Warn, 'warn').warn(`[VChart warn]: ${msg}\\n`, detail);\n }\n return Logger.logger(Logger.Warn, 'warn').warn(`[VChart warn]: ${msg}`);\n }\n };\n\n error = (msg: string, detail?: any, err?: Error) => {\n const errIns = new Error(msg);\n if (isFunction(config.errorHandler)) {\n config.errorHandler.call(null, errIns, detail);\n } else if (!config.silent) {\n return Logger.logger(Logger.Error, 'error').error(`[VChart error]: ${errIns}`, detail);\n }\n };\n}\n\nexport const config = {\n silent: false,\n warnHandler: false,\n errorHandler: false\n} as unknown as IConfig;\n\nexport interface IConfig {\n /**\n * 是否开启控制台告警\n */\n silent: boolean;\n /**\n * 错误处理\n */\n errorHandler?: (err: Error, detail?: any) => void;\n /**\n * 警告处理\n */\n warnHandler?: (msg: string, detail?: any) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/debug.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAEtD,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC;AAE3C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,GAAG,IAAW,EAAE,EAAE;IACjD,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;QAClB,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC;AAJW,QAAA,GAAG,OAId;AAEK,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,EAAE;IAChD,IAAI,IAAA,mBAAU,EAAC,cAAM,CAAC,WAAW,CAAC,EAAE;QAClC,cAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;KAC5C;SAAM,IAAI,UAAU,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;QACvC,IAAI,MAAM,EAAE;YACV,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;SACnF;QACD,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,CAAC;KACzE;AACH,CAAC,CAAC;AATW,QAAA,IAAI,QASf;AAEK,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,GAAW,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,IAAA,mBAAU,EAAC,cAAM,CAAC,YAAY,CAAC,EAAE;QACnC,cAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;QACzB,OAAO,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,mBAAmB,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;KACxF;AACH,CAAC,CAAC;AAPW,QAAA,KAAK,SAOhB;AAEW,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;CACE,CAAC","file":"debug.js","sourcesContent":["import { Logger, isFunction } from '@visactor/vutils';\n\nconst hasConsole = typeof console !== 'undefined';\n\nexport const log = (msg: string, ...args: any[]) => {\n if (!config.silent) {\n return Logger.logger(Logger.Info, 'log').info(msg, ...args);\n }\n};\n\nexport const warn = (msg: string, detail?: any) => {\n if (isFunction(config.warnHandler)) {\n config.warnHandler.call(null, msg, detail);\n } else if (hasConsole && !config.silent) {\n if (detail) {\n return Logger.logger(Logger.Warn, 'warn').warn(`[VChart warn]: ${msg}\\n`, detail);\n }\n return Logger.logger(Logger.Warn, 'warn').warn(`[VChart warn]: ${msg}`);\n }\n};\n\nexport const error = (msg: string, detail?: any, err?: Error) => {\n const errIns = new Error(msg);\n if (isFunction(config.errorHandler)) {\n config.errorHandler.call(null, errIns, detail);\n } else if (!config.silent) {\n return Logger.logger(Logger.Error, 'error').error(`[VChart error]: ${errIns}`, detail);\n }\n};\n\nexport const config = {\n silent: false,\n warnHandler: false,\n errorHandler: false\n} as unknown as IConfig;\n\nexport interface IConfig {\n /**\n * 是否开启控制台告警\n */\n silent: boolean;\n /**\n * 错误处理\n */\n errorHandler?: (err: Error, detail?: any) => void;\n /**\n * 警告处理\n */\n warnHandler?: (msg: string, detail?: any) => void;\n}\n"]}
@@ -16,6 +16,7 @@ export * from './spec';
16
16
  export * from './text';
17
17
  export * from './data';
18
18
  export * from './hierarchy';
19
+ export * from './style';
19
20
  export declare const Utils: {
20
21
  TimeUtil: typeof TimeUtil;
21
22
  };
package/cjs/util/index.js CHANGED
@@ -43,7 +43,8 @@ __exportStar(require("./model"), exports), __exportStar(require("./object"), exp
43
43
  __exportStar(require("./scale"), exports), __exportStar(require("./space"), exports),
44
44
  __exportStar(require("./type"), exports), __exportStar(require("./spec"), exports),
45
45
  __exportStar(require("./text"), exports), __exportStar(require("./data"), exports),
46
- __exportStar(require("./hierarchy"), exports), exports.Utils = {
46
+ __exportStar(require("./hierarchy"), exports), __exportStar(require("./style"), exports),
47
+ exports.Utils = {
47
48
  TimeUtil: time_1.TimeUtil
48
49
  };
49
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gEAAiE;AACjE,6CAA6D;AAEpD,yFAFA,iBAAQ,OAEA;AAAE,yFAFA,iBAAQ,OAEA;AAAE,sFAFA,cAAK,OAEA;AAElC,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,uCAAqB;AACrB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAEf,QAAA,KAAK,GAAG,EAAE,QAAQ,EAAR,eAAQ,EAAE,CAAC","file":"index.js","sourcesContent":["import { TimeUtil } from '../component/axis/cartesian/util/time';\nimport { debounce, throttle, clamp } from '@visactor/vutils';\n\nexport { debounce, throttle, clamp };\n\nexport * from './array';\nexport * from './color';\nexport * from './debug';\nexport * from './env';\nexport * from './id';\nexport * from './math';\nexport * from './model';\nexport * from './object';\nexport * from './scale';\nexport * from './space';\nexport * from './type';\nexport * from './spec';\nexport * from './text';\nexport * from './data';\nexport * from './hierarchy';\n\nexport const Utils = { TimeUtil };\n"]}
1
+ {"version":3,"sources":["../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gEAAiE;AACjE,6CAA6D;AAEpD,yFAFA,iBAAQ,OAEA;AAAE,yFAFA,iBAAQ,OAEA;AAAE,sFAFA,cAAK,OAEA;AAElC,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,uCAAqB;AACrB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,0CAAwB;AAEX,QAAA,KAAK,GAAG,EAAE,QAAQ,EAAR,eAAQ,EAAE,CAAC","file":"index.js","sourcesContent":["import { TimeUtil } from '../component/axis/cartesian/util/time';\nimport { debounce, throttle, clamp } from '@visactor/vutils';\n\nexport { debounce, throttle, clamp };\n\nexport * from './array';\nexport * from './color';\nexport * from './debug';\nexport * from './env';\nexport * from './id';\nexport * from './math';\nexport * from './model';\nexport * from './object';\nexport * from './scale';\nexport * from './space';\nexport * from './type';\nexport * from './spec';\nexport * from './text';\nexport * from './data';\nexport * from './hierarchy';\nexport * from './style';\n\nexport const Utils = { TimeUtil };\n"]}
package/cjs/util/style.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.transformToGraphic = exports.transformStateStyle = exports.transformComponentStyle = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), utils_1 = require("../mark/utils");
7
+ const vutils_1 = require("@visactor/vutils");
8
8
 
9
9
  function transformComponentStyle(cfg = {}) {
10
10
  return (0, vutils_1.isEmpty)(cfg.style) || (cfg.style = transformToGraphic(cfg.style)),
@@ -20,12 +20,8 @@ function transformStateStyle(stateStyle) {
20
20
  }
21
21
 
22
22
  function transformToGraphic(style) {
23
- return (0, vutils_1.isEmpty)(style) || (style.angle && (style.angle = (0, vutils_1.degreeToRadian)(style.angle)),
24
- (0, vutils_1.isValid)(style.strokeWidth) && (style.lineWidth = style.strokeWidth),
25
- (0, vutils_1.isValid)(style.limit) && (style.maxLineWidth = style.limit, delete style.limit),
26
- Object.keys(utils_1.DUPLICATED_ATTRS).forEach((oldAttr => {
27
- style[oldAttr] && (style[utils_1.DUPLICATED_ATTRS[oldAttr]] = style[oldAttr], delete style[oldAttr]);
28
- }))), style;
23
+ return (0, vutils_1.isEmpty)(style) || style.angle && (style.angle = (0, vutils_1.degreeToRadian)(style.angle)),
24
+ style;
29
25
  }
30
26
 
31
27
  exports.transformComponentStyle = transformComponentStyle, exports.transformStateStyle = transformStateStyle,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":";;;AAAA,6CAA8E;AAC9E,yCAAiD;AAQjD,SAAgB,uBAAuB,CAAC,MAAW,EAAE;IACnD,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,GAAG,CAAC,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;aACrD;QACH,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAdD,0DAcC;AAED,SAAgB,mBAAmB,CAAC,UAAe;IACjD,IAAI,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpC,IAAI,CAAC,IAAA,gBAAO,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YAC7B,UAAU,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AAXD,kDAWC;AAED,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;QAClB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,GAAG,IAAA,uBAAc,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IACD,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QAC9B,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC;KACrC;IACD,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACxB,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;QACjC,OAAO,KAAK,CAAC,KAAK,CAAC;KACpB;IACD,MAAM,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;YAClB,KAAK,CAAC,wBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;YAClD,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;SACvB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAtBD,gDAsBC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isString, isValid } from '@visactor/vutils';\nimport { DUPLICATED_ATTRS } from '../mark/utils';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n if (!isEmpty(cfg.style)) {\n cfg.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n Object.keys(cfg.state).forEach(key => {\n if (!isEmpty(cfg.state[key])) {\n cfg.state[key] = transformToGraphic(cfg.state[key]);\n }\n });\n }\n\n return cfg;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n Object.keys(stateStyle).forEach(key => {\n if (!isEmpty(stateStyle[key])) {\n stateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return stateStyle;\n}\n\nexport function transformToGraphic(style: any) {\n if (isEmpty(style)) {\n return style;\n }\n if (style.angle) {\n style.angle = degreeToRadian(style.angle);\n }\n if (isValid(style.strokeWidth)) {\n style.lineWidth = style.strokeWidth;\n }\n if (isValid(style.limit)) {\n style.maxLineWidth = style.limit;\n delete style.limit;\n }\n Object.keys(DUPLICATED_ATTRS).forEach(oldAttr => {\n if (style[oldAttr]) {\n style[DUPLICATED_ATTRS[oldAttr]] = style[oldAttr];\n delete style[oldAttr];\n }\n });\n\n return style;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/style.ts"],"names":[],"mappings":";;;AAAA,6CAAmF;AAQnF,SAAgB,uBAAuB,CAAC,MAAW,EAAE;IACnD,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,GAAG,CAAC,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;aACrD;QACH,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAdD,0DAcC;AAED,SAAgB,mBAAmB,CAAC,UAAe;IACjD,IAAI,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpC,IAAI,CAAC,IAAA,gBAAO,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YAC7B,UAAU,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AAXD,kDAWC;AAED,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;QAClB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,GAAG,IAAA,uBAAc,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AATD,gDASC","file":"style.js","sourcesContent":["import { degreeToRadian, isEmpty, isValid, isValidNumber } from '@visactor/vutils';\n\n/**\n * 针对一些可以配置状态样式的属性的转换函数,结构如下:\n * { style: {}, state: { hover: {} } }\n * @param cfg\n * @returns\n */\nexport function transformComponentStyle(cfg: any = {}) {\n if (!isEmpty(cfg.style)) {\n cfg.style = transformToGraphic(cfg.style);\n }\n\n if (!isEmpty(cfg.state)) {\n Object.keys(cfg.state).forEach(key => {\n if (!isEmpty(cfg.state[key])) {\n cfg.state[key] = transformToGraphic(cfg.state[key]);\n }\n });\n }\n\n return cfg;\n}\n\nexport function transformStateStyle(stateStyle: any) {\n if (isEmpty(stateStyle)) {\n return null;\n }\n Object.keys(stateStyle).forEach(key => {\n if (!isEmpty(stateStyle[key])) {\n stateStyle[key] = transformToGraphic(stateStyle[key]);\n }\n });\n\n return stateStyle;\n}\n\nexport function transformToGraphic(style: any) {\n if (isEmpty(style)) {\n return style;\n }\n if (style.angle) {\n style.angle = degreeToRadian(style.angle);\n }\n\n return style;\n}\n"]}
@@ -6,4 +6,5 @@ export declare class AreaChart extends CartesianChart {
6
6
  readonly type: string;
7
7
  readonly seriesType: string;
8
8
  protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any;
9
+ transformSpec(spec: any): void;
9
10
  }
@@ -4,6 +4,8 @@ import { CartesianChart } from "../cartesian/cartesian";
4
4
 
5
5
  import { ChartTypeEnum } from "../interface";
6
6
 
7
+ import { setDefaultCrosshairForCartesianChart } from "../util";
8
+
7
9
  import { VChart } from "../../core/vchart";
8
10
 
9
11
  import { AreaSeries } from "../../series";
@@ -22,6 +24,9 @@ export class AreaChart extends CartesianChart {
22
24
  area: spec.area
23
25
  });
24
26
  }
27
+ transformSpec(spec) {
28
+ super.transformSpec(spec), setDefaultCrosshairForCartesianChart(spec);
29
+ }
25
30
  }
26
31
 
27
32
  AreaChart.type = ChartTypeEnum.area, AreaChart.view = "singleDefault";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/B,MAAM,OAAO,SAAU,SAAQ,cAAc;IAA7C;;QAGW,SAAI,GAAW,aAAa,CAAC,IAAI,CAAC;QAClC,eAAU,GAAW,cAAc,CAAC,IAAI,CAAC;IAWpD,CAAC;IATW,qBAAqB,CAAC,IAAoB;QAClD,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,OAAO,EACxC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,IACf;IACJ,CAAC;;AAbe,cAAI,GAAW,aAAa,CAAC,IAAI,CAAC;AAClC,cAAI,GAAW,eAAe,CAAC","file":"area.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport type { IAreaChartSpec } from './interface';\nimport { VChart } from '../../core/vchart';\nimport { AreaSeries } from '../../series';\nVChart.useSeries([AreaSeries]);\n\nexport class AreaChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.area;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.area;\n readonly seriesType: string = SeriesTypeEnum.area;\n\n protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n invalidType: spec.invalidType || 'break',\n point: spec.point,\n line: spec.line,\n area: spec.area\n };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/B,MAAM,OAAO,SAAU,SAAQ,cAAc;IAA7C;;QAGW,SAAI,GAAW,aAAa,CAAC,IAAI,CAAC;QAClC,eAAU,GAAW,cAAc,CAAC,IAAI,CAAC;IAgBpD,CAAC;IAdW,qBAAqB,CAAC,IAAoB;QAClD,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,OAAO,EACxC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,IACf;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAlBe,cAAI,GAAW,aAAa,CAAC,IAAI,CAAC;AAClC,cAAI,GAAW,eAAe,CAAC","file":"area.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport type { IAreaChartSpec } from './interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport { AreaSeries } from '../../series';\nVChart.useSeries([AreaSeries]);\n\nexport class AreaChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.area;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.area;\n readonly seriesType: string = SeriesTypeEnum.area;\n\n protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n invalidType: spec.invalidType || 'break',\n point: spec.point,\n line: spec.line,\n area: spec.area\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
@@ -4,4 +4,5 @@ export declare class BarChart extends CartesianChart {
4
4
  static readonly view: string;
5
5
  readonly type: string;
6
6
  readonly seriesType: string;
7
+ transformSpec(spec: any): void;
7
8
  }
@@ -4,6 +4,8 @@ import { CartesianChart } from "../cartesian/cartesian";
4
4
 
5
5
  import { ChartTypeEnum } from "../interface";
6
6
 
7
+ import { setDefaultCrosshairForCartesianChart } from "../util";
8
+
7
9
  import { VChart } from "../../core/vchart";
8
10
 
9
11
  import { BarSeries } from "../../series";
@@ -14,6 +16,9 @@ export class BarChart extends CartesianChart {
14
16
  constructor() {
15
17
  super(...arguments), this.type = ChartTypeEnum.bar, this.seriesType = SeriesTypeEnum.bar;
16
18
  }
19
+ transformSpec(spec) {
20
+ super.transformSpec(spec), setDefaultCrosshairForCartesianChart(spec);
21
+ }
17
22
  }
18
23
 
19
24
  BarChart.type = ChartTypeEnum.bar, BarChart.view = "singleDefault";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9B,MAAM,OAAO,QAAS,SAAQ,cAAc;IAA5C;;QAGW,SAAI,GAAW,aAAa,CAAC,GAAG,CAAC;QACjC,eAAU,GAAW,cAAc,CAAC,GAAG,CAAC;IACnD,CAAC;;AAJiB,aAAI,GAAW,aAAa,CAAC,GAAG,CAAC;AACjC,aAAI,GAAW,eAAe,CAAC","file":"bar.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { VChart } from '../../core/vchart';\nimport { BarSeries } from '../../series';\nVChart.useSeries([BarSeries]);\n\nexport class BarChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar;\n readonly seriesType: string = SeriesTypeEnum.bar;\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9B,MAAM,OAAO,QAAS,SAAQ,cAAc;IAA5C;;QAGW,SAAI,GAAW,aAAa,CAAC,GAAG,CAAC;QACjC,eAAU,GAAW,cAAc,CAAC,GAAG,CAAC;IAMnD,CAAC;IAJC,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AARe,aAAI,GAAW,aAAa,CAAC,GAAG,CAAC;AACjC,aAAI,GAAW,eAAe,CAAC","file":"bar.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport { BarSeries } from '../../series';\nVChart.useSeries([BarSeries]);\n\nexport class BarChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar;\n readonly seriesType: string = SeriesTypeEnum.bar;\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
@@ -217,9 +217,10 @@ export class BaseChart extends CompilableBase {
217
217
  const component = components[index];
218
218
  component.type.startsWith(ComponentTypeEnum.cartesianAxis) ? cartesianAxis = component : component.type.startsWith(ComponentTypeEnum.polarAxis) ? polarAxis = component : noAxisComponents.push(component);
219
219
  }
220
+ cartesianAxis && this._createComponent(cartesianAxis, spec), polarAxis && this._createComponent(polarAxis, spec),
220
221
  noAxisComponents.forEach((C => {
221
222
  this._createComponent(C, spec);
222
- })), cartesianAxis && this._createComponent(cartesianAxis, spec), polarAxis && this._createComponent(polarAxis, spec);
223
+ }));
223
224
  }
224
225
  initComponent() {
225
226
  this._components.forEach((c => c.init({