minerva-design 1.3.0 → 1.4.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 (1166) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +21 -21
  3. package/custom-elements.json +13630 -4757
  4. package/dist/angular/fesm2022/minerva-angular.mjs +6872 -172
  5. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  6. package/dist/angular/types/minerva-angular.d.ts +2240 -0
  7. package/dist/charts/canvas.d.cts +7 -2
  8. package/dist/charts/canvas.d.ts +7 -2
  9. package/dist/charts/core.cjs +1 -1
  10. package/dist/charts/core.d.cts +7 -4
  11. package/dist/charts/core.d.ts +7 -4
  12. package/dist/charts/core.js +19 -8
  13. package/dist/charts/engine/axis.cjs +1 -1
  14. package/dist/charts/engine/axis.cjs.map +1 -1
  15. package/dist/charts/engine/axis.js +6 -6
  16. package/dist/charts/engine/axis.js.map +1 -1
  17. package/dist/charts/engine/canvas.cjs +1 -1
  18. package/dist/charts/engine/canvas.cjs.map +1 -1
  19. package/dist/charts/engine/canvas.d.cts +11 -1
  20. package/dist/charts/engine/canvas.d.ts +11 -1
  21. package/dist/charts/engine/canvas.js +118 -68
  22. package/dist/charts/engine/canvas.js.map +1 -1
  23. package/dist/charts/engine/chart.cjs +1 -1
  24. package/dist/charts/engine/chart.cjs.map +1 -1
  25. package/dist/charts/engine/chart.d.cts +1 -1
  26. package/dist/charts/engine/chart.d.ts +1 -1
  27. package/dist/charts/engine/chart.js +307 -285
  28. package/dist/charts/engine/chart.js.map +1 -1
  29. package/dist/charts/engine/color.cjs +1 -1
  30. package/dist/charts/engine/color.cjs.map +1 -1
  31. package/dist/charts/engine/color.js +2 -2
  32. package/dist/charts/engine/color.js.map +1 -1
  33. package/dist/charts/engine/controller.cjs +1 -1
  34. package/dist/charts/engine/controller.cjs.map +1 -1
  35. package/dist/charts/engine/controller.d.cts +12 -3
  36. package/dist/charts/engine/controller.d.ts +12 -3
  37. package/dist/charts/engine/controller.js +359 -299
  38. package/dist/charts/engine/controller.js.map +1 -1
  39. package/dist/charts/engine/data.cjs +1 -1
  40. package/dist/charts/engine/data.cjs.map +1 -1
  41. package/dist/charts/engine/data.d.cts +6 -0
  42. package/dist/charts/engine/data.d.ts +6 -0
  43. package/dist/charts/engine/data.js +63 -49
  44. package/dist/charts/engine/data.js.map +1 -1
  45. package/dist/charts/engine/format.cjs +1 -1
  46. package/dist/charts/engine/format.cjs.map +1 -1
  47. package/dist/charts/engine/format.d.cts +21 -6
  48. package/dist/charts/engine/format.d.ts +21 -6
  49. package/dist/charts/engine/format.js +46 -21
  50. package/dist/charts/engine/format.js.map +1 -1
  51. package/dist/charts/engine/items.cjs +1 -1
  52. package/dist/charts/engine/items.cjs.map +1 -1
  53. package/dist/charts/engine/items.js +211 -54
  54. package/dist/charts/engine/items.js.map +1 -1
  55. package/dist/charts/engine/labels.cjs +2 -0
  56. package/dist/charts/engine/labels.cjs.map +1 -0
  57. package/dist/charts/engine/labels.d.cts +13 -0
  58. package/dist/charts/engine/labels.d.ts +13 -0
  59. package/dist/charts/engine/labels.js +74 -0
  60. package/dist/charts/engine/labels.js.map +1 -0
  61. package/dist/charts/engine/layout.cjs +1 -1
  62. package/dist/charts/engine/layout.cjs.map +1 -1
  63. package/dist/charts/engine/layout.d.cts +34 -2
  64. package/dist/charts/engine/layout.d.ts +34 -2
  65. package/dist/charts/engine/layout.js +53 -12
  66. package/dist/charts/engine/layout.js.map +1 -1
  67. package/dist/charts/engine/locale.cjs +2 -0
  68. package/dist/charts/engine/locale.cjs.map +1 -0
  69. package/dist/charts/engine/locale.d.cts +33 -0
  70. package/dist/charts/engine/locale.d.ts +33 -0
  71. package/dist/charts/engine/locale.js +68 -0
  72. package/dist/charts/engine/locale.js.map +1 -0
  73. package/dist/charts/engine/model.cjs +1 -1
  74. package/dist/charts/engine/model.cjs.map +1 -1
  75. package/dist/charts/engine/model.d.cts +39 -1
  76. package/dist/charts/engine/model.d.ts +39 -1
  77. package/dist/charts/engine/model.js +212 -105
  78. package/dist/charts/engine/model.js.map +1 -1
  79. package/dist/charts/engine/orderbook/book.cjs +2 -0
  80. package/dist/charts/engine/orderbook/book.cjs.map +1 -0
  81. package/dist/charts/engine/orderbook/book.d.cts +28 -0
  82. package/dist/charts/engine/orderbook/book.d.ts +28 -0
  83. package/dist/charts/engine/orderbook/book.js +134 -0
  84. package/dist/charts/engine/orderbook/book.js.map +1 -0
  85. package/dist/charts/engine/orderbook/depth.cjs +2 -0
  86. package/dist/charts/engine/orderbook/depth.cjs.map +1 -0
  87. package/dist/charts/engine/orderbook/depth.d.cts +7 -0
  88. package/dist/charts/engine/orderbook/depth.d.ts +7 -0
  89. package/dist/charts/engine/orderbook/depth.js +413 -0
  90. package/dist/charts/engine/orderbook/depth.js.map +1 -0
  91. package/dist/charts/engine/orderbook/format.cjs +2 -0
  92. package/dist/charts/engine/orderbook/format.cjs.map +1 -0
  93. package/dist/charts/engine/orderbook/format.d.cts +48 -0
  94. package/dist/charts/engine/orderbook/format.d.ts +48 -0
  95. package/dist/charts/engine/orderbook/format.js +65 -0
  96. package/dist/charts/engine/orderbook/format.js.map +1 -0
  97. package/dist/charts/engine/orderbook/heatmap.cjs +2 -0
  98. package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -0
  99. package/dist/charts/engine/orderbook/heatmap.d.cts +9 -0
  100. package/dist/charts/engine/orderbook/heatmap.d.ts +9 -0
  101. package/dist/charts/engine/orderbook/heatmap.js +703 -0
  102. package/dist/charts/engine/orderbook/heatmap.js.map +1 -0
  103. package/dist/charts/engine/orderbook/host.cjs +2 -0
  104. package/dist/charts/engine/orderbook/host.cjs.map +1 -0
  105. package/dist/charts/engine/orderbook/host.d.cts +50 -0
  106. package/dist/charts/engine/orderbook/host.d.ts +50 -0
  107. package/dist/charts/engine/orderbook/host.js +161 -0
  108. package/dist/charts/engine/orderbook/host.js.map +1 -0
  109. package/dist/charts/engine/orderbook/index.cjs +1 -0
  110. package/dist/charts/engine/orderbook/index.d.cts +6 -0
  111. package/dist/charts/engine/orderbook/index.d.ts +6 -0
  112. package/dist/charts/engine/orderbook/index.js +6 -0
  113. package/dist/charts/engine/orderbook/ladder.cjs +2 -0
  114. package/dist/charts/engine/orderbook/ladder.cjs.map +1 -0
  115. package/dist/charts/engine/orderbook/ladder.d.cts +6 -0
  116. package/dist/charts/engine/orderbook/ladder.d.ts +6 -0
  117. package/dist/charts/engine/orderbook/ladder.js +341 -0
  118. package/dist/charts/engine/orderbook/ladder.js.map +1 -0
  119. package/dist/charts/engine/orderbook/tape.cjs +2 -0
  120. package/dist/charts/engine/orderbook/tape.cjs.map +1 -0
  121. package/dist/charts/engine/orderbook/tape.d.cts +6 -0
  122. package/dist/charts/engine/orderbook/tape.d.ts +6 -0
  123. package/dist/charts/engine/orderbook/tape.js +450 -0
  124. package/dist/charts/engine/orderbook/tape.js.map +1 -0
  125. package/dist/charts/engine/orderbook/types.d.cts +735 -0
  126. package/dist/charts/engine/orderbook/types.d.ts +735 -0
  127. package/dist/charts/engine/overlay.cjs +1 -1
  128. package/dist/charts/engine/overlay.cjs.map +1 -1
  129. package/dist/charts/engine/overlay.d.cts +18 -2
  130. package/dist/charts/engine/overlay.d.ts +18 -2
  131. package/dist/charts/engine/overlay.js +132 -96
  132. package/dist/charts/engine/overlay.js.map +1 -1
  133. package/dist/charts/engine/presets.cjs +2 -2
  134. package/dist/charts/engine/presets.cjs.map +1 -1
  135. package/dist/charts/engine/presets.d.cts +249 -1
  136. package/dist/charts/engine/presets.d.ts +249 -1
  137. package/dist/charts/engine/presets.js +367 -29
  138. package/dist/charts/engine/presets.js.map +1 -1
  139. package/dist/charts/engine/renderers/detect.cjs +1 -1
  140. package/dist/charts/engine/renderers/detect.cjs.map +1 -1
  141. package/dist/charts/engine/renderers/detect.js +18 -15
  142. package/dist/charts/engine/renderers/detect.js.map +1 -1
  143. package/dist/charts/engine/renderers/gl.cjs +2 -0
  144. package/dist/charts/engine/renderers/gl.cjs.map +1 -0
  145. package/dist/charts/engine/renderers/gl.d.cts +21 -0
  146. package/dist/charts/engine/renderers/gl.d.ts +21 -0
  147. package/dist/charts/engine/renderers/gl.js +56 -0
  148. package/dist/charts/engine/renderers/gl.js.map +1 -0
  149. package/dist/charts/engine/renderers/shaders.cjs +143 -1
  150. package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
  151. package/dist/charts/engine/renderers/shaders.d.cts +16 -0
  152. package/dist/charts/engine/renderers/shaders.d.ts +16 -0
  153. package/dist/charts/engine/renderers/shaders.js +139 -1
  154. package/dist/charts/engine/renderers/shaders.js.map +1 -1
  155. package/dist/charts/engine/renderers/webgl.cjs +2 -0
  156. package/dist/charts/engine/renderers/webgl.cjs.map +1 -0
  157. package/dist/charts/engine/renderers/webgl.d.cts +4 -0
  158. package/dist/charts/engine/renderers/webgl.d.ts +4 -0
  159. package/dist/charts/engine/renderers/webgl.js +133 -0
  160. package/dist/charts/engine/renderers/webgl.js.map +1 -0
  161. package/dist/charts/engine/renderers/webgl2.cjs +1 -1
  162. package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
  163. package/dist/charts/engine/renderers/webgl2.d.cts +0 -1
  164. package/dist/charts/engine/renderers/webgl2.d.ts +0 -1
  165. package/dist/charts/engine/renderers/webgl2.js +59 -108
  166. package/dist/charts/engine/renderers/webgl2.js.map +1 -1
  167. package/dist/charts/engine/scale.cjs +1 -1
  168. package/dist/charts/engine/scale.cjs.map +1 -1
  169. package/dist/charts/engine/scale.js +1 -1
  170. package/dist/charts/engine/scale.js.map +1 -1
  171. package/dist/charts/engine/scene.cjs +1 -1
  172. package/dist/charts/engine/scene.cjs.map +1 -1
  173. package/dist/charts/engine/scene.d.cts +14 -4
  174. package/dist/charts/engine/scene.d.ts +14 -4
  175. package/dist/charts/engine/scene.js +292 -163
  176. package/dist/charts/engine/scene.js.map +1 -1
  177. package/dist/charts/engine/shapes/bullet.cjs +2 -0
  178. package/dist/charts/engine/shapes/bullet.cjs.map +1 -0
  179. package/dist/charts/engine/shapes/bullet.d.cts +6 -0
  180. package/dist/charts/engine/shapes/bullet.d.ts +6 -0
  181. package/dist/charts/engine/shapes/bullet.js +255 -0
  182. package/dist/charts/engine/shapes/bullet.js.map +1 -0
  183. package/dist/charts/engine/shapes/calendar.cjs +2 -0
  184. package/dist/charts/engine/shapes/calendar.cjs.map +1 -0
  185. package/dist/charts/engine/shapes/calendar.d.cts +38 -0
  186. package/dist/charts/engine/shapes/calendar.d.ts +38 -0
  187. package/dist/charts/engine/shapes/calendar.js +369 -0
  188. package/dist/charts/engine/shapes/calendar.js.map +1 -0
  189. package/dist/charts/engine/shapes/canvas.cjs +1 -1
  190. package/dist/charts/engine/shapes/canvas.cjs.map +1 -1
  191. package/dist/charts/engine/shapes/canvas.d.cts +7 -0
  192. package/dist/charts/engine/shapes/canvas.d.ts +7 -0
  193. package/dist/charts/engine/shapes/canvas.js +22 -13
  194. package/dist/charts/engine/shapes/canvas.js.map +1 -1
  195. package/dist/charts/engine/shapes/chart.cjs +1 -1
  196. package/dist/charts/engine/shapes/chart.cjs.map +1 -1
  197. package/dist/charts/engine/shapes/chart.d.cts +3 -2
  198. package/dist/charts/engine/shapes/chart.d.ts +3 -2
  199. package/dist/charts/engine/shapes/chart.js +45 -26
  200. package/dist/charts/engine/shapes/chart.js.map +1 -1
  201. package/dist/charts/engine/shapes/draw.cjs +1 -1
  202. package/dist/charts/engine/shapes/draw.cjs.map +1 -1
  203. package/dist/charts/engine/shapes/draw.d.cts +3 -1
  204. package/dist/charts/engine/shapes/draw.d.ts +3 -1
  205. package/dist/charts/engine/shapes/draw.js +31 -18
  206. package/dist/charts/engine/shapes/draw.js.map +1 -1
  207. package/dist/charts/engine/shapes/funnel.cjs +1 -1
  208. package/dist/charts/engine/shapes/funnel.cjs.map +1 -1
  209. package/dist/charts/engine/shapes/funnel.js +3 -3
  210. package/dist/charts/engine/shapes/funnel.js.map +1 -1
  211. package/dist/charts/engine/shapes/gauge.cjs +1 -1
  212. package/dist/charts/engine/shapes/gauge.cjs.map +1 -1
  213. package/dist/charts/engine/shapes/gauge.js +132 -95
  214. package/dist/charts/engine/shapes/gauge.js.map +1 -1
  215. package/dist/charts/engine/shapes/hit.cjs +1 -1
  216. package/dist/charts/engine/shapes/hit.cjs.map +1 -1
  217. package/dist/charts/engine/shapes/hit.d.cts +3 -1
  218. package/dist/charts/engine/shapes/hit.d.ts +3 -1
  219. package/dist/charts/engine/shapes/hit.js +29 -8
  220. package/dist/charts/engine/shapes/hit.js.map +1 -1
  221. package/dist/charts/engine/shapes/index.d.cts +4 -1
  222. package/dist/charts/engine/shapes/index.d.ts +4 -1
  223. package/dist/charts/engine/shapes/labels.cjs +2 -0
  224. package/dist/charts/engine/shapes/labels.cjs.map +1 -0
  225. package/dist/charts/engine/shapes/labels.d.cts +14 -0
  226. package/dist/charts/engine/shapes/labels.d.ts +14 -0
  227. package/dist/charts/engine/shapes/labels.js +146 -0
  228. package/dist/charts/engine/shapes/labels.js.map +1 -0
  229. package/dist/charts/engine/shapes/layout.cjs +2 -2
  230. package/dist/charts/engine/shapes/layout.cjs.map +1 -1
  231. package/dist/charts/engine/shapes/layout.d.cts +8 -3
  232. package/dist/charts/engine/shapes/layout.d.ts +8 -3
  233. package/dist/charts/engine/shapes/layout.js +200 -113
  234. package/dist/charts/engine/shapes/layout.js.map +1 -1
  235. package/dist/charts/engine/shapes/pie.cjs +1 -1
  236. package/dist/charts/engine/shapes/pie.cjs.map +1 -1
  237. package/dist/charts/engine/shapes/pie.js +2 -2
  238. package/dist/charts/engine/shapes/pie.js.map +1 -1
  239. package/dist/charts/engine/shapes/radar.cjs +1 -1
  240. package/dist/charts/engine/shapes/radar.cjs.map +1 -1
  241. package/dist/charts/engine/shapes/radar.d.cts +2 -2
  242. package/dist/charts/engine/shapes/radar.d.ts +2 -2
  243. package/dist/charts/engine/shapes/radar.js +50 -49
  244. package/dist/charts/engine/shapes/radar.js.map +1 -1
  245. package/dist/charts/engine/shapes/radialBar.cjs +2 -0
  246. package/dist/charts/engine/shapes/radialBar.cjs.map +1 -0
  247. package/dist/charts/engine/shapes/radialBar.d.cts +8 -0
  248. package/dist/charts/engine/shapes/radialBar.d.ts +8 -0
  249. package/dist/charts/engine/shapes/radialBar.js +155 -0
  250. package/dist/charts/engine/shapes/radialBar.js.map +1 -0
  251. package/dist/charts/engine/shapes/runtime.cjs +1 -1
  252. package/dist/charts/engine/shapes/runtime.cjs.map +1 -1
  253. package/dist/charts/engine/shapes/runtime.d.cts +9 -2
  254. package/dist/charts/engine/shapes/runtime.d.ts +9 -2
  255. package/dist/charts/engine/shapes/runtime.js +61 -51
  256. package/dist/charts/engine/shapes/runtime.js.map +1 -1
  257. package/dist/charts/engine/shapes/sankey.cjs +2 -0
  258. package/dist/charts/engine/shapes/sankey.cjs.map +1 -0
  259. package/dist/charts/engine/shapes/sankey.d.cts +29 -0
  260. package/dist/charts/engine/shapes/sankey.d.ts +29 -0
  261. package/dist/charts/engine/shapes/sankey.js +372 -0
  262. package/dist/charts/engine/shapes/sankey.js.map +1 -0
  263. package/dist/charts/engine/shapes/scene.cjs +1 -1
  264. package/dist/charts/engine/shapes/scene.cjs.map +1 -1
  265. package/dist/charts/engine/shapes/scene.d.cts +62 -8
  266. package/dist/charts/engine/shapes/scene.d.ts +62 -8
  267. package/dist/charts/engine/shapes/scene.js +33 -31
  268. package/dist/charts/engine/shapes/scene.js.map +1 -1
  269. package/dist/charts/engine/shapes/sunburst.cjs +2 -0
  270. package/dist/charts/engine/shapes/sunburst.cjs.map +1 -0
  271. package/dist/charts/engine/shapes/sunburst.d.cts +6 -0
  272. package/dist/charts/engine/shapes/sunburst.d.ts +6 -0
  273. package/dist/charts/engine/shapes/sunburst.js +261 -0
  274. package/dist/charts/engine/shapes/sunburst.js.map +1 -0
  275. package/dist/charts/engine/shapes/treemap.cjs +1 -1
  276. package/dist/charts/engine/shapes/treemap.cjs.map +1 -1
  277. package/dist/charts/engine/shapes/treemap.js +2 -2
  278. package/dist/charts/engine/shapes/treemap.js.map +1 -1
  279. package/dist/charts/engine/shapes/types.d.cts +439 -12
  280. package/dist/charts/engine/shapes/types.d.ts +439 -12
  281. package/dist/charts/engine/three-d/canvas2d.cjs +2 -0
  282. package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -0
  283. package/dist/charts/engine/three-d/canvas2d.d.cts +4 -0
  284. package/dist/charts/engine/three-d/canvas2d.d.ts +4 -0
  285. package/dist/charts/engine/three-d/canvas2d.js +104 -0
  286. package/dist/charts/engine/three-d/canvas2d.js.map +1 -0
  287. package/dist/charts/engine/three-d/chart.cjs +2 -0
  288. package/dist/charts/engine/three-d/chart.cjs.map +1 -0
  289. package/dist/charts/engine/three-d/chart.d.cts +15 -0
  290. package/dist/charts/engine/three-d/chart.d.ts +15 -0
  291. package/dist/charts/engine/three-d/chart.js +621 -0
  292. package/dist/charts/engine/three-d/chart.js.map +1 -0
  293. package/dist/charts/engine/three-d/colormap.cjs +2 -0
  294. package/dist/charts/engine/three-d/colormap.cjs.map +1 -0
  295. package/dist/charts/engine/three-d/colormap.d.cts +16 -0
  296. package/dist/charts/engine/three-d/colormap.d.ts +16 -0
  297. package/dist/charts/engine/three-d/colormap.js +166 -0
  298. package/dist/charts/engine/three-d/colormap.js.map +1 -0
  299. package/dist/charts/engine/three-d/contours.cjs +2 -0
  300. package/dist/charts/engine/three-d/contours.cjs.map +1 -0
  301. package/dist/charts/engine/three-d/contours.d.cts +7 -0
  302. package/dist/charts/engine/three-d/contours.d.ts +7 -0
  303. package/dist/charts/engine/three-d/contours.js +47 -0
  304. package/dist/charts/engine/three-d/contours.js.map +1 -0
  305. package/dist/charts/engine/three-d/detect.cjs +2 -0
  306. package/dist/charts/engine/three-d/detect.cjs.map +1 -0
  307. package/dist/charts/engine/three-d/detect.d.cts +11 -0
  308. package/dist/charts/engine/three-d/detect.d.ts +11 -0
  309. package/dist/charts/engine/three-d/detect.js +35 -0
  310. package/dist/charts/engine/three-d/detect.js.map +1 -0
  311. package/dist/charts/engine/three-d/dom.cjs +2 -0
  312. package/dist/charts/engine/three-d/dom.cjs.map +1 -0
  313. package/dist/charts/engine/three-d/dom.d.cts +21 -0
  314. package/dist/charts/engine/three-d/dom.d.ts +21 -0
  315. package/dist/charts/engine/three-d/dom.js +98 -0
  316. package/dist/charts/engine/three-d/dom.js.map +1 -0
  317. package/dist/charts/engine/three-d/geometry.cjs +2 -0
  318. package/dist/charts/engine/three-d/geometry.cjs.map +1 -0
  319. package/dist/charts/engine/three-d/geometry.d.cts +76 -0
  320. package/dist/charts/engine/three-d/geometry.d.ts +76 -0
  321. package/dist/charts/engine/three-d/geometry.js +529 -0
  322. package/dist/charts/engine/three-d/geometry.js.map +1 -0
  323. package/dist/charts/engine/three-d/hover.cjs +2 -0
  324. package/dist/charts/engine/three-d/hover.cjs.map +1 -0
  325. package/dist/charts/engine/three-d/hover.d.cts +25 -0
  326. package/dist/charts/engine/three-d/hover.d.ts +25 -0
  327. package/dist/charts/engine/three-d/hover.js +131 -0
  328. package/dist/charts/engine/three-d/hover.js.map +1 -0
  329. package/dist/charts/engine/three-d/index.cjs +1 -0
  330. package/dist/charts/engine/three-d/index.d.cts +2 -0
  331. package/dist/charts/engine/three-d/index.d.ts +2 -0
  332. package/dist/charts/engine/three-d/index.js +2 -0
  333. package/dist/charts/engine/three-d/labels.cjs +2 -0
  334. package/dist/charts/engine/three-d/labels.cjs.map +1 -0
  335. package/dist/charts/engine/three-d/labels.d.cts +23 -0
  336. package/dist/charts/engine/three-d/labels.d.ts +23 -0
  337. package/dist/charts/engine/three-d/labels.js +136 -0
  338. package/dist/charts/engine/three-d/labels.js.map +1 -0
  339. package/dist/charts/engine/three-d/math.cjs +2 -0
  340. package/dist/charts/engine/three-d/math.cjs.map +1 -0
  341. package/dist/charts/engine/three-d/math.d.cts +84 -0
  342. package/dist/charts/engine/three-d/math.d.ts +84 -0
  343. package/dist/charts/engine/three-d/math.js +150 -0
  344. package/dist/charts/engine/three-d/math.js.map +1 -0
  345. package/dist/charts/engine/three-d/model.cjs +2 -0
  346. package/dist/charts/engine/three-d/model.cjs.map +1 -0
  347. package/dist/charts/engine/three-d/model.d.cts +130 -0
  348. package/dist/charts/engine/three-d/model.d.ts +130 -0
  349. package/dist/charts/engine/three-d/model.js +277 -0
  350. package/dist/charts/engine/three-d/model.js.map +1 -0
  351. package/dist/charts/engine/three-d/overlay.cjs +2 -0
  352. package/dist/charts/engine/three-d/overlay.cjs.map +1 -0
  353. package/dist/charts/engine/three-d/overlay.d.cts +72 -0
  354. package/dist/charts/engine/three-d/overlay.d.ts +72 -0
  355. package/dist/charts/engine/three-d/overlay.js +197 -0
  356. package/dist/charts/engine/three-d/overlay.js.map +1 -0
  357. package/dist/charts/engine/three-d/pick.cjs +2 -0
  358. package/dist/charts/engine/three-d/pick.cjs.map +1 -0
  359. package/dist/charts/engine/three-d/pick.d.cts +52 -0
  360. package/dist/charts/engine/three-d/pick.d.ts +52 -0
  361. package/dist/charts/engine/three-d/pick.js +220 -0
  362. package/dist/charts/engine/three-d/pick.js.map +1 -0
  363. package/dist/charts/engine/three-d/render-types.cjs +2 -0
  364. package/dist/charts/engine/three-d/render-types.cjs.map +1 -0
  365. package/dist/charts/engine/three-d/render-types.d.cts +82 -0
  366. package/dist/charts/engine/three-d/render-types.d.ts +82 -0
  367. package/dist/charts/engine/three-d/render-types.js +13 -0
  368. package/dist/charts/engine/three-d/render-types.js.map +1 -0
  369. package/dist/charts/engine/three-d/shaders.cjs +276 -0
  370. package/dist/charts/engine/three-d/shaders.cjs.map +1 -0
  371. package/dist/charts/engine/three-d/shaders.d.cts +26 -0
  372. package/dist/charts/engine/three-d/shaders.d.ts +26 -0
  373. package/dist/charts/engine/three-d/shaders.js +191 -0
  374. package/dist/charts/engine/three-d/shaders.js.map +1 -0
  375. package/dist/charts/engine/three-d/sort.cjs +2 -0
  376. package/dist/charts/engine/three-d/sort.cjs.map +1 -0
  377. package/dist/charts/engine/three-d/sort.d.cts +18 -0
  378. package/dist/charts/engine/three-d/sort.d.ts +18 -0
  379. package/dist/charts/engine/three-d/sort.js +71 -0
  380. package/dist/charts/engine/three-d/sort.js.map +1 -0
  381. package/dist/charts/engine/three-d/types.d.cts +588 -0
  382. package/dist/charts/engine/three-d/types.d.ts +588 -0
  383. package/dist/charts/engine/three-d/webgl.cjs +2 -0
  384. package/dist/charts/engine/three-d/webgl.cjs.map +1 -0
  385. package/dist/charts/engine/three-d/webgl.d.cts +10 -0
  386. package/dist/charts/engine/three-d/webgl.d.ts +10 -0
  387. package/dist/charts/engine/three-d/webgl.js +130 -0
  388. package/dist/charts/engine/three-d/webgl.js.map +1 -0
  389. package/dist/charts/engine/three-d/webgpu.cjs +2 -0
  390. package/dist/charts/engine/three-d/webgpu.cjs.map +1 -0
  391. package/dist/charts/engine/three-d/webgpu.d.cts +5 -0
  392. package/dist/charts/engine/three-d/webgpu.d.ts +5 -0
  393. package/dist/charts/engine/three-d/webgpu.js +249 -0
  394. package/dist/charts/engine/three-d/webgpu.js.map +1 -0
  395. package/dist/charts/engine/time.cjs +1 -1
  396. package/dist/charts/engine/time.cjs.map +1 -1
  397. package/dist/charts/engine/time.d.cts +13 -4
  398. package/dist/charts/engine/time.d.ts +13 -4
  399. package/dist/charts/engine/time.js +156 -91
  400. package/dist/charts/engine/time.js.map +1 -1
  401. package/dist/charts/engine/trading/chart.cjs +2 -0
  402. package/dist/charts/engine/trading/chart.cjs.map +1 -0
  403. package/dist/charts/engine/trading/chart.d.cts +3 -0
  404. package/dist/charts/engine/trading/chart.d.ts +3 -0
  405. package/dist/charts/engine/trading/chart.js +1507 -0
  406. package/dist/charts/engine/trading/chart.js.map +1 -0
  407. package/dist/charts/engine/trading/drawings.cjs +2 -0
  408. package/dist/charts/engine/trading/drawings.cjs.map +1 -0
  409. package/dist/charts/engine/trading/drawings.d.cts +57 -0
  410. package/dist/charts/engine/trading/drawings.d.ts +57 -0
  411. package/dist/charts/engine/trading/drawings.js +160 -0
  412. package/dist/charts/engine/trading/drawings.js.map +1 -0
  413. package/dist/charts/engine/trading/format.cjs +2 -0
  414. package/dist/charts/engine/trading/format.cjs.map +1 -0
  415. package/dist/charts/engine/trading/format.d.cts +60 -0
  416. package/dist/charts/engine/trading/format.d.ts +60 -0
  417. package/dist/charts/engine/trading/format.js +131 -0
  418. package/dist/charts/engine/trading/format.js.map +1 -0
  419. package/dist/charts/engine/trading/geometry.cjs +2 -0
  420. package/dist/charts/engine/trading/geometry.cjs.map +1 -0
  421. package/dist/charts/engine/trading/geometry.d.cts +55 -0
  422. package/dist/charts/engine/trading/geometry.d.ts +55 -0
  423. package/dist/charts/engine/trading/geometry.js +131 -0
  424. package/dist/charts/engine/trading/geometry.js.map +1 -0
  425. package/dist/charts/engine/trading/index.cjs +1 -0
  426. package/dist/charts/engine/trading/index.d.cts +3 -0
  427. package/dist/charts/engine/trading/index.d.ts +3 -0
  428. package/dist/charts/engine/trading/index.js +3 -0
  429. package/dist/charts/engine/trading/indicators.cjs +2 -0
  430. package/dist/charts/engine/trading/indicators.cjs.map +1 -0
  431. package/dist/charts/engine/trading/indicators.d.cts +105 -0
  432. package/dist/charts/engine/trading/indicators.d.ts +105 -0
  433. package/dist/charts/engine/trading/indicators.js +268 -0
  434. package/dist/charts/engine/trading/indicators.js.map +1 -0
  435. package/dist/charts/engine/trading/labels.cjs +2 -0
  436. package/dist/charts/engine/trading/labels.cjs.map +1 -0
  437. package/dist/charts/engine/trading/labels.d.cts +7 -0
  438. package/dist/charts/engine/trading/labels.d.ts +7 -0
  439. package/dist/charts/engine/trading/labels.js +91 -0
  440. package/dist/charts/engine/trading/labels.js.map +1 -0
  441. package/dist/charts/engine/trading/scale.cjs +2 -0
  442. package/dist/charts/engine/trading/scale.cjs.map +1 -0
  443. package/dist/charts/engine/trading/scale.d.cts +46 -0
  444. package/dist/charts/engine/trading/scale.d.ts +46 -0
  445. package/dist/charts/engine/trading/scale.js +100 -0
  446. package/dist/charts/engine/trading/scale.js.map +1 -0
  447. package/dist/charts/engine/trading/store.cjs +2 -0
  448. package/dist/charts/engine/trading/store.cjs.map +1 -0
  449. package/dist/charts/engine/trading/store.d.cts +62 -0
  450. package/dist/charts/engine/trading/store.d.ts +62 -0
  451. package/dist/charts/engine/trading/store.js +129 -0
  452. package/dist/charts/engine/trading/store.js.map +1 -0
  453. package/dist/charts/engine/trading/studies.cjs +2 -0
  454. package/dist/charts/engine/trading/studies.cjs.map +1 -0
  455. package/dist/charts/engine/trading/studies.d.cts +52 -0
  456. package/dist/charts/engine/trading/studies.d.ts +52 -0
  457. package/dist/charts/engine/trading/studies.js +254 -0
  458. package/dist/charts/engine/trading/studies.js.map +1 -0
  459. package/dist/charts/engine/trading/types.d.cts +656 -0
  460. package/dist/charts/engine/trading/types.d.ts +656 -0
  461. package/dist/charts/engine/types.d.cts +165 -14
  462. package/dist/charts/engine/types.d.ts +165 -14
  463. package/dist/charts/index.cjs +1 -1
  464. package/dist/charts/index.d.cts +7 -4
  465. package/dist/charts/index.d.ts +7 -4
  466. package/dist/charts/index.js +22 -11
  467. package/dist/charts/react/Chart.cjs +1 -1
  468. package/dist/charts/react/Chart.cjs.map +1 -1
  469. package/dist/charts/react/Chart.d.cts +4 -4
  470. package/dist/charts/react/Chart.d.ts +4 -4
  471. package/dist/charts/react/Chart.js +5 -1
  472. package/dist/charts/react/Chart.js.map +1 -1
  473. package/dist/charts/react/charts.cjs +1 -1
  474. package/dist/charts/react/charts.cjs.map +1 -1
  475. package/dist/charts/react/charts.d.cts +39 -1
  476. package/dist/charts/react/charts.d.ts +39 -1
  477. package/dist/charts/react/charts.js +303 -131
  478. package/dist/charts/react/charts.js.map +1 -1
  479. package/dist/charts/react/orderbook.cjs +2 -0
  480. package/dist/charts/react/orderbook.cjs.map +1 -0
  481. package/dist/charts/react/orderbook.d.cts +142 -0
  482. package/dist/charts/react/orderbook.d.ts +142 -0
  483. package/dist/charts/react/orderbook.js +182 -0
  484. package/dist/charts/react/orderbook.js.map +1 -0
  485. package/dist/charts/react/shapes.cjs +1 -1
  486. package/dist/charts/react/shapes.cjs.map +1 -1
  487. package/dist/charts/react/shapes.d.cts +291 -9
  488. package/dist/charts/react/shapes.d.ts +291 -9
  489. package/dist/charts/react/shapes.js +280 -93
  490. package/dist/charts/react/shapes.js.map +1 -1
  491. package/dist/charts/react/three-d.cjs +2 -0
  492. package/dist/charts/react/three-d.cjs.map +1 -0
  493. package/dist/charts/react/three-d.d.cts +151 -0
  494. package/dist/charts/react/three-d.d.ts +151 -0
  495. package/dist/charts/react/three-d.js +154 -0
  496. package/dist/charts/react/three-d.js.map +1 -0
  497. package/dist/charts/react/trading.cjs +2 -0
  498. package/dist/charts/react/trading.cjs.map +1 -0
  499. package/dist/charts/react/trading.d.cts +93 -0
  500. package/dist/charts/react/trading.d.ts +93 -0
  501. package/dist/charts/react/trading.js +95 -0
  502. package/dist/charts/react/trading.js.map +1 -0
  503. package/dist/charts/react/types.d.cts +132 -8
  504. package/dist/charts/react/types.d.ts +132 -8
  505. package/dist/core/contracts.cjs +1 -1
  506. package/dist/core/contracts.cjs.map +1 -1
  507. package/dist/core/contracts.js +1 -1
  508. package/dist/core/contracts.js.map +1 -1
  509. package/dist/native/charts/src/canvas.cjs +1 -1
  510. package/dist/native/charts/src/canvas.js +9 -3
  511. package/dist/native/charts/src/engine/axis.cjs +1 -1
  512. package/dist/native/charts/src/engine/axis.cjs.map +1 -1
  513. package/dist/native/charts/src/engine/axis.js +6 -6
  514. package/dist/native/charts/src/engine/axis.js.map +1 -1
  515. package/dist/native/charts/src/engine/controller.cjs +1 -1
  516. package/dist/native/charts/src/engine/controller.cjs.map +1 -1
  517. package/dist/native/charts/src/engine/controller.js +352 -292
  518. package/dist/native/charts/src/engine/controller.js.map +1 -1
  519. package/dist/native/charts/src/engine/data.cjs +1 -1
  520. package/dist/native/charts/src/engine/data.cjs.map +1 -1
  521. package/dist/native/charts/src/engine/data.js +63 -49
  522. package/dist/native/charts/src/engine/data.js.map +1 -1
  523. package/dist/native/charts/src/engine/format.cjs +1 -1
  524. package/dist/native/charts/src/engine/format.cjs.map +1 -1
  525. package/dist/native/charts/src/engine/format.js +46 -21
  526. package/dist/native/charts/src/engine/format.js.map +1 -1
  527. package/dist/native/charts/src/engine/labels.cjs +2 -0
  528. package/dist/native/charts/src/engine/labels.cjs.map +1 -0
  529. package/dist/native/charts/src/engine/labels.js +74 -0
  530. package/dist/native/charts/src/engine/labels.js.map +1 -0
  531. package/dist/native/charts/src/engine/layout.cjs +1 -1
  532. package/dist/native/charts/src/engine/layout.cjs.map +1 -1
  533. package/dist/native/charts/src/engine/layout.js +53 -12
  534. package/dist/native/charts/src/engine/layout.js.map +1 -1
  535. package/dist/native/charts/src/engine/locale.cjs +2 -0
  536. package/dist/native/charts/src/engine/locale.cjs.map +1 -0
  537. package/dist/native/charts/src/engine/locale.js +60 -0
  538. package/dist/native/charts/src/engine/locale.js.map +1 -0
  539. package/dist/native/charts/src/engine/model.cjs +1 -1
  540. package/dist/native/charts/src/engine/model.cjs.map +1 -1
  541. package/dist/native/charts/src/engine/model.js +223 -116
  542. package/dist/native/charts/src/engine/model.js.map +1 -1
  543. package/dist/native/charts/src/engine/overlay.cjs +1 -1
  544. package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
  545. package/dist/native/charts/src/engine/overlay.js +46 -23
  546. package/dist/native/charts/src/engine/overlay.js.map +1 -1
  547. package/dist/native/charts/src/engine/presets.cjs +2 -2
  548. package/dist/native/charts/src/engine/presets.cjs.map +1 -1
  549. package/dist/native/charts/src/engine/presets.js +448 -33
  550. package/dist/native/charts/src/engine/presets.js.map +1 -1
  551. package/dist/native/charts/src/engine/scale.cjs +1 -1
  552. package/dist/native/charts/src/engine/scale.cjs.map +1 -1
  553. package/dist/native/charts/src/engine/scale.js +1 -1
  554. package/dist/native/charts/src/engine/scale.js.map +1 -1
  555. package/dist/native/charts/src/engine/scene.cjs +1 -1
  556. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  557. package/dist/native/charts/src/engine/scene.js +296 -167
  558. package/dist/native/charts/src/engine/scene.js.map +1 -1
  559. package/dist/native/charts/src/engine/shapes/bullet.cjs +2 -0
  560. package/dist/native/charts/src/engine/shapes/bullet.cjs.map +1 -0
  561. package/dist/native/charts/src/engine/shapes/bullet.js +255 -0
  562. package/dist/native/charts/src/engine/shapes/bullet.js.map +1 -0
  563. package/dist/native/charts/src/engine/shapes/calendar.cjs +2 -0
  564. package/dist/native/charts/src/engine/shapes/calendar.cjs.map +1 -0
  565. package/dist/native/charts/src/engine/shapes/calendar.js +364 -0
  566. package/dist/native/charts/src/engine/shapes/calendar.js.map +1 -0
  567. package/dist/native/charts/src/engine/shapes/canvas.cjs +2 -0
  568. package/dist/native/charts/src/engine/shapes/canvas.cjs.map +1 -0
  569. package/dist/native/charts/src/engine/shapes/canvas.js +168 -0
  570. package/dist/native/charts/src/engine/shapes/canvas.js.map +1 -0
  571. package/dist/native/charts/src/engine/shapes/draw.cjs +2 -0
  572. package/dist/native/charts/src/engine/shapes/draw.cjs.map +1 -0
  573. package/dist/native/charts/src/engine/shapes/draw.js +165 -0
  574. package/dist/native/charts/src/engine/shapes/draw.js.map +1 -0
  575. package/dist/native/charts/src/engine/shapes/funnel.cjs +2 -0
  576. package/dist/native/charts/src/engine/shapes/funnel.cjs.map +1 -0
  577. package/dist/native/charts/src/engine/shapes/funnel.js +149 -0
  578. package/dist/native/charts/src/engine/shapes/funnel.js.map +1 -0
  579. package/dist/native/charts/src/engine/shapes/gauge.cjs +2 -0
  580. package/dist/native/charts/src/engine/shapes/gauge.cjs.map +1 -0
  581. package/dist/native/charts/src/engine/shapes/gauge.js +210 -0
  582. package/dist/native/charts/src/engine/shapes/gauge.js.map +1 -0
  583. package/dist/native/charts/src/engine/shapes/hit.cjs +2 -0
  584. package/dist/native/charts/src/engine/shapes/hit.cjs.map +1 -0
  585. package/dist/native/charts/src/engine/shapes/hit.js +106 -0
  586. package/dist/native/charts/src/engine/shapes/hit.js.map +1 -0
  587. package/dist/native/charts/src/engine/shapes/labels.cjs +2 -0
  588. package/dist/native/charts/src/engine/shapes/labels.cjs.map +1 -0
  589. package/dist/native/charts/src/engine/shapes/labels.js +146 -0
  590. package/dist/native/charts/src/engine/shapes/labels.js.map +1 -0
  591. package/dist/native/charts/src/engine/shapes/layout.cjs +3 -0
  592. package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -0
  593. package/dist/native/charts/src/engine/shapes/layout.js +331 -0
  594. package/dist/native/charts/src/engine/shapes/layout.js.map +1 -0
  595. package/dist/native/charts/src/engine/shapes/pie.cjs +2 -0
  596. package/dist/native/charts/src/engine/shapes/pie.cjs.map +1 -0
  597. package/dist/native/charts/src/engine/shapes/pie.js +302 -0
  598. package/dist/native/charts/src/engine/shapes/pie.js.map +1 -0
  599. package/dist/native/charts/src/engine/shapes/radar.cjs +2 -0
  600. package/dist/native/charts/src/engine/shapes/radar.cjs.map +1 -0
  601. package/dist/native/charts/src/engine/shapes/radar.js +198 -0
  602. package/dist/native/charts/src/engine/shapes/radar.js.map +1 -0
  603. package/dist/native/charts/src/engine/shapes/radialBar.cjs +2 -0
  604. package/dist/native/charts/src/engine/shapes/radialBar.cjs.map +1 -0
  605. package/dist/native/charts/src/engine/shapes/radialBar.js +155 -0
  606. package/dist/native/charts/src/engine/shapes/radialBar.js.map +1 -0
  607. package/dist/native/charts/src/engine/shapes/runtime.cjs +2 -0
  608. package/dist/native/charts/src/engine/shapes/runtime.cjs.map +1 -0
  609. package/dist/native/charts/src/engine/shapes/runtime.js +107 -0
  610. package/dist/native/charts/src/engine/shapes/runtime.js.map +1 -0
  611. package/dist/native/charts/src/engine/shapes/sankey.cjs +2 -0
  612. package/dist/native/charts/src/engine/shapes/sankey.cjs.map +1 -0
  613. package/dist/native/charts/src/engine/shapes/sankey.js +372 -0
  614. package/dist/native/charts/src/engine/shapes/sankey.js.map +1 -0
  615. package/dist/native/charts/src/engine/shapes/scene.cjs +2 -0
  616. package/dist/native/charts/src/engine/shapes/scene.cjs.map +1 -0
  617. package/dist/native/charts/src/engine/shapes/scene.js +125 -0
  618. package/dist/native/charts/src/engine/shapes/scene.js.map +1 -0
  619. package/dist/native/charts/src/engine/shapes/sunburst.cjs +2 -0
  620. package/dist/native/charts/src/engine/shapes/sunburst.cjs.map +1 -0
  621. package/dist/native/charts/src/engine/shapes/sunburst.js +261 -0
  622. package/dist/native/charts/src/engine/shapes/sunburst.js.map +1 -0
  623. package/dist/native/charts/src/engine/shapes/treemap.cjs +2 -0
  624. package/dist/native/charts/src/engine/shapes/treemap.cjs.map +1 -0
  625. package/dist/native/charts/src/engine/shapes/treemap.js +213 -0
  626. package/dist/native/charts/src/engine/shapes/treemap.js.map +1 -0
  627. package/dist/native/charts/src/engine/time.cjs +1 -1
  628. package/dist/native/charts/src/engine/time.cjs.map +1 -1
  629. package/dist/native/charts/src/engine/time.js +156 -91
  630. package/dist/native/charts/src/engine/time.js.map +1 -1
  631. package/dist/native/components/Chart/ChartBase.cjs +1 -1
  632. package/dist/native/components/Chart/ChartBase.cjs.map +1 -1
  633. package/dist/native/components/Chart/ChartBase.d.cts +1 -1
  634. package/dist/native/components/Chart/ChartBase.d.ts +1 -1
  635. package/dist/native/components/Chart/ChartBase.js +110 -107
  636. package/dist/native/components/Chart/ChartBase.js.map +1 -1
  637. package/dist/native/components/Chart/charts.cjs +1 -1
  638. package/dist/native/components/Chart/charts.cjs.map +1 -1
  639. package/dist/native/components/Chart/charts.d.cts +6 -1
  640. package/dist/native/components/Chart/charts.d.ts +6 -1
  641. package/dist/native/components/Chart/charts.js +53 -29
  642. package/dist/native/components/Chart/charts.js.map +1 -1
  643. package/dist/native/components/Chart/index.cjs +1 -1
  644. package/dist/native/components/Chart/index.d.cts +1 -1
  645. package/dist/native/components/Chart/index.d.ts +1 -1
  646. package/dist/native/components/Chart/index.js +2 -2
  647. package/dist/native/components/Chart/scene.cjs +1 -1
  648. package/dist/native/components/Chart/scene.cjs.map +1 -1
  649. package/dist/native/components/Chart/scene.js +234 -217
  650. package/dist/native/components/Chart/scene.js.map +1 -1
  651. package/dist/native/components/Chart/types.d.cts +26 -3
  652. package/dist/native/components/Chart/types.d.ts +26 -3
  653. package/dist/native/components/Charts/charts.cjs +2 -0
  654. package/dist/native/components/Charts/charts.cjs.map +1 -0
  655. package/dist/native/components/Charts/charts.d.cts +41 -0
  656. package/dist/native/components/Charts/charts.d.ts +41 -0
  657. package/dist/native/components/Charts/charts.js +338 -0
  658. package/dist/native/components/Charts/charts.js.map +1 -0
  659. package/dist/native/components/Charts/index.cjs +1 -0
  660. package/dist/native/components/Charts/index.d.cts +2 -0
  661. package/dist/native/components/Charts/index.d.ts +2 -0
  662. package/dist/native/components/Charts/index.js +2 -0
  663. package/dist/native/components/Charts/types.d.cts +144 -0
  664. package/dist/native/components/Charts/types.d.ts +144 -0
  665. package/dist/native/components/ShapeChart/ShapeChartBase.cjs +2 -0
  666. package/dist/native/components/ShapeChart/ShapeChartBase.cjs.map +1 -0
  667. package/dist/native/components/ShapeChart/ShapeChartBase.d.cts +24 -0
  668. package/dist/native/components/ShapeChart/ShapeChartBase.d.ts +24 -0
  669. package/dist/native/components/ShapeChart/ShapeChartBase.js +271 -0
  670. package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -0
  671. package/dist/native/components/ShapeChart/charts.cjs +2 -0
  672. package/dist/native/components/ShapeChart/charts.cjs.map +1 -0
  673. package/dist/native/components/ShapeChart/charts.d.cts +38 -0
  674. package/dist/native/components/ShapeChart/charts.d.ts +38 -0
  675. package/dist/native/components/ShapeChart/charts.js +387 -0
  676. package/dist/native/components/ShapeChart/charts.js.map +1 -0
  677. package/dist/native/components/ShapeChart/draw.cjs +2 -0
  678. package/dist/native/components/ShapeChart/draw.cjs.map +1 -0
  679. package/dist/native/components/ShapeChart/draw.d.cts +4 -0
  680. package/dist/native/components/ShapeChart/draw.d.ts +4 -0
  681. package/dist/native/components/ShapeChart/draw.js +104 -0
  682. package/dist/native/components/ShapeChart/draw.js.map +1 -0
  683. package/dist/native/components/ShapeChart/geometry.cjs +2 -0
  684. package/dist/native/components/ShapeChart/geometry.cjs.map +1 -0
  685. package/dist/native/components/ShapeChart/geometry.d.cts +71 -0
  686. package/dist/native/components/ShapeChart/geometry.d.ts +71 -0
  687. package/dist/native/components/ShapeChart/geometry.js +602 -0
  688. package/dist/native/components/ShapeChart/geometry.js.map +1 -0
  689. package/dist/native/components/ShapeChart/index.cjs +1 -0
  690. package/dist/native/components/ShapeChart/index.d.cts +2 -0
  691. package/dist/native/components/ShapeChart/index.d.ts +2 -0
  692. package/dist/native/components/ShapeChart/index.js +2 -0
  693. package/dist/native/components/ShapeChart/recorder.cjs +2 -0
  694. package/dist/native/components/ShapeChart/recorder.cjs.map +1 -0
  695. package/dist/native/components/ShapeChart/recorder.d.cts +106 -0
  696. package/dist/native/components/ShapeChart/recorder.d.ts +106 -0
  697. package/dist/native/components/ShapeChart/recorder.js +574 -0
  698. package/dist/native/components/ShapeChart/recorder.js.map +1 -0
  699. package/dist/native/components/ShapeChart/types.d.cts +509 -0
  700. package/dist/native/components/ShapeChart/types.d.ts +509 -0
  701. package/dist/native/index.cjs +1 -1
  702. package/dist/native/index.d.cts +2 -0
  703. package/dist/native/index.d.ts +2 -0
  704. package/dist/native/index.js +14 -10
  705. package/dist/native/manifest.d.cts +6 -4
  706. package/dist/native/manifest.d.ts +6 -4
  707. package/dist/native/source/components/Chart/ChartBase.tsx +8 -1
  708. package/dist/native/source/components/Chart/charts.tsx +42 -6
  709. package/dist/native/source/components/Chart/index.ts +1 -0
  710. package/dist/native/source/components/Chart/scene.tsx +154 -84
  711. package/dist/native/source/components/Chart/types.ts +31 -1
  712. package/dist/native/source/components/Charts/charts.tsx +493 -0
  713. package/dist/native/source/components/Charts/index.ts +14 -0
  714. package/dist/native/source/components/Charts/types.ts +207 -0
  715. package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +484 -0
  716. package/dist/native/source/components/ShapeChart/charts.tsx +605 -0
  717. package/dist/native/source/components/ShapeChart/draw.tsx +170 -0
  718. package/dist/native/source/components/ShapeChart/geometry.ts +1185 -0
  719. package/dist/native/source/components/ShapeChart/index.ts +15 -0
  720. package/dist/native/source/components/ShapeChart/recorder.ts +830 -0
  721. package/dist/native/source/components/ShapeChart/types.ts +564 -0
  722. package/dist/native/source/index.ts +2 -0
  723. package/dist/native/source/manifest.ts +30 -4
  724. package/dist/taro/charts.d.ts +209 -4
  725. package/dist/taro/index.d.ts +1 -0
  726. package/dist/taro/index.js +7517 -1856
  727. package/dist/taro/manifest.d.ts +1 -0
  728. package/dist/taro/shape-charts.d.ts +537 -0
  729. package/dist/uni/AreaChart.vue +68 -0
  730. package/dist/uni/AreaChart.vue.d.ts +120 -0
  731. package/dist/uni/Badge.vue.d.ts +1 -1
  732. package/dist/uni/BoxPlotChart.vue +66 -0
  733. package/dist/uni/BoxPlotChart.vue.d.ts +102 -0
  734. package/dist/uni/BubbleChart.vue +68 -0
  735. package/dist/uni/BubbleChart.vue.d.ts +106 -0
  736. package/dist/uni/BulletChart.vue +86 -0
  737. package/dist/uni/BulletChart.vue.d.ts +110 -0
  738. package/dist/uni/CalendarHeatmap.vue +92 -0
  739. package/dist/uni/CalendarHeatmap.vue.d.ts +129 -0
  740. package/dist/uni/CandlestickChart.vue +66 -0
  741. package/dist/uni/CandlestickChart.vue.d.ts +100 -0
  742. package/dist/uni/DonutChart.vue +72 -0
  743. package/dist/uni/DonutChart.vue.d.ts +114 -0
  744. package/dist/uni/FunnelChart.vue +67 -0
  745. package/dist/uni/FunnelChart.vue.d.ts +104 -0
  746. package/dist/uni/GanttChart.vue +67 -0
  747. package/dist/uni/GanttChart.vue.d.ts +123 -0
  748. package/dist/uni/GaugeChart.vue +77 -0
  749. package/dist/uni/GaugeChart.vue.d.ts +123 -0
  750. package/dist/uni/HeatmapChart.vue +66 -0
  751. package/dist/uni/HeatmapChart.vue.d.ts +114 -0
  752. package/dist/uni/HistogramChart.vue +66 -0
  753. package/dist/uni/HistogramChart.vue.d.ts +121 -0
  754. package/dist/uni/HorizontalBarChart.vue +68 -0
  755. package/dist/uni/HorizontalBarChart.vue.d.ts +127 -0
  756. package/dist/uni/Input.vue.d.ts +1 -1
  757. package/dist/uni/MixedChart.vue +68 -0
  758. package/dist/uni/MixedChart.vue.d.ts +106 -0
  759. package/dist/uni/NumberInput.vue.d.ts +1 -1
  760. package/dist/uni/PieChart.vue +72 -0
  761. package/dist/uni/PieChart.vue.d.ts +114 -0
  762. package/dist/uni/RadarChart.vue +67 -0
  763. package/dist/uni/RadarChart.vue.d.ts +110 -0
  764. package/dist/uni/RadialBarChart.vue +90 -0
  765. package/dist/uni/RadialBarChart.vue.d.ts +132 -0
  766. package/dist/uni/RangeAreaChart.vue +68 -0
  767. package/dist/uni/RangeAreaChart.vue.d.ts +102 -0
  768. package/dist/uni/ResponsiveGrid.vue.d.ts +1 -1
  769. package/dist/uni/SankeyChart.vue +88 -0
  770. package/dist/uni/SankeyChart.vue.d.ts +121 -0
  771. package/dist/uni/ShapeChart.vue +73 -0
  772. package/dist/uni/ShapeChart.vue.d.ts +54 -0
  773. package/dist/uni/Sparkline.vue +58 -0
  774. package/dist/uni/Sparkline.vue.d.ts +77 -0
  775. package/dist/uni/SunburstChart.vue +90 -0
  776. package/dist/uni/SunburstChart.vue.d.ts +114 -0
  777. package/dist/uni/Textarea.vue.d.ts +1 -1
  778. package/dist/uni/TimePicker.vue.d.ts +1 -1
  779. package/dist/uni/TreemapChart.vue +65 -0
  780. package/dist/uni/TreemapChart.vue.d.ts +100 -0
  781. package/dist/uni/WaterfallChart.vue +66 -0
  782. package/dist/uni/WaterfallChart.vue.d.ts +125 -0
  783. package/dist/uni/chart-types.d.ts +216 -2
  784. package/dist/uni/chart-types.js +174 -0
  785. package/dist/uni/charts-canvas.js +8 -3
  786. package/dist/uni/index.d.ts +26 -1
  787. package/dist/uni/index.js +26 -1
  788. package/dist/uni/manifest.d.ts +272 -0
  789. package/dist/uni/manifest.js +387 -0
  790. package/dist/uni/named-chart-options.d.ts +88 -0
  791. package/dist/uni/named-chart-options.js +156 -0
  792. package/dist/uni/shape-chart-canvas.d.ts +51 -0
  793. package/dist/uni/shape-chart-canvas.js +342 -0
  794. package/dist/uni/shape-chart-types.d.ts +381 -0
  795. package/dist/uni/shape-chart-types.js +261 -0
  796. package/dist/vue/components/Chart/AreaChart.vue.d.ts +124 -0
  797. package/dist/vue/components/Chart/AreaChart.vue.js +7 -0
  798. package/dist/vue/components/Chart/AreaChart.vue.js.map +1 -0
  799. package/dist/vue/components/Chart/AreaChart.vue_vue_type_script_setup_true_lang.js +49 -0
  800. package/dist/vue/components/Chart/AreaChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  801. package/dist/vue/components/Chart/Bar3DChart.vue.d.ts +132 -0
  802. package/dist/vue/components/Chart/Bar3DChart.vue.js +7 -0
  803. package/dist/vue/components/Chart/Bar3DChart.vue.js.map +1 -0
  804. package/dist/vue/components/Chart/Bar3DChart.vue_vue_type_script_setup_true_lang.js +55 -0
  805. package/dist/vue/components/Chart/Bar3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  806. package/dist/vue/components/Chart/BarChart.vue.d.ts +123 -0
  807. package/dist/vue/components/Chart/BarChart.vue.js +7 -0
  808. package/dist/vue/components/Chart/BarChart.vue.js.map +1 -0
  809. package/dist/vue/components/Chart/BarChart.vue_vue_type_script_setup_true_lang.js +53 -0
  810. package/dist/vue/components/Chart/BarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  811. package/dist/vue/components/Chart/BoxPlotChart.vue.d.ts +112 -0
  812. package/dist/vue/components/Chart/BoxPlotChart.vue.js +7 -0
  813. package/dist/vue/components/Chart/BoxPlotChart.vue.js.map +1 -0
  814. package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js +57 -0
  815. package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  816. package/dist/vue/components/Chart/BubbleChart.vue.d.ts +106 -0
  817. package/dist/vue/components/Chart/BubbleChart.vue.js +7 -0
  818. package/dist/vue/components/Chart/BubbleChart.vue.js.map +1 -0
  819. package/dist/vue/components/Chart/BubbleChart.vue_vue_type_script_setup_true_lang.js +52 -0
  820. package/dist/vue/components/Chart/BubbleChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  821. package/dist/vue/components/Chart/BulletChart.vue.d.ts +117 -0
  822. package/dist/vue/components/Chart/BulletChart.vue.js +7 -0
  823. package/dist/vue/components/Chart/BulletChart.vue.js.map +1 -0
  824. package/dist/vue/components/Chart/BulletChart.vue_vue_type_script_setup_true_lang.js +64 -0
  825. package/dist/vue/components/Chart/BulletChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  826. package/dist/vue/components/Chart/CalendarHeatmap.vue.d.ts +144 -0
  827. package/dist/vue/components/Chart/CalendarHeatmap.vue.js +7 -0
  828. package/dist/vue/components/Chart/CalendarHeatmap.vue.js.map +1 -0
  829. package/dist/vue/components/Chart/CalendarHeatmap.vue_vue_type_script_setup_true_lang.js +77 -0
  830. package/dist/vue/components/Chart/CalendarHeatmap.vue_vue_type_script_setup_true_lang.js.map +1 -0
  831. package/dist/vue/components/Chart/CandlestickChart.vue.d.ts +94 -0
  832. package/dist/vue/components/Chart/CandlestickChart.vue.js +7 -0
  833. package/dist/vue/components/Chart/CandlestickChart.vue.js.map +1 -0
  834. package/dist/vue/components/Chart/CandlestickChart.vue_vue_type_script_setup_true_lang.js +44 -0
  835. package/dist/vue/components/Chart/CandlestickChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  836. package/dist/vue/components/Chart/Chart.vue.d.ts +103 -0
  837. package/dist/vue/components/Chart/Chart.vue.js +7 -0
  838. package/dist/vue/components/Chart/Chart.vue.js.map +1 -0
  839. package/dist/vue/components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +47 -0
  840. package/dist/vue/components/Chart/Chart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  841. package/dist/vue/components/Chart/DepthChart.vue.d.ts +139 -0
  842. package/dist/vue/components/Chart/DepthChart.vue.js +7 -0
  843. package/dist/vue/components/Chart/DepthChart.vue.js.map +1 -0
  844. package/dist/vue/components/Chart/DepthChart.vue_vue_type_script_setup_true_lang.js +42 -0
  845. package/dist/vue/components/Chart/DepthChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  846. package/dist/vue/components/Chart/DonutChart.vue.d.ts +104 -0
  847. package/dist/vue/components/Chart/DonutChart.vue.js +7 -0
  848. package/dist/vue/components/Chart/DonutChart.vue.js.map +1 -0
  849. package/dist/vue/components/Chart/DonutChart.vue_vue_type_script_setup_true_lang.js +53 -0
  850. package/dist/vue/components/Chart/DonutChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  851. package/dist/vue/components/Chart/FunnelChart.vue.d.ts +105 -0
  852. package/dist/vue/components/Chart/FunnelChart.vue.js +7 -0
  853. package/dist/vue/components/Chart/FunnelChart.vue.js.map +1 -0
  854. package/dist/vue/components/Chart/FunnelChart.vue_vue_type_script_setup_true_lang.js +58 -0
  855. package/dist/vue/components/Chart/FunnelChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  856. package/dist/vue/components/Chart/GanttChart.vue.d.ts +132 -0
  857. package/dist/vue/components/Chart/GanttChart.vue.js +7 -0
  858. package/dist/vue/components/Chart/GanttChart.vue.js.map +1 -0
  859. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js +98 -0
  860. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  861. package/dist/vue/components/Chart/GaugeChart.vue.d.ts +132 -0
  862. package/dist/vue/components/Chart/GaugeChart.vue.js +7 -0
  863. package/dist/vue/components/Chart/GaugeChart.vue.js.map +1 -0
  864. package/dist/vue/components/Chart/GaugeChart.vue_vue_type_script_setup_true_lang.js +71 -0
  865. package/dist/vue/components/Chart/GaugeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  866. package/dist/vue/components/Chart/HeatmapChart.vue.d.ts +125 -0
  867. package/dist/vue/components/Chart/HeatmapChart.vue.js +7 -0
  868. package/dist/vue/components/Chart/HeatmapChart.vue.js.map +1 -0
  869. package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js +65 -0
  870. package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  871. package/dist/vue/components/Chart/HistogramChart.vue.d.ts +132 -0
  872. package/dist/vue/components/Chart/HistogramChart.vue.js +7 -0
  873. package/dist/vue/components/Chart/HistogramChart.vue.js.map +1 -0
  874. package/dist/vue/components/Chart/HistogramChart.vue_vue_type_script_setup_true_lang.js +66 -0
  875. package/dist/vue/components/Chart/HistogramChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  876. package/dist/vue/components/Chart/HorizontalBarChart.vue.d.ts +121 -0
  877. package/dist/vue/components/Chart/HorizontalBarChart.vue.js +7 -0
  878. package/dist/vue/components/Chart/HorizontalBarChart.vue.js.map +1 -0
  879. package/dist/vue/components/Chart/HorizontalBarChart.vue_vue_type_script_setup_true_lang.js +55 -0
  880. package/dist/vue/components/Chart/HorizontalBarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  881. package/dist/vue/components/Chart/Line3DChart.vue.d.ts +121 -0
  882. package/dist/vue/components/Chart/Line3DChart.vue.js +7 -0
  883. package/dist/vue/components/Chart/Line3DChart.vue.js.map +1 -0
  884. package/dist/vue/components/Chart/Line3DChart.vue_vue_type_script_setup_true_lang.js +47 -0
  885. package/dist/vue/components/Chart/Line3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  886. package/dist/vue/components/Chart/LineChart.vue.d.ts +125 -0
  887. package/dist/vue/components/Chart/LineChart.vue.js +7 -0
  888. package/dist/vue/components/Chart/LineChart.vue.js.map +1 -0
  889. package/dist/vue/components/Chart/LineChart.vue_vue_type_script_setup_true_lang.js +50 -0
  890. package/dist/vue/components/Chart/LineChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  891. package/dist/vue/components/Chart/MixedChart.vue.d.ts +103 -0
  892. package/dist/vue/components/Chart/MixedChart.vue.js +7 -0
  893. package/dist/vue/components/Chart/MixedChart.vue.js.map +1 -0
  894. package/dist/vue/components/Chart/MixedChart.vue_vue_type_script_setup_true_lang.js +47 -0
  895. package/dist/vue/components/Chart/MixedChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  896. package/dist/vue/components/Chart/OrderBook.vue.d.ts +125 -0
  897. package/dist/vue/components/Chart/OrderBook.vue.js +7 -0
  898. package/dist/vue/components/Chart/OrderBook.vue.js.map +1 -0
  899. package/dist/vue/components/Chart/OrderBook.vue_vue_type_script_setup_true_lang.js +38 -0
  900. package/dist/vue/components/Chart/OrderBook.vue_vue_type_script_setup_true_lang.js.map +1 -0
  901. package/dist/vue/components/Chart/OrderBookHeatmap.vue.d.ts +128 -0
  902. package/dist/vue/components/Chart/OrderBookHeatmap.vue.js +7 -0
  903. package/dist/vue/components/Chart/OrderBookHeatmap.vue.js.map +1 -0
  904. package/dist/vue/components/Chart/OrderBookHeatmap.vue_vue_type_script_setup_true_lang.js +46 -0
  905. package/dist/vue/components/Chart/OrderBookHeatmap.vue_vue_type_script_setup_true_lang.js.map +1 -0
  906. package/dist/vue/components/Chart/PieChart.vue.d.ts +104 -0
  907. package/dist/vue/components/Chart/PieChart.vue.js +7 -0
  908. package/dist/vue/components/Chart/PieChart.vue.js.map +1 -0
  909. package/dist/vue/components/Chart/PieChart.vue_vue_type_script_setup_true_lang.js +53 -0
  910. package/dist/vue/components/Chart/PieChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  911. package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +186 -0
  912. package/dist/vue/components/Chart/QuadrantChart.vue.js +7 -0
  913. package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -0
  914. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +107 -0
  915. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  916. package/dist/vue/components/Chart/RadarChart.vue.d.ts +111 -0
  917. package/dist/vue/components/Chart/RadarChart.vue.js +7 -0
  918. package/dist/vue/components/Chart/RadarChart.vue.js.map +1 -0
  919. package/dist/vue/components/Chart/RadarChart.vue_vue_type_script_setup_true_lang.js +61 -0
  920. package/dist/vue/components/Chart/RadarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  921. package/dist/vue/components/Chart/RadialBarChart.vue.d.ts +147 -0
  922. package/dist/vue/components/Chart/RadialBarChart.vue.js +7 -0
  923. package/dist/vue/components/Chart/RadialBarChart.vue.js.map +1 -0
  924. package/dist/vue/components/Chart/RadialBarChart.vue_vue_type_script_setup_true_lang.js +78 -0
  925. package/dist/vue/components/Chart/RadialBarChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  926. package/dist/vue/components/Chart/RangeAreaChart.vue.d.ts +106 -0
  927. package/dist/vue/components/Chart/RangeAreaChart.vue.js +7 -0
  928. package/dist/vue/components/Chart/RangeAreaChart.vue.js.map +1 -0
  929. package/dist/vue/components/Chart/RangeAreaChart.vue_vue_type_script_setup_true_lang.js +51 -0
  930. package/dist/vue/components/Chart/RangeAreaChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  931. package/dist/vue/components/Chart/SankeyChart.vue.d.ts +132 -0
  932. package/dist/vue/components/Chart/SankeyChart.vue.js +7 -0
  933. package/dist/vue/components/Chart/SankeyChart.vue.js.map +1 -0
  934. package/dist/vue/components/Chart/SankeyChart.vue_vue_type_script_setup_true_lang.js +71 -0
  935. package/dist/vue/components/Chart/SankeyChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  936. package/dist/vue/components/Chart/Scatter3DChart.vue.d.ts +121 -0
  937. package/dist/vue/components/Chart/Scatter3DChart.vue.js +7 -0
  938. package/dist/vue/components/Chart/Scatter3DChart.vue.js.map +1 -0
  939. package/dist/vue/components/Chart/Scatter3DChart.vue_vue_type_script_setup_true_lang.js +47 -0
  940. package/dist/vue/components/Chart/Scatter3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  941. package/dist/vue/components/Chart/ScatterChart.vue.d.ts +94 -0
  942. package/dist/vue/components/Chart/ScatterChart.vue.js +7 -0
  943. package/dist/vue/components/Chart/ScatterChart.vue.js.map +1 -0
  944. package/dist/vue/components/Chart/ScatterChart.vue_vue_type_script_setup_true_lang.js +44 -0
  945. package/dist/vue/components/Chart/ScatterChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  946. package/dist/vue/components/Chart/ShapeChart.vue.d.ts +39 -0
  947. package/dist/vue/components/Chart/ShapeChart.vue.js +7 -0
  948. package/dist/vue/components/Chart/ShapeChart.vue.js.map +1 -0
  949. package/dist/vue/components/Chart/ShapeChart.vue_vue_type_script_setup_true_lang.js +43 -0
  950. package/dist/vue/components/Chart/ShapeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  951. package/dist/vue/components/Chart/Sparkline.vue.d.ts +90 -0
  952. package/dist/vue/components/Chart/Sparkline.vue.js +7 -0
  953. package/dist/vue/components/Chart/Sparkline.vue.js.map +1 -0
  954. package/dist/vue/components/Chart/Sparkline.vue_vue_type_script_setup_true_lang.js +66 -0
  955. package/dist/vue/components/Chart/Sparkline.vue_vue_type_script_setup_true_lang.js.map +1 -0
  956. package/dist/vue/components/Chart/SunburstChart.vue.d.ts +123 -0
  957. package/dist/vue/components/Chart/SunburstChart.vue.js +7 -0
  958. package/dist/vue/components/Chart/SunburstChart.vue.js.map +1 -0
  959. package/dist/vue/components/Chart/SunburstChart.vue_vue_type_script_setup_true_lang.js +68 -0
  960. package/dist/vue/components/Chart/SunburstChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  961. package/dist/vue/components/Chart/Surface3DChart.vue.d.ts +143 -0
  962. package/dist/vue/components/Chart/Surface3DChart.vue.js +7 -0
  963. package/dist/vue/components/Chart/Surface3DChart.vue.js.map +1 -0
  964. package/dist/vue/components/Chart/Surface3DChart.vue_vue_type_script_setup_true_lang.js +60 -0
  965. package/dist/vue/components/Chart/Surface3DChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  966. package/dist/vue/components/Chart/TimeAndSales.vue.d.ts +114 -0
  967. package/dist/vue/components/Chart/TimeAndSales.vue.js +7 -0
  968. package/dist/vue/components/Chart/TimeAndSales.vue.js.map +1 -0
  969. package/dist/vue/components/Chart/TimeAndSales.vue_vue_type_script_setup_true_lang.js +46 -0
  970. package/dist/vue/components/Chart/TimeAndSales.vue_vue_type_script_setup_true_lang.js.map +1 -0
  971. package/dist/vue/components/Chart/TradingChart.vue.d.ts +160 -0
  972. package/dist/vue/components/Chart/TradingChart.vue.js +7 -0
  973. package/dist/vue/components/Chart/TradingChart.vue.js.map +1 -0
  974. package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js +70 -0
  975. package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  976. package/dist/vue/components/Chart/TreemapChart.vue.d.ts +97 -0
  977. package/dist/vue/components/Chart/TreemapChart.vue.js +7 -0
  978. package/dist/vue/components/Chart/TreemapChart.vue.js.map +1 -0
  979. package/dist/vue/components/Chart/TreemapChart.vue_vue_type_script_setup_true_lang.js +54 -0
  980. package/dist/vue/components/Chart/TreemapChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  981. package/dist/vue/components/Chart/WaterfallChart.vue.d.ts +132 -0
  982. package/dist/vue/components/Chart/WaterfallChart.vue.js +7 -0
  983. package/dist/vue/components/Chart/WaterfallChart.vue.js.map +1 -0
  984. package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js +68 -0
  985. package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  986. package/dist/vue/components/Chart/cartesian.d.ts +47 -0
  987. package/dist/vue/components/Chart/cartesian.js +56 -0
  988. package/dist/vue/components/Chart/cartesian.js.map +1 -0
  989. package/dist/vue/components/Chart/engine.d.ts +35 -0
  990. package/dist/vue/components/Chart/engine.js +35 -0
  991. package/dist/vue/components/Chart/engine.js.map +1 -0
  992. package/dist/vue/components/Chart/index.d.ts +41 -0
  993. package/dist/vue/components/Chart/index.js +40 -0
  994. package/dist/vue/components/Chart/orderbook.d.ts +359 -0
  995. package/dist/vue/components/Chart/orderbook.js +126 -0
  996. package/dist/vue/components/Chart/orderbook.js.map +1 -0
  997. package/dist/vue/components/Chart/props.d.ts +188 -0
  998. package/dist/vue/components/Chart/props.js +92 -0
  999. package/dist/vue/components/Chart/props.js.map +1 -0
  1000. package/dist/vue/components/Chart/shape.d.ts +41 -0
  1001. package/dist/vue/components/Chart/shape.js +42 -0
  1002. package/dist/vue/components/Chart/shape.js.map +1 -0
  1003. package/dist/vue/components/Chart/three-d.d.ts +106 -0
  1004. package/dist/vue/components/Chart/three-d.js +88 -0
  1005. package/dist/vue/components/Chart/three-d.js.map +1 -0
  1006. package/dist/vue/components/Chart/trading.d.ts +105 -0
  1007. package/dist/vue/components/Chart/trading.js +55 -0
  1008. package/dist/vue/components/Chart/trading.js.map +1 -0
  1009. package/dist/vue/components/Chart/types.d.ts +137 -0
  1010. package/dist/vue/global.d.ts +38 -0
  1011. package/dist/vue/groups/charts.d.ts +1 -0
  1012. package/dist/vue/groups/charts.js +87 -0
  1013. package/dist/vue/groups/charts.js.map +1 -0
  1014. package/dist/vue/index.d.ts +1 -0
  1015. package/dist/vue/index.js +63 -23
  1016. package/dist/vue/plugin.js +12 -10
  1017. package/dist/vue/plugin.js.map +1 -1
  1018. package/dist/weapp/area-chart/index.js +1 -0
  1019. package/dist/weapp/area-chart/index.json +1 -0
  1020. package/dist/weapp/area-chart/index.wxml +1 -0
  1021. package/dist/weapp/area-chart/index.wxss +1 -0
  1022. package/dist/weapp/box-plot-chart/index.js +1 -0
  1023. package/dist/weapp/box-plot-chart/index.json +1 -0
  1024. package/dist/weapp/box-plot-chart/index.wxml +1 -0
  1025. package/dist/weapp/box-plot-chart/index.wxss +1 -0
  1026. package/dist/weapp/bubble-chart/index.js +1 -0
  1027. package/dist/weapp/bubble-chart/index.json +1 -0
  1028. package/dist/weapp/bubble-chart/index.wxml +1 -0
  1029. package/dist/weapp/bubble-chart/index.wxss +1 -0
  1030. package/dist/weapp/bullet-chart/index.js +1 -0
  1031. package/dist/weapp/bullet-chart/index.json +1 -0
  1032. package/dist/weapp/bullet-chart/index.wxml +1 -0
  1033. package/dist/weapp/bullet-chart/index.wxss +1 -0
  1034. package/dist/weapp/calendar-heatmap/index.js +1 -0
  1035. package/dist/weapp/calendar-heatmap/index.json +1 -0
  1036. package/dist/weapp/calendar-heatmap/index.wxml +1 -0
  1037. package/dist/weapp/calendar-heatmap/index.wxss +1 -0
  1038. package/dist/weapp/candlestick-chart/index.js +1 -0
  1039. package/dist/weapp/candlestick-chart/index.json +1 -0
  1040. package/dist/weapp/candlestick-chart/index.wxml +1 -0
  1041. package/dist/weapp/candlestick-chart/index.wxss +1 -0
  1042. package/dist/weapp/charts/canvas.js +11436 -0
  1043. package/dist/weapp/charts/core.d.ts +2 -0
  1044. package/dist/weapp/charts/core.js +41 -0
  1045. package/dist/weapp/controls.js +1433 -4478
  1046. package/dist/weapp/donut-chart/index.js +1 -0
  1047. package/dist/weapp/donut-chart/index.json +1 -0
  1048. package/dist/weapp/donut-chart/index.wxml +1 -0
  1049. package/dist/weapp/donut-chart/index.wxss +1 -0
  1050. package/dist/weapp/funnel-chart/index.js +1 -0
  1051. package/dist/weapp/funnel-chart/index.json +1 -0
  1052. package/dist/weapp/funnel-chart/index.wxml +1 -0
  1053. package/dist/weapp/funnel-chart/index.wxss +1 -0
  1054. package/dist/weapp/gantt-chart/index.js +1 -0
  1055. package/dist/weapp/gantt-chart/index.json +1 -0
  1056. package/dist/weapp/gantt-chart/index.wxml +1 -0
  1057. package/dist/weapp/gantt-chart/index.wxss +1 -0
  1058. package/dist/weapp/gauge-chart/index.js +1 -0
  1059. package/dist/weapp/gauge-chart/index.json +1 -0
  1060. package/dist/weapp/gauge-chart/index.wxml +1 -0
  1061. package/dist/weapp/gauge-chart/index.wxss +1 -0
  1062. package/dist/weapp/heatmap-chart/index.js +1 -0
  1063. package/dist/weapp/heatmap-chart/index.json +1 -0
  1064. package/dist/weapp/heatmap-chart/index.wxml +1 -0
  1065. package/dist/weapp/heatmap-chart/index.wxss +1 -0
  1066. package/dist/weapp/histogram-chart/index.js +1 -0
  1067. package/dist/weapp/histogram-chart/index.json +1 -0
  1068. package/dist/weapp/histogram-chart/index.wxml +1 -0
  1069. package/dist/weapp/histogram-chart/index.wxss +1 -0
  1070. package/dist/weapp/horizontal-bar-chart/index.js +1 -0
  1071. package/dist/weapp/horizontal-bar-chart/index.json +1 -0
  1072. package/dist/weapp/horizontal-bar-chart/index.wxml +1 -0
  1073. package/dist/weapp/horizontal-bar-chart/index.wxss +1 -0
  1074. package/dist/weapp/mixed-chart/index.js +1 -0
  1075. package/dist/weapp/mixed-chart/index.json +1 -0
  1076. package/dist/weapp/mixed-chart/index.wxml +1 -0
  1077. package/dist/weapp/mixed-chart/index.wxss +1 -0
  1078. package/dist/weapp/pie-chart/index.js +1 -0
  1079. package/dist/weapp/pie-chart/index.json +1 -0
  1080. package/dist/weapp/pie-chart/index.wxml +1 -0
  1081. package/dist/weapp/pie-chart/index.wxss +1 -0
  1082. package/dist/weapp/radar-chart/index.js +1 -0
  1083. package/dist/weapp/radar-chart/index.json +1 -0
  1084. package/dist/weapp/radar-chart/index.wxml +1 -0
  1085. package/dist/weapp/radar-chart/index.wxss +1 -0
  1086. package/dist/weapp/radial-bar-chart/index.js +1 -0
  1087. package/dist/weapp/radial-bar-chart/index.json +1 -0
  1088. package/dist/weapp/radial-bar-chart/index.wxml +1 -0
  1089. package/dist/weapp/radial-bar-chart/index.wxss +1 -0
  1090. package/dist/weapp/range-area-chart/index.js +1 -0
  1091. package/dist/weapp/range-area-chart/index.json +1 -0
  1092. package/dist/weapp/range-area-chart/index.wxml +1 -0
  1093. package/dist/weapp/range-area-chart/index.wxss +1 -0
  1094. package/dist/weapp/sankey-chart/index.js +1 -0
  1095. package/dist/weapp/sankey-chart/index.json +1 -0
  1096. package/dist/weapp/sankey-chart/index.wxml +1 -0
  1097. package/dist/weapp/sankey-chart/index.wxss +1 -0
  1098. package/dist/weapp/shape-chart/index.js +1 -0
  1099. package/dist/weapp/shape-chart/index.json +1 -0
  1100. package/dist/weapp/shape-chart/index.wxml +1 -0
  1101. package/dist/weapp/shape-chart/index.wxss +1 -0
  1102. package/dist/weapp/sparkline/index.js +1 -0
  1103. package/dist/weapp/sparkline/index.json +1 -0
  1104. package/dist/weapp/sparkline/index.wxml +1 -0
  1105. package/dist/weapp/sparkline/index.wxss +1 -0
  1106. package/dist/weapp/sunburst-chart/index.js +1 -0
  1107. package/dist/weapp/sunburst-chart/index.json +1 -0
  1108. package/dist/weapp/sunburst-chart/index.wxml +1 -0
  1109. package/dist/weapp/sunburst-chart/index.wxss +1 -0
  1110. package/dist/weapp/treemap-chart/index.js +1 -0
  1111. package/dist/weapp/treemap-chart/index.json +1 -0
  1112. package/dist/weapp/treemap-chart/index.wxml +1 -0
  1113. package/dist/weapp/treemap-chart/index.wxss +1 -0
  1114. package/dist/weapp/types.d.ts +466 -0
  1115. package/dist/weapp/waterfall-chart/index.js +1 -0
  1116. package/dist/weapp/waterfall-chart/index.json +1 -0
  1117. package/dist/weapp/waterfall-chart/index.wxml +1 -0
  1118. package/dist/weapp/waterfall-chart/index.wxss +1 -0
  1119. package/dist/web-components/components/chart/chart.d.ts +58 -0
  1120. package/dist/web-components/components/chart/chart.js +55 -0
  1121. package/dist/web-components/components/chart/chart.js.map +1 -0
  1122. package/dist/web-components/components/chart/charts.d.ts +252 -0
  1123. package/dist/web-components/components/chart/charts.js +201 -0
  1124. package/dist/web-components/components/chart/charts.js.map +1 -0
  1125. package/dist/web-components/components/chart/engine-element.d.ts +53 -0
  1126. package/dist/web-components/components/chart/engine-element.js +77 -0
  1127. package/dist/web-components/components/chart/engine-element.js.map +1 -0
  1128. package/dist/web-components/components/chart/extended.d.ts +224 -0
  1129. package/dist/web-components/components/chart/extended.js +183 -0
  1130. package/dist/web-components/components/chart/extended.js.map +1 -0
  1131. package/dist/web-components/components/chart/series.d.ts +7 -0
  1132. package/dist/web-components/components/chart/series.js +14 -0
  1133. package/dist/web-components/components/chart/series.js.map +1 -0
  1134. package/dist/web-components/components/chart/shape-chart.d.ts +199 -0
  1135. package/dist/web-components/components/chart/shape-chart.js +161 -0
  1136. package/dist/web-components/components/chart/shape-chart.js.map +1 -0
  1137. package/dist/web-components/components/chart/shapes-extended.d.ts +162 -0
  1138. package/dist/web-components/components/chart/shapes-extended.js +156 -0
  1139. package/dist/web-components/components/chart/shapes-extended.js.map +1 -0
  1140. package/dist/web-components/components/chart-3d/chart-3d.d.ts +111 -0
  1141. package/dist/web-components/components/chart-3d/chart-3d.js +97 -0
  1142. package/dist/web-components/components/chart-3d/chart-3d.js.map +1 -0
  1143. package/dist/web-components/components/order-book/order-book.d.ts +165 -0
  1144. package/dist/web-components/components/order-book/order-book.js +174 -0
  1145. package/dist/web-components/components/order-book/order-book.js.map +1 -0
  1146. package/dist/web-components/components/trading-chart/trading-chart.d.ts +96 -0
  1147. package/dist/web-components/components/trading-chart/trading-chart.js +96 -0
  1148. package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -0
  1149. package/dist/web-components/elements/chart-3d.d.ts +2 -0
  1150. package/dist/web-components/elements/chart-3d.js +13 -0
  1151. package/dist/web-components/elements/chart-3d.js.map +1 -0
  1152. package/dist/web-components/elements/chart.d.ts +7 -0
  1153. package/dist/web-components/elements/chart.js +43 -0
  1154. package/dist/web-components/elements/chart.js.map +1 -0
  1155. package/dist/web-components/elements/order-book.d.ts +2 -0
  1156. package/dist/web-components/elements/order-book.js +13 -0
  1157. package/dist/web-components/elements/order-book.js.map +1 -0
  1158. package/dist/web-components/elements/trading-chart.d.ts +2 -0
  1159. package/dist/web-components/elements/trading-chart.js +8 -0
  1160. package/dist/web-components/elements/trading-chart.js.map +1 -0
  1161. package/dist/web-components/html-custom-data.json +1192 -29
  1162. package/dist/web-components/types/react.d.ts +435 -0
  1163. package/dist/web-components/types/solid.d.ts +321 -0
  1164. package/dist/web-components/types/svelte.d.ts +321 -0
  1165. package/dist/web-components/types/vue.d.ts +359 -0
  1166. package/package.json +113 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hit.cjs","names":["TAU","padAngleAt","sectorPad","require_scene","require_draw","VERTEX_RADIUS","wrapFrom","d","a","from","pointInSector","dx","x","s","dy","y","span","half","off","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","hitRadar","radar","scene","best","bestD","k","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport { TAU, type ShapeHover, type ShapeNode, type ShapeScene } from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\":\n return (\n x >= node.x &&\n x <= node.x + node.width &&\n y >= node.y &&\n y <= node.y + node.height\n );\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + 4) return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n default:\n return false;\n }\n};\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":"uDAMA,IAAMK,EAAgB,GAGhBC,GAAY,EAAW,IAAiB,CAC5C,IAAIC,GAAKC,EAAIC,GAAQT,EAAAA,IAErB,OADIO,EAAI,IAAG,GAAKP,EAAAA,KACTS,EAAOF,CAChB,EAGaG,GACX,EACA,EACA,IASY,CACZ,IAAMC,EAAKC,EAAIC,EAAE,GACXC,EAAKC,EAAIF,EAAE,GACXN,EAAI,KAAK,MAAMI,EAAIG,CAAE,EAC3B,GAAIP,EAAIM,EAAE,IAAMN,EAAIM,EAAE,GAAI,MAAO,GACjC,IAAMG,EAAOH,EAAE,GAAKA,EAAE,GACtB,GAAIG,GAAQhB,EAAAA,IAAM,KAAM,MAAO,GAC/B,GAAIgB,GAAQ,EAAG,MAAO,GACtB,IAAMR,EAAIF,EAAS,KAAK,MAAMQ,EAAIH,CAAE,EAAGE,EAAE,EAAE,EACrCI,GAAQJ,EAAE,KAAO,GAAK,EACtBK,EAAMD,EAAO,EAAIhB,EAAAA,WAAWgB,EAAMV,CAAC,EAAI,EAC7C,OAAOC,GAAKK,EAAE,GAAKK,GAAOV,GAAKK,EAAE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AAO,KAClB,IAAME,EACJD,EAAM,YAAc,IAAA,GAAiD,KAArCD,EAAK,aAAaC,EAAM,WAC1D,OAAOC,EAAM,CAAE,EAAGA,EAAI,EAAG,EAAGA,EAAI,CAAE,EAAI,CAAE,EAAGF,EAAK,EAAG,EAAGA,EAAK,CAAE,CAC/D,EAMaG,GACX,EACA,EACA,IACsB,CACtB,IAAMC,EAAQnB,EAAM,MACpB,GAAI,CAACmB,EAAM,OAAQ,OAAO,KAC1B,IAAMC,EAAMP,EACRM,EAAM,UAAW,GAAOP,EAAG,QAAUC,EAAQ,KAAK,EAClD,GACEd,EAAQC,EAAM,OAAS,QAC7B,GAAIoB,EAAM,EAAG,CACX,IAAMC,EACJC,IAAc,QAAUA,IAAc,KAAOH,EAAM,OAAS,EAAI,EAClE,OAAOpB,EACH,CAAE,MAAOoB,EAAME,EAAM,CAAC,MAAO,UAAW,CAAE,EAC1C,CAAE,MAAOF,EAAME,EAAM,CAAC,KAAM,CAClC,CACA,IAAME,EAAUD,IAAc,QAAUA,IAAc,OACtD,GAAIvB,IAAUuB,IAAc,QAAUA,IAAc,QAAS,CAC3D,IAAME,EAAQL,EAAMC,EAAI,CAAC,YAAY,QAAU,EACzCjB,EAAIU,GAAS,WAAa,EAChC,MAAO,CACL,MAAOM,EAAMC,EAAI,CAAC,MAClB,WAAYjB,GAAKoB,EAAU,EAAI,IAAMC,GAASA,CAChD,CACF,CACA,IAAMC,EAAON,GAAOC,GAAOG,EAAU,EAAI,IAAMJ,EAAM,QAAUA,EAAM,QACrE,OAAOpB,EACH,CAAE,MAAO0B,EAAK,MAAO,UAAWZ,GAAS,WAAa,CAAE,EACxD,CAAE,MAAOY,EAAK,KAAM,CAC1B"}
