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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","names":["DAY_MS","MAX_DAYS","localDay","date","calendarDay","d","m","t","ymd","day","dayOfYmd","y","pad2","n","calendarIso","weekdayOf","monthsOf","out","from","to","runtimeLocale","SUNDAY","SATURDAY","LANGUAGE_REGION","localeWeekStart","tag","locale","region","language","Locale","loc","info","FORMATS","formatter","key","options","f","EN_MONTHS","EN_DAYS","format","fallback","monthName","weekdayName","width","wd","dateName","calendarModel","raw","first","last","o","positive","start","end","range","a","b","weekStart","finiteWeekStart","values","max","integer","v","count","clamp","finite","thresholds","given","k","resolveLocale","calendarLevel","model","span","calendarLevelNames","localeFormat","names","fmt","lo","emptyColor","mix","theme","calendarColors","palette","base","resolveWith","own","calendarValues","calendarLegend","colors","toCss","hidden","calendarStrips","y0","y1","HEADER","STRIP_GAP","BLOCK_GAP","layoutCalendar","c","emptyLayout","row","gapOpt","months","maxCell","labelFont","font","muted","nodes","cells","size","pitchOf","list","head","best","cols","rows","byWidth","area","byHeight","pitch","gap","blockW","blockH","totalW","totalH","left","top","withYear","titleFont","narrow","r","bx","hy","nm","lead","offset","strips","colOf","s","ncols","st","header","allRows","dayNames","gutter","measure","yearFont","showRow","gridTop","labels","col","lastEnd","x","lb","w","next","empty","vis","radius","outline","hitPad","items","cell","level","fill","css","index","percent","enter"],"sources":["../../../../../charts/src/engine/shapes/calendar.ts"],"sourcesContent":["// Calendar heatmap layout: one cell per day, colored by level. `weeks`: a\n// column per week and a row per weekday (a strip per year for long ranges);\n// `months`: a small calendar per month. Days are UTC day numbers, so that\n// daylight-saving changes never shift a cell; month / weekday names and the\n// first day of the week come from `Intl` (with fallbacks).\n\nimport { mix, toCss, type Rgba } from \"../color\";\nimport { resolveLocale } from \"../locale\";\nimport { font } from \"../overlay\";\nimport type { ChartTheme } from \"../theme\";\nimport { localeFormat } from \"./labels\";\nimport {\n clamp,\n emptyLayout,\n finite,\n positive,\n resolveWith,\n type LayoutContext,\n type LayoutResult,\n type ShapeItem,\n type ShapeLegendEntry,\n type ShapeNode,\n} from \"./scene\";\nimport type { CalendarDate, CalendarHeatmapOptions } from \"./types\";\n\nconst DAY_MS = 86400000;\n/** Longest range drawn, in days (about 10 years) */\nconst MAX_DAYS = 3660;\n\nconst localDay = (date: Date) =>\n Math.floor(\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / DAY_MS,\n );\n\n/** Day number (days since 1970-01-01) of a date; `null` when invalid */\nexport const calendarDay = (d: CalendarDate): number | null => {\n if (typeof d === \"string\") {\n const m = /^\\s*(\\d{4})-(\\d{1,2})-(\\d{1,2})/.exec(d);\n if (m) {\n const t = Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]));\n return Number.isFinite(t) ? Math.floor(t / DAY_MS) : null;\n }\n const t = Date.parse(d);\n return Number.isFinite(t) ? localDay(new Date(t)) : null;\n }\n if (typeof d === \"number\")\n return Number.isFinite(d) ? localDay(new Date(d)) : null;\n if (d instanceof Date)\n return Number.isFinite(d.getTime()) ? localDay(d) : null;\n return null;\n};\n\nconst ymd = (day: number) => {\n const date = new Date(day * DAY_MS);\n return {\n y: date.getUTCFullYear(),\n m: date.getUTCMonth(),\n d: date.getUTCDate(),\n };\n};\n\nconst dayOfYmd = (y: number, m: number, d: number) =>\n Math.floor(Date.UTC(y, m, d) / DAY_MS);\n\nconst pad2 = (n: number) => (n < 10 ? `0${n}` : String(n));\n\n/** `YYYY-MM-DD` of a day number */\nexport const calendarIso = (day: number) => {\n const { y, m, d } = ymd(day);\n return `${y}-${pad2(m + 1)}-${pad2(d)}`;\n};\n\n/** Day of the week, 0 = Sunday */\nconst weekdayOf = (day: number) => (((day + 4) % 7) + 7) % 7;\n\n/** Months (year, 0-based month) overlapping the days `from`-`to` */\nconst monthsOf = (from: number, to: number) => {\n const out: { y: number; m: number }[] = [];\n let { y, m } = ymd(from);\n while (dayOfYmd(y, m, 1) <= to) {\n out.push({ y, m });\n if (m === 11) {\n m = 0;\n y++;\n } else m++;\n }\n return out;\n};\n\n// ------------------------------------------------------------- locale\n\nconst runtimeLocale = () => {\n try {\n return new Intl.DateTimeFormat().resolvedOptions().locale;\n } catch {\n return \"en-US\";\n }\n};\n\n/** Regions whose weeks start on Sunday / Saturday (CLDR); Monday elsewhere */\nconst SUNDAY = new Set(\n \"AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW\".split(\n \" \",\n ),\n);\nconst SATURDAY = new Set(\n \"AE AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY\".split(\" \"),\n);\n/** Likely region of a language without one */\nconst LANGUAGE_REGION: Record<string, string> = {\n en: \"US\",\n ja: \"JP\",\n ko: \"KR\",\n he: \"IL\",\n pt: \"BR\",\n ar: \"EG\",\n fa: \"IR\",\n hi: \"IN\",\n th: \"TH\",\n zh: \"CN\",\n};\n\ninterface LocaleLike {\n language?: string;\n region?: string;\n weekInfo?: { firstDay?: number };\n getWeekInfo?: () => { firstDay?: number };\n maximize?: () => { region?: string };\n}\n\n/** First day of the week of a locale, 0 = Sunday */\nexport const localeWeekStart = (locale?: string): number => {\n const tag = locale || runtimeLocale();\n let region = \"\";\n let language = tag.split(/[-_]/)[0]?.toLowerCase() ?? \"\";\n try {\n const Locale = (\n Intl as unknown as { Locale?: new (tag: string) => LocaleLike }\n ).Locale;\n if (typeof Locale === \"function\") {\n const loc = new Locale(tag);\n const info =\n typeof loc.getWeekInfo === \"function\"\n ? loc.getWeekInfo()\n : loc.weekInfo;\n if (info && typeof info.firstDay === \"number\")\n return ((info.firstDay % 7) + 7) % 7;\n region = loc.region ?? loc.maximize?.().region ?? \"\";\n language = loc.language ?? language;\n }\n } catch {\n // invalid tag or no Intl.Locale: parse it by hand\n }\n if (!region) {\n const m = /[-_]([A-Za-z]{2})(?=$|[-_])/.exec(tag);\n region = m ? m[1].toUpperCase() : (LANGUAGE_REGION[language] ?? \"\");\n }\n return SUNDAY.has(region) ? 0 : SATURDAY.has(region) ? 6 : 1;\n};\n\nconst FORMATS = new Map<string, Intl.DateTimeFormat | null>();\n\n/** Cached UTC date formatter (`null` without a usable Intl) */\nconst formatter = (\n locale: string | undefined,\n options: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat | null => {\n const key = `${locale ?? \"\"}|${JSON.stringify(options)}`;\n if (FORMATS.has(key)) return FORMATS.get(key) ?? null;\n let f: Intl.DateTimeFormat | null = null;\n for (const tag of [locale, undefined]) {\n try {\n f = new Intl.DateTimeFormat(tag, { ...options, timeZone: \"UTC\" });\n break;\n } catch {\n f = null;\n }\n }\n if (FORMATS.size > 64) FORMATS.clear();\n FORMATS.set(key, f);\n return f;\n};\n\nconst EN_MONTHS = \"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\".split(\" \");\nconst EN_DAYS = \"Sun Mon Tue Wed Thu Fri Sat\".split(\" \");\n\nconst format = (\n locale: string | undefined,\n options: Intl.DateTimeFormatOptions,\n day: number,\n fallback: string,\n) => {\n const f = formatter(locale, options);\n try {\n return f ? f.format(new Date(day * DAY_MS)) : fallback;\n } catch {\n return fallback;\n }\n};\n\n/** Short month name */\nconst monthName = (locale: string | undefined, y: number, m: number) =>\n format(locale, { month: \"short\" }, dayOfYmd(y, m, 1), EN_MONTHS[m]);\n\n/** Weekday name (0 = Sunday) */\nconst weekdayName = (\n locale: string | undefined,\n wd: number,\n width: \"short\" | \"narrow\",\n) =>\n // 2023-01-01 is a Sunday\n format(\n locale,\n { weekday: width },\n dayOfYmd(2023, 0, 1 + wd),\n width === \"short\" ? EN_DAYS[wd] : EN_DAYS[wd].charAt(0),\n );\n\n/** Date of the tooltip */\nconst dateName = (locale: string | undefined, day: number) =>\n format(\n locale,\n { year: \"numeric\", month: \"short\", day: \"numeric\", weekday: \"short\" },\n day,\n calendarIso(day),\n );\n\n// -------------------------------------------------------------- model\n\nexport interface CalendarModel {\n /** First and last day shown (day numbers) */\n start: number;\n end: number;\n /** Sum of the values of each day of the range */\n values: Map<number, number>;\n max: number;\n /** Upper bounds of the levels but the last */\n thresholds: number[];\n /** Number of levels */\n count: number;\n /** Whether every value is an integer (level names \"3–5\" vs \"≤ 2.5\") */\n integer: boolean;\n}\n\n/** Days, values and levels of a calendar heatmap; `null` without days */\nexport const calendarModel = (\n o: CalendarHeatmapOptions,\n): CalendarModel | null => {\n const raw = new Map<number, number>();\n let first = Infinity;\n let last = -Infinity;\n for (const d of o.data ?? []) {\n if (!d) continue;\n const day = calendarDay(d.date);\n if (day === null) continue;\n raw.set(day, (raw.get(day) ?? 0) + positive(d.value));\n first = Math.min(first, day);\n last = Math.max(last, day);\n }\n let start: number;\n let end: number;\n const range = o.range;\n if (typeof range === \"number\" && Number.isFinite(range)) {\n const y = Math.round(range);\n start = dayOfYmd(y, 0, 1);\n end = dayOfYmd(y, 11, 31);\n } else if (Array.isArray(range) && range.length >= 2) {\n const a = calendarDay(range[0] as CalendarDate);\n const b = calendarDay(range[1] as CalendarDate);\n if (a === null || b === null) return null;\n start = Math.min(a, b);\n end = Math.max(a, b);\n } else {\n if (!Number.isFinite(last)) return null;\n end = last;\n // 53 columns: the 52 weeks before the week of the last day\n const weekStart = finiteWeekStart(o);\n const from = end - 52 * 7;\n start = from - ((weekdayOf(from) - weekStart + 7) % 7);\n }\n if (end - start + 1 > MAX_DAYS) start = end - MAX_DAYS + 1;\n const values = new Map<number, number>();\n let max = 0;\n let integer = true;\n raw.forEach((v, day) => {\n if (day < start || day > end) return;\n values.set(day, v);\n max = Math.max(max, v);\n if (!Number.isInteger(v)) integer = false;\n });\n let count = o.colors?.length\n ? Math.min(12, o.colors.length)\n : clamp(Math.round(finite(o.levels, 4)), 1, 12);\n let thresholds: number[];\n const given = (o.thresholds ?? [])\n .filter((t) => typeof t === \"number\" && Number.isFinite(t))\n .slice()\n .sort((a, b) => a - b);\n if (given.length) {\n thresholds = given.slice(0, count - 1);\n count = thresholds.length + 1;\n if (thresholds.some((t) => !Number.isInteger(t))) integer = false;\n } else {\n thresholds = [];\n for (let k = 1; k < count; k++) {\n const t = (max * k) / count;\n thresholds.push(integer ? Math.max(k, Math.ceil(t)) : t);\n }\n // strictly ascending\n for (let k = 1; k < thresholds.length; k++)\n if (thresholds[k] <= thresholds[k - 1])\n thresholds[k] = integer ? thresholds[k - 1] + 1 : thresholds[k - 1];\n }\n return { start, end, values, max, thresholds, count, integer };\n};\n\nconst finiteWeekStart = (o: CalendarHeatmapOptions) =>\n typeof o.weekStart === \"number\" && Number.isFinite(o.weekStart)\n ? ((Math.round(o.weekStart) % 7) + 7) % 7\n : localeWeekStart(resolveLocale(o.locale));\n\n/** Level of a value: -1 for the empty days */\nexport const calendarLevel = (model: CalendarModel, v: number) => {\n if (!(v > 0)) return -1;\n const { thresholds } = model;\n for (let k = 0; k < thresholds.length; k++) if (v <= thresholds[k]) return k;\n return model.count - 1;\n};\n\n/** `a–b`, the unit written once when both ends share it (`1–15 min`) */\nconst span = (a: string, b: string) => {\n let k = 0;\n while (\n k < a.length &&\n k < b.length &&\n a[a.length - 1 - k] === b[b.length - 1 - k] &&\n !/\\d/.test(a[a.length - 1 - k])\n )\n k++;\n return `${k ? a.slice(0, a.length - k).trimEnd() : a}\\u2013${b}`;\n};\n\n/** Names of the levels: \"1–3\", \"4–6\", \"> 6\" */\nexport const calendarLevelNames = (\n model: CalendarModel,\n fmt: (v: number) => string = localeFormat(),\n): string[] => {\n const { thresholds: t, count, integer } = model;\n const names: string[] = [];\n for (let k = 0; k < count; k++) {\n if (k === count - 1) {\n names.push(count === 1 ? \"> 0\" : `> ${fmt(t[k - 1])}`);\n continue;\n }\n if (integer) {\n const lo = k ? t[k - 1] + 1 : 1;\n names.push(lo >= t[k] ? fmt(t[k]) : span(fmt(lo), fmt(t[k])));\n } else\n names.push(k ? span(fmt(t[k - 1]), fmt(t[k])) : `\\u2264 ${fmt(t[k])}`);\n }\n return names;\n};\n\n/** Fill of the empty days */\nconst emptyColor = (theme: ChartTheme): Rgba =>\n mix(theme.background, theme.text, 0.07);\n\n/** Colors of the levels, lowest first */\nexport const calendarColors = (\n o: CalendarHeatmapOptions,\n theme: ChartTheme,\n count: number,\n): Rgba[] => {\n const palette = theme.palette.length ? theme.palette : [theme.primary];\n const base = resolveWith(theme, o.color, palette[0]);\n return Array.from({ length: count }, (_, k) => {\n const own = o.colors?.[k];\n if (own) return resolveWith(theme, own, base);\n return mix(\n theme.background,\n base,\n count === 1 ? 1 : 0.32 + (0.68 * k) / (count - 1),\n );\n });\n};\n\nexport const calendarValues = (\n o: CalendarHeatmapOptions,\n hidden: ReadonlySet<number>,\n out: Map<string, number>,\n) => {\n const model = calendarModel(o);\n const count = model?.count ?? 0;\n for (let k = 0; k < count; k++) out.set(`~L${k}`, hidden.has(k) ? 0 : 1);\n};\n\n/** Legend entries: one per level */\nexport const calendarLegend = (\n o: CalendarHeatmapOptions,\n theme: ChartTheme,\n hidden: ReadonlySet<number>,\n): ShapeLegendEntry[] => {\n const model = calendarModel(o);\n if (!model) return [];\n const colors = calendarColors(o, theme, model.count);\n return calendarLevelNames(model, o.format ?? localeFormat(o.locale)).map(\n (name, k) => ({\n index: k,\n name,\n color: toCss(colors[k]),\n hidden: hidden.has(k),\n }),\n );\n};\n\n// ------------------------------------------------------------- layout\n\n/** Number of strips of the `weeks` layout (one per year for long ranges) */\nexport const calendarStrips = (o: CalendarHeatmapOptions) => {\n const model = calendarModel(o);\n if (!model) return 1;\n const y0 = ymd(model.start).y;\n const y1 = ymd(model.end).y;\n return y1 > y0 && model.end - model.start + 1 > 371 ? y1 - y0 + 1 : 1;\n};\n\nconst HEADER = 18;\nconst STRIP_GAP = 12;\nconst BLOCK_GAP = 16;\n\ninterface Cell {\n day: number;\n x: number;\n y: number;\n}\n\nexport const layoutCalendar = (\n o: CalendarHeatmapOptions,\n c: LayoutContext,\n): LayoutResult => {\n const { theme, area, measure } = c;\n const model = calendarModel(o);\n if (!model) return emptyLayout(c);\n const { start, end } = model;\n const locale = c.locale;\n const weekStart = finiteWeekStart(o);\n const row = (day: number) => (weekdayOf(day) - weekStart + 7) % 7;\n const gapOpt = Math.max(0, finite(o.gap, 3));\n const months = o.layout === \"months\";\n const maxCell = Math.max(2, finite(o.maxCellSize, months ? 28 : 16));\n const labelFont = font(theme, 11);\n const muted = toCss(theme.textMuted);\n const y0 = ymd(start).y;\n const y1 = ymd(end).y;\n const nodes: ShapeNode[] = [];\n const cells: Cell[] = [];\n let size = 0;\n /** Distance between two cells (cell + gap) */\n let pitchOf: number;\n\n if (!months) {\n // strips: one per year when the range is longer than a year\n const strips: { s: number; e: number; year: number | null }[] = [];\n if (y1 > y0 && end - start + 1 > 371)\n for (let y = y0; y <= y1; y++)\n strips.push({\n s: Math.max(start, dayOfYmd(y, 0, 1)),\n e: Math.min(end, dayOfYmd(y, 11, 31)),\n year: y,\n });\n else strips.push({ s: start, e: end, year: null });\n const colOf = (day: number, s: number) =>\n Math.floor((day - (s - row(s))) / 7);\n const ncols = Math.max(...strips.map((st) => colOf(st.e, st.s) + 1));\n const header = o.monthLabels !== false || strips.length > 1 ? HEADER : 0;\n const allRows = o.weekdayLabels !== false;\n const dayNames = Array.from({ length: 7 }, (_, r) =>\n weekdayName(locale, (weekStart + r) % 7, \"short\"),\n );\n let gutter = allRows\n ? Math.max(...dayNames.map((nm) => measure(nm, labelFont))) + 8\n : 0;\n const yearFont = font(theme, 11, 600);\n if (strips.length > 1)\n gutter = Math.max(gutter, measure(String(y1), yearFont) + 8);\n const n = strips.length;\n const byWidth = (area.width - gutter + gapOpt) / ncols;\n const byHeight =\n ((area.height - (n - 1) * STRIP_GAP) / n - header + gapOpt) / 7;\n let pitch = Math.max(2, Math.min(byWidth, byHeight));\n const gap = Math.min(gapOpt, pitch * 0.25);\n size = Math.min(maxCell, pitch - gap);\n pitch = size + gap;\n pitchOf = pitch;\n const blockW = gutter + ncols * pitch - gap;\n const blockH = n * (header + 7 * pitch - gap) + (n - 1) * STRIP_GAP;\n const left = area.x + Math.max(0, (area.width - blockW) / 2) + gutter;\n let top = area.y + Math.max(0, (area.height - blockH) / 2);\n const showRow = (r: number) =>\n pitch >= 15 || [1, 3, 5].includes((weekStart + r) % 7);\n\n for (const st of strips) {\n const gridTop = top + header;\n if (st.year !== null)\n nodes.push({\n kind: \"text\",\n x: left - gutter,\n y: top + header / 2,\n text: String(st.year),\n font: yearFont,\n color: toCss(theme.text, 0.85),\n align: \"left\",\n baseline: \"middle\",\n });\n if (allRows && size >= 6)\n dayNames.forEach((nm, r) => {\n if (!showRow(r)) return;\n nodes.push({\n kind: \"text\",\n x: left - 6,\n y: gridTop + r * pitch + size / 2,\n text: nm,\n font: labelFont,\n color: muted,\n align: \"right\",\n baseline: \"middle\",\n });\n });\n if (o.monthLabels !== false) {\n const cols = colOf(st.e, st.s) + 1;\n const labels: { col: number; text: string }[] = [];\n for (const { y, m } of monthsOf(st.s, st.e)) {\n const first = Math.max(st.s, dayOfYmd(y, m, 1));\n const col =\n colOf(first, st.s) + (first > st.s && row(first) > 0 ? 1 : 0);\n if (col < cols) labels.push({ col, text: monthName(locale, y, m) });\n }\n let lastEnd = -Infinity;\n labels.forEach((lb, k) => {\n const x = left + lb.col * pitch;\n const w = measure(lb.text, labelFont);\n const next = labels[k + 1];\n // the partial first month only when it does not crowd the next one\n if (next && k === 0 && left + next.col * pitch < x + w + 6) return;\n if (x < lastEnd + 6 || x + w > left + cols * pitch + 24) return;\n lastEnd = x + w;\n nodes.push({\n kind: \"text\",\n x,\n y: top + header / 2,\n text: lb.text,\n font: labelFont,\n color: muted,\n align: \"left\",\n baseline: \"middle\",\n });\n });\n }\n for (let day = st.s; day <= st.e; day++)\n cells.push({\n day,\n x: left + colOf(day, st.s) * pitch,\n y: gridTop + row(day) * pitch,\n });\n top += header + 7 * pitch - gap + STRIP_GAP;\n }\n } else {\n // a small calendar per month, in the grid of columns giving the biggest cells\n const list = monthsOf(start, end);\n const count = list.length;\n const head =\n (o.monthLabels !== false ? HEADER : 0) +\n (o.weekdayLabels !== false ? 14 : 0);\n let best = { cols: 1, pitch: 0 };\n for (let cols = 1; cols <= count; cols++) {\n const rows = Math.ceil(count / cols);\n const byWidth =\n (area.width - (cols - 1) * BLOCK_GAP + gapOpt) / (7 * cols);\n const byHeight =\n ((area.height - (rows - 1) * BLOCK_GAP) / rows - head + gapOpt) / 6;\n const pitch = Math.min(byWidth, byHeight, maxCell + gapOpt);\n if (pitch > best.pitch + 1e-6) best = { cols, pitch };\n }\n let pitch = Math.max(2, best.pitch);\n const gap = Math.min(gapOpt, pitch * 0.25);\n size = Math.min(maxCell, pitch - gap);\n pitch = size + gap;\n pitchOf = pitch;\n const cols = best.cols;\n const rows = Math.ceil(count / cols);\n const blockW = 7 * pitch - gap;\n const blockH = head + 6 * pitch - gap;\n const totalW = cols * blockW + (cols - 1) * BLOCK_GAP;\n const totalH = rows * blockH + (rows - 1) * BLOCK_GAP;\n const left = area.x + Math.max(0, (area.width - totalW) / 2);\n const top = area.y + Math.max(0, (area.height - totalH) / 2);\n const withYear = y1 > y0;\n const titleFont = font(theme, 12, 600);\n const narrow = Array.from({ length: 7 }, (_, r) =>\n weekdayName(locale, (weekStart + r) % 7, \"narrow\"),\n );\n list.forEach(({ y, m }, k) => {\n const bx = left + (k % cols) * (blockW + BLOCK_GAP);\n const by = top + Math.floor(k / cols) * (blockH + BLOCK_GAP);\n let hy = by;\n if (o.monthLabels !== false) {\n nodes.push({\n kind: \"text\",\n x: bx,\n y: hy + HEADER / 2 - 1,\n text: withYear\n ? format(\n locale,\n { month: \"short\", year: \"numeric\" },\n dayOfYmd(y, m, 1),\n `${EN_MONTHS[m]} ${y}`,\n )\n : format(\n locale,\n { month: \"long\" },\n dayOfYmd(y, m, 1),\n EN_MONTHS[m],\n ),\n font: titleFont,\n color: toCss(theme.text, 0.88),\n align: \"left\",\n baseline: \"middle\",\n });\n hy += HEADER;\n }\n if (o.weekdayLabels !== false) {\n if (size >= 8)\n narrow.forEach((nm, r) =>\n nodes.push({\n kind: \"text\",\n x: bx + r * pitch + size / 2,\n y: hy + 6,\n text: nm,\n font: font(theme, 10),\n color: muted,\n align: \"center\",\n baseline: \"middle\",\n }),\n );\n hy += 14;\n }\n const first = dayOfYmd(y, m, 1);\n const last = Math.min(end, dayOfYmd(y, m + 1, 0));\n const lead = row(first);\n for (let day = Math.max(first, start); day <= last; day++) {\n const offset = lead + (day - first);\n cells.push({\n day,\n x: bx + (offset % 7) * pitch,\n y: hy + Math.floor(offset / 7) * pitch,\n });\n }\n });\n }\n\n // cells and items\n const colors = calendarColors(o, theme, model.count);\n const empty = emptyColor(theme);\n const vis = colors.map((_, k) =>\n clamp(c.value(`~L${k}`, c.hidden.has(k) ? 0 : 1), 0, 1),\n );\n const radius = clamp(finite(o.radius, 2), 0, size / 2);\n const outline = toCss(theme.text, 0.75);\n const hitPad = Math.max(0, (pitchOf - size) / 2);\n const items: ShapeItem[] = [];\n for (const cell of cells) {\n const v = model.values.get(cell.day) ?? 0;\n const level = calendarLevel(model, v);\n const fill = level < 0 ? empty : mix(empty, colors[level], vis[level] ?? 1);\n const css = toCss(fill);\n const index = cell.day - start;\n nodes.push({\n kind: \"rect\",\n x: cell.x,\n y: cell.y,\n width: size,\n height: size,\n radius,\n fill: css,\n hit: index,\n hoverStroke: outline,\n hitPad,\n });\n const percent = model.max > 0 ? v / model.max : 0;\n items.push({\n index,\n name: dateName(locale, cell.day),\n value: v,\n percent,\n share: c.percent(percent),\n color: level < 0 ? css : toCss(colors[level]),\n x: cell.x + size / 2,\n y: cell.y + size / 2,\n rows: [{ name: c.labels.value, value: c.format(v) }],\n event: { date: calendarIso(cell.day) },\n });\n }\n items.sort((a, b) => a.index - b.index);\n\n const enter = clamp(c.enter, 0, 1);\n return {\n nodes,\n items,\n dim: 1,\n empty: false,\n steps: months ? { next: 1, down: 7 } : { next: 7, down: 1 },\n ...(enter < 1\n ? {\n enter: {\n alpha: enter,\n scale: 0.985 + 0.015 * enter,\n cx: area.x + area.width / 2,\n cy: area.y + area.height / 2,\n },\n }\n : {}),\n };\n};\n"],"mappings":";;;;;;AAyBA,IAAMA,IAAS,OAETC,IAAW,MAEXC,KAAY,MAChB,KAAK,MACH,KAAK,IAAIC,EAAK,YAAY,GAAGA,EAAK,SAAS,GAAGA,EAAK,QAAQ,CAAC,IAAIH,CAClE,GAGWI,KAAe,MAAmC;CAC7D,IAAI,OAAOC,KAAM,UAAU;EACzB,IAAMC,IAAI,kCAAkC,KAAKD,CAAC;EAClD,IAAIC,GAAG;GACL,IAAMC,IAAI,KAAK,IAAI,OAAOD,EAAE,EAAE,GAAG,OAAOA,EAAE,EAAE,IAAI,GAAG,OAAOA,EAAE,EAAE,CAAC;GAC/D,OAAO,OAAO,SAASC,CAAC,IAAI,KAAK,MAAMA,IAAIP,CAAM,IAAI;EACvD;EACA,IAAMO,IAAI,KAAK,MAAMF,CAAC;EACtB,OAAO,OAAO,SAASE,CAAC,IAAIL,EAAS,IAAI,KAAKK,CAAC,CAAC,IAAI;CACtD;CAKA,OAJI,OAAOF,KAAM,WACR,OAAO,SAASA,CAAC,IAAIH,EAAS,IAAI,KAAKG,CAAC,CAAC,IAAI,OAClDA,aAAa,QACR,OAAO,SAASA,EAAE,QAAQ,CAAC,IAAIH,EAASG,CAAC,IAAI;AAExD,GAEMG,KAAO,MAAgB;CAC3B,IAAML,oBAAO,IAAI,KAAKM,IAAMT,CAAM;CAClC,OAAO;EACL,GAAGG,EAAK,eAAe;EACvB,GAAGA,EAAK,YAAY;EACpB,GAAGA,EAAK,WAAW;CACrB;AACF,GAEMO,KAAY,GAAW,GAAW,MACtC,KAAK,MAAM,KAAK,IAAIC,GAAGL,GAAGD,CAAC,IAAIL,CAAM,GAEjCY,KAAQ,MAAeC,IAAI,KAAK,IAAIA,MAAM,OAAOA,CAAC,GAG3CC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AOI,IAAS;GAAE,MAAM;GAAG,MAAM;EAAE,IAAI;GAAE,MAAM;GAAG,MAAM;EAAE;EAC1D,GAAIkE,IAAQ,IACR,EACE,OAAO;GACL,OAAOA;GACP,OAAO,OAAQ,OAAQA;GACvB,IAAInD,EAAK,IAAIA,EAAK,QAAQ;GAC1B,IAAIA,EAAK,IAAIA,EAAK,SAAS;EAC7B,EACF,IACA,CAAC;CACP;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("../theme.cjs"),t=require("./scene.cjs"),n=require("./draw.cjs"),r=require("./hit.cjs"),i=require("./layout.cjs"),a=require("./runtime.cjs");var o=8,s=s=>{let{canvas:c}=s,l=null;try{l=c.getContext(`2d`)}catch{l=null}let u=s.width,d=s.height,f=s.pixelRatio??1,p=s.options,m=s.theme,h=e.createTheme(m,p.palette),g=a.createShapeRuntime(p),_=null,v=[],y=null,b=null,x=!1,S=null,C=`timeout`,w=``,T={hover:new Set,click:new Set,toggle:new Set},E=(e,t)=>{for(let n of[...T[e]])n(t)},D=(e,n)=>!l||typeof l.measureText!=`function`?t.estimateText(e,n):(n!==w&&(l.font=n,w=n),l.measureText(e).width),O=globalThis,k=()=>{S!==null&&(C===`canvas`?c.cancelAnimationFrame?.(S):C===`global`?O.cancelAnimationFrame?.(S):clearTimeout(S),S=null)},A=()=>{x||S!==null||(c.requestAnimationFrame?(C=`canvas`,S=c.requestAnimationFrame(()=>M())):O.requestAnimationFrame?(C=`global`,S=O.requestAnimationFrame(()=>M())):(C=`timeout`,S=setTimeout(()=>M(),16)))},j=e=>{if(p.tooltip===!1)return null;let t=typeof p.tooltip==`object`?p.tooltip.render:void 0;if(!t)return;let n=t(e);return n===null?null:typeof n==`string`?n:n.textContent??null};function M(){if(S=null,x||!(u>0&&d>0))return;let e=Math.max(1,Math.round(u*f)),t=Math.max(1,Math.round(d*f));c.width!==e&&(c.width=e),c.height!==t&&(c.height=t),w=``;let r=i.shapeLegend(p,h,g.hidden),o=i.legendConfig(p).position,s={x:0,y:0,width:u,height:d};if(v=[],r){let e=i.layoutShapeLegend(r,u,o,d,h,D);v=e.boxes,s={x:0,y:o===`top`?e.height:0,width:u,height:Math.max(0,d-e.height)}}let m=g.frame(a.now(),{theme:h,width:u,height:d,bounds:s,measure:D});if(_=m.scene,y&&!_.items.some(e=>e.index===y?.hover.index)&&(y=null,E(`hover`,null)),l){l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,e,t),l.setTransform(f,0,0,f,0,0),n.drawShapeScene(l,_,y?.hover??null),v.length&&n.drawShapeLegend(l,h,v);let r=y?i.hoverEvent(_,y.hover):null;if(y&&r&&!b?.moved){let e=j(r),t=e===void 0?i.tooltipContent(_,y.hover):e;if(t){let e=i.layoutShapeTooltip(t,y.x,y.y,u,d,h,D,_,y.hover);n.drawShapeTooltip(l,h,e)}}w=``}m.animating&&A()}let N=(e,t,n)=>{let r=!i.sameHover(y?.hover??null,e),a=!!e&&(y?.x!==t||y?.y!==n);y=e?{hover:e,x:t,y:n}:null,(r||a)&&A(),r&&E(`hover`,_&&e?i.hoverEvent(_,e):null)},P=(e,t)=>v.find(n=>e>=n.x-4&&e<=n.x+n.width+4&&t>=n.y&&t<=n.y+n.height),F=(e,t)=>_?r.hitTestShapes(_,e,t,y?.hover??null):null,I=e=>{if(x)return;let t=g.toggle(e);t&&(p.hidden||A(),E(`toggle`,t))},L=(e,t)=>{let n=P(e,t);if(n){i.legendConfig(p).toggle&&I(n.index);return}let r=F(e,t);if(r&&_){N(r,e,t);let n=i.hoverEvent(_,r);n&&E(`click`,n)}else N(null,e,t)},R=(e,t)=>{b={x:e,y:t,moved:!1}},z=(e,t,n)=>{b&&Math.hypot(e-b.x,t-b.y)>o&&(b.moved=!0),!n&&N(F(e,t),e,t)},B=(e,t)=>{let n=b;b=null,n&&!n.moved?L(e,t):A()};return M(),{setOptions(t){if(x)return;let n=(t.palette??[]).join()!==(p.palette??[]).join();t.type!==p.type&&(y=null),p=t,g.setOptions(t),n&&(h=e.createTheme(m,t.palette)),A()},setTheme(t){x||(m=t,h=e.createTheme(t,p.palette),A())},resize(e,t,n){u=e,d=t,n&&(f=n),A()},render(){k(),M()},touchStart(e){let t=e[0];t&&R(t.x,t.y)},touchMove(e){let t=e[0];t&&z(t.x,t.y,!0)},touchEnd(e){let t=e[0];t?B(t.x,t.y):b=null},touchCancel(){b=null,A()},pointerDown:(e,t)=>R(e,t),pointerMove:(e,t)=>z(e,t,!1),pointerUp:(e,t)=>B(e,t),pointerLeave(){b=null,N(null,0,0)},toggle:I,getHidden:()=>g.hiddenIndexes(),clearHover:()=>N(null,0,0),on(e,t){return T[e].add(t),()=>{T[e].delete(t)}},destroy(){x||(x=!0,k(),T.hover.clear(),T.click.clear(),T.toggle.clear())}}};exports.createCanvasShapeChart=s;
1
+ const e=require("../theme.cjs"),t=require("./scene.cjs"),n=require("./draw.cjs"),r=require("./hit.cjs"),i=require("./layout.cjs"),a=require("./runtime.cjs");var o=8,s=s=>{let{canvas:c}=s,l=null;try{l=c.getContext(`2d`)}catch{l=null}let u=s.width,d=s.height,f=s.pixelRatio??1,p=s.options,m=s.theme,h=e.createTheme(m,p.palette),g=a.createShapeRuntime(p),_=null,v=[],y=null,b=null,x=!1,S=null,C=`timeout`,w=``,T={hover:new Set,click:new Set,toggle:new Set,drill:new Set},E=(e,t)=>{for(let n of[...T[e]])n(t)},D=(e,n)=>!l||typeof l.measureText!=`function`?t.estimateText(e,n):(n!==w&&(l.font=n,w=n),l.measureText(e).width),O=globalThis,k=()=>{S!==null&&(C===`canvas`?c.cancelAnimationFrame?.(S):C===`global`?O.cancelAnimationFrame?.(S):clearTimeout(S),S=null)},A=()=>{x||S!==null||(c.requestAnimationFrame?(C=`canvas`,S=c.requestAnimationFrame(()=>M())):O.requestAnimationFrame?(C=`global`,S=O.requestAnimationFrame(()=>M())):(C=`timeout`,S=setTimeout(()=>M(),16)))},j=e=>{if(p.tooltip===!1)return null;let t=typeof p.tooltip==`object`?p.tooltip.render:void 0;if(!t)return;let n=t(e);return n===null?null:typeof n==`string`?n:n.textContent??null};function M(){if(S=null,x||!(u>0&&d>0))return;let e=Math.max(1,Math.round(u*f)),t=Math.max(1,Math.round(d*f));c.width!==e&&(c.width=e),c.height!==t&&(c.height=t),w=``;let r=i.shapeLegend(p,h,g.hidden),o=i.legendConfig(p).position,s={x:0,y:0,width:u,height:d};if(v=[],r){let e=i.layoutShapeLegend(r,u,o,d,h,D);v=e.boxes,s={x:0,y:o===`top`?e.height:0,width:u,height:Math.max(0,d-e.height)}}let m=g.frame(a.now(),{theme:h,width:u,height:d,bounds:s,measure:D});if(_=m.scene,y&&!_.items.some(e=>e.index===y?.hover.index)&&(y=null,E(`hover`,null)),l){l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,e,t),l.setTransform(f,0,0,f,0,0),n.drawShapeScene(l,_,y?.hover??null),v.length&&n.drawShapeLegend(l,h,v);let r=y?i.hoverEvent(_,y.hover):null;if(y&&r&&!b?.moved){let e=j(r),t=e===void 0?i.tooltipContent(_,y.hover):e;if(t){let e=i.layoutShapeTooltip(t,y.x,y.y,u,d,h,D,_,y.hover);n.drawShapeTooltip(l,h,e)}}w=``}m.animating&&A()}let N=(e,t,n)=>{let r=!i.sameHover(y?.hover??null,e),a=!!e&&(y?.x!==t||y?.y!==n);y=e?{hover:e,x:t,y:n}:null,(r||a)&&A(),r&&E(`hover`,_&&e?i.hoverEvent(_,e):null)},P=(e,t)=>v.find(n=>e>=n.x-4&&e<=n.x+n.width+4&&t>=n.y&&t<=n.y+n.height),F=(e,t)=>_?r.hitTestShapes(_,e,t,y?.hover??null):null,I=e=>{if(x)return;let t=g.toggle(e);t&&(p.hidden||A(),E(`toggle`,t))},L=e=>{if(x)return;let t=g.drill(e);t&&(p.type===`sunburst`&&!p.drillPath&&A(),E(`drill`,t))},R=(e,t)=>{let n=P(e,t);if(n){i.legendConfig(p).toggle&&I(n.index);return}let r=F(e,t);if(r&&_){N(r,e,t);let n=i.hoverEvent(_,r);n&&E(`click`,n);let a=_.items.find(e=>e.index===r.index);a?.drill&&p.type===`sunburst`&&p.drill!==!1&&L(a.drill)}else N(null,e,t)},z=(e,t)=>{b={x:e,y:t,moved:!1}},B=(e,t,n)=>{b&&Math.hypot(e-b.x,t-b.y)>o&&(b.moved=!0),!n&&N(F(e,t),e,t)},V=(e,t)=>{let n=b;b=null,n&&!n.moved?R(e,t):A()};return M(),{setOptions(t){if(x)return;let n=(t.palette??[]).join()!==(p.palette??[]).join();t.type!==p.type&&(y=null),p=t,g.setOptions(t),n&&(h=e.createTheme(m,t.palette)),A()},setTheme(t){x||(m=t,h=e.createTheme(t,p.palette),A())},resize(e,t,n){u=e,d=t,n&&(f=n),A()},render(){k(),M()},touchStart(e){let t=e[0];t&&z(t.x,t.y)},touchMove(e){let t=e[0];t&&B(t.x,t.y,!0)},touchEnd(e){let t=e[0];t?V(t.x,t.y):b=null},touchCancel(){b=null,A()},pointerDown:(e,t)=>z(e,t),pointerMove:(e,t)=>B(e,t,!1),pointerUp:(e,t)=>V(e,t),pointerLeave(){b=null,N(null,0,0)},toggle:I,getHidden:()=>g.hiddenIndexes(),drill:L,getDrillPath:()=>g.drillPath(),clearHover:()=>N(null,0,0),on(e,t){return T[e].add(t),()=>{T[e].delete(t)}},destroy(){x||(x=!0,k(),T.hover.clear(),T.click.clear(),T.toggle.clear(),T.drill.clear())}}};exports.createCanvasShapeChart=s;
2
2
  //# sourceMappingURL=canvas.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.cjs","names":["createTheme","createShapeRuntime","estimateText","shapeLegend","legendConfig","layoutShapeLegend","now","hoverEvent","tooltipContent","layoutShapeTooltip","sameHover","hitTestShapes","require_theme","require_scene","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","createCanvasShapeChart","config","ctx","canvas","width","height","dpr","options","themeInput","theme","runtime","scene","legendBoxes","hover","press","destroyed","frameId","frameKind","fontSet","listeners","emit","listener","type","event","measure","text","f","g","cancelFrame","schedule","render","tooltipText","out","pw","ph","entries","legendPosition","bounds","legend","frame","it","custom","content","box","setHover","changed","next","moved","x","y","legendAt","b","hitAt","toggle","index","tap","hit","e","down","move","up","p","paletteChanged","input","w","h","ratio","touches"],"sources":["../../../../../charts/src/engine/shapes/canvas.ts"],"sourcesContent":["// createCanvasShapeChart: shape charts on one 2D canvas without any DOM\n// (mini-programs, Taro, uni-app, OffscreenCanvas). The legend and the\n// tooltip are drawn on the canvas; the host forwards touches / pointer events.\n\nimport type { ChartCanvas, ChartTouch } from \"../canvas\";\nimport { createTheme, type ChartTheme, type ChartThemeInput } from \"../theme\";\nimport { drawShapeLegend, drawShapeScene, drawShapeTooltip } from \"./draw\";\nimport { hitTestShapes } from \"./hit\";\nimport {\n hoverEvent,\n layoutShapeLegend,\n layoutShapeTooltip,\n legendConfig,\n sameHover,\n shapeLegend,\n tooltipContent,\n type ShapeLegendBox,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\nconst TAP_SLOP = 8;\n\nexport interface CanvasShapeChartConfig {\n /** Canvas to draw on (`HTMLCanvasElement`, `OffscreenCanvas` or a mini-program canvas node) */\n canvas: ChartCanvas;\n /** Width of the canvas in CSS pixels (rpx converted by the host) */\n width: number;\n /** Height of the canvas in CSS pixels */\n height: number;\n /**\n * Device pixel ratio (`wx.getWindowInfo().pixelRatio` in mini-programs)\n * @default 1\n */\n pixelRatio?: number;\n /** Chart options */\n options: ShapeChartOptions;\n /** Colors and fonts: values of the Minerva CSS variables */\n theme?: ChartThemeInput;\n}\n\nexport interface CanvasShapeChartInstance {\n /** Replaces the options (animates from the previous values) */\n setOptions(options: ShapeChartOptions): void;\n /** Replaces the theme input */\n setTheme(theme: ChartThemeInput | undefined): void;\n /** New CSS size (and pixel ratio) of the canvas */\n resize(width: number, height: number, pixelRatio?: number): void;\n /** Draws now (frames are otherwise scheduled automatically) */\n render(): void;\n /** Touch handlers: pass the `touches` / `changedTouches` of the event */\n touchStart(touches: readonly ChartTouch[]): void;\n touchMove(touches: readonly ChartTouch[]): void;\n touchEnd(changedTouches: readonly ChartTouch[]): void;\n touchCancel(changedTouches?: readonly ChartTouch[]): void;\n /** Mouse / pen handlers (H5, desktop mini-programs) */\n pointerDown(x: number, y: number): void;\n pointerMove(x: number, y: number): void;\n pointerUp(x: number, y: number): void;\n pointerLeave(): void;\n /**\n * Hides / shows a slice, stage, radar series or top-level treemap node and\n * emits `toggle` (with the `hidden` option: only emits `toggle`)\n */\n toggle(index: number): void;\n /** Indexes of the hidden entries, ascending */\n getHidden(): number[];\n /** Removes the hover (and the tooltip) */\n clearHover(): void;\n /** Subscribes to an event; returns the unsubscribe function */\n on<K extends keyof ShapeChartEventMap>(\n type: K,\n listener: (event: ShapeChartEventMap[K]) => void,\n ): () => void;\n /** Stops the animations and the listeners */\n destroy(): void;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart drawn on a 2D\n * canvas, legend and tooltip included. Works without a DOM.\n */\nexport const createCanvasShapeChart = (\n config: CanvasShapeChartConfig,\n): CanvasShapeChartInstance => {\n const { canvas } = config;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D | null;\n } catch {\n ctx = null;\n }\n let width = config.width;\n let height = config.height;\n let dpr = config.pixelRatio ?? 1;\n let options = config.options;\n let themeInput = config.theme;\n let theme: ChartTheme = createTheme(themeInput, options.palette);\n const runtime = createShapeRuntime(options);\n let scene: ShapeScene | null = null;\n let legendBoxes: ShapeLegendBox[] = [];\n let hover: { hover: ShapeHover; x: number; y: number } | null = null;\n let press: { x: number; y: number; moved: boolean } | null = null;\n let destroyed = false;\n let frameId: number | null = null;\n let frameKind: \"canvas\" | \"global\" | \"timeout\" = \"timeout\";\n let fontSet = \"\";\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = { hover: new Set(), click: new Set(), toggle: new Set() };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n const measure: MeasureText = (text, f) => {\n if (!ctx || typeof ctx.measureText !== \"function\")\n return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n const g = globalThis as {\n requestAnimationFrame?: (cb: () => void) => number;\n cancelAnimationFrame?: (id: number) => void;\n };\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameKind === \"canvas\") canvas.cancelAnimationFrame?.(frameId);\n else if (frameKind === \"global\") g.cancelAnimationFrame?.(frameId);\n else clearTimeout(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (canvas.requestAnimationFrame) {\n frameKind = \"canvas\";\n frameId = canvas.requestAnimationFrame(() => render());\n } else if (g.requestAnimationFrame) {\n frameKind = \"global\";\n frameId = g.requestAnimationFrame(() => render());\n } else {\n frameKind = \"timeout\";\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipText = (event: ShapeHoverEvent): string | null | undefined => {\n if (options.tooltip === false) return null;\n const render =\n typeof options.tooltip === \"object\" ? options.tooltip.render : undefined;\n if (!render) return undefined;\n const out = render(event);\n // nodes cannot be drawn on a canvas: use their text\n if (out === null) return null;\n return typeof out === \"string\" ? out : (out.textContent ?? null);\n };\n\n function render() {\n frameId = null;\n if (destroyed || !(width > 0 && height > 0)) return;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n fontSet = \"\";\n\n const entries = shapeLegend(options, theme, runtime.hidden);\n const legendPosition = legendConfig(options).position;\n let bounds = { x: 0, y: 0, width, height };\n legendBoxes = [];\n if (entries) {\n const legend = layoutShapeLegend(\n entries,\n width,\n legendPosition,\n height,\n theme,\n measure,\n );\n legendBoxes = legend.boxes;\n bounds = {\n x: 0,\n y: legendPosition === \"top\" ? legend.height : 0,\n width,\n height: Math.max(0, height - legend.height),\n };\n }\n const frame = runtime.frame(now(), {\n theme,\n width,\n height,\n bounds,\n measure,\n });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n if (legendBoxes.length) drawShapeLegend(ctx, theme, legendBoxes);\n const event = hover ? hoverEvent(scene, hover.hover) : null;\n if (hover && event && !press?.moved) {\n const custom = tooltipText(event);\n const content =\n custom === undefined ? tooltipContent(scene, hover.hover) : custom;\n if (content) {\n const box = layoutShapeTooltip(\n content,\n hover.x,\n hover.y,\n width,\n height,\n theme,\n measure,\n scene,\n hover.hover,\n );\n drawShapeTooltip(ctx, theme, box);\n }\n }\n fontSet = \"\";\n }\n if (frame.animating) schedule();\n }\n\n const setHover = (next: ShapeHover | null, x: number, y: number) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n const moved = !!next && (hover?.x !== x || hover?.y !== y);\n hover = next ? { hover: next, x, y } : null;\n if (changed || moved) schedule();\n if (changed) emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n const legendAt = (x: number, y: number) =>\n legendBoxes.find(\n (b) =>\n x >= b.x - 4 &&\n x <= b.x + b.width + 4 &&\n y >= b.y &&\n y <= b.y + b.height,\n );\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const toggle = (index: number) => {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) schedule();\n emit(\"toggle\", event);\n };\n\n /** Tap / click: legend toggle, else hover + click event */\n const tap = (x: number, y: number) => {\n const box = legendAt(x, y);\n if (box) {\n if (legendConfig(options).toggle) toggle(box.index);\n return;\n }\n const hit = hitAt(x, y);\n if (hit && scene) {\n setHover(hit, x, y);\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n } else setHover(null, x, y);\n };\n\n const down = (x: number, y: number) => {\n press = { x, y, moved: false };\n };\n const move = (x: number, y: number, touch: boolean) => {\n if (press && Math.hypot(x - press.x, y - press.y) > TAP_SLOP)\n press.moved = true;\n if (touch) return;\n setHover(hitAt(x, y), x, y);\n };\n const up = (x: number, y: number) => {\n const p = press;\n press = null;\n if (p && !p.moved) tap(x, y);\n else schedule();\n };\n\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const paletteChanged =\n (next.palette ?? []).join() !== (options.palette ?? []).join();\n if (next.type !== options.type) hover = null;\n options = next;\n runtime.setOptions(next);\n if (paletteChanged) theme = createTheme(themeInput, next.palette);\n schedule();\n },\n setTheme(input) {\n if (destroyed) return;\n themeInput = input;\n theme = createTheme(input, options.palette);\n schedule();\n },\n resize(w, h, ratio) {\n width = w;\n height = h;\n if (ratio) dpr = ratio;\n schedule();\n },\n render() {\n cancelFrame();\n render();\n },\n touchStart(touches) {\n const t = touches[0];\n if (t) down(t.x, t.y);\n },\n touchMove(touches) {\n const t = touches[0];\n if (t) move(t.x, t.y, true);\n },\n touchEnd(touches) {\n const t = touches[0];\n if (t) up(t.x, t.y);\n else press = null;\n },\n touchCancel() {\n press = null;\n schedule();\n },\n pointerDown: (x, y) => down(x, y),\n pointerMove: (x, y) => move(x, y, false),\n pointerUp: (x, y) => up(x, y),\n pointerLeave() {\n press = null;\n setHover(null, 0, 0);\n },\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n clearHover: () => setHover(null, 0, 0),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n },\n };\n};\n"],"mappings":"6JA+BA,IAAMkB,EAAW,EA6DJC,EACX,GAC6B,CAC7B,GAAM,CAAE,UAAWC,EACfC,EAAuC,KAC3C,GAAI,CACF,EAAMC,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CACA,IAAIC,EAAQH,EAAO,MACfI,EAASJ,EAAO,OAChBK,EAAML,EAAO,YAAc,EAC3BM,EAAUN,EAAO,QACjBO,EAAaP,EAAO,MACpBQ,EAAoB5B,EAAAA,YAAY2B,EAAYD,EAAQ,OAAO,EACzDG,EAAU5B,EAAAA,mBAAmByB,CAAO,EACtCI,EAA2B,KAC3BC,EAAgC,CAAC,EACjCC,EAA4D,KAC5DC,EAAyD,KACzDC,EAAY,GACZC,EAAyB,KACzBC,EAA6C,UAC7CC,EAAU,GAERC,EAIF,CAAE,MAAO,IAAI,IAAO,MAAO,IAAI,IAAO,OAAQ,IAAI,GAAM,EACtDC,GACJ,EACA,IACG,CACH,IAAK,IAAMC,IAAY,CAAC,GAAGF,EAAUG,EAAK,EAAGD,EAASE,CAAK,CAC7D,EAEMC,GAAwB,EAAM,IAC9B,CAACtB,GAAO,OAAOA,EAAI,aAAgB,WAC9BnB,EAAAA,aAAa0C,EAAMC,CAAC,GACzBA,IAAMR,IACR,EAAI,KAAOQ,EACX,EAAUA,GAELxB,EAAI,YAAYuB,CAAI,CAAC,CAAC,OAGzBE,EAAI,WAKJC,MAAoB,CACpBZ,IAAY,OACZC,IAAc,SAAUd,EAAO,uBAAuBa,CAAO,EACxDC,IAAc,SAAUU,EAAE,uBAAuBX,CAAO,EAC5D,aAAaA,CAAO,EACzB,EAAU,KACZ,EAEMa,MAAiB,CACjBd,GAAaC,IAAY,OACzBb,EAAO,uBACT,EAAY,SACZ,EAAUA,EAAO,0BAA4B2B,EAAO,CAAC,GAC5CH,EAAE,uBACX,EAAY,SACZ,EAAUA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AAID,CAAQ,MACf,CACXF,EAAUG,EAAK,CAAC,OAAOD,CAAQ,CACjC,CACF,EACA,SAAU,CACJN,IACJ,EAAY,GACZa,EAAY,EACZT,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACzB,CACF,CACF"}