1
+ {"version":3,"file":"hit.cjs","names":["TAU","padAngleAt","sectorPad","require_scene","require_draw","VERTEX_RADIUS","wrapFrom","d","a","from","pointInSector","dx","x","s","dy","y","span","half","off","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","pad","pointNearLink","LINK_SEGMENTS","left","right","xm","at","u","t","b0","b1","b2","b3","px","py","k","qx","qy","len2","clampUnit","v","hitRadar","radar","scene","best","bestD","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","step","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport {\n TAU,\n type LinkNode,\n type ShapeHover,\n type ShapeNode,\n type ShapeScene,\n} from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\": {\n const pad = node.hitPad ?? 0;\n return (\n x >= node.x - pad &&\n x <= node.x + node.width + pad &&\n y >= node.y - pad &&\n y <= node.y + node.height + pad\n );\n }\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + (node.hitPad ?? 4))\n return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n case \"link\":\n return pointNearLink(x, y, node);\n default:\n return false;\n }\n};\n\n/** Segments of the polyline approximating a link's center curve */\nconst LINK_SEGMENTS = 24;\n\n/** Whether a point is within a sankey link (its thickness, plus 2 px) */\nexport const pointNearLink = (x: number, y: number, node: LinkNode) => {\n const half = Math.max(1, node.width) / 2 + 2;\n const left = Math.min(node.x0, node.x1);\n const right = Math.max(node.x0, node.x1);\n if (x < left - half || x > right + half) return false;\n if (\n y < Math.min(node.y0, node.y1) - half ||\n y > Math.max(node.y0, node.y1) + half\n )\n return false;\n const xm = (node.x0 + node.x1) / 2;\n // cubic Bézier (x0, y0) (xm, y0) (xm, y1) (x1, y1)\n const at = (t: number): [number, number] => {\n const u = 1 - t;\n const b0 = u * u * u;\n const b1 = 3 * u * u * t;\n const b2 = 3 * u * t * t;\n const b3 = t * t * t;\n return [\n b0 * node.x0 + (b1 + b2) * xm + b3 * node.x1,\n (b0 + b1) * node.y0 + (b2 + b3) * node.y1,\n ];\n };\n let [px, py] = at(0);\n for (let k = 1; k <= LINK_SEGMENTS; k++) {\n const [qx, qy] = at(k / LINK_SEGMENTS);\n const dx = qx - px;\n const dy = qy - py;\n const len2 = dx * dx + dy * dy;\n const s = len2 > 0 ? clampUnit(((x - px) * dx + (y - py) * dy) / len2) : 0;\n if (Math.hypot(x - (px + s * dx), y - (py + s * dy)) <= half) return true;\n px = qx;\n py = qy;\n }\n return false;\n};\n\nconst clampUnit = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (scene.steps) {\n const step =\n direction === \"next\" || direction === \"prev\"\n ? scene.steps.next\n : scene.steps.down;\n const target = items[pos + (forward ? step : -step)];\n return { index: (target ?? items[pos]).index };\n }\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":"uDAYA,IAAMK,EAAgB,GAGhBC,GAAY,EAAW,IAAiB,CAC5C,IAAIC,GAAKC,EAAIC,GAAQT,EAAAA,IAErB,OADIO,EAAI,IAAG,GAAKP,EAAAA,KACTS,EAAOF,CAChB,EAGaG,GACX,EACA,EACA,IASY,CACZ,IAAMC,EAAKC,EAAIC,EAAE,GACXC,EAAKC,EAAIF,EAAE,GACXN,EAAI,KAAK,MAAMI,EAAIG,CAAE,EAC3B,GAAIP,EAAIM,EAAE,IAAMN,EAAIM,EAAE,GAAI,MAAO,GACjC,IAAMG,EAAOH,EAAE,GAAKA,EAAE,GACtB,GAAIG,GAAQhB,EAAAA,IAAM,KAAM,MAAO,GAC/B,GAAIgB,GAAQ,EAAG,MAAO,GACtB,IAAMR,EAAIF,EAAS,KAAK,MAAMQ,EAAIH,CAAE,EAAGE,EAAE,EAAE,EACrCI,GAAQJ,EAAE,KAAO,GAAK,EACtBK,EAAMD,EAAO,EAAIhB,EAAAA,WAAWgB,EAAMV,CAAC,EAAI,EAC7C,OAAOC,GAAKK,EAAE,GAAKK,GAAOV,GAAKK,EAAE,GAAKK,CACxC,EAGaC,GACX,EACA,EACA,IACY,CACZ,IAAMC,EAAIC,EAAO,QAAU,EACvBC,EAAS,GACb,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAI,EAAGG,EAAIH,EAAG,EAAI,IAAK,CACzC,IAAMK,EAAKJ,EAAOE,EAAI,GAChBG,EAAKL,EAAOE,EAAI,EAAI,GACpBI,EAAKN,EAAOG,EAAI,GAChBI,EAAKP,EAAOG,EAAI,EAAI,GACtBE,EAAKX,GAAMa,EAAKb,GAAKH,GAAMe,EAAKF,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2
  /** Whether a point is in an annular sector (gaps included, corners approximated) */
3
3
  export declare const pointInSector: (x: number, y: number, s: {
4
4
  cx: number;
@@ -11,6 +11,8 @@ export declare const pointInSector: (x: number, y: number, s: {
11
11
  }) => boolean;
12
12
  /** Even-odd test of a point in a polygon given as a flat x, y list */
13
13
  export declare const pointInPolygon: (x: number, y: number, points: readonly number[]) => boolean;
14
+ /** Whether a point is within a sankey link (its thickness, plus 2 px) */
15
+ export declare const pointNearLink: (x: number, y: number, node: LinkNode) => boolean;
14
16
  /**
15
17
  * Item under a point (CSS pixels). `current` is the hovered item: its
16
18
  * popped-out geometry also counts so a moved slice keeps the hover.
@@ -1,4 +1,4 @@
1
- import { ShapeHover, ShapeScene } from './scene.js';
1
+ import { LinkNode, ShapeHover, ShapeScene } from './scene.js';
2
2
  /** Whether a point is in an annular sector (gaps included, corners approximated) */
3
3
  export declare const pointInSector: (x: number, y: number, s: {
4
4
  cx: number;
@@ -11,6 +11,8 @@ export declare const pointInSector: (x: number, y: number, s: {
11
11
  }) => boolean;
12
12
  /** Even-odd test of a point in a polygon given as a flat x, y list */
13
13
  export declare const pointInPolygon: (x: number, y: number, points: readonly number[]) => boolean;
14
+ /** Whether a point is within a sankey link (its thickness, plus 2 px) */
15
+ export declare const pointNearLink: (x: number, y: number, node: LinkNode) => boolean;
14
16
  /**
15
17
  * Item under a point (CSS pixels). `current` is the hovered item: its
16
18
  * popped-out geometry also counts so a moved slice keeps the hover.
@@ -30,15 +30,32 @@ var r = 12, i = (t, n) => {
30
30
  pad: n(t)
31
31
  });
32
32
  case "polygon": return o(r, s, t.points) && !(t.hole && o(r, s, t.hole));
33
- case "rect": return r >= t.x && r <= t.x + t.width && s >= t.y && s <= t.y + t.height;
33
+ case "rect": {
34
+ let e = t.hitPad ?? 0;
35
+ return r >= t.x - e && r <= t.x + t.width + e && s >= t.y - e && s <= t.y + t.height + e;
36
+ }
34
37
  case "circle": return Math.hypot(r - t.cx, s - t.cy) <= t.r;
35
38
  case "arc": {
36
39
  let n = Math.hypot(r - t.cx, s - t.cy);
37
- return Math.abs(n - t.r) > t.width / 2 + 4 ? !1 : t.a1 - t.a0 >= e - 1e-6 || i(Math.atan2(s - t.cy, r - t.cx), t.a0) <= t.a1;
40
+ return Math.abs(n - t.r) > t.width / 2 + (t.hitPad ?? 4) ? !1 : t.a1 - t.a0 >= e - 1e-6 || i(Math.atan2(s - t.cy, r - t.cx), t.a0) <= t.a1;
38
41
  }
42
+ case "link": return u(r, s, t);
39
43
  default: return !1;
40
44
  }
41
- }, l = (e, t, n) => {
45
+ }, l = 24, u = (e, t, n) => {
46
+ let r = Math.max(1, n.width) / 2 + 2, i = Math.min(n.x0, n.x1), a = Math.max(n.x0, n.x1);
47
+ if (e < i - r || e > a + r || t < Math.min(n.y0, n.y1) - r || t > Math.max(n.y0, n.y1) + r) return !1;
48
+ let o = (n.x0 + n.x1) / 2, s = (e) => {
49
+ let t = 1 - e, r = t * t * t, i = 3 * t * t * e, a = 3 * t * e * e, s = e * e * e;
50
+ return [r * n.x0 + (i + a) * o + s * n.x1, (r + i) * n.y0 + (a + s) * n.y1];
51
+ }, [c, u] = s(0);
52
+ for (let n = 1; n <= l; n++) {
53
+ let [i, a] = s(n / l), o = i - c, f = a - u, p = o * o + f * f, m = p > 0 ? d(((e - c) * o + (t - u) * f) / p) : 0;
54
+ if (Math.hypot(e - (c + m * o), t - (u + m * f)) <= r) return !0;
55
+ c = i, u = a;
56
+ }
57
+ return !1;
58
+ }, d = (e) => e < 0 ? 0 : e > 1 ? 1 : e, f = (e, t, n) => {
42
59
  let a = e.radar;
43
60
  if (!a || !a.series.length) return null;
44
61
  let c = null, l = r;
@@ -65,9 +82,9 @@ var r = 12, i = (t, n) => {
65
82
  index: d,
66
83
  indicator: p
67
84
  };
68
- }, u = (e, t, n, r = null) => {
85
+ }, p = (e, t, n, r = null) => {
69
86
  if (e.empty) return null;
70
- if (e.type === "radar") return l(e, t, n);
87
+ if (e.type === "radar") return f(e, t, n);
71
88
  let i = e.enter;
72
89
  i && i.scale > 0 && i.scale !== 1 && (t = i.cx + (t - i.cx) / i.scale, n = i.cy + (n - i.cy) / i.scale);
73
90
  let a = new Set(e.items.map((e) => e.index));
@@ -82,7 +99,7 @@ var r = 12, i = (t, n) => {
82
99
  }
83
100
  }
84
101
  return null;
85
- }, d = (e, t) => {
102
+ }, m = (e, t) => {
86
103
  let n = e.items.find((e) => e.index === t.index);
87
104
  if (!n) return null;
88
105
  let r = t.indicator === void 0 ? null : n.indicators?.[t.indicator];
@@ -93,7 +110,7 @@ var r = 12, i = (t, n) => {
93
110
  x: n.x,
94
111
  y: n.y
95
112
  };
96
- }, f = (e, t, n) => {
113
+ }, h = (e, t, n) => {
97
114
  let r = e.items;
98
115
  if (!r.length) return null;
99
116
  let i = t ? r.findIndex((e) => e.index === t.index) : -1, a = e.type === "radar";
@@ -105,6 +122,10 @@ var r = 12, i = (t, n) => {
105
122
  } : { index: r[e].index };
106
123
  }
107
124
  let o = n === "next" || n === "down";
125
+ if (e.steps) {
126
+ let t = n === "next" || n === "prev" ? e.steps.next : e.steps.down;
127
+ return { index: (r[i + (o ? t : -t)] ?? r[i]).index };
128
+ }
108
129
  if (a && (n === "next" || n === "prev")) {
109
130
  let e = r[i].indicators?.length ?? 1, n = t?.indicator ?? 0;
110
131
  return {
@@ -119,6 +140,6 @@ var r = 12, i = (t, n) => {
119
140
  } : { index: s.index };
120
141
  };
121
142
  //#endregion
122
- export { u as hitTestShapes, d as hoverAnchor, o as pointInPolygon, a as pointInSector, f as stepHover };
143
+ export { p as hitTestShapes, m as hoverAnchor, o as pointInPolygon, a as pointInSector, u as pointNearLink, h as stepHover };
123
144
 
124
145
  //# sourceMappingURL=hit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hit.js","names":["VERTEX_RADIUS","wrapFrom","d","a","from","TAU","pointInSector","dx","x","s","dy","y","span","half","off","padAngleAt","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","sectorPad","hitRadar","radar","scene","best","bestD","k","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport { TAU, type ShapeHover, type ShapeNode, type ShapeScene } from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\":\n return (\n x >= node.x &&\n x <= node.x + node.width &&\n y >= node.y &&\n y <= node.y + node.height\n );\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + 4) return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n default:\n return false;\n }\n};\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":";;;AAMA,IAAMA,IAAgB,IAGhBC,KAAY,GAAW,MAAiB;CAC5C,IAAIC,KAAKC,IAAIC,KAAQC;CAErB,OADIH,IAAI,MAAG,KAAKG,IACTD,IAAOF;AAChB,GAGaI,KACX,GACA,GACA,MASY;CACZ,IAAMC,IAAKC,IAAIC,EAAE,IACXC,IAAKC,IAAIF,EAAE,IACXP,IAAI,KAAK,MAAMK,GAAIG,CAAE;CAC3B,IAAIR,IAAIO,EAAE,MAAMP,IAAIO,EAAE,IAAI,OAAO;CACjC,IAAMG,IAAOH,EAAE,KAAKA,EAAE;CACtB,IAAIG,KAAQP,IAAM,MAAM,OAAO;CAC/B,IAAIO,KAAQ,GAAG,OAAO;CACtB,IAAMT,IAAIF,EAAS,KAAK,MAAMS,GAAIH,CAAE,GAAGE,EAAE,EAAE,GACrCI,KAAQJ,EAAE,OAAO,KAAK,GACtBK,IAAMD,IAAO,IAAIE,EAAWF,GAAMX,CAAC,IAAI;CAC7C,OAAOC,KAAKM,EAAE,KAAKK,KAAOX,KAAKM,EAAE,KAAKK;AACxC,GAGaE,KACX,GACA,GACA,MACY;CACZ,IAAMC,IAAIC,EAAO,UAAU,GACvBC,IAAS;CACb,KAAK,IAAIC,IAAI,GAAGC,IAAIJ,IAAI,GAAGG,IAAIH,GAAG,IAAI,KAAK;EACzC,IAAMK,IAAKJ,EAAOE,IAAI,IAChBG,IAAKL,EAAOE,IAAI,IAAI,IACpBI,IAAKN,EAAOG,IAAI,IAChBI,IAAKP,EAAOG,IAAI,IAAI;EAC1B,AAAIE,IAAKZ,KAAMc,IAAKd,KAAKH,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,EAAM,WAAW,MAAOP,EAAG,UAAUC,EAAQ,KAAK,IAClD,IACEd,IAAQC,EAAM,SAAS;CAC7B,IAAIoB,IAAM,GAAG;EACX,IAAMC,IACJC,MAAc,UAAUA,MAAc,OAAOH,EAAM,SAAS,IAAI;EAClE,OAAOpB,IACH;GAAE,OAAOoB,EAAME,EAAM,CAAC;GAAO,WAAW;EAAE,IAC1C,EAAE,OAAOF,EAAME,EAAM,CAAC,MAAM;CAClC;CACA,IAAME,IAAUD,MAAc,UAAUA,MAAc;CACtD,IAAIvB,MAAUuB,MAAc,UAAUA,MAAc,SAAS;EAC3D,IAAME,IAAQL,EAAMC,EAAI,CAAC,YAAY,UAAU,GACzCjB,IAAIU,GAAS,aAAa;EAChC,OAAO;GACL,OAAOM,EAAMC,EAAI,CAAC;GAClB,YAAYjB,KAAKoB,IAAU,IAAI,MAAMC,KAASA;EAChD;CACF;CACA,IAAMC,IAAON,GAAOC,KAAOG,IAAU,IAAI,MAAMJ,EAAM,UAAUA,EAAM;CACrE,OAAOpB,IACH;EAAE,OAAO0B,EAAK;EAAO,WAAWZ,GAAS,aAAa;CAAE,IACxD,EAAE,OAAOY,EAAK,MAAM;AAC1B"}
1
+ {"version":3,"file":"hit.js","names":["VERTEX_RADIUS","wrapFrom","d","a","from","TAU","pointInSector","dx","x","s","dy","y","span","half","off","padAngleAt","pointInPolygon","n","points","inside","i","j","xi","yi","xj","yj","polygonArea","nodeContains","node","sectorPad","pad","pointNearLink","LINK_SEGMENTS","left","right","xm","at","u","t","b0","b1","b2","b3","px","py","k","qx","qy","len2","clampUnit","v","hitRadar","radar","scene","best","bestD","area","index","indicator","diff","angle","hitTestShapes","enter","valid","it","current","hoverAnchor","item","hover","ind","stepHover","items","pos","first","direction","forward","step","count","next"],"sources":["../../../../../charts/src/engine/shapes/hit.ts"],"sourcesContent":["// Hit testing of a ShapeScene and keyboard navigation between its items.\n\nimport { padAngleAt, sectorPad } from \"./draw\";\nimport {\n TAU,\n type LinkNode,\n type ShapeHover,\n type ShapeNode,\n type ShapeScene,\n} from \"./scene\";\n\n/** Distance (px) under which a radar vertex is picked */\nconst VERTEX_RADIUS = 12;\n\n/** Angle `a` brought into [from, from + 2π) */\nconst wrapFrom = (a: number, from: number) => {\n let d = (a - from) % TAU;\n if (d < 0) d += TAU;\n return from + d;\n};\n\n/** Whether a point is in an annular sector (gaps included, corners approximated) */\nexport const pointInSector = (\n x: number,\n y: number,\n s: {\n cx: number;\n cy: number;\n r0: number;\n r1: number;\n a0: number;\n a1: number;\n pad?: number;\n },\n): boolean => {\n const dx = x - s.cx;\n const dy = y - s.cy;\n const d = Math.hypot(dx, dy);\n if (d > s.r1 || d < s.r0) return false;\n const span = s.a1 - s.a0;\n if (span >= TAU - 1e-6) return true;\n if (span <= 0) return false;\n const a = wrapFrom(Math.atan2(dy, dx), s.a0);\n const half = (s.pad ?? 0) / 2;\n const off = half > 0 ? padAngleAt(half, d) : 0;\n return a >= s.a0 + off && a <= s.a1 - off;\n};\n\n/** Even-odd test of a point in a polygon given as a flat x, y list */\nexport const pointInPolygon = (\n x: number,\n y: number,\n points: readonly number[],\n): boolean => {\n const n = points.length >> 1;\n let inside = false;\n for (let i = 0, j = n - 1; i < n; j = i++) {\n const xi = points[i * 2];\n const yi = points[i * 2 + 1];\n const xj = points[j * 2];\n const yj = points[j * 2 + 1];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi)\n inside = !inside;\n }\n return inside;\n};\n\nconst polygonArea = (points: readonly number[]) => {\n const n = points.length >> 1;\n let a = 0;\n for (let i = 0, j = n - 1; i < n; j = i++)\n a += points[j * 2] * points[i * 2 + 1] - points[i * 2] * points[j * 2 + 1];\n return Math.abs(a) / 2;\n};\n\nconst nodeContains = (node: ShapeNode, x: number, y: number): boolean => {\n switch (node.kind) {\n case \"sector\":\n return pointInSector(x, y, { ...node, pad: sectorPad(node) });\n case \"polygon\":\n return (\n pointInPolygon(x, y, node.points) &&\n !(node.hole && pointInPolygon(x, y, node.hole))\n );\n case \"rect\": {\n const pad = node.hitPad ?? 0;\n return (\n x >= node.x - pad &&\n x <= node.x + node.width + pad &&\n y >= node.y - pad &&\n y <= node.y + node.height + pad\n );\n }\n case \"circle\":\n return Math.hypot(x - node.cx, y - node.cy) <= node.r;\n case \"arc\": {\n const d = Math.hypot(x - node.cx, y - node.cy);\n if (Math.abs(d - node.r) > node.width / 2 + (node.hitPad ?? 4))\n return false;\n if (node.a1 - node.a0 >= TAU - 1e-6) return true;\n const a = wrapFrom(Math.atan2(y - node.cy, x - node.cx), node.a0);\n return a <= node.a1;\n }\n case \"link\":\n return pointNearLink(x, y, node);\n default:\n return false;\n }\n};\n\n/** Segments of the polyline approximating a link's center curve */\nconst LINK_SEGMENTS = 24;\n\n/** Whether a point is within a sankey link (its thickness, plus 2 px) */\nexport const pointNearLink = (x: number, y: number, node: LinkNode) => {\n const half = Math.max(1, node.width) / 2 + 2;\n const left = Math.min(node.x0, node.x1);\n const right = Math.max(node.x0, node.x1);\n if (x < left - half || x > right + half) return false;\n if (\n y < Math.min(node.y0, node.y1) - half ||\n y > Math.max(node.y0, node.y1) + half\n )\n return false;\n const xm = (node.x0 + node.x1) / 2;\n // cubic Bézier (x0, y0) (xm, y0) (xm, y1) (x1, y1)\n const at = (t: number): [number, number] => {\n const u = 1 - t;\n const b0 = u * u * u;\n const b1 = 3 * u * u * t;\n const b2 = 3 * u * t * t;\n const b3 = t * t * t;\n return [\n b0 * node.x0 + (b1 + b2) * xm + b3 * node.x1,\n (b0 + b1) * node.y0 + (b2 + b3) * node.y1,\n ];\n };\n let [px, py] = at(0);\n for (let k = 1; k <= LINK_SEGMENTS; k++) {\n const [qx, qy] = at(k / LINK_SEGMENTS);\n const dx = qx - px;\n const dy = qy - py;\n const len2 = dx * dx + dy * dy;\n const s = len2 > 0 ? clampUnit(((x - px) * dx + (y - py) * dy) / len2) : 0;\n if (Math.hypot(x - (px + s * dx), y - (py + s * dy)) <= half) return true;\n px = qx;\n py = qy;\n }\n return false;\n};\n\nconst clampUnit = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n\n/** Radar: the vertex under the pointer, else the smallest polygon containing it */\nconst hitRadar = (\n scene: ShapeScene,\n x: number,\n y: number,\n): ShapeHover | null => {\n const radar = scene.radar;\n if (!radar || !radar.series.length) return null;\n let best: ShapeHover | null = null;\n let bestD = VERTEX_RADIUS;\n for (const s of radar.series) {\n for (let k = 0; k < s.points.length >> 1; k++) {\n const d = Math.hypot(x - s.points[k * 2], y - s.points[k * 2 + 1]);\n if (d <= bestD) {\n bestD = d;\n best = { index: s.index, indicator: k };\n }\n }\n }\n if (best) return best;\n let area = Infinity;\n let index = -1;\n for (const s of radar.series) {\n if (s.points.length < 6 || !pointInPolygon(x, y, s.points)) continue;\n const a = polygonArea(s.points);\n if (a < area) {\n area = a;\n index = s.index;\n }\n }\n if (index < 0) return null;\n // nearest indicator by angle\n const a = Math.atan2(y - radar.cy, x - radar.cx);\n let indicator = 0;\n let diff = Infinity;\n radar.angles.forEach((angle, k) => {\n const d = Math.abs(wrapFrom(a - angle + Math.PI, 0) - Math.PI);\n if (d < diff) {\n diff = d;\n indicator = k;\n }\n });\n return { index, indicator };\n};\n\n/**\n * Item under a point (CSS pixels). `current` is the hovered item: its\n * popped-out geometry also counts so a moved slice keeps the hover.\n */\nexport const hitTestShapes = (\n scene: ShapeScene,\n x: number,\n y: number,\n current: ShapeHover | null = null,\n): ShapeHover | null => {\n if (scene.empty) return null;\n if (scene.type === \"radar\") return hitRadar(scene, x, y);\n const enter = scene.enter;\n if (enter && enter.scale > 0 && enter.scale !== 1) {\n x = enter.cx + (x - enter.cx) / enter.scale;\n y = enter.cy + (y - enter.cy) / enter.scale;\n }\n const valid = new Set(scene.items.map((it) => it.index));\n for (let i = scene.nodes.length - 1; i >= 0; i--) {\n const node = scene.nodes[i];\n if (node.hit === undefined || !valid.has(node.hit)) continue;\n if (node.kind === \"text\" || node.kind === \"line\") continue;\n if (nodeContains(node, x, y)) return { index: node.hit };\n if (current?.index === node.hit && node.shift) {\n const [dx, dy] = node.shift;\n if (nodeContains(node, x - dx, y - dy)) return { index: node.hit };\n }\n }\n return null;\n};\n\n/** Where the tooltip of a keyboard-focused item goes */\nexport const hoverAnchor = (\n scene: ShapeScene,\n hover: ShapeHover,\n): { x: number; y: number } | null => {\n const item = scene.items.find((it) => it.index === hover.index);\n if (!item) return null;\n const ind =\n hover.indicator !== undefined ? item.indicators?.[hover.indicator] : null;\n return ind ? { x: ind.x, y: ind.y } : { x: item.x, y: item.y };\n};\n\n/**\n * Next focused item for the arrow keys: `next` / `prev` walk the items\n * (radar: the indicators of the series), `up` / `down` the radar series.\n */\nexport const stepHover = (\n scene: ShapeScene,\n current: ShapeHover | null,\n direction: \"next\" | \"prev\" | \"up\" | \"down\",\n): ShapeHover | null => {\n const items = scene.items;\n if (!items.length) return null;\n const pos = current\n ? items.findIndex((it) => it.index === current.index)\n : -1;\n const radar = scene.type === \"radar\";\n if (pos < 0) {\n const first =\n direction === \"prev\" || direction === \"up\" ? items.length - 1 : 0;\n return radar\n ? { index: items[first].index, indicator: 0 }\n : { index: items[first].index };\n }\n const forward = direction === \"next\" || direction === \"down\";\n if (scene.steps) {\n const step =\n direction === \"next\" || direction === \"prev\"\n ? scene.steps.next\n : scene.steps.down;\n const target = items[pos + (forward ? step : -step)];\n return { index: (target ?? items[pos]).index };\n }\n if (radar && (direction === \"next\" || direction === \"prev\")) {\n const count = items[pos].indicators?.length ?? 1;\n const k = current?.indicator ?? 0;\n return {\n index: items[pos].index,\n indicator: (k + (forward ? 1 : -1) + count) % count,\n };\n }\n const next = items[(pos + (forward ? 1 : -1) + items.length) % items.length];\n return radar\n ? { index: next.index, indicator: current?.indicator ?? 0 }\n : { index: next.index };\n};\n"],"mappings":";;;AAYA,IAAMA,IAAgB,IAGhBC,KAAY,GAAW,MAAiB;CAC5C,IAAIC,KAAKC,IAAIC,KAAQC;CAErB,OADIH,IAAI,MAAG,KAAKG,IACTD,IAA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OH,EAAM,SAAS,IAAI;EAClE,OAAOnB,IACH;GAAE,OAAOmB,EAAME,EAAM,CAAC;GAAO,WAAW;EAAE,IAC1C,EAAE,OAAOF,EAAME,EAAM,CAAC,MAAM;CAClC;CACA,IAAME,IAAUD,MAAc,UAAUA,MAAc;CACtD,IAAIrB,EAAM,OAAO;EACf,IAAMuB,IACJF,MAAc,UAAUA,MAAc,SAClCrB,EAAM,MAAM,OACZA,EAAM,MAAM;EAElB,OAAO,EAAE,QADMkB,EAAMC,KAAOG,IAAUC,IAAO,CAACA,OACnBL,EAAMC,GAAA,CAAM,MAAM;CAC/C;CACA,IAAIpB,MAAUsB,MAAc,UAAUA,MAAc,SAAS;EAC3D,IAAMG,IAAQN,EAAMC,EAAI,CAAC,YAAY,UAAU,GACzC3B,IAAIoB,GAAS,aAAa;EAChC,OAAO;GACL,OAAOM,EAAMC,EAAI,CAAC;GAClB,YAAY3B,KAAK8B,IAAU,IAAI,MAAME,KAASA;EAChD;CACF;CACA,IAAMC,IAAOP,GAAOC,KAAOG,IAAU,IAAI,MAAMJ,EAAM,UAAUA,EAAM;CACrE,OAAOnB,IACH;EAAE,OAAO0B,EAAK;EAAO,WAAWb,GAAS,aAAa;CAAE,IACxD,EAAE,OAAOa,EAAK,MAAM;AAC1B"}
@@ -5,5 +5,8 @@ export { hitTestShapes, hoverAnchor, pointInPolygon, pointInSector, stepHover, }
5
5
  export { describeChart, describeScene, hoverEvent, layoutShapeLegend, layoutShapeScene, layoutShapeTooltip, placeShapeTooltip, shapeLegend, shapeValues, tooltipContent, type ShapeLayoutInput, type ShapeLegendBox, type ShapeTooltipBox, type ShapeTooltipContent, } from './layout.cjs';
6
6
  export { gaugeBandIndex } from './gauge.cjs';
7
7
  export { squarify, treemapLeaves } from './treemap.cjs';
8
+ export { resolveSankey, sankeyColumns } from './sankey.cjs';
9
+ export { calendarDay, calendarIso, localeWeekStart } from './calendar.cjs';
10
+ export { bulletScale } from './bullet.cjs';
8
11
  export type { MeasureText, ShapeHover, ShapeItem, ShapeLegendEntry, ShapeNode, ShapeRect, ShapeScene, ShapeTooltipRow, } from './scene.cjs';
9
- export type { FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, TreemapChartOptions, TreemapNode, } from './types.cjs';
12
+ export type { BulletChartOptions, BulletDatum, CalendarDate, CalendarDatum, CalendarHeatmapOptions, FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, RadialBarChartOptions, RadialBarDatum, SankeyChartOptions, SankeyLink, SankeyNode, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartLabels, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeDrillEvent, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, SunburstChartOptions, TreemapChartOptions, TreemapNode, } from './types.cjs';
@@ -5,5 +5,8 @@ export { hitTestShapes, hoverAnchor, pointInPolygon, pointInSector, stepHover, }
5
5
  export { describeChart, describeScene, hoverEvent, layoutShapeLegend, layoutShapeScene, layoutShapeTooltip, placeShapeTooltip, shapeLegend, shapeValues, tooltipContent, type ShapeLayoutInput, type ShapeLegendBox, type ShapeTooltipBox, type ShapeTooltipContent, } from './layout.js';
6
6
  export { gaugeBandIndex } from './gauge.js';
7
7
  export { squarify, treemapLeaves } from './treemap.js';
8
+ export { resolveSankey, sankeyColumns } from './sankey.js';
9
+ export { calendarDay, calendarIso, localeWeekStart } from './calendar.js';
10
+ export { bulletScale } from './bullet.js';
8
11
  export type { MeasureText, ShapeHover, ShapeItem, ShapeLegendEntry, ShapeNode, ShapeRect, ShapeScene, ShapeTooltipRow, } from './scene.js';
9
- export type { FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, TreemapChartOptions, TreemapNode, } from './types.js';
12
+ export type { BulletChartOptions, BulletDatum, CalendarDate, CalendarDatum, CalendarHeatmapOptions, FunnelChartOptions, GaugeBand, GaugeChartOptions, PieChartOptions, RadarChartOptions, RadarIndicator, RadarSeries, RadialBarChartOptions, RadialBarDatum, SankeyChartOptions, SankeyLink, SankeyNode, ShapeChartCommonOptions, ShapeChartEventMap, ShapeChartInstance, ShapeChartLabels, ShapeChartOptions, ShapeChartType, ShapeDatum, ShapeDrillEvent, ShapeHoverEvent, ShapeLegendOptions, ShapeToggleEvent, ShapeTooltipOptions, SunburstChartOptions, TreemapChartOptions, TreemapNode, } from './types.js';
@@ -0,0 +1,2 @@
1
+ const e=require("../locale.cjs");var t={en:{noData:`No data`,value:`Value`,share:`Share`,ofFirstStage:`Of first stage`,conversion:`Conversion`,ofRange:`Of range`,ofName:`Of {name}`,incoming:`Incoming`,outgoing:`Outgoing`,max:`Max`,progress:`Progress`,target:`Target`,ofTarget:`Of target`,range:`Range`,series:`Series {index}`,pieChart:`Pie chart`,donutChart:`Donut chart`,roseChart:`Rose chart`,radarChart:`Radar chart`,gaugeChart:`Gauge`,gaugeChartNamed:`Gauge: {label}`,funnelChart:`Funnel chart`,treemapChart:`Treemap`,sankeyChart:`Sankey diagram`,sunburstChart:`Sunburst chart`,radialBarChart:`Radial bar chart`,calendarHeatmap:`Calendar heatmap`,bulletChart:`Bullet chart`},zh:{noData:`暂无数据`,value:`数值`,share:`占比`,ofFirstStage:`占首阶段`,conversion:`转化率`,ofRange:`占量程`,ofName:`占{name}`,incoming:`流入`,outgoing:`流出`,max:`最大值`,progress:`进度`,target:`目标`,ofTarget:`目标达成`,range:`区间`,series:`系列 {index}`,pieChart:`饼图`,donutChart:`环形图`,roseChart:`玫瑰图`,radarChart:`雷达图`,gaugeChart:`仪表盘`,gaugeChartNamed:`仪表盘:{label}`,funnelChart:`漏斗图`,treemapChart:`矩形树图`,sankeyChart:`桑基图`,sunburstChart:`旭日图`,radialBarChart:`径向条形图`,calendarHeatmap:`日历热力图`,bulletChart:`子弹图`},ja:{noData:`データなし`,value:`値`,share:`割合`,ofFirstStage:`初段階比`,conversion:`転換率`,ofRange:`範囲比`,ofName:`{name}比`,incoming:`流入`,outgoing:`流出`,max:`最大`,progress:`進捗`,target:`目標`,ofTarget:`目標達成率`,range:`範囲`,series:`系列 {index}`,pieChart:`円グラフ`,donutChart:`ドーナツグラフ`,roseChart:`鶏頭図`,radarChart:`レーダーチャート`,gaugeChart:`ゲージ`,gaugeChartNamed:`ゲージ:{label}`,funnelChart:`ファネルチャート`,treemapChart:`ツリーマップ`,sankeyChart:`サンキー図`,sunburstChart:`サンバースト図`,radialBarChart:`円形棒グラフ`,calendarHeatmap:`カレンダーヒートマップ`,bulletChart:`ブレットグラフ`},fr:{noData:`Aucune donnée`,value:`Valeur`,share:`Part`,ofFirstStage:`Part de la 1re étape`,conversion:`Conversion`,ofRange:`Part de la plage`,ofName:`Part de {name}`,incoming:`Entrées`,outgoing:`Sorties`,max:`Max`,progress:`Progression`,target:`Objectif`,ofTarget:`Atteinte de l’objectif`,range:`Plage`,series:`Série {index}`,pieChart:`Graphique circulaire`,donutChart:`Graphique en anneau`,roseChart:`Diagramme de Nightingale`,radarChart:`Graphique radar`,gaugeChart:`Jauge`,gaugeChartNamed:`Jauge : {label}`,funnelChart:`Graphique en entonnoir`,treemapChart:`Treemap`,sankeyChart:`Diagramme de Sankey`,sunburstChart:`Diagramme en rayons de soleil`,radialBarChart:`Graphique à barres radiales`,calendarHeatmap:`Calendrier thermique`,bulletChart:`Graphique à puces`}},n=n=>e.localeLabels(t,n.locale,n.texts),r=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),i=t=>{let n=e.resolveLocale(t),r=e.compactUnits(n);return t=>{if(!Number.isFinite(t))return String(t);if(Object.is(t,-0)||t===0)return`0`;let i=Math.abs(t);for(let[a,o]of r)if(i>=a)return e.numberFormat(n,{maximumFractionDigits:2}).format(t/a)+o;if(i<1e-4)return t.toExponential(1);let a=Math.floor(Math.log10(i)+1e-9),o=Math.min(6,Math.max(0,-a)+2);return e.numberFormat(n,{maximumFractionDigits:o}).format(t)}},a=t=>{let n=e.resolveLocale(t);return t=>Number.isFinite(t)?e.numberFormat(n,{style:`percent`,minimumFractionDigits:1,maximumFractionDigits:1}).format(t):`–`};exports.SHAPE_LABELS=t,exports.interpolate=r,exports.localeFormat=i,exports.localePercent=a,exports.shapeLabels=n;
2
+ //# sourceMappingURL=labels.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.cjs","names":["localeLabels","resolveLocale","compactUnits","numberFormat","require_locale","SHAPE_LABELS","shapeLabels","o","interpolate","template","key","values","all","localeFormat","tag","locale","units","value","abs","unit","suffix","magnitude","decimals","localePercent","share"],"sources":["../../../../../charts/src/engine/shapes/labels.ts"],"sourcesContent":["// Language of the shape charts: built-in texts (tooltip rows, accessible\n// names, \"No data\") and locale-aware number / percent formatting. The locale\n// is resolved on every layout, so a page language switch followed by a\n// re-render updates the texts.\n\nimport {\n compactUnits,\n localeLabels,\n numberFormat,\n resolveLocale,\n type LabelDictionary,\n} from \"../locale\";\nimport type { ShapeChartLabels, ShapeChartOptions } from \"./types\";\n\nexport const SHAPE_LABELS: LabelDictionary<ShapeChartLabels> = {\n en: {\n noData: \"No data\",\n value: \"Value\",\n share: \"Share\",\n ofFirstStage: \"Of first stage\",\n conversion: \"Conversion\",\n ofRange: \"Of range\",\n ofName: \"Of {name}\",\n incoming: \"Incoming\",\n outgoing: \"Outgoing\",\n max: \"Max\",\n progress: \"Progress\",\n target: \"Target\",\n ofTarget: \"Of target\",\n range: \"Range\",\n series: \"Series {index}\",\n pieChart: \"Pie chart\",\n donutChart: \"Donut chart\",\n roseChart: \"Rose chart\",\n radarChart: \"Radar chart\",\n gaugeChart: \"Gauge\",\n gaugeChartNamed: \"Gauge: {label}\",\n funnelChart: \"Funnel chart\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Sankey diagram\",\n sunburstChart: \"Sunburst chart\",\n radialBarChart: \"Radial bar chart\",\n calendarHeatmap: \"Calendar heatmap\",\n bulletChart: \"Bullet chart\",\n },\n zh: {\n noData: \"暂无数据\",\n value: \"数值\",\n share: \"占比\",\n ofFirstStage: \"占首阶段\",\n conversion: \"转化率\",\n ofRange: \"占量程\",\n ofName: \"占{name}\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大值\",\n progress: \"进度\",\n target: \"目标\",\n ofTarget: \"目标达成\",\n range: \"区间\",\n series: \"系列 {index}\",\n pieChart: \"饼图\",\n donutChart: \"环形图\",\n roseChart: \"玫瑰图\",\n radarChart: \"雷达图\",\n gaugeChart: \"仪表盘\",\n gaugeChartNamed: \"仪表盘:{label}\",\n funnelChart: \"漏斗图\",\n treemapChart: \"矩形树图\",\n sankeyChart: \"桑基图\",\n sunburstChart: \"旭日图\",\n radialBarChart: \"径向条形图\",\n calendarHeatmap: \"日历热力图\",\n bulletChart: \"子弹图\",\n },\n ja: {\n noData: \"データなし\",\n value: \"値\",\n share: \"割合\",\n ofFirstStage: \"初段階比\",\n conversion: \"転換率\",\n ofRange: \"範囲比\",\n ofName: \"{name}比\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大\",\n progress: \"進捗\",\n target: \"目標\",\n ofTarget: \"目標達成率\",\n range: \"範囲\",\n series: \"系列 {index}\",\n pieChart: \"円グラフ\",\n donutChart: \"ドーナツグラフ\",\n roseChart: \"鶏頭図\",\n radarChart: \"レーダーチャート\",\n gaugeChart: \"ゲージ\",\n gaugeChartNamed: \"ゲージ:{label}\",\n funnelChart: \"ファネルチャート\",\n treemapChart: \"ツリーマップ\",\n sankeyChart: \"サンキー図\",\n sunburstChart: \"サンバースト図\",\n radialBarChart: \"円形棒グラフ\",\n calendarHeatmap: \"カレンダーヒートマップ\",\n bulletChart: \"ブレットグラフ\",\n },\n fr: {\n noData: \"Aucune donnée\",\n value: \"Valeur\",\n share: \"Part\",\n ofFirstStage: \"Part de la 1re étape\",\n conversion: \"Conversion\",\n ofRange: \"Part de la plage\",\n ofName: \"Part de {name}\",\n incoming: \"Entrées\",\n outgoing: \"Sorties\",\n max: \"Max\",\n progress: \"Progression\",\n target: \"Objectif\",\n ofTarget: \"Atteinte de l’objectif\",\n range: \"Plage\",\n series: \"Série {index}\",\n pieChart: \"Graphique circulaire\",\n donutChart: \"Graphique en anneau\",\n roseChart: \"Diagramme de Nightingale\",\n radarChart: \"Graphique radar\",\n gaugeChart: \"Jauge\",\n gaugeChartNamed: \"Jauge : {label}\",\n funnelChart: \"Graphique en entonnoir\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Diagramme de Sankey\",\n sunburstChart: \"Diagramme en rayons de soleil\",\n radialBarChart: \"Graphique à barres radiales\",\n calendarHeatmap: \"Calendrier thermique\",\n bulletChart: \"Graphique à puces\",\n },\n};\n\n/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */\nexport const shapeLabels = (\n o: Pick<ShapeChartOptions, \"locale\" | \"texts\">,\n): ShapeChartLabels => localeLabels(SHAPE_LABELS, o.locale, o.texts);\n\n/** Replaces the `{key}` placeholders of a text */\nexport const interpolate = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (all, key: string) =>\n key in values ? String(values[key]) : all,\n );\n\n/**\n * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values\n * keep enough decimals to be told apart\n */\nexport const localeFormat = (locale?: string) => {\n const tag = resolveLocale(locale);\n const units = compactUnits(tag);\n return (value: number): string => {\n if (!Number.isFinite(value)) return String(value);\n if (Object.is(value, -0) || value === 0) return \"0\";\n const abs = Math.abs(value);\n for (const [unit, suffix] of units)\n if (abs >= unit)\n return (\n numberFormat(tag, { maximumFractionDigits: 2 }).format(value / unit) +\n suffix\n );\n if (abs < 1e-4) return value.toExponential(1);\n // at least two decimals, two more than the magnitude (0.0123, 1.25)\n const magnitude = Math.floor(Math.log10(abs) + 1e-9);\n const decimals = Math.min(6, Math.max(0, -magnitude) + 2);\n return numberFormat(tag, { maximumFractionDigits: decimals }).format(value);\n };\n};\n\n/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */\nexport const localePercent = (locale?: string) => {\n const tag = resolveLocale(locale);\n return (share: number): string =>\n Number.isFinite(share)\n ? numberFormat(tag, {\n style: \"percent\",\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(share)\n : \"–\";\n};\n"],"mappings":"iCAcA,IAAaK,EAAkD,CAC7D,GAAI,CACF,OAAQ,UACR,MAAO,QACP,MAAO,QACP,aAAc,iBACd,WAAY,aACZ,QAAS,WACT,OAAQ,YACR,SAAU,WACV,SAAU,WACV,IAAK,MACL,SAAU,WACV,OAAQ,SACR,SAAU,YACV,MAAO,QACP,OAAQ,iBACR,SAAU,YACV,WAAY,cACZ,UAAW,aACX,WAAY,cACZ,WAAY,QACZ,gBAAiB,iBACjB,YAAa,eACb,aAAc,UACd,YAAa,iBACb,cAAe,iBACf,eAAgB,mBAChB,gBAAiB,mBACjB,YAAa,cACf,EACA,GAAI,CACF,OAAQ,OACR,MAAO,KACP,MAAO,KACP,aAAc,OACd,WAAY,MACZ,QAAS,MACT,OAAQ,UACR,SAAU,KACV,SAAU,KACV,IAAK,MACL,SAAU,KACV,OAAQ,KACR,SAAU,OACV,MAAO,KACP,OAAQ,aACR,SAAU,KACV,WAAY,MACZ,UAAW,MACX,WAAY,MACZ,WAAY,MACZ,gBAAiB,cACjB,YAAa,MACb,aAAc,OACd,YAAa,MACb,cAAe,MACf,eAAgB,QAChB,gBAAiB,QACjB,YAAa,KACf,EACA,GAAI,CACF,OAAQ,QACR,MAAO,IACP,MAAO,KACP,aAAc,OACd,WA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,EAAQE,CAAI,EACnEC,EAEN,GAAIF,EAAM,KAAM,OAAOD,EAAM,cAAc,CAAC,EAE5C,IAAMI,EAAY,KAAK,MAAM,KAAK,MAAMH,CAAG,EAAI,IAAI,EAC7CI,EAAW,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,CAACD,CAAS,EAAI,CAAC,EACxD,OAAOlB,EAAAA,aAAaW,EAAK,CAAE,sBAAuBQ,CAAS,CAAC,CAAC,CAAC,OAAOL,CAAK,CAC5E,CACF,EAGaM,EAAiB,GAAoB,CAChD,IAAMT,EAAMb,EAAAA,cAAcc,CAAM,EAChC,MAAQ,IACN,OAAO,SAASS,CAAK,EACjBrB,EAAAA,aAAaW,EAAK,CAChB,MAAO,UACP,sBAAuB,EACvB,sBAAuB,CACzB,CAAC,CAAC,CAAC,OAAOU,CAAK,EACf,GACR"}
@@ -0,0 +1,14 @@
1
+ import { LabelDictionary } from '../locale.cjs';
2
+ import { ShapeChartLabels, ShapeChartOptions } from './types.cjs';
3
+ export declare const SHAPE_LABELS: LabelDictionary<ShapeChartLabels>;
4
+ /** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */
5
+ export declare const shapeLabels: (o: Pick<ShapeChartOptions, "locale" | "texts">) => ShapeChartLabels;
6
+ /** Replaces the `{key}` placeholders of a text */
7
+ export declare const interpolate: (template: string, values: Record<string, string | number>) => string;
8
+ /**
9
+ * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values
10
+ * keep enough decimals to be told apart
11
+ */
12
+ export declare const localeFormat: (locale?: string) => (value: number) => string;
13
+ /** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */
14
+ export declare const localePercent: (locale?: string) => (share: number) => string;
@@ -0,0 +1,14 @@
1
+ import { LabelDictionary } from '../locale.js';
2
+ import { ShapeChartLabels, ShapeChartOptions } from './types.js';
3
+ export declare const SHAPE_LABELS: LabelDictionary<ShapeChartLabels>;
4
+ /** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */
5
+ export declare const shapeLabels: (o: Pick<ShapeChartOptions, "locale" | "texts">) => ShapeChartLabels;
6
+ /** Replaces the `{key}` placeholders of a text */
7
+ export declare const interpolate: (template: string, values: Record<string, string | number>) => string;
8
+ /**
9
+ * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values
10
+ * keep enough decimals to be told apart
11
+ */
12
+ export declare const localeFormat: (locale?: string) => (value: number) => string;
13
+ /** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */
14
+ export declare const localePercent: (locale?: string) => (share: number) => string;
@@ -0,0 +1,146 @@
1
+ import { compactUnits as e, localeLabels as t, numberFormat as n, resolveLocale as r } from "../locale.js";
2
+ //#region src/engine/shapes/labels.ts
3
+ var i = {
4
+ en: {
5
+ noData: "No data",
6
+ value: "Value",
7
+ share: "Share",
8
+ ofFirstStage: "Of first stage",
9
+ conversion: "Conversion",
10
+ ofRange: "Of range",
11
+ ofName: "Of {name}",
12
+ incoming: "Incoming",
13
+ outgoing: "Outgoing",
14
+ max: "Max",
15
+ progress: "Progress",
16
+ target: "Target",
17
+ ofTarget: "Of target",
18
+ range: "Range",
19
+ series: "Series {index}",
20
+ pieChart: "Pie chart",
21
+ donutChart: "Donut chart",
22
+ roseChart: "Rose chart",
23
+ radarChart: "Radar chart",
24
+ gaugeChart: "Gauge",
25
+ gaugeChartNamed: "Gauge: {label}",
26
+ funnelChart: "Funnel chart",
27
+ treemapChart: "Treemap",
28
+ sankeyChart: "Sankey diagram",
29
+ sunburstChart: "Sunburst chart",
30
+ radialBarChart: "Radial bar chart",
31
+ calendarHeatmap: "Calendar heatmap",
32
+ bulletChart: "Bullet chart"
33
+ },
34
+ zh: {
35
+ noData: "暂无数据",
36
+ value: "数值",
37
+ share: "占比",
38
+ ofFirstStage: "占首阶段",
39
+ conversion: "转化率",
40
+ ofRange: "占量程",
41
+ ofName: "占{name}",
42
+ incoming: "流入",
43
+ outgoing: "流出",
44
+ max: "最大值",
45
+ progress: "进度",
46
+ target: "目标",
47
+ ofTarget: "目标达成",
48
+ range: "区间",
49
+ series: "系列 {index}",
50
+ pieChart: "饼图",
51
+ donutChart: "环形图",
52
+ roseChart: "玫瑰图",
53
+ radarChart: "雷达图",
54
+ gaugeChart: "仪表盘",
55
+ gaugeChartNamed: "仪表盘:{label}",
56
+ funnelChart: "漏斗图",
57
+ treemapChart: "矩形树图",
58
+ sankeyChart: "桑基图",
59
+ sunburstChart: "旭日图",
60
+ radialBarChart: "径向条形图",
61
+ calendarHeatmap: "日历热力图",
62
+ bulletChart: "子弹图"
63
+ },
64
+ ja: {
65
+ noData: "データなし",
66
+ value: "値",
67
+ share: "割合",
68
+ ofFirstStage: "初段階比",
69
+ conversion: "転換率",
70
+ ofRange: "範囲比",
71
+ ofName: "{name}比",
72
+ incoming: "流入",
73
+ outgoing: "流出",
74
+ max: "最大",
75
+ progress: "進捗",
76
+ target: "目標",
77
+ ofTarget: "目標達成率",
78
+ range: "範囲",
79
+ series: "系列 {index}",
80
+ pieChart: "円グラフ",
81
+ donutChart: "ドーナツグラフ",
82
+ roseChart: "鶏頭図",
83
+ radarChart: "レーダーチャート",
84
+ gaugeChart: "ゲージ",
85
+ gaugeChartNamed: "ゲージ:{label}",
86
+ funnelChart: "ファネルチャート",
87
+ treemapChart: "ツリーマップ",
88
+ sankeyChart: "サンキー図",
89
+ sunburstChart: "サンバースト図",
90
+ radialBarChart: "円形棒グラフ",
91
+ calendarHeatmap: "カレンダーヒートマップ",
92
+ bulletChart: "ブレットグラフ"
93
+ },
94
+ fr: {
95
+ noData: "Aucune donnée",
96
+ value: "Valeur",
97
+ share: "Part",
98
+ ofFirstStage: "Part de la 1re étape",
99
+ conversion: "Conversion",
100
+ ofRange: "Part de la plage",
101
+ ofName: "Part de {name}",
102
+ incoming: "Entrées",
103
+ outgoing: "Sorties",
104
+ max: "Max",
105
+ progress: "Progression",
106
+ target: "Objectif",
107
+ ofTarget: "Atteinte de l’objectif",
108
+ range: "Plage",
109
+ series: "Série {index}",
110
+ pieChart: "Graphique circulaire",
111
+ donutChart: "Graphique en anneau",
112
+ roseChart: "Diagramme de Nightingale",
113
+ radarChart: "Graphique radar",
114
+ gaugeChart: "Jauge",
115
+ gaugeChartNamed: "Jauge : {label}",
116
+ funnelChart: "Graphique en entonnoir",
117
+ treemapChart: "Treemap",
118
+ sankeyChart: "Diagramme de Sankey",
119
+ sunburstChart: "Diagramme en rayons de soleil",
120
+ radialBarChart: "Graphique à barres radiales",
121
+ calendarHeatmap: "Calendrier thermique",
122
+ bulletChart: "Graphique à puces"
123
+ }
124
+ }, a = (e) => t(i, e.locale, e.texts), o = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), s = (t) => {
125
+ let i = r(t), a = e(i);
126
+ return (e) => {
127
+ if (!Number.isFinite(e)) return String(e);
128
+ if (Object.is(e, -0) || e === 0) return "0";
129
+ let t = Math.abs(e);
130
+ for (let [r, o] of a) if (t >= r) return n(i, { maximumFractionDigits: 2 }).format(e / r) + o;
131
+ if (t < 1e-4) return e.toExponential(1);
132
+ let r = Math.floor(Math.log10(t) + 1e-9), o = Math.min(6, Math.max(0, -r) + 2);
133
+ return n(i, { maximumFractionDigits: o }).format(e);
134
+ };
135
+ }, c = (e) => {
136
+ let t = r(e);
137
+ return (e) => Number.isFinite(e) ? n(t, {
138
+ style: "percent",
139
+ minimumFractionDigits: 1,
140
+ maximumFractionDigits: 1
141
+ }).format(e) : "–";
142
+ };
143
+ //#endregion
144
+ export { i as SHAPE_LABELS, o as interpolate, s as localeFormat, c as localePercent, a as shapeLabels };
145
+
146
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","names":["SHAPE_LABELS","shapeLabels","localeLabels","o","interpolate","template","key","values","all","localeFormat","tag","resolveLocale","locale","units","compactUnits","value","abs","unit","suffix","numberFormat","magnitude","decimals","localePercent","share"],"sources":["../../../../../charts/src/engine/shapes/labels.ts"],"sourcesContent":["// Language of the shape charts: built-in texts (tooltip rows, accessible\n// names, \"No data\") and locale-aware number / percent formatting. The locale\n// is resolved on every layout, so a page language switch followed by a\n// re-render updates the texts.\n\nimport {\n compactUnits,\n localeLabels,\n numberFormat,\n resolveLocale,\n type LabelDictionary,\n} from \"../locale\";\nimport type { ShapeChartLabels, ShapeChartOptions } from \"./types\";\n\nexport const SHAPE_LABELS: LabelDictionary<ShapeChartLabels> = {\n en: {\n noData: \"No data\",\n value: \"Value\",\n share: \"Share\",\n ofFirstStage: \"Of first stage\",\n conversion: \"Conversion\",\n ofRange: \"Of range\",\n ofName: \"Of {name}\",\n incoming: \"Incoming\",\n outgoing: \"Outgoing\",\n max: \"Max\",\n progress: \"Progress\",\n target: \"Target\",\n ofTarget: \"Of target\",\n range: \"Range\",\n series: \"Series {index}\",\n pieChart: \"Pie chart\",\n donutChart: \"Donut chart\",\n roseChart: \"Rose chart\",\n radarChart: \"Radar chart\",\n gaugeChart: \"Gauge\",\n gaugeChartNamed: \"Gauge: {label}\",\n funnelChart: \"Funnel chart\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Sankey diagram\",\n sunburstChart: \"Sunburst chart\",\n radialBarChart: \"Radial bar chart\",\n calendarHeatmap: \"Calendar heatmap\",\n bulletChart: \"Bullet chart\",\n },\n zh: {\n noData: \"暂无数据\",\n value: \"数值\",\n share: \"占比\",\n ofFirstStage: \"占首阶段\",\n conversion: \"转化率\",\n ofRange: \"占量程\",\n ofName: \"占{name}\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大值\",\n progress: \"进度\",\n target: \"目标\",\n ofTarget: \"目标达成\",\n range: \"区间\",\n series: \"系列 {index}\",\n pieChart: \"饼图\",\n donutChart: \"环形图\",\n roseChart: \"玫瑰图\",\n radarChart: \"雷达图\",\n gaugeChart: \"仪表盘\",\n gaugeChartNamed: \"仪表盘:{label}\",\n funnelChart: \"漏斗图\",\n treemapChart: \"矩形树图\",\n sankeyChart: \"桑基图\",\n sunburstChart: \"旭日图\",\n radialBarChart: \"径向条形图\",\n calendarHeatmap: \"日历热力图\",\n bulletChart: \"子弹图\",\n },\n ja: {\n noData: \"データなし\",\n value: \"値\",\n share: \"割合\",\n ofFirstStage: \"初段階比\",\n conversion: \"転換率\",\n ofRange: \"範囲比\",\n ofName: \"{name}比\",\n incoming: \"流入\",\n outgoing: \"流出\",\n max: \"最大\",\n progress: \"進捗\",\n target: \"目標\",\n ofTarget: \"目標達成率\",\n range: \"範囲\",\n series: \"系列 {index}\",\n pieChart: \"円グラフ\",\n donutChart: \"ドーナツグラフ\",\n roseChart: \"鶏頭図\",\n radarChart: \"レーダーチャート\",\n gaugeChart: \"ゲージ\",\n gaugeChartNamed: \"ゲージ:{label}\",\n funnelChart: \"ファネルチャート\",\n treemapChart: \"ツリーマップ\",\n sankeyChart: \"サンキー図\",\n sunburstChart: \"サンバースト図\",\n radialBarChart: \"円形棒グラフ\",\n calendarHeatmap: \"カレンダーヒートマップ\",\n bulletChart: \"ブレットグラフ\",\n },\n fr: {\n noData: \"Aucune donnée\",\n value: \"Valeur\",\n share: \"Part\",\n ofFirstStage: \"Part de la 1re étape\",\n conversion: \"Conversion\",\n ofRange: \"Part de la plage\",\n ofName: \"Part de {name}\",\n incoming: \"Entrées\",\n outgoing: \"Sorties\",\n max: \"Max\",\n progress: \"Progression\",\n target: \"Objectif\",\n ofTarget: \"Atteinte de l’objectif\",\n range: \"Plage\",\n series: \"Série {index}\",\n pieChart: \"Graphique circulaire\",\n donutChart: \"Graphique en anneau\",\n roseChart: \"Diagramme de Nightingale\",\n radarChart: \"Graphique radar\",\n gaugeChart: \"Jauge\",\n gaugeChartNamed: \"Jauge : {label}\",\n funnelChart: \"Graphique en entonnoir\",\n treemapChart: \"Treemap\",\n sankeyChart: \"Diagramme de Sankey\",\n sunburstChart: \"Diagramme en rayons de soleil\",\n radialBarChart: \"Graphique à barres radiales\",\n calendarHeatmap: \"Calendrier thermique\",\n bulletChart: \"Graphique à puces\",\n },\n};\n\n/** Texts of a chart: its `locale` (the page language by default) and `texts` overrides */\nexport const shapeLabels = (\n o: Pick<ShapeChartOptions, \"locale\" | \"texts\">,\n): ShapeChartLabels => localeLabels(SHAPE_LABELS, o.locale, o.texts);\n\n/** Replaces the `{key}` placeholders of a text */\nexport const interpolate = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (all, key: string) =>\n key in values ? String(values[key]) : all,\n );\n\n/**\n * Compact number of a locale: `1.23k` / `12.3万` / `1,2 k`; small values\n * keep enough decimals to be told apart\n */\nexport const localeFormat = (locale?: string) => {\n const tag = resolveLocale(locale);\n const units = compactUnits(tag);\n return (value: number): string => {\n if (!Number.isFinite(value)) return String(value);\n if (Object.is(value, -0) || value === 0) return \"0\";\n const abs = Math.abs(value);\n for (const [unit, suffix] of units)\n if (abs >= unit)\n return (\n numberFormat(tag, { maximumFractionDigits: 2 }).format(value / unit) +\n suffix\n );\n if (abs < 1e-4) return value.toExponential(1);\n // at least two decimals, two more than the magnitude (0.0123, 1.25)\n const magnitude = Math.floor(Math.log10(abs) + 1e-9);\n const decimals = Math.min(6, Math.max(0, -magnitude) + 2);\n return numberFormat(tag, { maximumFractionDigits: decimals }).format(value);\n };\n};\n\n/** Share 0-1 as a locale percent with one decimal: `40.0%`, `40,0 %` */\nexport const localePercent = (locale?: string) => {\n const tag = resolveLocale(locale);\n return (share: number): string =>\n Number.isFinite(share)\n ? numberFormat(tag, {\n style: \"percent\",\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(share)\n : \"–\";\n};\n"],"mappings":";;AAcA,IAAaA,IAAkD;CAC7D,IAAI;EACF,QAAQ;EACR,OAAO;EACP,OAAO;EACP,cAAc;EACd,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,KAAK;EACL,UAAU;EACV,QAAQ;EACR,UAAU;EACV,OAAO;EACP,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,iBAAi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AAOC,IAAS,OAAOA,EAAOD,EAAI,IAAIE,CACxC,GAMWC,KAAgB,MAAoB;CAC/C,IAAMC,IAAMC,EAAcC,CAAM,GAC1BC,IAAQC,EAAaJ,CAAG;CAC9B,QAAQ,MAA0B;EAChC,IAAI,CAAC,OAAO,SAASK,CAAK,GAAG,OAAO,OAAOA,CAAK;EAChD,IAAI,OAAO,GAAGA,GAAO,EAAE,KAAKA,MAAU,GAAG,OAAO;EAChD,IAAMC,IAAM,KAAK,IAAID,CAAK;EAC1B,KAAK,IAAM,CAACE,GAAMC,MAAWL,GAC3B,IAAIG,KAAOC,GACT,OACEE,EAAaT,GAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,OAAOK,IAAQE,CAAI,IACnEC;EAEN,IAAIF,IAAM,MAAM,OAAOD,EAAM,cAAc,CAAC;EAE5C,IAAMK,IAAY,KAAK,MAAM,KAAK,MAAMJ,CAAG,IAAI,IAAI,GAC7CK,IAAW,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAACD,CAAS,IAAI,CAAC;EACxD,OAAOD,EAAaT,GAAK,EAAE,uBAAuBW,EAAS,CAAC,CAAC,CAAC,OAAON,CAAK;CAC5E;AACF,GAGaO,KAAiB,MAAoB;CAChD,IAAMZ,IAAMC,EAAcC,CAAM;CAChC,QAAQ,MACN,OAAO,SAASW,CAAK,IACjBJ,EAAaT,GAAK;EAChB,OAAO;EACP,uBAAuB;EACvB,uBAAuB;CACzB,CAAC,CAAC,CAAC,OAAOa,CAAK,IACf;AACR"}
@@ -1,3 +1,3 @@
1
- const e=require("../color.cjs"),t=require("../overlay.cjs"),n=require("./scene.cjs"),r=require("./funnel.cjs"),i=require("./gauge.cjs"),a=require("./pie.cjs"),o=require("./radar.cjs"),s=require("./treemap.cjs");var c=new Set,l=e=>{let{options:t,theme:l,width:u,height:d}=e,f=e.bounds??{x:0,y:0,width:u,height:d},p=e.from??null,m=n.clamp(e.t??1,0,1),h=l.palette.length?l.palette:[l.primary],g={theme:l,measure:e.measure,hidden:e.hidden??c,enter:n.clamp(e.enter??1,0,1),value:(e,t)=>{if(!p||m>=1)return t;let n=p.get(e)??0;return n+(t-n)*m},format:t.format??n.defaultFormat,percent:t.percentFormat??n.formatPercent,color:(e,t)=>n.resolveWith(l,e,h[t%h.length]),area:n.inset(f,t.padding)},_;switch(t.type){case`pie`:_=a.layoutPie(t,g);break;case`radar`:_=o.layoutRadar(t,g);break;case`gauge`:_=i.layoutGauge(t,g);break;case`funnel`:_=r.layoutFunnel(t,g);break;default:_=s.layoutTreemap(t,g)}return{type:t.type,width:u,height:d,..._}},u=(e,t=c)=>{let n=new Map;switch(e.type){case`pie`:a.pieValues(e,t,n);break;case`radar`:o.radarValues(e,t,n);break;case`gauge`:i.gaugeValues(e,t,n);break;case`funnel`:r.funnelValues(e,t,n);break;default:s.treemapValues(e,t,n)}return n},d=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=e.get(i)??0;r.set(i,a+(t-a)*n)}),r},f=(e,t)=>{if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(e===void 0||Math.abs(e-r)>1e-12)return!1}return!0},p=e=>{let t=typeof e.legend==`object`?e.legend:{};return{position:t.position??`bottom`,toggle:t.toggle??!0}},m=(t,i,a=c)=>{if(t.legend===!1)return null;let s=i.palette.length?i.palette:[i.primary],l=(t,r)=>e.toCss(n.resolveWith(i,t,s[r%s.length])),u=[],d=t.legend!==void 0;switch(t.type){case`pie`:d=!0,u=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:a.has(t)}));break;case`funnel`:d=!0,u=r.funnelOrder(t,c).map(e=>({index:e,name:t.data[e].name,color:l(t.data[e].color,e),hidden:a.has(e)}));break;case`radar`:d||(d=t.series.length>1),u=t.series.map((e,n)=>({index:n,name:o.seriesName(t,n),color:l(e.color,n),hidden:a.has(n)}));break;case`treemap`:u=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:a.has(t)}))}return d&&u.length?u:null},h=e=>e.type===`radar`?e.series.length:e.type===`gauge`?0:e.data.length,g=(e,t)=>{if(!t)return null;let r=e.items.find(e=>e.index===t.index);if(!r)return null;if(r.indicators){let e=n.clamp(t.indicator??0,0,r.indicators.length-1),i=r.indicators[e];return{index:r.index,indicator:e,name:r.name,value:i.value,percent:i.percent,color:r.color}}return{index:r.index,name:r.name,value:r.value,percent:r.percent,color:r.color,...r.path?{path:r.path}:{}}},_=(e,t)=>e===t||!!e&&!!t&&e.index===t.index&&e.indicator===t.indicator,v=(e,t)=>{let n=e.items.find(e=>e.index===t.index);if(!n)return null;let r=n.indicators?n.rows.map((e,n)=>n===(t.indicator??-1)?{...e,strong:!0}:e):n.rows;return{title:n.path?n.path.join(` / `):n.name,color:n.color,rows:r}},y=(e,t)=>{let r=e.items.find(e=>e.index===t.index);if(!r)return``;if(r.indicators){let e=n.clamp(t.indicator??0,0,r.indicators.length-1);return`${r.name}, ${r.indicators[e].name}: ${r.rows[e]?.value??r.indicators[e].value}`}return`${r.path?r.path.join(` / `):r.name}: ${r.rows[0]?.value??r.value} (${r.share??n.formatPercent(r.percent)})`},b=e=>{switch(e.type){case`pie`:return e.rose?`Rose chart`:(e.innerRadius??0)>0?`Donut chart`:`Pie chart`;case`radar`:return`Radar chart`;case`gauge`:return e.label?`Gauge: ${e.label}`:`Gauge`;case`funnel`:return`Funnel chart`;default:return`Treemap`}},x=e=>e.empty?`No data`:e.items.slice(0,12).map(t=>t.indicators?`${t.name}: ${t.indicators.map((e,n)=>`${e.name} ${t.rows[n]?.value??e.value}`).join(`, `)}`:y(e,{index:t.index})).join(`; `),S=20,C=(e,n,r,i,a,o)=>{let s=t.font(a,12),c=[[]],l=0;for(let t of e){let e=Math.min(n-8,16+o(t.name,s)),r=c[c.length-1];r.length&&l+14+e>n-8&&(c.push(r=[]),l=0),r.length&&(l+=14),r.push({...t,x:l,y:0,width:e,height:S}),l+=e}let u=c.length*S+8,d=r===`top`?2:i-u+6,f=[];return c.forEach((e,t)=>{let r=e[e.length-1],i=(n-(r?r.x+r.width:0))/2;for(let n of e)f.push({...n,x:n.x+i,y:d+t*S})}),{boxes:f,height:u}},w=6,T=14,E=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y)),D=(e,t,n,r,i,a,o)=>{let s=w,c=(e,t)=>({x:Math.max(s,Math.min(e,a-r-s)),y:Math.max(s,Math.min(t,o-i-s))}),{x:l,y:u}=n,d=e?.radar;if(!d||!e||!t){let e=l+16;return e+r>a-s&&(e=l-16-r),c(e,u-i/2)}let f=[[l,u]],p=e.items.find(e=>e.index===t.index),m=p?.indicators&&t.indicator!==void 0?p.indicators[t.indicator]:void 0;m&&f.push([m.x,m.y]);let h=d.labels??[],g=l-d.cx,_=u-d.cy,v=Math.hypot(g,_);v>1?(g/=v,_/=v):(g=1,_=0);let y=T,b=[[l+y,u-i/2],[l-y-r,u-i/2],[l-r/2,u-y-i],[l-r/2,u+y],[l+y,u-y-i],[l+y,u+y],[l-y-r,u-y-i],[l-y-r,u+y]],x=c(b[0][0],b[0][1]),S=1/0;for(let[e,t]of b){let n=c(e,t),a={x:n.x,y:n.y,width:r,height:i},o=0;for(let[e,t]of f)e>a.x-8&&e<a.x+r+8&&t>a.y-8&&t<a.y+i+8&&(o+=1e6);for(let e of h)o+=E(a,e)*4;let s=n.x+r/2-l,d=n.y+i/2-u,p=Math.hypot(s,d)||1;o+=p*.5,o-=(s*g+d*_)/p*40,o+=Math.abs(n.x-e)+Math.abs(n.y-t),o<S&&(S=o,x=n)}return x},O=(e,n,r,i,a,o,s,c=null,l=null)=>{let u=0,d,f,p;if(typeof e==`string`){p=e.split(`
2
- `);let n=t.font(o,12);for(let e of p)u=Math.max(u,s(e,n));d=p.length}else{f=e,u=(e.color?14:0)+s(e.title,t.font(o,12,600));for(let n of e.rows)u=Math.max(u,(n.color?14:0)+s(n.name,t.font(o,12))+16+s(n.value,t.font(o,12,600)));d=1+e.rows.length}let m=Math.max(96,Math.ceil(u+18+4)),h=d*18+18,{x:g,y:_}=D(c,l,{x:n,y:r},m,h,i,a);return{x:g,y:_,width:m,height:h,padding:9,lineHeight:18,...f?{content:f}:{},...p?{text:p}:{}}};exports.blendValues=d,exports.describeChart=b,exports.describeItem=y,exports.describeScene=x,exports.hoverEvent=g,exports.layoutShapeLegend=C,exports.layoutShapeScene=l,exports.layoutShapeTooltip=O,exports.legendConfig=p,exports.placeShapeTooltip=D,exports.sameHover=_,exports.sameValues=f,exports.shapeLegend=m,exports.shapeValues=u,exports.toggleCount=h,exports.tooltipContent=v;
1
+ const e=require("../color.cjs"),t=require("../locale.cjs"),n=require("../overlay.cjs"),r=require("./labels.cjs"),i=require("./scene.cjs"),a=require("./calendar.cjs"),o=require("./bullet.cjs"),s=require("./funnel.cjs"),c=require("./gauge.cjs"),l=require("./pie.cjs"),u=require("./radar.cjs"),d=require("./radialBar.cjs"),f=require("./sankey.cjs"),p=require("./sunburst.cjs"),m=require("./treemap.cjs");var h=new Set,g=[],_=e=>{let{options:n,theme:_,width:v,height:y}=e,b=e.bounds??{x:0,y:0,width:v,height:y},x=e.from??null,S=i.clamp(e.t??1,0,1),C=_.palette.length?_.palette:[_.primary],w=t.resolveLocale(n.locale),T=r.shapeLabels(n),E={theme:_,measure:e.measure,hidden:e.hidden??h,enter:i.clamp(e.enter??1,0,1),value:(e,t)=>{if(!x||S>=1)return t;let n=x.get(e)??0;return n+(t-n)*S},format:n.format??r.localeFormat(w),percent:n.percentFormat??r.localePercent(w),labels:T,locale:w,color:(e,t)=>i.resolveWith(_,e,C[t%C.length]),area:i.inset(b,n.padding),focus:e.focus??g},D;switch(n.type){case`pie`:D=l.layoutPie(n,E);break;case`radar`:D=u.layoutRadar(n,E);break;case`gauge`:D=c.layoutGauge(n,E);break;case`funnel`:D=s.layoutFunnel(n,E);break;case`sankey`:D=f.layoutSankey(n,E);break;case`sunburst`:D=p.layoutSunburst(n,E);break;case`radialBar`:D=d.layoutRadialBar(n,E);break;case`calendarHeatmap`:D=a.layoutCalendar(n,E);break;case`bullet`:D=o.layoutBullet(n,E);break;default:D=m.layoutTreemap(n,E)}return{type:n.type,width:v,height:y,labels:T,locale:w,...D}},v=(e,t=h,n=g)=>{let r=new Map;switch(e.type){case`pie`:l.pieValues(e,t,r);break;case`radar`:u.radarValues(e,t,r);break;case`gauge`:c.gaugeValues(e,t,r);break;case`funnel`:s.funnelValues(e,t,r);break;case`sankey`:f.sankeyValues(e,t,r);break;case`sunburst`:p.sunburstValues(e,t,n,r);break;case`radialBar`:d.radialBarValues(e,t,r);break;case`calendarHeatmap`:a.calendarValues(e,t,r);break;case`bullet`:o.bulletValues(e,t,r);break;default:m.treemapValues(e,t,r)}return r},y=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=e.get(i)??0;r.set(i,a+(t-a)*n)}),r},b=(e,t)=>{if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(e===void 0||Math.abs(e-r)>1e-12)return!1}return!0},x=e=>{let t=typeof e.legend==`object`?e.legend:{};return{position:t.position??`bottom`,toggle:t.toggle??!0}},S=(t,n,o=h)=>{if(t.legend===!1)return null;let c=n.palette.length?n.palette:[n.primary],l=(t,r)=>e.toCss(i.resolveWith(n,t,c[r%c.length])),p=[],m=t.legend!==void 0;switch(t.type){case`pie`:m=!0,p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`funnel`:m=!0,p=s.funnelOrder(t,h).map(e=>({index:e,name:t.data[e].name,color:l(t.data[e].color,e),hidden:o.has(e)}));break;case`radar`:m||(m=t.series.length>1),p=t.series.map((e,n)=>({index:n,name:u.seriesName(t,n,r.shapeLabels(t)),color:l(e.color,n),hidden:o.has(n)}));break;case`treemap`:case`sunburst`:p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`radialBar`:m||(m=!d.radialBarLabels(t)),p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`bullet`:p=t.data.map((e,t)=>({index:t,name:e.name,color:l(e.color,t),hidden:o.has(t)}));break;case`sankey`:{let e=f.resolveSankey(t);p=e.names.map((t,n)=>({index:n,name:t,color:l(e.colors[n],n),hidden:o.has(n)}));break}case`calendarHeatmap`:m=!0,p=a.calendarLegend(t,n,o)}return m&&p.length?p:null},C=e=>{switch(e.type){case`radar`:return e.series.length;case`gauge`:return 0;case`sankey`:return f.resolveSankey(e).names.length;case`calendarHeatmap`:return a.calendarModel(e)?.count??0;default:return e.data.length}},w=(e,t)=>{if(!t)return null;let n=e.items.find(e=>e.index===t.index);if(!n)return null;if(n.indicators){let e=i.clamp(t.indicator??0,0,n.indicators.length-1),r=n.indicators[e];return{index:n.index,indicator:e,name:n.name,value:r.value,percent:r.percent,color:n.color}}return{index:n.index,name:n.name,value:n.value,percent:n.percent,color:n.color,...n.path?{path:n.path}:{},...n.event}},T=(e,t)=>e===t||!!e&&!!t&&e.index===t.index&&e.indicator===t.indicator,E=(e,t)=>{let n=e.items.find(e=>e.index===t.index);if(!n)return null;let r=n.indicators?n.rows.map((e,n)=>n===(t.indicator??-1)?{...e,strong:!0}:e):n.rows;return{title:n.path?n.path.join(` / `):n.name,color:n.color,rows:r}},D=(e,t)=>{let n=e.items.find(e=>e.index===t.index);if(!n)return``;if(n.indicators){let e=i.clamp(t.indicator??0,0,n.indicators.length-1);return`${n.name}, ${n.indicators[e].name}: ${n.rows[e]?.value??n.indicators[e].value}`}return`${n.path?n.path.join(` / `):n.name}: ${n.rows[0]?.value??n.value} (${n.share??r.localePercent(e.locale)(n.percent)})`},O=e=>{let t=r.shapeLabels(e);switch(e.type){case`pie`:return e.rose?t.roseChart:(e.innerRadius??0)>0?t.donutChart:t.pieChart;case`radar`:return t.radarChart;case`gauge`:return e.label?r.interpolate(t.gaugeChartNamed,{label:e.label}):t.gaugeChart;case`funnel`:return t.funnelChart;case`sankey`:return t.sankeyChart;case`sunburst`:return t.sunburstChart;case`radialBar`:return t.radialBarChart;case`calendarHeatmap`:return t.calendarHeatmap;case`bullet`:return t.bulletChart;default:return t.treemapChart}},k=e=>e.empty?(e.labels??r.SHAPE_LABELS.en).noData:e.items.slice(0,12).map(t=>t.indicators?`${t.name}: ${t.indicators.map((e,n)=>`${e.name} ${t.rows[n]?.value??e.value}`).join(`, `)}`:D(e,{index:t.index})).join(`; `),A=20,j=(e,t,r,i,a,o)=>{let s=n.font(a,12),c=[[]],l=0;for(let n of e){let e=Math.min(t-8,16+o(n.name,s)),r=c[c.length-1];r.length&&l+14+e>t-8&&(c.push(r=[]),l=0),r.length&&(l+=14),r.push({...n,x:l,y:0,width:e,height:A}),l+=e}let u=c.length*A+8,d=r===`top`?2:i-u+6,f=[];return c.forEach((e,n)=>{let r=e[e.length-1],i=(t-(r?r.x+r.width:0))/2;for(let t of e)f.push({...t,x:t.x+i,y:d+n*A})}),{boxes:f,height:u}},M=6,N=14,P=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y)),F=(e,t,n,r,i,a,o)=>{let s=M,c=(e,t)=>({x:Math.max(s,Math.min(e,a-r-s)),y:Math.max(s,Math.min(t,o-i-s))}),{x:l,y:u}=n,d=e?.radar;if(!d||!e||!t){let e=l+16;return e+r>a-s&&(e=l-16-r),c(e,u-i/2)}let f=[[l,u]],p=e.items.find(e=>e.index===t.index),m=p?.indicators&&t.indicator!==void 0?p.indicators[t.indicator]:void 0;m&&f.push([m.x,m.y]);let h=d.labels??[],g=l-d.cx,_=u-d.cy,v=Math.hypot(g,_);v>1?(g/=v,_/=v):(g=1,_=0);let y=N,b=[[l+y,u-i/2],[l-y-r,u-i/2],[l-r/2,u-y-i],[l-r/2,u+y],[l+y,u-y-i],[l+y,u+y],[l-y-r,u-y-i],[l-y-r,u+y]],x=c(b[0][0],b[0][1]),S=1/0;for(let[e,t]of b){let n=c(e,t),a={x:n.x,y:n.y,width:r,height:i},o=0;for(let[e,t]of f)e>a.x-8&&e<a.x+r+8&&t>a.y-8&&t<a.y+i+8&&(o+=1e6);for(let e of h)o+=P(a,e)*4;let s=n.x+r/2-l,d=n.y+i/2-u,p=Math.hypot(s,d)||1;o+=p*.5,o-=(s*g+d*_)/p*40,o+=Math.abs(n.x-e)+Math.abs(n.y-t),o<S&&(S=o,x=n)}return x},I=(e,t,r,i,a,o,s,c=null,l=null)=>{let u=0,d,f,p;if(typeof e==`string`){p=e.split(`
2
+ `);let t=n.font(o,12);for(let e of p)u=Math.max(u,s(e,t));d=p.length}else{f=e,u=(e.color?14:0)+s(e.title,n.font(o,12,600));for(let t of e.rows)u=Math.max(u,(t.color?14:0)+s(t.name,n.font(o,12))+16+s(t.value,n.font(o,12,600)));d=1+e.rows.length}let m=Math.max(96,Math.ceil(u+18+4)),h=d*18+18,{x:g,y:_}=F(c,l,{x:t,y:r},m,h,i,a);return{x:g,y:_,width:m,height:h,padding:9,lineHeight:18,...f?{content:f}:{},...p?{text:p}:{}}};exports.blendValues=y,exports.describeChart=O,exports.describeItem=D,exports.describeScene=k,exports.hoverEvent=w,exports.layoutShapeLegend=j,exports.layoutShapeScene=_,exports.layoutShapeTooltip=I,exports.legendConfig=x,exports.placeShapeTooltip=F,exports.sameHover=T,exports.sameValues=b,exports.shapeLegend=S,exports.shapeValues=v,exports.toggleCount=C,exports.tooltipContent=E;
3
3
  //# sourceMappingURL=layout.cjs.map