1
+ {"version":3,"file":"canvas.cjs","names":["createTheme","createShapeRuntime","estimateText","shapeLegend","legendConfig","layoutShapeLegend","now","hoverEvent","tooltipContent","layoutShapeTooltip","sameHover","hitTestShapes","require_theme","require_scene","require_draw","require_hit","require_layout","require_runtime","TAP_SLOP","createCanvasShapeChart","config","ctx","canvas","width","height","dpr","options","themeInput","theme","runtime","scene","legendBoxes","hover","press","destroyed","frameId","frameKind","fontSet","listeners","emit","listener","type","event","measure","text","f","g","cancelFrame","schedule","render","tooltipText","out","pw","ph","entries","legendPosition","bounds","legend","frame","it","custom","content","box","setHover","changed","next","moved","x","y","legendAt","b","hitAt","toggle","index","drill","path","tap","hit","e","item","down","move","up","p","paletteChanged","input","w","h","ratio","touches"],"sources":["../../../../../charts/src/engine/shapes/canvas.ts"],"sourcesContent":["// createCanvasShapeChart: shape charts on one 2D canvas without any DOM\n// (mini-programs, Taro, uni-app, OffscreenCanvas). The legend and the\n// tooltip are drawn on the canvas; the host forwards touches / pointer events.\n\nimport type { ChartCanvas, ChartTouch } from \"../canvas\";\nimport { createTheme, type ChartTheme, type ChartThemeInput } from \"../theme\";\nimport { drawShapeLegend, drawShapeScene, drawShapeTooltip } from \"./draw\";\nimport { hitTestShapes } from \"./hit\";\nimport {\n hoverEvent,\n layoutShapeLegend,\n layoutShapeTooltip,\n legendConfig,\n sameHover,\n shapeLegend,\n tooltipContent,\n type ShapeLegendBox,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\nconst TAP_SLOP = 8;\n\nexport interface CanvasShapeChartConfig {\n /** Canvas to draw on (`HTMLCanvasElement`, `OffscreenCanvas` or a mini-program canvas node) */\n canvas: ChartCanvas;\n /** Width of the canvas in CSS pixels (rpx converted by the host) */\n width: number;\n /** Height of the canvas in CSS pixels */\n height: number;\n /**\n * Device pixel ratio (`wx.getWindowInfo().pixelRatio` in mini-programs)\n * @default 1\n */\n pixelRatio?: number;\n /** Chart options */\n options: ShapeChartOptions;\n /** Colors and fonts: values of the Minerva CSS variables */\n theme?: ChartThemeInput;\n}\n\nexport interface CanvasShapeChartInstance {\n /** Replaces the options (animates from the previous values) */\n setOptions(options: ShapeChartOptions): void;\n /** Replaces the theme input */\n setTheme(theme: ChartThemeInput | undefined): void;\n /** New CSS size (and pixel ratio) of the canvas */\n resize(width: number, height: number, pixelRatio?: number): void;\n /** Draws now (frames are otherwise scheduled automatically) */\n render(): void;\n /** Touch handlers: pass the `touches` / `changedTouches` of the event */\n touchStart(touches: readonly ChartTouch[]): void;\n touchMove(touches: readonly ChartTouch[]): void;\n touchEnd(changedTouches: readonly ChartTouch[]): void;\n touchCancel(changedTouches?: readonly ChartTouch[]): void;\n /** Mouse / pen handlers (H5, desktop mini-programs) */\n pointerDown(x: number, y: number): void;\n pointerMove(x: number, y: number): void;\n pointerUp(x: number, y: number): void;\n pointerLeave(): void;\n /**\n * Hides / shows a slice, stage, radar series or top-level treemap node and\n * emits `toggle` (with the `hidden` option: only emits `toggle`)\n */\n toggle(index: number): void;\n /** Indexes of the hidden entries, ascending */\n getHidden(): number[];\n /**\n * Sunburst: zooms into the node at `path` (names from the root, `[]` =\n * the root) and emits `drill` (with the `drillPath` option: only emits `drill`)\n */\n drill(path: readonly string[]): void;\n /** Sunburst: names from the root to the focused node (`[]` = the root) */\n getDrillPath(): string[];\n /** Removes the hover (and the tooltip) */\n clearHover(): void;\n /** Subscribes to an event; returns the unsubscribe function */\n on<K extends keyof ShapeChartEventMap>(\n type: K,\n listener: (event: ShapeChartEventMap[K]) => void,\n ): () => void;\n /** Stops the animations and the listeners */\n destroy(): void;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart drawn on a 2D\n * canvas, legend and tooltip included. Works without a DOM.\n */\nexport const createCanvasShapeChart = (\n config: CanvasShapeChartConfig,\n): CanvasShapeChartInstance => {\n const { canvas } = config;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D | null;\n } catch {\n ctx = null;\n }\n let width = config.width;\n let height = config.height;\n let dpr = config.pixelRatio ?? 1;\n let options = config.options;\n let themeInput = config.theme;\n let theme: ChartTheme = createTheme(themeInput, options.palette);\n const runtime = createShapeRuntime(options);\n let scene: ShapeScene | null = null;\n let legendBoxes: ShapeLegendBox[] = [];\n let hover: { hover: ShapeHover; x: number; y: number } | null = null;\n let press: { x: number; y: number; moved: boolean } | null = null;\n let destroyed = false;\n let frameId: number | null = null;\n let frameKind: \"canvas\" | \"global\" | \"timeout\" = \"timeout\";\n let fontSet = \"\";\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n const measure: MeasureText = (text, f) => {\n if (!ctx || typeof ctx.measureText !== \"function\")\n return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n const g = globalThis as {\n requestAnimationFrame?: (cb: () => void) => number;\n cancelAnimationFrame?: (id: number) => void;\n };\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameKind === \"canvas\") canvas.cancelAnimationFrame?.(frameId);\n else if (frameKind === \"global\") g.cancelAnimationFrame?.(frameId);\n else clearTimeout(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (canvas.requestAnimationFrame) {\n frameKind = \"canvas\";\n frameId = canvas.requestAnimationFrame(() => render());\n } else if (g.requestAnimationFrame) {\n frameKind = \"global\";\n frameId = g.requestAnimationFrame(() => render());\n } else {\n frameKind = \"timeout\";\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipText = (event: ShapeHoverEvent): string | null | undefined => {\n if (options.tooltip === false) return null;\n const render =\n typeof options.tooltip === \"object\" ? options.tooltip.render : undefined;\n if (!render) return undefined;\n const out = render(event);\n // nodes cannot be drawn on a canvas: use their text\n if (out === null) return null;\n return typeof out === \"string\" ? out : (out.textContent ?? null);\n };\n\n function render() {\n frameId = null;\n if (destroyed || !(width > 0 && height > 0)) return;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n fontSet = \"\";\n\n const entries = shapeLegend(options, theme, runtime.hidden);\n const legendPosition = legendConfig(options).position;\n let bounds = { x: 0, y: 0, width, height };\n legendBoxes = [];\n if (entries) {\n const legend = layoutShapeLegend(\n entries,\n width,\n legendPosition,\n height,\n theme,\n measure,\n );\n legendBoxes = legend.boxes;\n bounds = {\n x: 0,\n y: legendPosition === \"top\" ? legend.height : 0,\n width,\n height: Math.max(0, height - legend.height),\n };\n }\n const frame = runtime.frame(now(), {\n theme,\n width,\n height,\n bounds,\n measure,\n });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n if (legendBoxes.length) drawShapeLegend(ctx, theme, legendBoxes);\n const event = hover ? hoverEvent(scene, hover.hover) : null;\n if (hover && event && !press?.moved) {\n const custom = tooltipText(event);\n const content =\n custom === undefined ? tooltipContent(scene, hover.hover) : custom;\n if (content) {\n const box = layoutShapeTooltip(\n content,\n hover.x,\n hover.y,\n width,\n height,\n theme,\n measure,\n scene,\n hover.hover,\n );\n drawShapeTooltip(ctx, theme, box);\n }\n }\n fontSet = \"\";\n }\n if (frame.animating) schedule();\n }\n\n const setHover = (next: ShapeHover | null, x: number, y: number) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n const moved = !!next && (hover?.x !== x || hover?.y !== y);\n hover = next ? { hover: next, x, y } : null;\n if (changed || moved) schedule();\n if (changed) emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n const legendAt = (x: number, y: number) =>\n legendBoxes.find(\n (b) =>\n x >= b.x - 4 &&\n x <= b.x + b.width + 4 &&\n y >= b.y &&\n y <= b.y + b.height,\n );\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const toggle = (index: number) => {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) schedule();\n emit(\"toggle\", event);\n };\n\n const drill = (path: readonly string[]) => {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) schedule();\n emit(\"drill\", event);\n };\n\n /** Tap / click: legend toggle, else hover + click event */\n const tap = (x: number, y: number) => {\n const box = legendAt(x, y);\n if (box) {\n if (legendConfig(options).toggle) toggle(box.index);\n return;\n }\n const hit = hitAt(x, y);\n if (hit && scene) {\n setHover(hit, x, y);\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill && options.type === \"sunburst\" && options.drill !== false)\n drill(item.drill);\n } else setHover(null, x, y);\n };\n\n const down = (x: number, y: number) => {\n press = { x, y, moved: false };\n };\n const move = (x: number, y: number, touch: boolean) => {\n if (press && Math.hypot(x - press.x, y - press.y) > TAP_SLOP)\n press.moved = true;\n if (touch) return;\n setHover(hitAt(x, y), x, y);\n };\n const up = (x: number, y: number) => {\n const p = press;\n press = null;\n if (p && !p.moved) tap(x, y);\n else schedule();\n };\n\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const paletteChanged =\n (next.palette ?? []).join() !== (options.palette ?? []).join();\n if (next.type !== options.type) hover = null;\n options = next;\n runtime.setOptions(next);\n if (paletteChanged) theme = createTheme(themeInput, next.palette);\n schedule();\n },\n setTheme(input) {\n if (destroyed) return;\n themeInput = input;\n theme = createTheme(input, options.palette);\n schedule();\n },\n resize(w, h, ratio) {\n width = w;\n height = h;\n if (ratio) dpr = ratio;\n schedule();\n },\n render() {\n cancelFrame();\n render();\n },\n touchStart(touches) {\n const t = touches[0];\n if (t) down(t.x, t.y);\n },\n touchMove(touches) {\n const t = touches[0];\n if (t) move(t.x, t.y, true);\n },\n touchEnd(touches) {\n const t = touches[0];\n if (t) up(t.x, t.y);\n else press = null;\n },\n touchCancel() {\n press = null;\n schedule();\n },\n pointerDown: (x, y) => down(x, y),\n pointerMove: (x, y) => move(x, y, false),\n pointerUp: (x, y) => up(x, y),\n pointerLeave() {\n press = null;\n setHover(null, 0, 0);\n },\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n clearHover: () => setHover(null, 0, 0),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n },\n };\n};\n"],"mappings":"6JA+BA,IAAMkB,EAAW,EAoEJC,EACX,GAC6B,CAC7B,GAAM,CAAE,UAAWC,EACfC,EAAuC,KAC3C,GAAI,CACF,EAAMC,EAAO,WAAW,IAAI,CAC9B,MAAQ,CACN,EAAM,IACR,CACA,IAAIC,EAAQH,EAAO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AAQ,UAAU,EACtC,eAAkBkC,EAAS,KAAM,EAAG,CAAC,EACrC,GAAG,EAAM,EAAU,CAEjB,OADAzB,EAAUG,EAAK,CAAC,IAAID,CAAQ,MACf,CACXF,EAAUG,EAAK,CAAC,OAAOD,CAAQ,CACjC,CACF,EACA,SAAU,CACJN,IACJ,EAAY,GACZa,EAAY,EACZT,EAAU,MAAM,MAAM,EACtBA,EAAU,MAAM,MAAM,EACtBA,EAAU,OAAO,MAAM,EACvBA,EAAU,MAAM,MAAM,EACxB,CACF,CACF"}
@@ -44,6 +44,13 @@ export interface CanvasShapeChartInstance {
44
44
  toggle(index: number): void;
45
45
  /** Indexes of the hidden entries, ascending */
46
46
  getHidden(): number[];
47
+ /**
48
+ * Sunburst: zooms into the node at `path` (names from the root, `[]` =
49
+ * the root) and emits `drill` (with the `drillPath` option: only emits `drill`)
50
+ */
51
+ drill(path: readonly string[]): void;
52
+ /** Sunburst: names from the root to the focused node (`[]` = the root) */
53
+ getDrillPath(): string[];
47
54
  /** Removes the hover (and the tooltip) */
48
55
  clearHover(): void;
49
56
  /** Subscribes to an event; returns the unsubscribe function */
@@ -44,6 +44,13 @@ export interface CanvasShapeChartInstance {
44
44
  toggle(index: number): void;
45
45
  /** Indexes of the hidden entries, ascending */
46
46
  getHidden(): number[];
47
+ /**
48
+ * Sunburst: zooms into the node at `path` (names from the root, `[]` =
49
+ * the root) and emits `drill` (with the `drillPath` option: only emits `drill`)
50
+ */
51
+ drill(path: readonly string[]): void;
52
+ /** Sunburst: names from the root to the focused node (`[]` = the root) */
53
+ getDrillPath(): string[];
47
54
  /** Removes the hover (and the tooltip) */
48
55
  clearHover(): void;
49
56
  /** Subscribes to an event; returns the unsubscribe function */
@@ -15,7 +15,8 @@ var h = 8, g = (g) => {
15
15
  let y = g.width, b = g.height, x = g.pixelRatio ?? 1, S = g.options, C = g.theme, w = e(C, S.palette), T = p(S), E = null, D = [], O = null, k = null, A = !1, j = null, M = "timeout", N = "", P = {
16
16
  hover: /* @__PURE__ */ new Set(),
17
17
  click: /* @__PURE__ */ new Set(),
18
- toggle: /* @__PURE__ */ new Set()
18
+ toggle: /* @__PURE__ */ new Set(),
19
+ drill: /* @__PURE__ */ new Set()
19
20
  }, F = (e, t) => {
20
21
  for (let n of [...P[e]]) n(t);
21
22
  }, I = (e, n) => !v || typeof v.measureText != "function" ? t(e, n) : (n !== N && (v.font = n, N = n), v.measureText(e).width), L = globalThis, R = () => {
@@ -80,7 +81,11 @@ var h = 8, g = (g) => {
80
81
  if (A) return;
81
82
  let t = T.toggle(e);
82
83
  t && (S.hidden || z(), F("toggle", t));
83
- }, K = (e, t) => {
84
+ }, K = (e) => {
85
+ if (A) return;
86
+ let t = T.drill(e);
87
+ t && (S.type === "sunburst" && !S.drillPath && z(), F("drill", t));
88
+ }, q = (e, t) => {
84
89
  let n = U(e, t);
85
90
  if (n) {
86
91
  l(S).toggle && G(n.index);
@@ -91,18 +96,20 @@ var h = 8, g = (g) => {
91
96
  H(r, e, t);
92
97
  let n = o(E, r);
93
98
  n && F("click", n);
99
+ let i = E.items.find((e) => e.index === r.index);
100
+ i?.drill && S.type === "sunburst" && S.drill !== !1 && K(i.drill);
94
101
  } else H(null, e, t);
95
- }, q = (e, t) => {
102
+ }, J = (e, t) => {
96
103
  k = {
97
104
  x: e,
98
105
  y: t,
99
106
  moved: !1
100
107
  };
101
- }, J = (e, t, n) => {
108
+ }, Y = (e, t, n) => {
102
109
  k && Math.hypot(e - k.x, t - k.y) > h && (k.moved = !0), !n && H(W(e, t), e, t);
103
- }, Y = (e, t) => {
110
+ }, X = (e, t) => {
104
111
  let n = k;
105
- k = null, n && !n.moved ? K(e, t) : z();
112
+ k = null, n && !n.moved ? q(e, t) : z();
106
113
  };
107
114
  return V(), {
108
115
  setOptions(t) {
@@ -121,27 +128,29 @@ var h = 8, g = (g) => {
121
128
  },
122
129
  touchStart(e) {
123
130
  let t = e[0];
124
- t && q(t.x, t.y);
131
+ t && J(t.x, t.y);
125
132
  },
126
133
  touchMove(e) {
127
134
  let t = e[0];
128
- t && J(t.x, t.y, !0);
135
+ t && Y(t.x, t.y, !0);
129
136
  },
130
137
  touchEnd(e) {
131
138
  let t = e[0];
132
- t ? Y(t.x, t.y) : k = null;
139
+ t ? X(t.x, t.y) : k = null;
133
140
  },
134
141
  touchCancel() {
135
142
  k = null, z();
136
143
  },
137
- pointerDown: (e, t) => q(e, t),
138
- pointerMove: (e, t) => J(e, t, !1),
139
- pointerUp: (e, t) => Y(e, t),
144
+ pointerDown: (e, t) => J(e, t),
145
+ pointerMove: (e, t) => Y(e, t, !1),
146
+ pointerUp: (e, t) => X(e, t),
140
147
  pointerLeave() {
141
148
  k = null, H(null, 0, 0);
142
149
  },
143
150
  toggle: G,
144
151
  getHidden: () => T.hiddenIndexes(),
152
+ drill: K,
153
+ getDrillPath: () => T.drillPath(),
145
154
  clearHover: () => H(null, 0, 0),
146
155
  on(e, t) {
147
156
  return P[e].add(t), () => {
@@ -149,7 +158,7 @@ var h = 8, g = (g) => {
149
158
  };
150
159
  },
151
160
  destroy() {
152
- A || (A = !0, R(), P.hover.clear(), P.click.clear(), P.toggle.clear());
161
+ A || (A = !0, R(), P.hover.clear(), P.click.clear(), P.toggle.clear(), P.drill.clear());
153
162
  }
154
163
  };
155
164
  };
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.js","names":["TAP_SLOP","createCanvasShapeChart","config","ctx","canvas","width","height","dpr","options","themeInput","theme","createTheme","runtime","createShapeRuntime","scene","legendBoxes","hover","press","destroyed","frameId","frameKind","fontSet","listeners","emit","listener","type","event","measure","estimateText","text","f","g","cancelFrame","schedule","render","tooltipText","out","pw","ph","entries","shapeLegend","legendPosition","legendConfig","bounds","legend","layoutShapeLegend","frame","now","it","drawShapeScene","drawShapeLegend","hoverEvent","custom","content","tooltipContent","box","layoutShapeTooltip","setHover","changed","sameHover","next","moved","x","y","legendAt","b","hitAt","hitTestShapes","toggle","index","tap","hit","e","down","move","up","p","paletteChanged","input","w","h","ratio","touches"],"sources":["../../../../../charts/src/engine/shapes/canvas.ts"],"sourcesContent":["// createCanvasShapeChart: shape charts on one 2D canvas without any DOM\n// (mini-programs, Taro, uni-app, OffscreenCanvas). The legend and the\n// tooltip are drawn on the canvas; the host forwards touches / pointer events.\n\nimport type { ChartCanvas, ChartTouch } from \"../canvas\";\nimport { createTheme, type ChartTheme, type ChartThemeInput } from \"../theme\";\nimport { drawShapeLegend, drawShapeScene, drawShapeTooltip } from \"./draw\";\nimport { hitTestShapes } from \"./hit\";\nimport {\n hoverEvent,\n layoutShapeLegend,\n layoutShapeTooltip,\n legendConfig,\n sameHover,\n shapeLegend,\n tooltipContent,\n type ShapeLegendBox,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\nconst TAP_SLOP = 8;\n\nexport interface CanvasShapeChartConfig {\n /** Canvas to draw on (`HTMLCanvasElement`, `OffscreenCanvas` or a mini-program canvas node) */\n canvas: ChartCanvas;\n /** Width of the canvas in CSS pixels (rpx converted by the host) */\n width: number;\n /** Height of the canvas in CSS pixels */\n height: number;\n /**\n * Device pixel ratio (`wx.getWindowInfo().pixelRatio` in mini-programs)\n * @default 1\n */\n pixelRatio?: number;\n /** Chart options */\n options: ShapeChartOptions;\n /** Colors and fonts: values of the Minerva CSS variables */\n theme?: ChartThemeInput;\n}\n\nexport interface CanvasShapeChartInstance {\n /** Replaces the options (animates from the previous values) */\n setOptions(options: ShapeChartOptions): void;\n /** Replaces the theme input */\n setTheme(theme: ChartThemeInput | undefined): void;\n /** New CSS size (and pixel ratio) of the canvas */\n resize(width: number, height: number, pixelRatio?: number): void;\n /** Draws now (frames are otherwise scheduled automatically) */\n render(): void;\n /** Touch handlers: pass the `touches` / `changedTouches` of the event */\n touchStart(touches: readonly ChartTouch[]): void;\n touchMove(touches: readonly ChartTouch[]): void;\n touchEnd(changedTouches: readonly ChartTouch[]): void;\n touchCancel(changedTouches?: readonly ChartTouch[]): void;\n /** Mouse / pen handlers (H5, desktop mini-programs) */\n pointerDown(x: number, y: number): void;\n pointerMove(x: number, y: number): void;\n pointerUp(x: number, y: number): void;\n pointerLeave(): void;\n /**\n * Hides / shows a slice, stage, radar series or top-level treemap node and\n * emits `toggle` (with the `hidden` option: only emits `toggle`)\n */\n toggle(index: number): void;\n /** Indexes of the hidden entries, ascending */\n getHidden(): number[];\n /** Removes the hover (and the tooltip) */\n clearHover(): void;\n /** Subscribes to an event; returns the unsubscribe function */\n on<K extends keyof ShapeChartEventMap>(\n type: K,\n listener: (event: ShapeChartEventMap[K]) => void,\n ): () => void;\n /** Stops the animations and the listeners */\n destroy(): void;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart drawn on a 2D\n * canvas, legend and tooltip included. Works without a DOM.\n */\nexport const createCanvasShapeChart = (\n config: CanvasShapeChartConfig,\n): CanvasShapeChartInstance => {\n const { canvas } = config;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D | null;\n } catch {\n ctx = null;\n }\n let width = config.width;\n let height = config.height;\n let dpr = config.pixelRatio ?? 1;\n let options = config.options;\n let themeInput = config.theme;\n let theme: ChartTheme = createTheme(themeInput, options.palette);\n const runtime = createShapeRuntime(options);\n let scene: ShapeScene | null = null;\n let legendBoxes: ShapeLegendBox[] = [];\n let hover: { hover: ShapeHover; x: number; y: number } | null = null;\n let press: { x: number; y: number; moved: boolean } | null = null;\n let destroyed = false;\n let frameId: number | null = null;\n let frameKind: \"canvas\" | \"global\" | \"timeout\" = \"timeout\";\n let fontSet = \"\";\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = { hover: new Set(), click: new Set(), toggle: new Set() };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n const measure: MeasureText = (text, f) => {\n if (!ctx || typeof ctx.measureText !== \"function\")\n return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n const g = globalThis as {\n requestAnimationFrame?: (cb: () => void) => number;\n cancelAnimationFrame?: (id: number) => void;\n };\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameKind === \"canvas\") canvas.cancelAnimationFrame?.(frameId);\n else if (frameKind === \"global\") g.cancelAnimationFrame?.(frameId);\n else clearTimeout(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (canvas.requestAnimationFrame) {\n frameKind = \"canvas\";\n frameId = canvas.requestAnimationFrame(() => render());\n } else if (g.requestAnimationFrame) {\n frameKind = \"global\";\n frameId = g.requestAnimationFrame(() => render());\n } else {\n frameKind = \"timeout\";\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipText = (event: ShapeHoverEvent): string | null | undefined => {\n if (options.tooltip === false) return null;\n const render =\n typeof options.tooltip === \"object\" ? options.tooltip.render : undefined;\n if (!render) return undefined;\n const out = render(event);\n // nodes cannot be drawn on a canvas: use their text\n if (out === null) return null;\n return typeof out === \"string\" ? out : (out.textContent ?? null);\n };\n\n function render() {\n frameId = null;\n if (destroyed || !(width > 0 && height > 0)) return;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n fontSet = \"\";\n\n const entries = shapeLegend(options, theme, runtime.hidden);\n const legendPosition = legendConfig(options).position;\n let bounds = { x: 0, y: 0, width, height };\n legendBoxes = [];\n if (entries) {\n const legend = layoutShapeLegend(\n entries,\n width,\n legendPosition,\n height,\n theme,\n measure,\n );\n legendBoxes = legend.boxes;\n bounds = {\n x: 0,\n y: legendPosition === \"top\" ? legend.height : 0,\n width,\n height: Math.max(0, height - legend.height),\n };\n }\n const frame = runtime.frame(now(), {\n theme,\n width,\n height,\n bounds,\n measure,\n });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n if (legendBoxes.length) drawShapeLegend(ctx, theme, legendBoxes);\n const event = hover ? hoverEvent(scene, hover.hover) : null;\n if (hover && event && !press?.moved) {\n const custom = tooltipText(event);\n const content =\n custom === undefined ? tooltipContent(scene, hover.hover) : custom;\n if (content) {\n const box = layoutShapeTooltip(\n content,\n hover.x,\n hover.y,\n width,\n height,\n theme,\n measure,\n scene,\n hover.hover,\n );\n drawShapeTooltip(ctx, theme, box);\n }\n }\n fontSet = \"\";\n }\n if (frame.animating) schedule();\n }\n\n const setHover = (next: ShapeHover | null, x: number, y: number) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n const moved = !!next && (hover?.x !== x || hover?.y !== y);\n hover = next ? { hover: next, x, y } : null;\n if (changed || moved) schedule();\n if (changed) emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n const legendAt = (x: number, y: number) =>\n legendBoxes.find(\n (b) =>\n x >= b.x - 4 &&\n x <= b.x + b.width + 4 &&\n y >= b.y &&\n y <= b.y + b.height,\n );\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const toggle = (index: number) => {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) schedule();\n emit(\"toggle\", event);\n };\n\n /** Tap / click: legend toggle, else hover + click event */\n const tap = (x: number, y: number) => {\n const box = legendAt(x, y);\n if (box) {\n if (legendConfig(options).toggle) toggle(box.index);\n return;\n }\n const hit = hitAt(x, y);\n if (hit && scene) {\n setHover(hit, x, y);\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n } else setHover(null, x, y);\n };\n\n const down = (x: number, y: number) => {\n press = { x, y, moved: false };\n };\n const move = (x: number, y: number, touch: boolean) => {\n if (press && Math.hypot(x - press.x, y - press.y) > TAP_SLOP)\n press.moved = true;\n if (touch) return;\n setHover(hitAt(x, y), x, y);\n };\n const up = (x: number, y: number) => {\n const p = press;\n press = null;\n if (p && !p.moved) tap(x, y);\n else schedule();\n };\n\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const paletteChanged =\n (next.palette ?? []).join() !== (options.palette ?? []).join();\n if (next.type !== options.type) hover = null;\n options = next;\n runtime.setOptions(next);\n if (paletteChanged) theme = createTheme(themeInput, next.palette);\n schedule();\n },\n setTheme(input) {\n if (destroyed) return;\n themeInput = input;\n theme = createTheme(input, options.palette);\n schedule();\n },\n resize(w, h, ratio) {\n width = w;\n height = h;\n if (ratio) dpr = ratio;\n schedule();\n },\n render() {\n cancelFrame();\n render();\n },\n touchStart(touches) {\n const t = touches[0];\n if (t) down(t.x, t.y);\n },\n touchMove(touches) {\n const t = touches[0];\n if (t) move(t.x, t.y, true);\n },\n touchEnd(touches) {\n const t = touches[0];\n if (t) up(t.x, t.y);\n else press = null;\n },\n touchCancel() {\n press = null;\n schedule();\n },\n pointerDown: (x, y) => down(x, y),\n pointerMove: (x, y) => move(x, y, false),\n pointerUp: (x, y) => up(x, y),\n pointerLeave() {\n press = null;\n setHover(null, 0, 0);\n },\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n clearHover: () => setHover(null, 0, 0),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n },\n };\n};\n"],"mappings":";;;;;;;AA+BA,IAAM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IACZc,EAAY,GACZV,EAAU,MAAM,MAAM,GACtBA,EAAU,MAAM,MAAM,GACtBA,EAAU,OAAO,MAAM;EACzB;CACF;AACF"}
1
+ {"version":3,"file":"canvas.js","names":["TAP_SLOP","createCanvasShapeChart","config","ctx","canvas","width","height","dpr","options","themeInput","theme","createTheme","runtime","createShapeRuntime","scene","legendBoxes","hover","press","destroyed","frameId","frameKind","fontSet","listeners","emit","listener","type","event","measure","estimateText","text","f","g","cancelFrame","schedule","render","tooltipText","out","pw","ph","entries","shapeLegend","legendPosition","legendConfig","bounds","legend","layoutShapeLegend","frame","now","it","drawShapeScene","drawShapeLegend","hoverEvent","custom","content","tooltipContent","box","layoutShapeTooltip","setHover","changed","sameHover","next","moved","x","y","legendAt","b","hitAt","hitTestShapes","toggle","index","drill","path","tap","hit","e","item","down","move","up","p","paletteChanged","input","w","h","ratio","touches"],"sources":["../../../../../charts/src/engine/shapes/canvas.ts"],"sourcesContent":["// createCanvasShapeChart: shape charts on one 2D canvas without any DOM\n// (mini-programs, Taro, uni-app, OffscreenCanvas). The legend and the\n// tooltip are drawn on the canvas; the host forwards touches / pointer events.\n\nimport type { ChartCanvas, ChartTouch } from \"../canvas\";\nimport { createTheme, type ChartTheme, type ChartThemeInput } from \"../theme\";\nimport { drawShapeLegend, drawShapeScene, drawShapeTooltip } from \"./draw\";\nimport { hitTestShapes } from \"./hit\";\nimport {\n hoverEvent,\n layoutShapeLegend,\n layoutShapeTooltip,\n legendConfig,\n sameHover,\n shapeLegend,\n tooltipContent,\n type ShapeLegendBox,\n} from \"./layout\";\nimport { createShapeRuntime, now } from \"./runtime\";\nimport {\n estimateText,\n type MeasureText,\n type ShapeHover,\n type ShapeScene,\n} from \"./scene\";\nimport type {\n ShapeChartEventMap,\n ShapeChartOptions,\n ShapeHoverEvent,\n} from \"./types\";\n\nconst TAP_SLOP = 8;\n\nexport interface CanvasShapeChartConfig {\n /** Canvas to draw on (`HTMLCanvasElement`, `OffscreenCanvas` or a mini-program canvas node) */\n canvas: ChartCanvas;\n /** Width of the canvas in CSS pixels (rpx converted by the host) */\n width: number;\n /** Height of the canvas in CSS pixels */\n height: number;\n /**\n * Device pixel ratio (`wx.getWindowInfo().pixelRatio` in mini-programs)\n * @default 1\n */\n pixelRatio?: number;\n /** Chart options */\n options: ShapeChartOptions;\n /** Colors and fonts: values of the Minerva CSS variables */\n theme?: ChartThemeInput;\n}\n\nexport interface CanvasShapeChartInstance {\n /** Replaces the options (animates from the previous values) */\n setOptions(options: ShapeChartOptions): void;\n /** Replaces the theme input */\n setTheme(theme: ChartThemeInput | undefined): void;\n /** New CSS size (and pixel ratio) of the canvas */\n resize(width: number, height: number, pixelRatio?: number): void;\n /** Draws now (frames are otherwise scheduled automatically) */\n render(): void;\n /** Touch handlers: pass the `touches` / `changedTouches` of the event */\n touchStart(touches: readonly ChartTouch[]): void;\n touchMove(touches: readonly ChartTouch[]): void;\n touchEnd(changedTouches: readonly ChartTouch[]): void;\n touchCancel(changedTouches?: readonly ChartTouch[]): void;\n /** Mouse / pen handlers (H5, desktop mini-programs) */\n pointerDown(x: number, y: number): void;\n pointerMove(x: number, y: number): void;\n pointerUp(x: number, y: number): void;\n pointerLeave(): void;\n /**\n * Hides / shows a slice, stage, radar series or top-level treemap node and\n * emits `toggle` (with the `hidden` option: only emits `toggle`)\n */\n toggle(index: number): void;\n /** Indexes of the hidden entries, ascending */\n getHidden(): number[];\n /**\n * Sunburst: zooms into the node at `path` (names from the root, `[]` =\n * the root) and emits `drill` (with the `drillPath` option: only emits `drill`)\n */\n drill(path: readonly string[]): void;\n /** Sunburst: names from the root to the focused node (`[]` = the root) */\n getDrillPath(): string[];\n /** Removes the hover (and the tooltip) */\n clearHover(): void;\n /** Subscribes to an event; returns the unsubscribe function */\n on<K extends keyof ShapeChartEventMap>(\n type: K,\n listener: (event: ShapeChartEventMap[K]) => void,\n ): () => void;\n /** Stops the animations and the listeners */\n destroy(): void;\n}\n\n/**\n * Creates a pie / donut, radar, gauge, funnel or treemap chart drawn on a 2D\n * canvas, legend and tooltip included. Works without a DOM.\n */\nexport const createCanvasShapeChart = (\n config: CanvasShapeChartConfig,\n): CanvasShapeChartInstance => {\n const { canvas } = config;\n let ctx: CanvasRenderingContext2D | null = null;\n try {\n ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D | null;\n } catch {\n ctx = null;\n }\n let width = config.width;\n let height = config.height;\n let dpr = config.pixelRatio ?? 1;\n let options = config.options;\n let themeInput = config.theme;\n let theme: ChartTheme = createTheme(themeInput, options.palette);\n const runtime = createShapeRuntime(options);\n let scene: ShapeScene | null = null;\n let legendBoxes: ShapeLegendBox[] = [];\n let hover: { hover: ShapeHover; x: number; y: number } | null = null;\n let press: { x: number; y: number; moved: boolean } | null = null;\n let destroyed = false;\n let frameId: number | null = null;\n let frameKind: \"canvas\" | \"global\" | \"timeout\" = \"timeout\";\n let fontSet = \"\";\n\n const listeners: {\n [K in keyof ShapeChartEventMap]: Set<\n (event: ShapeChartEventMap[K]) => void\n >;\n } = {\n hover: new Set(),\n click: new Set(),\n toggle: new Set(),\n drill: new Set(),\n };\n const emit = <K extends keyof ShapeChartEventMap>(\n type: K,\n event: ShapeChartEventMap[K],\n ) => {\n for (const listener of [...listeners[type]]) listener(event);\n };\n\n const measure: MeasureText = (text, f) => {\n if (!ctx || typeof ctx.measureText !== \"function\")\n return estimateText(text, f);\n if (f !== fontSet) {\n ctx.font = f;\n fontSet = f;\n }\n return ctx.measureText(text).width;\n };\n\n const g = globalThis as {\n requestAnimationFrame?: (cb: () => void) => number;\n cancelAnimationFrame?: (id: number) => void;\n };\n\n const cancelFrame = () => {\n if (frameId === null) return;\n if (frameKind === \"canvas\") canvas.cancelAnimationFrame?.(frameId);\n else if (frameKind === \"global\") g.cancelAnimationFrame?.(frameId);\n else clearTimeout(frameId);\n frameId = null;\n };\n\n const schedule = () => {\n if (destroyed || frameId !== null) return;\n if (canvas.requestAnimationFrame) {\n frameKind = \"canvas\";\n frameId = canvas.requestAnimationFrame(() => render());\n } else if (g.requestAnimationFrame) {\n frameKind = \"global\";\n frameId = g.requestAnimationFrame(() => render());\n } else {\n frameKind = \"timeout\";\n frameId = setTimeout(() => render(), 16) as unknown as number;\n }\n };\n\n const tooltipText = (event: ShapeHoverEvent): string | null | undefined => {\n if (options.tooltip === false) return null;\n const render =\n typeof options.tooltip === \"object\" ? options.tooltip.render : undefined;\n if (!render) return undefined;\n const out = render(event);\n // nodes cannot be drawn on a canvas: use their text\n if (out === null) return null;\n return typeof out === \"string\" ? out : (out.textContent ?? null);\n };\n\n function render() {\n frameId = null;\n if (destroyed || !(width > 0 && height > 0)) return;\n const pw = Math.max(1, Math.round(width * dpr));\n const ph = Math.max(1, Math.round(height * dpr));\n if (canvas.width !== pw) canvas.width = pw;\n if (canvas.height !== ph) canvas.height = ph;\n fontSet = \"\";\n\n const entries = shapeLegend(options, theme, runtime.hidden);\n const legendPosition = legendConfig(options).position;\n let bounds = { x: 0, y: 0, width, height };\n legendBoxes = [];\n if (entries) {\n const legend = layoutShapeLegend(\n entries,\n width,\n legendPosition,\n height,\n theme,\n measure,\n );\n legendBoxes = legend.boxes;\n bounds = {\n x: 0,\n y: legendPosition === \"top\" ? legend.height : 0,\n width,\n height: Math.max(0, height - legend.height),\n };\n }\n const frame = runtime.frame(now(), {\n theme,\n width,\n height,\n bounds,\n measure,\n });\n scene = frame.scene;\n if (hover && !scene.items.some((it) => it.index === hover?.hover.index)) {\n hover = null;\n emit(\"hover\", null);\n }\n if (ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, pw, ph);\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawShapeScene(ctx, scene, hover?.hover ?? null);\n if (legendBoxes.length) drawShapeLegend(ctx, theme, legendBoxes);\n const event = hover ? hoverEvent(scene, hover.hover) : null;\n if (hover && event && !press?.moved) {\n const custom = tooltipText(event);\n const content =\n custom === undefined ? tooltipContent(scene, hover.hover) : custom;\n if (content) {\n const box = layoutShapeTooltip(\n content,\n hover.x,\n hover.y,\n width,\n height,\n theme,\n measure,\n scene,\n hover.hover,\n );\n drawShapeTooltip(ctx, theme, box);\n }\n }\n fontSet = \"\";\n }\n if (frame.animating) schedule();\n }\n\n const setHover = (next: ShapeHover | null, x: number, y: number) => {\n const changed = !sameHover(hover?.hover ?? null, next);\n const moved = !!next && (hover?.x !== x || hover?.y !== y);\n hover = next ? { hover: next, x, y } : null;\n if (changed || moved) schedule();\n if (changed) emit(\"hover\", scene && next ? hoverEvent(scene, next) : null);\n };\n\n const legendAt = (x: number, y: number) =>\n legendBoxes.find(\n (b) =>\n x >= b.x - 4 &&\n x <= b.x + b.width + 4 &&\n y >= b.y &&\n y <= b.y + b.height,\n );\n\n const hitAt = (x: number, y: number) =>\n scene ? hitTestShapes(scene, x, y, hover?.hover ?? null) : null;\n\n const toggle = (index: number) => {\n if (destroyed) return;\n const event = runtime.toggle(index);\n if (!event) return;\n if (!options.hidden) schedule();\n emit(\"toggle\", event);\n };\n\n const drill = (path: readonly string[]) => {\n if (destroyed) return;\n const event = runtime.drill(path);\n if (!event) return;\n if (options.type === \"sunburst\" && !options.drillPath) schedule();\n emit(\"drill\", event);\n };\n\n /** Tap / click: legend toggle, else hover + click event */\n const tap = (x: number, y: number) => {\n const box = legendAt(x, y);\n if (box) {\n if (legendConfig(options).toggle) toggle(box.index);\n return;\n }\n const hit = hitAt(x, y);\n if (hit && scene) {\n setHover(hit, x, y);\n const e = hoverEvent(scene, hit);\n if (e) emit(\"click\", e);\n const item = scene.items.find((it) => it.index === hit.index);\n if (item?.drill && options.type === \"sunburst\" && options.drill !== false)\n drill(item.drill);\n } else setHover(null, x, y);\n };\n\n const down = (x: number, y: number) => {\n press = { x, y, moved: false };\n };\n const move = (x: number, y: number, touch: boolean) => {\n if (press && Math.hypot(x - press.x, y - press.y) > TAP_SLOP)\n press.moved = true;\n if (touch) return;\n setHover(hitAt(x, y), x, y);\n };\n const up = (x: number, y: number) => {\n const p = press;\n press = null;\n if (p && !p.moved) tap(x, y);\n else schedule();\n };\n\n render();\n\n return {\n setOptions(next) {\n if (destroyed) return;\n const paletteChanged =\n (next.palette ?? []).join() !== (options.palette ?? []).join();\n if (next.type !== options.type) hover = null;\n options = next;\n runtime.setOptions(next);\n if (paletteChanged) theme = createTheme(themeInput, next.palette);\n schedule();\n },\n setTheme(input) {\n if (destroyed) return;\n themeInput = input;\n theme = createTheme(input, options.palette);\n schedule();\n },\n resize(w, h, ratio) {\n width = w;\n height = h;\n if (ratio) dpr = ratio;\n schedule();\n },\n render() {\n cancelFrame();\n render();\n },\n touchStart(touches) {\n const t = touches[0];\n if (t) down(t.x, t.y);\n },\n touchMove(touches) {\n const t = touches[0];\n if (t) move(t.x, t.y, true);\n },\n touchEnd(touches) {\n const t = touches[0];\n if (t) up(t.x, t.y);\n else press = null;\n },\n touchCancel() {\n press = null;\n schedule();\n },\n pointerDown: (x, y) => down(x, y),\n pointerMove: (x, y) => move(x, y, false),\n pointerUp: (x, y) => up(x, y),\n pointerLeave() {\n press = null;\n setHover(null, 0, 0);\n },\n toggle,\n getHidden: () => runtime.hiddenIndexes(),\n drill,\n getDrillPath: () => runtime.drillPath(),\n clearHover: () => setHover(null, 0, 0),\n on(type, listener) {\n listeners[type].add(listener);\n return () => {\n listeners[type].delete(listener);\n };\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n cancelFrame();\n listeners.hover.clear();\n listeners.click.clear();\n listeners.toggle.clear();\n listeners.drill.clear();\n },\n };\n};\n"],"mappings":";;;;;;;AA+BA,IAAMA,IAAW,GAoEJC,KACX,MAC6B;CAC7B,IAAM,EAAE,cAAWC,GACfC,IAAuC;CAC3C,IAAI;EACF,IAAMC,EAAO,WAAW,IAAI;CAC9B,QAAQ;EACN,IAAM;CACR;CACA,IAAIC,IAAQH,EAAO,OACfI,IAASJ,EAAO,QAChBK,IAAML,EAAO,cAAc,GAC3BM,IAAUN,EAAO,SACjBO,IAAaP,EAAO,OACpBQ,IAAoBC,EAAYF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AnC,EAAUG,EAAK,CAAC,IAAID,CAAQ,SACf;IACX,EAAUC,EAAK,CAAC,OAAOD,CAAQ;GACjC;EACF;EACA,UAAU;GACR,AAAIN,MACJ,IAAY,IACZc,EAAY,GACZV,EAAU,MAAM,MAAM,GACtBA,EAAU,MAAM,MAAM,GACtBA,EAAU,OAAO,MAAM,GACvBA,EAAU,MAAM,MAAM;EACxB;CACF;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("../dom.cjs"),t=require("../theme.cjs"),n=require("./scene.cjs"),r=require("./draw.cjs"),i=require("./hit.cjs"),a=require("./layout.cjs"),o=require("./runtime.cjs");var s=6,c=0,l=(l,u)=>{let d=l.ownerDocument,f=d.defaultView,p=e.createChartDom(l);p.root.classList.add(`minerva-shape-chart`),p.foreground.style.display=`none`,p.hover.style.display=`none`;let m=p.background,h=null;try{h=m.getContext(`2d`)}catch{h=null}let g=o.createShapeRuntime(u),_=u,v=t.readTheme(p.root,_.palette),y=null,b=null,x=``,S=!1,C=null,w=!1,T=null,E={hover:new Set,click:new Set,toggle:new Set},D=(e,t)=>{for(let n of[...E[e]])n(t)},O=d.createElement(`div`);O.id=`minerva-shape-chart-${++c}`,e.styleElement(O,{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`}),p.stage.appendChild(O),p.stage.setAttribute(`aria-describedby`,O.id),p.stage.tabIndex=0;let k=``,A=(e,t)=>h?(t!==k&&(h.font=t,k=t),h.measureText(e).width):n.estimateText(e,t),j=()=>{C!==null&&(w?clearTimeout(C):f?.cancelAnimationFrame?.(C),C=null)},M=()=>{S||C!==null||(f&&typeof f.requestAnimationFrame==`function`?(w=!1,C=f.requestAnimationFrame(()=>I())):(w=!0,C=setTimeout(()=>I(),16)))},N=()=>_.tooltip===!1?null:typeof _.tooltip==`object`?_.tooltip:{},ee=t=>{let n=N()?.render;if(n)return n(t);if(!y||!b)return null;let r=a.tooltipContent(y,b.hover);if(!r)return null;let i=d.createDocumentFragment(),o=d.createElement(`div`);e.styleElement(o,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`}),r.color&&o.appendChild(e.swatch(d,r.color,`dot`)),o.appendChild(d.createTextNode(r.title)),i.append(o);for(let t of r.rows){let n=d.createElement(`div`);e.styleElement(n,{display:`flex`,alignItems:`center`,gap:`8px`}),t.color&&n.appendChild(e.swatch(d,t.color,`dot`));let r=d.createElement(`span`);e.styleElement(r,{flex:`1 1 auto`,color:t.strong?`var(--text-color, #1f2937)`:`var(--text-secondary-color, #6b7280)`,fontWeight:t.strong?`600`:`400`}),r.textContent=t.name;let a=d.createElement(`span`);e.styleElement(a,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,marginLeft:`12px`}),a.textContent=t.value,n.append(r,a),i.append(n)}return i},P=(e=!1)=>{let t=p.tooltip,n=y&&b?a.hoverEvent(y,b.hover):null;if(!n||!y||!b||!N()||T?.moved){t.style.display=`none`,x=``;return}let r=`${n.index}:${n.indicator??``}`;if(e||r!==x){x=r;let e=ee(n);if(e===null||e===``){t.replaceChildren(),x=``,t.style.display=`none`;return}typeof e==`string`?(t.textContent=e,t.style.whiteSpace=`pre`):(t.replaceChildren(e),t.style.whiteSpace=`nowrap`)}else if(!t.firstChild)return;t.style.display=`block`;let o=b.keyboard?i.hoverAnchor(y,b.hover)??b:b,s=p.stage.clientWidth,c=p.stage.clientHeight,{x:l,y:u}=a.placeShapeTooltip(y,b.hover,o,t.offsetWidth,t.offsetHeight,s,c);t.style.transform=`translate(${Math.round(l)}px, ${Math.round(u)}px)`},F=(e,t,n,r)=>{let i=!a.sameHover(b?.hover??null,e);b=e?{hover:e,x:t,y:n,keyboard:r}:null,p.stage.style.cursor=e&&!r?`pointer`:``,P(),i&&(M(),D(`hover`,y&&e?a.hoverEvent(y,e):null))};function I(){if(C=null,S)return;let e=p.stage.clientWidth,t=p.stage.clientHeight;if(!(e>0&&t>0))return;let n=f?.devicePixelRatio||1,i=Math.max(1,Math.round(e*n)),s=Math.max(1,Math.round(t*n));m.width!==i&&(m.width=i),m.height!==s&&(m.height=s),m.style.width=`${e}px`,m.style.height=`${t}px`,k=``;let c=g.frame(o.now(),{theme:v,width:e,height:t,measure:A});if(y=c.scene,b&&!y.items.some(e=>e.index===b?.hover.index)&&(b=null,p.stage.style.cursor=``,D(`hover`,null)),h&&(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,i,s),h.setTransform(n,0,0,n,0,0),r.drawShapeScene(h,y,b?.hover??null),k=``),P(),c.animating)M();else{let e=a.describeScene(y);O.textContent!==e&&(O.textContent=e)}}let L=()=>{let t=a.shapeLegend(_,v,g.hidden),n=a.legendConfig(_),r=[...p.legend.children].indexOf(d.activeElement);if(p.legend.replaceChildren(),p.legend.style.display=t?`flex`:`none`,!t)return;let i=n.position===`bottom`;p.legend.style.order=i?`1`:`0`,p.legend.style.padding=i?`8px 4px 0`:`0 4px 8px`,p.legend.style.justifyContent=`center`;for(let r of t){let t=d.createElement(n.toggle?`button`:`span`);t instanceof HTMLButtonElement&&(t.type=`button`,t.setAttribute(`aria-pressed`,String(!r.hidden)),t.addEventListener(`click`,()=>z(r.index))),e.styleElement(t,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:n.toggle?`pointer`:`default`,opacity:r.hidden?`0.45`:`1`,textDecoration:r.hidden?`line-through`:`none`,transition:`opacity 120ms ease-out`}),t.append(e.swatch(d,r.color,`dot`),d.createTextNode(r.name)),p.legend.appendChild(t)}r>=0&&p.legend.children[r]?.focus()},R=()=>{p.stage.setAttribute(`aria-label`,_.ariaLabel??a.describeChart(_))};function z(e){if(S)return;let t=g.toggle(e);t&&(_.hidden||(L(),x=``,M()),D(`toggle`,t))}let B=e=>{let t=p.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},V=(e,t)=>y?i.hitTestShapes(y,e,t,b?.hover??null):null,H=e=>{let{x:t,y:n}=B(e);if(T&&T.id===e.pointerId){if(Math.hypot(t-T.x,n-T.y)>s&&(T.moved=!0),T.touch)return}else if(e.pointerType===`touch`)return;F(V(t,n),t,n,!1)},U=e=>{let{x:t,y:n}=B(e);T={x:t,y:n,id:e.pointerId,touch:e.pointerType===`touch`,moved:!1}},W=e=>{let t=T;if(T=null,!t||t.id!==e.pointerId||t.moved){P();return}let{x:n,y:r}=B(e),i=V(n,r);if(F(i,n,r,!1),i&&y){let e=a.hoverEvent(y,i);e&&D(`click`,e)}},G=()=>{T=null,P()},K=e=>{e.pointerType!==`touch`&&(T=null,b&&!b.keyboard&&F(null,0,0,!1))},q=e=>{if(!y||!e)return;let t=i.hoverAnchor(y,e)??{x:0,y:0};F(e,t.x,t.y,!0),p.live.textContent=a.describeItem(y,e)},J=e=>{if(!y)return;let t=b?.hover??null,n={ArrowRight:`next`,ArrowLeft:`prev`,ArrowUp:`up`,ArrowDown:`down`}[e.key];if(n){e.preventDefault(),q(i.stepHover(y,t,n));return}switch(e.key){case`Home`:case`End`:{let n=y.items;if(!n.length)return;e.preventDefault();let r=e.key===`Home`?n[0]:n[n.length-1];q(y.type===`radar`?{index:r.index,indicator:t?.indicator??0}:{index:r.index});break}case`Enter`:case` `:{if(!t)return;let n=a.hoverEvent(y,t);if(!n)return;e.preventDefault(),D(`click`,n);break}case`Escape`:b&&(e.preventDefault(),F(null,0,0,!1))}},Y=()=>{let e;try{e=p.stage.matches(`:focus-visible`)}catch{e=!0}e&&(p.stage.style.boxShadow=`inset 0 0 0 2px var(--primary-color, #4f46e5)`)},X=()=>{p.stage.style.boxShadow=``,b?.keyboard&&F(null,0,0,!1)},Z=p.stage;Z.addEventListener(`pointermove`,H),Z.addEventListener(`pointerdown`,U),Z.addEventListener(`pointerup`,W),Z.addEventListener(`pointercancel`,G),Z.addEventListener(`pointerleave`,K),Z.addEventListener(`keydown`,J),Z.addEventListener(`focus`,Y),Z.addEventListener(`blur`,X);let Q=typeof ResizeObserver==`function`?new ResizeObserver(()=>M()):null;Q?.observe(p.stage);let $=()=>{S||(v=t.readTheme(p.root,_.palette),L(),x=``,M())},te=t.watchTheme($);return L(),R(),I(),{setOptions(e){if(S)return;let n=_;_=e,g.setOptions(e),(e.palette??[]).join()!==(n.palette??[]).join()&&(v=t.readTheme(p.root,e.palette)),e.type!==n.type&&b&&F(null,0,0,!1),L(),R(),x=``,M()},resize(){S||(j(),I())},refreshTheme:$,toggle:z,getHidden:()=>g.hiddenIndexes(),on(e,t){return E[e].add(t),()=>{E[e].delete(t)}},destroy(){S||(S=!0,j(),Z.removeEventListener(`pointermove`,H),Z.removeEventListener(`pointerdown`,U),Z.removeEventListener(`pointerup`,W),Z.removeEventListener(`pointercancel`,G),Z.removeEventListener(`pointerleave`,K),Z.removeEventListener(`keydown`,J),Z.removeEventListener(`focus`,Y),Z.removeEventListener(`blur`,X),Q?.disconnect(),te(),E.hover.clear(),E.click.clear(),E.toggle.clear(),p.root.remove())}}};exports.createShapeChart=l;
1
+ const e=require("../dom.cjs"),t=require("../theme.cjs"),n=require("./scene.cjs"),r=require("./draw.cjs"),i=require("./hit.cjs"),a=require("./layout.cjs"),o=require("./runtime.cjs");var s=6,c=0,l=(l,u)=>{let d=l.ownerDocument,f=d.defaultView,p=e.createChartDom(l);p.root.classList.add(`minerva-shape-chart`),p.foreground.style.display=`none`,p.hover.style.display=`none`;let m=p.background,h=null;try{h=m.getContext(`2d`)}catch{h=null}let g=o.createShapeRuntime(u),_=u,v=t.readTheme(p.root,_.palette),y=null,b=null,x=``,S=!1,C=null,w=!1,T=null,E={hover:new Set,click:new Set,toggle:new Set,drill:new Set},D=(e,t)=>{for(let n of[...E[e]])n(t)},O=d.createElement(`div`);O.id=`minerva-shape-chart-${++c}`,e.styleElement(O,{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`}),p.stage.appendChild(O),p.stage.setAttribute(`aria-describedby`,O.id),p.stage.tabIndex=0;let k=``,ee=(e,t)=>h?(t!==k&&(h.font=t,k=t),h.measureText(e).width):n.estimateText(e,t),A=()=>{C!==null&&(w?clearTimeout(C):f?.cancelAnimationFrame?.(C),C=null)},j=()=>{S||C!==null||(f&&typeof f.requestAnimationFrame==`function`?(w=!1,C=f.requestAnimationFrame(()=>F())):(w=!0,C=setTimeout(()=>F(),16)))},M=()=>_.tooltip===!1?null:typeof _.tooltip==`object`?_.tooltip:{},te=t=>{let n=M()?.render;if(n)return n(t);if(!y||!b)return null;let r=a.tooltipContent(y,b.hover);if(!r)return null;let i=d.createDocumentFragment(),o=d.createElement(`div`);e.styleElement(o,{display:`flex`,alignItems:`center`,gap:`6px`,fontWeight:`600`,marginBottom:`4px`,color:`var(--text-color, #1f2937)`}),r.color&&o.appendChild(e.swatch(d,r.color,`dot`)),o.appendChild(d.createTextNode(r.title)),i.append(o);for(let t of r.rows){let n=d.createElement(`div`);e.styleElement(n,{display:`flex`,alignItems:`center`,gap:`8px`}),t.color&&n.appendChild(e.swatch(d,t.color,`dot`));let r=d.createElement(`span`);e.styleElement(r,{flex:`1 1 auto`,color:t.strong?`var(--text-color, #1f2937)`:`var(--text-secondary-color, #6b7280)`,fontWeight:t.strong?`600`:`400`}),r.textContent=t.name;let a=d.createElement(`span`);e.styleElement(a,{fontWeight:`600`,fontVariantNumeric:`tabular-nums`,marginLeft:`12px`}),a.textContent=t.value,n.append(r,a),i.append(n)}return i},N=(e=!1)=>{let t=p.tooltip,n=y&&b?a.hoverEvent(y,b.hover):null;if(!n||!y||!b||!M()||T?.moved){t.style.display=`none`,x=``;return}let r=`${n.index}:${n.indicator??``}`;if(e||r!==x){x=r;let e=te(n);if(e===null||e===``){t.replaceChildren(),x=``,t.style.display=`none`;return}typeof e==`string`?(t.textContent=e,t.style.whiteSpace=`pre`):(t.replaceChildren(e),t.style.whiteSpace=`nowrap`)}else if(!t.firstChild)return;t.style.display=`block`;let o=b.keyboard?i.hoverAnchor(y,b.hover)??b:b,s=p.stage.clientWidth,c=p.stage.clientHeight,{x:l,y:u}=a.placeShapeTooltip(y,b.hover,o,t.offsetWidth,t.offsetHeight,s,c);t.style.transform=`translate(${Math.round(l)}px, ${Math.round(u)}px)`},P=(e,t,n,r)=>{let i=!a.sameHover(b?.hover??null,e);b=e?{hover:e,x:t,y:n,keyboard:r}:null,p.stage.style.cursor=e&&!r?`pointer`:``,N(),i&&(j(),D(`hover`,y&&e?a.hoverEvent(y,e):null))};function F(){if(C=null,S)return;let e=p.stage.clientWidth,t=p.stage.clientHeight;if(!(e>0&&t>0))return;let n=f?.devicePixelRatio||1,i=Math.max(1,Math.round(e*n)),s=Math.max(1,Math.round(t*n));m.width!==i&&(m.width=i),m.height!==s&&(m.height=s),m.style.width=`${e}px`,m.style.height=`${t}px`,k=``;let c=g.frame(o.now(),{theme:v,width:e,height:t,measure:ee});if(y=c.scene,b&&!y.items.some(e=>e.index===b?.hover.index)&&(b=null,p.stage.style.cursor=``,D(`hover`,null)),h&&(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,i,s),h.setTransform(n,0,0,n,0,0),r.drawShapeScene(h,y,b?.hover??null),k=``),N(),c.animating)j();else{let e=a.describeScene(y);O.textContent!==e&&(O.textContent=e)}}let I=()=>{let t=a.shapeLegend(_,v,g.hidden),n=a.legendConfig(_),r=[...p.legend.children].indexOf(d.activeElement);if(p.legend.replaceChildren(),p.legend.style.display=t?`flex`:`none`,!t)return;let i=n.position===`bottom`;p.legend.style.order=i?`1`:`0`,p.legend.style.padding=i?`8px 4px 0`:`0 4px 8px`,p.legend.style.justifyContent=`center`;for(let r of t){let t=d.createElement(n.toggle?`button`:`span`);t instanceof HTMLButtonElement&&(t.type=`button`,t.setAttribute(`aria-pressed`,String(!r.hidden)),t.addEventListener(`click`,()=>R(r.index))),e.styleElement(t,{display:`inline-flex`,alignItems:`center`,gap:`6px`,padding:`2px 4px`,margin:`0`,border:`0`,borderRadius:`4px`,background:`none`,font:`inherit`,color:`var(--text-secondary-color, #6b7280)`,cursor:n.toggle?`pointer`:`default`,opacity:r.hidden?`0.45`:`1`,textDecoration:r.hidden?`line-through`:`none`,transition:`opacity 120ms ease-out`}),t.append(e.swatch(d,r.color,`dot`),d.createTextNode(r.name)),p.legend.appendChild(t)}r>=0&&p.legend.children[r]?.focus()},L=()=>{p.stage.setAttribute(`aria-label`,_.ariaLabel??a.describeChart(_))};function R(e){if(S)return;let t=g.toggle(e);t&&(_.hidden||(I(),x=``,j()),D(`toggle`,t))}function z(e){if(S)return;let t=g.drill(e);t&&(_.type===`sunburst`&&!_.drillPath&&(x=``,j()),D(`drill`,t))}let B=e=>{if(_.type!==`sunburst`||_.drill===!1||!y)return;let t=y.items.find(t=>t.index===e.index);t?.drill&&z(t.drill)},V=e=>{let t=p.stage.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},H=(e,t)=>y?i.hitTestShapes(y,e,t,b?.hover??null):null,U=e=>{let{x:t,y:n}=V(e);if(T&&T.id===e.pointerId){if(Math.hypot(t-T.x,n-T.y)>s&&(T.moved=!0),T.touch)return}else if(e.pointerType===`touch`)return;P(H(t,n),t,n,!1)},W=e=>{let{x:t,y:n}=V(e);T={x:t,y:n,id:e.pointerId,touch:e.pointerType===`touch`,moved:!1}},G=e=>{let t=T;if(T=null,!t||t.id!==e.pointerId||t.moved){N();return}let{x:n,y:r}=V(e),i=H(n,r);if(P(i,n,r,!1),i&&y){let e=a.hoverEvent(y,i);e&&D(`click`,e),B(i)}},K=()=>{T=null,N()},q=e=>{e.pointerType!==`touch`&&(T=null,b&&!b.keyboard&&P(null,0,0,!1))},J=e=>{if(!y||!e)return;let t=i.hoverAnchor(y,e)??{x:0,y:0};P(e,t.x,t.y,!0),p.live.textContent=a.describeItem(y,e)},Y=e=>{if(!y)return;let t=b?.hover??null,n={ArrowRight:`next`,ArrowLeft:`prev`,ArrowUp:`up`,ArrowDown:`down`}[e.key];if(n){e.preventDefault(),J(i.stepHover(y,t,n));return}switch(e.key){case`Home`:case`End`:{let n=y.items;if(!n.length)return;e.preventDefault();let r=e.key===`Home`?n[0]:n[n.length-1];J(y.type===`radar`?{index:r.index,indicator:t?.indicator??0}:{index:r.index});break}case`Enter`:case` `:{if(!t)return;let n=a.hoverEvent(y,t);if(!n)return;e.preventDefault(),D(`click`,n),B(t);break}case`Backspace`:{if(_.type!==`sunburst`||_.drill===!1)return;let t=g.drillPath();if(!t.length)return;e.preventDefault(),z(t.slice(0,-1));break}case`Escape`:b&&(e.preventDefault(),P(null,0,0,!1))}},X=()=>{let e;try{e=p.stage.matches(`:focus-visible`)}catch{e=!0}e&&(p.stage.style.boxShadow=`inset 0 0 0 2px var(--primary-color, #4f46e5)`)},Z=()=>{p.stage.style.boxShadow=``,b?.keyboard&&P(null,0,0,!1)},Q=p.stage;Q.addEventListener(`pointermove`,U),Q.addEventListener(`pointerdown`,W),Q.addEventListener(`pointerup`,G),Q.addEventListener(`pointercancel`,K),Q.addEventListener(`pointerleave`,q),Q.addEventListener(`keydown`,Y),Q.addEventListener(`focus`,X),Q.addEventListener(`blur`,Z);let $=typeof ResizeObserver==`function`?new ResizeObserver(()=>j()):null;$?.observe(p.stage);let ne=()=>{S||(v=t.readTheme(p.root,_.palette),I(),x=``,j())},re=t.watchTheme(ne);return I(),L(),F(),{setOptions(e){if(S)return;let n=_;_=e,g.setOptions(e),(e.palette??[]).join()!==(n.palette??[]).join()&&(v=t.readTheme(p.root,e.palette)),e.type!==n.type&&b&&P(null,0,0,!1),I(),L(),x=``,j()},resize(){S||(A(),F())},refreshTheme:ne,toggle:R,getHidden:()=>g.hiddenIndexes(),drill:z,getDrillPath:()=>g.drillPath(),on(e,t){return E[e].add(t),()=>{E[e].delete(t)}},destroy(){S||(S=!0,A(),Q.removeEventListener(`pointermove`,U),Q.removeEventListener(`pointerdown`,W),Q.removeEventListener(`pointerup`,G),Q.removeEventListener(`pointercancel`,K),Q.removeEventListener(`pointerleave`,q),Q.removeEventListener(`keydown`,Y),Q.removeEventListener(`focus`,X),Q.removeEventListener(`blur`,Z),$?.disconnect(),re(),E.hover.clear(),E.click.clear(),E.toggle.clear(),E.drill.clear(),p.root.remove())}}};exports.createShapeChart=l;
2
2
  //# sourceMappingURL=chart.cjs.map