minerva-design 1.4.0 → 1.6.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 (824) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +21 -21
  3. package/custom-elements.json +3072 -611
  4. package/dist/angular/fesm2022/minerva-angular.mjs +1491 -5
  5. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  6. package/dist/angular/types/minerva-angular.d.ts +595 -5
  7. package/dist/charts/canvas.d.cts +4 -3
  8. package/dist/charts/canvas.d.ts +4 -3
  9. package/dist/charts/core.cjs +1 -1
  10. package/dist/charts/core.d.cts +6 -4
  11. package/dist/charts/core.d.ts +6 -4
  12. package/dist/charts/core.js +24 -16
  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 +42 -19
  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.js +155 -127
  20. package/dist/charts/engine/canvas.js.map +1 -1
  21. package/dist/charts/engine/chart.cjs +1 -1
  22. package/dist/charts/engine/chart.cjs.map +1 -1
  23. package/dist/charts/engine/chart.js +370 -255
  24. package/dist/charts/engine/chart.js.map +1 -1
  25. package/dist/charts/engine/color.cjs +1 -1
  26. package/dist/charts/engine/color.cjs.map +1 -1
  27. package/dist/charts/engine/color.d.cts +18 -0
  28. package/dist/charts/engine/color.d.ts +18 -0
  29. package/dist/charts/engine/color.js +48 -2
  30. package/dist/charts/engine/color.js.map +1 -1
  31. package/dist/charts/engine/controller.cjs +2 -2
  32. package/dist/charts/engine/controller.cjs.map +1 -1
  33. package/dist/charts/engine/controller.d.cts +34 -1
  34. package/dist/charts/engine/controller.d.ts +34 -1
  35. package/dist/charts/engine/controller.js +318 -273
  36. package/dist/charts/engine/controller.js.map +1 -1
  37. package/dist/charts/engine/data.cjs +1 -1
  38. package/dist/charts/engine/data.cjs.map +1 -1
  39. package/dist/charts/engine/data.d.cts +3 -1
  40. package/dist/charts/engine/data.d.ts +3 -1
  41. package/dist/charts/engine/data.js +6 -4
  42. package/dist/charts/engine/data.js.map +1 -1
  43. package/dist/charts/engine/defaults.cjs +2 -0
  44. package/dist/charts/engine/defaults.cjs.map +1 -0
  45. package/dist/charts/engine/defaults.d.cts +20 -0
  46. package/dist/charts/engine/defaults.d.ts +20 -0
  47. package/dist/charts/engine/defaults.js +35 -0
  48. package/dist/charts/engine/defaults.js.map +1 -0
  49. package/dist/charts/engine/format.cjs +1 -1
  50. package/dist/charts/engine/format.cjs.map +1 -1
  51. package/dist/charts/engine/format.d.cts +6 -0
  52. package/dist/charts/engine/format.d.ts +6 -0
  53. package/dist/charts/engine/format.js +15 -2
  54. package/dist/charts/engine/format.js.map +1 -1
  55. package/dist/charts/engine/graph/chart.cjs +2 -0
  56. package/dist/charts/engine/graph/chart.cjs.map +1 -0
  57. package/dist/charts/engine/graph/chart.d.cts +3 -0
  58. package/dist/charts/engine/graph/chart.d.ts +3 -0
  59. package/dist/charts/engine/graph/chart.js +1708 -0
  60. package/dist/charts/engine/graph/chart.js.map +1 -0
  61. package/dist/charts/engine/graph/circular.cjs +2 -0
  62. package/dist/charts/engine/graph/circular.cjs.map +1 -0
  63. package/dist/charts/engine/graph/circular.d.cts +16 -0
  64. package/dist/charts/engine/graph/circular.d.ts +16 -0
  65. package/dist/charts/engine/graph/circular.js +62 -0
  66. package/dist/charts/engine/graph/circular.js.map +1 -0
  67. package/dist/charts/engine/graph/dag.cjs +2 -0
  68. package/dist/charts/engine/graph/dag.cjs.map +1 -0
  69. package/dist/charts/engine/graph/dag.d.cts +34 -0
  70. package/dist/charts/engine/graph/dag.d.ts +34 -0
  71. package/dist/charts/engine/graph/dag.js +339 -0
  72. package/dist/charts/engine/graph/dag.js.map +1 -0
  73. package/dist/charts/engine/graph/dom.cjs +2 -0
  74. package/dist/charts/engine/graph/dom.cjs.map +1 -0
  75. package/dist/charts/engine/graph/dom.d.cts +23 -0
  76. package/dist/charts/engine/graph/dom.d.ts +23 -0
  77. package/dist/charts/engine/graph/dom.js +158 -0
  78. package/dist/charts/engine/graph/dom.js.map +1 -0
  79. package/dist/charts/engine/graph/force.cjs +2 -0
  80. package/dist/charts/engine/graph/force.cjs.map +1 -0
  81. package/dist/charts/engine/graph/force.d.cts +76 -0
  82. package/dist/charts/engine/graph/force.d.ts +76 -0
  83. package/dist/charts/engine/graph/force.js +423 -0
  84. package/dist/charts/engine/graph/force.js.map +1 -0
  85. package/dist/charts/engine/graph/geometry.cjs +2 -0
  86. package/dist/charts/engine/graph/geometry.cjs.map +1 -0
  87. package/dist/charts/engine/graph/geometry.d.cts +50 -0
  88. package/dist/charts/engine/graph/geometry.d.ts +50 -0
  89. package/dist/charts/engine/graph/geometry.js +197 -0
  90. package/dist/charts/engine/graph/geometry.js.map +1 -0
  91. package/dist/charts/engine/graph/index.cjs +1 -0
  92. package/dist/charts/engine/graph/index.d.cts +6 -0
  93. package/dist/charts/engine/graph/index.d.ts +6 -0
  94. package/dist/charts/engine/graph/index.js +6 -0
  95. package/dist/charts/engine/graph/labels.cjs +2 -0
  96. package/dist/charts/engine/graph/labels.cjs.map +1 -0
  97. package/dist/charts/engine/graph/labels.d.cts +12 -0
  98. package/dist/charts/engine/graph/labels.d.ts +12 -0
  99. package/dist/charts/engine/graph/labels.js +128 -0
  100. package/dist/charts/engine/graph/labels.js.map +1 -0
  101. package/dist/charts/engine/graph/model.cjs +2 -0
  102. package/dist/charts/engine/graph/model.cjs.map +1 -0
  103. package/dist/charts/engine/graph/model.d.cts +52 -0
  104. package/dist/charts/engine/graph/model.d.ts +52 -0
  105. package/dist/charts/engine/graph/model.js +108 -0
  106. package/dist/charts/engine/graph/model.js.map +1 -0
  107. package/dist/charts/engine/graph/sizing.cjs +2 -0
  108. package/dist/charts/engine/graph/sizing.cjs.map +1 -0
  109. package/dist/charts/engine/graph/sizing.d.cts +33 -0
  110. package/dist/charts/engine/graph/sizing.d.ts +33 -0
  111. package/dist/charts/engine/graph/sizing.js +60 -0
  112. package/dist/charts/engine/graph/sizing.js.map +1 -0
  113. package/dist/charts/engine/graph/tree.cjs +2 -0
  114. package/dist/charts/engine/graph/tree.cjs.map +1 -0
  115. package/dist/charts/engine/graph/tree.d.cts +30 -0
  116. package/dist/charts/engine/graph/tree.d.ts +30 -0
  117. package/dist/charts/engine/graph/tree.js +218 -0
  118. package/dist/charts/engine/graph/tree.js.map +1 -0
  119. package/dist/charts/engine/graph/types.d.cts +640 -0
  120. package/dist/charts/engine/graph/types.d.ts +640 -0
  121. package/dist/charts/engine/graph/worker.cjs +52 -0
  122. package/dist/charts/engine/graph/worker.cjs.map +1 -0
  123. package/dist/charts/engine/graph/worker.d.cts +36 -0
  124. package/dist/charts/engine/graph/worker.d.ts +36 -0
  125. package/dist/charts/engine/graph/worker.js +135 -0
  126. package/dist/charts/engine/graph/worker.js.map +1 -0
  127. package/dist/charts/engine/items.cjs +1 -1
  128. package/dist/charts/engine/items.cjs.map +1 -1
  129. package/dist/charts/engine/items.d.cts +15 -2
  130. package/dist/charts/engine/items.d.ts +15 -2
  131. package/dist/charts/engine/items.js +131 -112
  132. package/dist/charts/engine/items.js.map +1 -1
  133. package/dist/charts/engine/labels.cjs +1 -1
  134. package/dist/charts/engine/labels.cjs.map +1 -1
  135. package/dist/charts/engine/labels.d.cts +17 -0
  136. package/dist/charts/engine/labels.d.ts +17 -0
  137. package/dist/charts/engine/labels.js +28 -4
  138. package/dist/charts/engine/labels.js.map +1 -1
  139. package/dist/charts/engine/layout.cjs +1 -1
  140. package/dist/charts/engine/layout.cjs.map +1 -1
  141. package/dist/charts/engine/layout.d.cts +9 -0
  142. package/dist/charts/engine/layout.d.ts +9 -0
  143. package/dist/charts/engine/layout.js +11 -2
  144. package/dist/charts/engine/layout.js.map +1 -1
  145. package/dist/charts/engine/model.cjs +1 -1
  146. package/dist/charts/engine/model.cjs.map +1 -1
  147. package/dist/charts/engine/model.d.cts +73 -3
  148. package/dist/charts/engine/model.d.ts +73 -3
  149. package/dist/charts/engine/model.js +258 -154
  150. package/dist/charts/engine/model.js.map +1 -1
  151. package/dist/charts/engine/orderbook/field.cjs +37 -0
  152. package/dist/charts/engine/orderbook/field.cjs.map +1 -0
  153. package/dist/charts/engine/orderbook/field.d.cts +92 -0
  154. package/dist/charts/engine/orderbook/field.d.ts +92 -0
  155. package/dist/charts/engine/orderbook/field.js +297 -0
  156. package/dist/charts/engine/orderbook/field.js.map +1 -0
  157. package/dist/charts/engine/orderbook/format.cjs +1 -1
  158. package/dist/charts/engine/orderbook/format.cjs.map +1 -1
  159. package/dist/charts/engine/orderbook/format.d.cts +3 -2
  160. package/dist/charts/engine/orderbook/format.d.ts +3 -2
  161. package/dist/charts/engine/orderbook/format.js +5 -5
  162. package/dist/charts/engine/orderbook/format.js.map +1 -1
  163. package/dist/charts/engine/orderbook/heatmap.cjs +1 -1
  164. package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -1
  165. package/dist/charts/engine/orderbook/heatmap.js +566 -475
  166. package/dist/charts/engine/orderbook/heatmap.js.map +1 -1
  167. package/dist/charts/engine/orderbook/host.cjs +1 -1
  168. package/dist/charts/engine/orderbook/host.cjs.map +1 -1
  169. package/dist/charts/engine/orderbook/host.d.cts +8 -1
  170. package/dist/charts/engine/orderbook/host.d.ts +8 -1
  171. package/dist/charts/engine/orderbook/host.js +27 -5
  172. package/dist/charts/engine/orderbook/host.js.map +1 -1
  173. package/dist/charts/engine/orderbook/ladder.cjs +1 -1
  174. package/dist/charts/engine/orderbook/ladder.cjs.map +1 -1
  175. package/dist/charts/engine/orderbook/ladder.js +1 -1
  176. package/dist/charts/engine/orderbook/ladder.js.map +1 -1
  177. package/dist/charts/engine/orderbook/layout.cjs +2 -0
  178. package/dist/charts/engine/orderbook/layout.cjs.map +1 -0
  179. package/dist/charts/engine/orderbook/layout.d.cts +42 -0
  180. package/dist/charts/engine/orderbook/layout.d.ts +42 -0
  181. package/dist/charts/engine/orderbook/layout.js +76 -0
  182. package/dist/charts/engine/orderbook/layout.js.map +1 -0
  183. package/dist/charts/engine/orderbook/tape.cjs +1 -1
  184. package/dist/charts/engine/orderbook/tape.cjs.map +1 -1
  185. package/dist/charts/engine/orderbook/tape.js +4 -4
  186. package/dist/charts/engine/orderbook/tape.js.map +1 -1
  187. package/dist/charts/engine/orderbook/types.d.cts +27 -3
  188. package/dist/charts/engine/orderbook/types.d.ts +27 -3
  189. package/dist/charts/engine/overlay.cjs +1 -1
  190. package/dist/charts/engine/overlay.cjs.map +1 -1
  191. package/dist/charts/engine/overlay.d.cts +27 -0
  192. package/dist/charts/engine/overlay.d.ts +27 -0
  193. package/dist/charts/engine/overlay.js +34 -12
  194. package/dist/charts/engine/overlay.js.map +1 -1
  195. package/dist/charts/engine/presets.cjs +2 -2
  196. package/dist/charts/engine/presets.cjs.map +1 -1
  197. package/dist/charts/engine/presets.d.cts +35 -3
  198. package/dist/charts/engine/presets.d.ts +35 -3
  199. package/dist/charts/engine/presets.js +121 -101
  200. package/dist/charts/engine/presets.js.map +1 -1
  201. package/dist/charts/engine/renderers/canvas2d.cjs +1 -1
  202. package/dist/charts/engine/renderers/canvas2d.cjs.map +1 -1
  203. package/dist/charts/engine/renderers/canvas2d.js +13 -9
  204. package/dist/charts/engine/renderers/canvas2d.js.map +1 -1
  205. package/dist/charts/engine/renderers/detect.cjs +1 -1
  206. package/dist/charts/engine/renderers/detect.cjs.map +1 -1
  207. package/dist/charts/engine/renderers/detect.d.cts +2 -1
  208. package/dist/charts/engine/renderers/detect.d.ts +2 -1
  209. package/dist/charts/engine/renderers/detect.js +23 -21
  210. package/dist/charts/engine/renderers/detect.js.map +1 -1
  211. package/dist/charts/engine/renderers/follow.cjs +2 -0
  212. package/dist/charts/engine/renderers/follow.cjs.map +1 -0
  213. package/dist/charts/engine/renderers/follow.d.cts +8 -0
  214. package/dist/charts/engine/renderers/follow.d.ts +8 -0
  215. package/dist/charts/engine/renderers/follow.js +10 -0
  216. package/dist/charts/engine/renderers/follow.js.map +1 -0
  217. package/dist/charts/engine/renderers/gl-budget.cjs +2 -0
  218. package/dist/charts/engine/renderers/gl-budget.cjs.map +1 -0
  219. package/dist/charts/engine/renderers/gl-budget.d.cts +32 -0
  220. package/dist/charts/engine/renderers/gl-budget.d.ts +32 -0
  221. package/dist/charts/engine/renderers/gl-budget.js +95 -0
  222. package/dist/charts/engine/renderers/gl-budget.js.map +1 -0
  223. package/dist/charts/engine/renderers/gl.cjs +1 -1
  224. package/dist/charts/engine/renderers/gl.cjs.map +1 -1
  225. package/dist/charts/engine/renderers/gl.js +1 -1
  226. package/dist/charts/engine/renderers/gl.js.map +1 -1
  227. package/dist/charts/engine/renderers/shaders.cjs +9 -6
  228. package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
  229. package/dist/charts/engine/renderers/shaders.d.cts +1 -1
  230. package/dist/charts/engine/renderers/shaders.d.ts +1 -1
  231. package/dist/charts/engine/renderers/shaders.js +9 -6
  232. package/dist/charts/engine/renderers/shaders.js.map +1 -1
  233. package/dist/charts/engine/renderers/types.cjs.map +1 -1
  234. package/dist/charts/engine/renderers/types.d.cts +2 -0
  235. package/dist/charts/engine/renderers/types.d.ts +2 -0
  236. package/dist/charts/engine/renderers/types.js.map +1 -1
  237. package/dist/charts/engine/renderers/webgl.cjs +1 -1
  238. package/dist/charts/engine/renderers/webgl.cjs.map +1 -1
  239. package/dist/charts/engine/renderers/webgl.js +85 -64
  240. package/dist/charts/engine/renderers/webgl.js.map +1 -1
  241. package/dist/charts/engine/renderers/webgl2.cjs +1 -1
  242. package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
  243. package/dist/charts/engine/renderers/webgl2.js +72 -58
  244. package/dist/charts/engine/renderers/webgl2.js.map +1 -1
  245. package/dist/charts/engine/renderers/webgpu.cjs +1 -1
  246. package/dist/charts/engine/renderers/webgpu.cjs.map +1 -1
  247. package/dist/charts/engine/renderers/webgpu.js +1 -1
  248. package/dist/charts/engine/renderers/webgpu.js.map +1 -1
  249. package/dist/charts/engine/scene.cjs +1 -1
  250. package/dist/charts/engine/scene.cjs.map +1 -1
  251. package/dist/charts/engine/scene.d.cts +104 -4
  252. package/dist/charts/engine/scene.d.ts +104 -4
  253. package/dist/charts/engine/scene.js +412 -193
  254. package/dist/charts/engine/scene.js.map +1 -1
  255. package/dist/charts/engine/shapes/bullet.cjs +1 -1
  256. package/dist/charts/engine/shapes/bullet.cjs.map +1 -1
  257. package/dist/charts/engine/shapes/bullet.js +110 -110
  258. package/dist/charts/engine/shapes/bullet.js.map +1 -1
  259. package/dist/charts/engine/shapes/chart.cjs +1 -1
  260. package/dist/charts/engine/shapes/chart.cjs.map +1 -1
  261. package/dist/charts/engine/shapes/chart.js +4 -1
  262. package/dist/charts/engine/shapes/chart.js.map +1 -1
  263. package/dist/charts/engine/shapes/chord.cjs +2 -0
  264. package/dist/charts/engine/shapes/chord.cjs.map +1 -0
  265. package/dist/charts/engine/shapes/chord.d.cts +18 -0
  266. package/dist/charts/engine/shapes/chord.d.ts +18 -0
  267. package/dist/charts/engine/shapes/chord.js +419 -0
  268. package/dist/charts/engine/shapes/chord.js.map +1 -0
  269. package/dist/charts/engine/shapes/draw.cjs +1 -1
  270. package/dist/charts/engine/shapes/draw.cjs.map +1 -1
  271. package/dist/charts/engine/shapes/draw.d.cts +5 -1
  272. package/dist/charts/engine/shapes/draw.d.ts +5 -1
  273. package/dist/charts/engine/shapes/draw.js +47 -17
  274. package/dist/charts/engine/shapes/draw.js.map +1 -1
  275. package/dist/charts/engine/shapes/hit.cjs +1 -1
  276. package/dist/charts/engine/shapes/hit.cjs.map +1 -1
  277. package/dist/charts/engine/shapes/hit.d.cts +3 -1
  278. package/dist/charts/engine/shapes/hit.d.ts +3 -1
  279. package/dist/charts/engine/shapes/hit.js +75 -46
  280. package/dist/charts/engine/shapes/hit.js.map +1 -1
  281. package/dist/charts/engine/shapes/index.d.cts +3 -2
  282. package/dist/charts/engine/shapes/index.d.ts +3 -2
  283. package/dist/charts/engine/shapes/labels.cjs +1 -1
  284. package/dist/charts/engine/shapes/labels.cjs.map +1 -1
  285. package/dist/charts/engine/shapes/labels.js +12 -4
  286. package/dist/charts/engine/shapes/labels.js.map +1 -1
  287. package/dist/charts/engine/shapes/layout.cjs +2 -2
  288. package/dist/charts/engine/shapes/layout.cjs.map +1 -1
  289. package/dist/charts/engine/shapes/layout.d.cts +3 -1
  290. package/dist/charts/engine/shapes/layout.d.ts +3 -1
  291. package/dist/charts/engine/shapes/layout.js +106 -78
  292. package/dist/charts/engine/shapes/layout.js.map +1 -1
  293. package/dist/charts/engine/shapes/scene.cjs +1 -1
  294. package/dist/charts/engine/shapes/scene.cjs.map +1 -1
  295. package/dist/charts/engine/shapes/scene.d.cts +33 -3
  296. package/dist/charts/engine/shapes/scene.d.ts +33 -3
  297. package/dist/charts/engine/shapes/scene.js +62 -19
  298. package/dist/charts/engine/shapes/scene.js.map +1 -1
  299. package/dist/charts/engine/shapes/types.d.cts +121 -8
  300. package/dist/charts/engine/shapes/types.d.ts +121 -8
  301. package/dist/charts/engine/signature.cjs +1 -1
  302. package/dist/charts/engine/signature.cjs.map +1 -1
  303. package/dist/charts/engine/signature.js +1 -1
  304. package/dist/charts/engine/signature.js.map +1 -1
  305. package/dist/charts/engine/three-d/canvas2d.cjs +1 -1
  306. package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -1
  307. package/dist/charts/engine/three-d/canvas2d.d.cts +41 -3
  308. package/dist/charts/engine/three-d/canvas2d.d.ts +41 -3
  309. package/dist/charts/engine/three-d/canvas2d.js +166 -67
  310. package/dist/charts/engine/three-d/canvas2d.js.map +1 -1
  311. package/dist/charts/engine/three-d/chart.cjs +1 -1
  312. package/dist/charts/engine/three-d/chart.cjs.map +1 -1
  313. package/dist/charts/engine/three-d/chart.js +219 -215
  314. package/dist/charts/engine/three-d/chart.js.map +1 -1
  315. package/dist/charts/engine/three-d/detect.cjs +1 -1
  316. package/dist/charts/engine/three-d/detect.cjs.map +1 -1
  317. package/dist/charts/engine/three-d/detect.d.cts +3 -2
  318. package/dist/charts/engine/three-d/detect.d.ts +3 -2
  319. package/dist/charts/engine/three-d/detect.js +22 -20
  320. package/dist/charts/engine/three-d/detect.js.map +1 -1
  321. package/dist/charts/engine/three-d/geometry.cjs +1 -1
  322. package/dist/charts/engine/three-d/geometry.cjs.map +1 -1
  323. package/dist/charts/engine/three-d/geometry.d.cts +6 -0
  324. package/dist/charts/engine/three-d/geometry.d.ts +6 -0
  325. package/dist/charts/engine/three-d/geometry.js +106 -90
  326. package/dist/charts/engine/three-d/geometry.js.map +1 -1
  327. package/dist/charts/engine/three-d/model.cjs +1 -1
  328. package/dist/charts/engine/three-d/model.cjs.map +1 -1
  329. package/dist/charts/engine/three-d/model.d.cts +2 -0
  330. package/dist/charts/engine/three-d/model.d.ts +2 -0
  331. package/dist/charts/engine/three-d/model.js +2 -0
  332. package/dist/charts/engine/three-d/model.js.map +1 -1
  333. package/dist/charts/engine/three-d/oit.cjs +109 -0
  334. package/dist/charts/engine/three-d/oit.cjs.map +1 -0
  335. package/dist/charts/engine/three-d/oit.d.cts +34 -0
  336. package/dist/charts/engine/three-d/oit.d.ts +34 -0
  337. package/dist/charts/engine/three-d/oit.js +111 -0
  338. package/dist/charts/engine/three-d/oit.js.map +1 -0
  339. package/dist/charts/engine/three-d/overlay.cjs +1 -1
  340. package/dist/charts/engine/three-d/overlay.cjs.map +1 -1
  341. package/dist/charts/engine/three-d/overlay.js +43 -36
  342. package/dist/charts/engine/three-d/overlay.js.map +1 -1
  343. package/dist/charts/engine/three-d/render-types.cjs +1 -1
  344. package/dist/charts/engine/three-d/render-types.cjs.map +1 -1
  345. package/dist/charts/engine/three-d/render-types.d.cts +37 -3
  346. package/dist/charts/engine/three-d/render-types.d.ts +37 -3
  347. package/dist/charts/engine/three-d/render-types.js +6 -10
  348. package/dist/charts/engine/three-d/render-types.js.map +1 -1
  349. package/dist/charts/engine/three-d/shaders.cjs +109 -48
  350. package/dist/charts/engine/three-d/shaders.cjs.map +1 -1
  351. package/dist/charts/engine/three-d/shaders.d.cts +12 -5
  352. package/dist/charts/engine/three-d/shaders.d.ts +12 -5
  353. package/dist/charts/engine/three-d/shaders.js +118 -55
  354. package/dist/charts/engine/three-d/shaders.js.map +1 -1
  355. package/dist/charts/engine/three-d/sort.cjs +1 -1
  356. package/dist/charts/engine/three-d/sort.cjs.map +1 -1
  357. package/dist/charts/engine/three-d/sort.d.cts +18 -5
  358. package/dist/charts/engine/three-d/sort.d.ts +18 -5
  359. package/dist/charts/engine/three-d/sort.js +129 -43
  360. package/dist/charts/engine/three-d/sort.js.map +1 -1
  361. package/dist/charts/engine/three-d/types.d.cts +36 -0
  362. package/dist/charts/engine/three-d/types.d.ts +36 -0
  363. package/dist/charts/engine/three-d/webgl.cjs +1 -1
  364. package/dist/charts/engine/three-d/webgl.cjs.map +1 -1
  365. package/dist/charts/engine/three-d/webgl.d.cts +9 -0
  366. package/dist/charts/engine/three-d/webgl.d.ts +9 -0
  367. package/dist/charts/engine/three-d/webgl.js +199 -74
  368. package/dist/charts/engine/three-d/webgl.js.map +1 -1
  369. package/dist/charts/engine/three-d/webgpu.cjs +1 -1
  370. package/dist/charts/engine/three-d/webgpu.cjs.map +1 -1
  371. package/dist/charts/engine/three-d/webgpu.js +231 -94
  372. package/dist/charts/engine/three-d/webgpu.js.map +1 -1
  373. package/dist/charts/engine/trading/chart.cjs +1 -1
  374. package/dist/charts/engine/trading/chart.cjs.map +1 -1
  375. package/dist/charts/engine/trading/chart.d.cts +10 -1
  376. package/dist/charts/engine/trading/chart.d.ts +10 -1
  377. package/dist/charts/engine/trading/chart.js +1677 -813
  378. package/dist/charts/engine/trading/chart.js.map +1 -1
  379. package/dist/charts/engine/trading/drawings.cjs +2 -1
  380. package/dist/charts/engine/trading/drawings.cjs.map +1 -1
  381. package/dist/charts/engine/trading/drawings.d.cts +53 -9
  382. package/dist/charts/engine/trading/drawings.d.ts +53 -9
  383. package/dist/charts/engine/trading/drawings.js +346 -71
  384. package/dist/charts/engine/trading/drawings.js.map +1 -1
  385. package/dist/charts/engine/trading/format.cjs +1 -1
  386. package/dist/charts/engine/trading/format.cjs.map +1 -1
  387. package/dist/charts/engine/trading/format.d.cts +19 -0
  388. package/dist/charts/engine/trading/format.d.ts +19 -0
  389. package/dist/charts/engine/trading/format.js +65 -21
  390. package/dist/charts/engine/trading/format.js.map +1 -1
  391. package/dist/charts/engine/trading/geometry.cjs +1 -1
  392. package/dist/charts/engine/trading/geometry.cjs.map +1 -1
  393. package/dist/charts/engine/trading/geometry.d.cts +16 -0
  394. package/dist/charts/engine/trading/geometry.d.ts +16 -0
  395. package/dist/charts/engine/trading/geometry.js +19 -4
  396. package/dist/charts/engine/trading/geometry.js.map +1 -1
  397. package/dist/charts/engine/trading/index.cjs +1 -1
  398. package/dist/charts/engine/trading/index.d.cts +2 -1
  399. package/dist/charts/engine/trading/index.d.ts +2 -1
  400. package/dist/charts/engine/trading/index.js +4 -3
  401. package/dist/charts/engine/trading/indicators.cjs +1 -1
  402. package/dist/charts/engine/trading/indicators.cjs.map +1 -1
  403. package/dist/charts/engine/trading/indicators.d.cts +180 -10
  404. package/dist/charts/engine/trading/indicators.d.ts +180 -10
  405. package/dist/charts/engine/trading/indicators.js +449 -173
  406. package/dist/charts/engine/trading/indicators.js.map +1 -1
  407. package/dist/charts/engine/trading/labels.cjs +1 -1
  408. package/dist/charts/engine/trading/labels.cjs.map +1 -1
  409. package/dist/charts/engine/trading/labels.js +104 -4
  410. package/dist/charts/engine/trading/labels.js.map +1 -1
  411. package/dist/charts/engine/trading/store.cjs +1 -1
  412. package/dist/charts/engine/trading/store.cjs.map +1 -1
  413. package/dist/charts/engine/trading/store.d.cts +21 -0
  414. package/dist/charts/engine/trading/store.d.ts +21 -0
  415. package/dist/charts/engine/trading/store.js +22 -1
  416. package/dist/charts/engine/trading/store.js.map +1 -1
  417. package/dist/charts/engine/trading/studies.cjs +1 -1
  418. package/dist/charts/engine/trading/studies.cjs.map +1 -1
  419. package/dist/charts/engine/trading/studies.d.cts +49 -8
  420. package/dist/charts/engine/trading/studies.d.ts +49 -8
  421. package/dist/charts/engine/trading/studies.js +352 -93
  422. package/dist/charts/engine/trading/studies.js.map +1 -1
  423. package/dist/charts/engine/trading/sync.cjs +2 -0
  424. package/dist/charts/engine/trading/sync.cjs.map +1 -0
  425. package/dist/charts/engine/trading/sync.d.cts +8 -0
  426. package/dist/charts/engine/trading/sync.d.ts +8 -0
  427. package/dist/charts/engine/trading/sync.js +25 -0
  428. package/dist/charts/engine/trading/sync.js.map +1 -0
  429. package/dist/charts/engine/trading/types.d.cts +514 -16
  430. package/dist/charts/engine/trading/types.d.ts +514 -16
  431. package/dist/charts/engine/types.d.cts +106 -11
  432. package/dist/charts/engine/types.d.ts +106 -11
  433. package/dist/charts/index.cjs +1 -1
  434. package/dist/charts/index.d.cts +3 -2
  435. package/dist/charts/index.d.ts +3 -2
  436. package/dist/charts/index.js +30 -22
  437. package/dist/charts/react/charts.cjs +1 -1
  438. package/dist/charts/react/charts.cjs.map +1 -1
  439. package/dist/charts/react/charts.js +51 -34
  440. package/dist/charts/react/charts.js.map +1 -1
  441. package/dist/charts/react/graph.cjs +2 -0
  442. package/dist/charts/react/graph.cjs.map +1 -0
  443. package/dist/charts/react/graph.d.cts +219 -0
  444. package/dist/charts/react/graph.d.ts +219 -0
  445. package/dist/charts/react/graph.js +160 -0
  446. package/dist/charts/react/graph.js.map +1 -0
  447. package/dist/charts/react/orderbook.cjs +1 -1
  448. package/dist/charts/react/orderbook.cjs.map +1 -1
  449. package/dist/charts/react/orderbook.d.cts +3 -1
  450. package/dist/charts/react/orderbook.d.ts +3 -1
  451. package/dist/charts/react/orderbook.js +1 -0
  452. package/dist/charts/react/orderbook.js.map +1 -1
  453. package/dist/charts/react/shapes.cjs +1 -1
  454. package/dist/charts/react/shapes.cjs.map +1 -1
  455. package/dist/charts/react/shapes.d.cts +88 -4
  456. package/dist/charts/react/shapes.d.ts +88 -4
  457. package/dist/charts/react/shapes.js +55 -12
  458. package/dist/charts/react/shapes.js.map +1 -1
  459. package/dist/charts/react/three-d.cjs +1 -1
  460. package/dist/charts/react/three-d.cjs.map +1 -1
  461. package/dist/charts/react/three-d.d.cts +7 -0
  462. package/dist/charts/react/three-d.d.ts +7 -0
  463. package/dist/charts/react/three-d.js +14 -13
  464. package/dist/charts/react/three-d.js.map +1 -1
  465. package/dist/charts/react/trading.cjs +1 -1
  466. package/dist/charts/react/trading.cjs.map +1 -1
  467. package/dist/charts/react/trading.d.cts +54 -2
  468. package/dist/charts/react/trading.d.ts +54 -2
  469. package/dist/charts/react/trading.js +68 -37
  470. package/dist/charts/react/trading.js.map +1 -1
  471. package/dist/charts/react/types.d.cts +11 -0
  472. package/dist/charts/react/types.d.ts +11 -0
  473. package/dist/core/contracts.cjs +1 -1
  474. package/dist/core/contracts.cjs.map +1 -1
  475. package/dist/core/contracts.js +1 -1
  476. package/dist/core/contracts.js.map +1 -1
  477. package/dist/native/charts/src/canvas.cjs +1 -1
  478. package/dist/native/charts/src/canvas.js +5 -4
  479. package/dist/native/charts/src/engine/axis.cjs +1 -1
  480. package/dist/native/charts/src/engine/axis.cjs.map +1 -1
  481. package/dist/native/charts/src/engine/axis.js +42 -19
  482. package/dist/native/charts/src/engine/axis.js.map +1 -1
  483. package/dist/native/charts/src/engine/color.cjs +1 -1
  484. package/dist/native/charts/src/engine/color.cjs.map +1 -1
  485. package/dist/native/charts/src/engine/color.js +47 -5
  486. package/dist/native/charts/src/engine/color.js.map +1 -1
  487. package/dist/native/charts/src/engine/controller.cjs +2 -2
  488. package/dist/native/charts/src/engine/controller.cjs.map +1 -1
  489. package/dist/native/charts/src/engine/controller.js +296 -251
  490. package/dist/native/charts/src/engine/controller.js.map +1 -1
  491. package/dist/native/charts/src/engine/data.cjs +1 -1
  492. package/dist/native/charts/src/engine/data.cjs.map +1 -1
  493. package/dist/native/charts/src/engine/data.js +6 -4
  494. package/dist/native/charts/src/engine/data.js.map +1 -1
  495. package/dist/native/charts/src/engine/format.cjs +1 -1
  496. package/dist/native/charts/src/engine/format.cjs.map +1 -1
  497. package/dist/native/charts/src/engine/format.js +15 -2
  498. package/dist/native/charts/src/engine/format.js.map +1 -1
  499. package/dist/native/charts/src/engine/labels.cjs +1 -1
  500. package/dist/native/charts/src/engine/labels.cjs.map +1 -1
  501. package/dist/native/charts/src/engine/labels.js +42 -5
  502. package/dist/native/charts/src/engine/labels.js.map +1 -1
  503. package/dist/native/charts/src/engine/layout.cjs +1 -1
  504. package/dist/native/charts/src/engine/layout.cjs.map +1 -1
  505. package/dist/native/charts/src/engine/layout.js +11 -2
  506. package/dist/native/charts/src/engine/layout.js.map +1 -1
  507. package/dist/native/charts/src/engine/model.cjs +1 -1
  508. package/dist/native/charts/src/engine/model.cjs.map +1 -1
  509. package/dist/native/charts/src/engine/model.js +278 -174
  510. package/dist/native/charts/src/engine/model.js.map +1 -1
  511. package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
  512. package/dist/native/charts/src/engine/overlay.js.map +1 -1
  513. package/dist/native/charts/src/engine/presets.cjs +2 -2
  514. package/dist/native/charts/src/engine/presets.cjs.map +1 -1
  515. package/dist/native/charts/src/engine/presets.js +110 -90
  516. package/dist/native/charts/src/engine/presets.js.map +1 -1
  517. package/dist/native/charts/src/engine/scene.cjs +1 -1
  518. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  519. package/dist/native/charts/src/engine/scene.js +421 -202
  520. package/dist/native/charts/src/engine/scene.js.map +1 -1
  521. package/dist/native/charts/src/engine/shapes/bullet.cjs +1 -1
  522. package/dist/native/charts/src/engine/shapes/bullet.cjs.map +1 -1
  523. package/dist/native/charts/src/engine/shapes/bullet.js +110 -110
  524. package/dist/native/charts/src/engine/shapes/bullet.js.map +1 -1
  525. package/dist/native/charts/src/engine/shapes/calendar.cjs +1 -1
  526. package/dist/native/charts/src/engine/shapes/calendar.cjs.map +1 -1
  527. package/dist/native/charts/src/engine/shapes/calendar.js +21 -16
  528. package/dist/native/charts/src/engine/shapes/calendar.js.map +1 -1
  529. package/dist/native/charts/src/engine/shapes/chord.cjs +2 -0
  530. package/dist/native/charts/src/engine/shapes/chord.cjs.map +1 -0
  531. package/dist/native/charts/src/engine/shapes/chord.js +419 -0
  532. package/dist/native/charts/src/engine/shapes/chord.js.map +1 -0
  533. package/dist/native/charts/src/engine/shapes/draw.cjs +1 -1
  534. package/dist/native/charts/src/engine/shapes/draw.cjs.map +1 -1
  535. package/dist/native/charts/src/engine/shapes/draw.js +47 -17
  536. package/dist/native/charts/src/engine/shapes/draw.js.map +1 -1
  537. package/dist/native/charts/src/engine/shapes/hit.cjs +1 -1
  538. package/dist/native/charts/src/engine/shapes/hit.cjs.map +1 -1
  539. package/dist/native/charts/src/engine/shapes/hit.js +73 -44
  540. package/dist/native/charts/src/engine/shapes/hit.js.map +1 -1
  541. package/dist/native/charts/src/engine/shapes/labels.cjs +1 -1
  542. package/dist/native/charts/src/engine/shapes/labels.cjs.map +1 -1
  543. package/dist/native/charts/src/engine/shapes/labels.js +12 -4
  544. package/dist/native/charts/src/engine/shapes/labels.js.map +1 -1
  545. package/dist/native/charts/src/engine/shapes/layout.cjs +2 -2
  546. package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -1
  547. package/dist/native/charts/src/engine/shapes/layout.js +136 -94
  548. package/dist/native/charts/src/engine/shapes/layout.js.map +1 -1
  549. package/dist/native/charts/src/engine/shapes/scene.cjs +1 -1
  550. package/dist/native/charts/src/engine/shapes/scene.cjs.map +1 -1
  551. package/dist/native/charts/src/engine/shapes/scene.js +62 -19
  552. package/dist/native/charts/src/engine/shapes/scene.js.map +1 -1
  553. package/dist/native/components/Chart/ChartBase.cjs +1 -1
  554. package/dist/native/components/Chart/ChartBase.cjs.map +1 -1
  555. package/dist/native/components/Chart/ChartBase.js +127 -115
  556. package/dist/native/components/Chart/ChartBase.js.map +1 -1
  557. package/dist/native/components/Chart/charts.cjs +1 -1
  558. package/dist/native/components/Chart/charts.cjs.map +1 -1
  559. package/dist/native/components/Chart/charts.js +8 -5
  560. package/dist/native/components/Chart/charts.js.map +1 -1
  561. package/dist/native/components/Chart/scene.cjs +1 -1
  562. package/dist/native/components/Chart/scene.cjs.map +1 -1
  563. package/dist/native/components/Chart/scene.d.cts +6 -1
  564. package/dist/native/components/Chart/scene.d.ts +6 -1
  565. package/dist/native/components/Chart/scene.js +226 -108
  566. package/dist/native/components/Chart/scene.js.map +1 -1
  567. package/dist/native/components/Chart/types.d.cts +7 -1
  568. package/dist/native/components/Chart/types.d.ts +7 -1
  569. package/dist/native/components/Charts/charts.cjs +1 -1
  570. package/dist/native/components/Charts/charts.cjs.map +1 -1
  571. package/dist/native/components/Charts/charts.js +60 -43
  572. package/dist/native/components/Charts/charts.js.map +1 -1
  573. package/dist/native/components/Charts/types.d.cts +11 -0
  574. package/dist/native/components/Charts/types.d.ts +11 -0
  575. package/dist/native/components/ShapeChart/ShapeChartBase.cjs +1 -1
  576. package/dist/native/components/ShapeChart/ShapeChartBase.cjs.map +1 -1
  577. package/dist/native/components/ShapeChart/ShapeChartBase.d.cts +1 -1
  578. package/dist/native/components/ShapeChart/ShapeChartBase.d.ts +1 -1
  579. package/dist/native/components/ShapeChart/ShapeChartBase.js +97 -106
  580. package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -1
  581. package/dist/native/components/ShapeChart/charts.cjs +1 -1
  582. package/dist/native/components/ShapeChart/charts.cjs.map +1 -1
  583. package/dist/native/components/ShapeChart/charts.d.cts +6 -1
  584. package/dist/native/components/ShapeChart/charts.d.ts +6 -1
  585. package/dist/native/components/ShapeChart/charts.js +138 -96
  586. package/dist/native/components/ShapeChart/charts.js.map +1 -1
  587. package/dist/native/components/ShapeChart/draw.cjs +1 -1
  588. package/dist/native/components/ShapeChart/draw.cjs.map +1 -1
  589. package/dist/native/components/ShapeChart/draw.d.cts +1 -1
  590. package/dist/native/components/ShapeChart/draw.d.ts +1 -1
  591. package/dist/native/components/ShapeChart/draw.js +26 -17
  592. package/dist/native/components/ShapeChart/draw.js.map +1 -1
  593. package/dist/native/components/ShapeChart/geometry.cjs +1 -1
  594. package/dist/native/components/ShapeChart/geometry.cjs.map +1 -1
  595. package/dist/native/components/ShapeChart/geometry.js +233 -70
  596. package/dist/native/components/ShapeChart/geometry.js.map +1 -1
  597. package/dist/native/components/ShapeChart/index.cjs +1 -1
  598. package/dist/native/components/ShapeChart/index.d.cts +1 -1
  599. package/dist/native/components/ShapeChart/index.d.ts +1 -1
  600. package/dist/native/components/ShapeChart/index.js +2 -2
  601. package/dist/native/components/ShapeChart/recorder.cjs +1 -1
  602. package/dist/native/components/ShapeChart/recorder.cjs.map +1 -1
  603. package/dist/native/components/ShapeChart/recorder.d.cts +10 -1
  604. package/dist/native/components/ShapeChart/recorder.d.ts +10 -1
  605. package/dist/native/components/ShapeChart/recorder.js +19 -10
  606. package/dist/native/components/ShapeChart/recorder.js.map +1 -1
  607. package/dist/native/components/ShapeChart/types.d.cts +95 -8
  608. package/dist/native/components/ShapeChart/types.d.ts +95 -8
  609. package/dist/native/index.cjs +1 -1
  610. package/dist/native/index.js +2 -2
  611. package/dist/native/source/components/Chart/ChartBase.tsx +19 -6
  612. package/dist/native/source/components/Chart/charts.tsx +10 -3
  613. package/dist/native/source/components/Chart/scene.tsx +243 -14
  614. package/dist/native/source/components/Chart/types.ts +7 -0
  615. package/dist/native/source/components/Charts/charts.tsx +37 -2
  616. package/dist/native/source/components/Charts/types.ts +11 -0
  617. package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +10 -34
  618. package/dist/native/source/components/ShapeChart/charts.tsx +91 -35
  619. package/dist/native/source/components/ShapeChart/draw.tsx +39 -8
  620. package/dist/native/source/components/ShapeChart/geometry.ts +376 -25
  621. package/dist/native/source/components/ShapeChart/index.ts +1 -0
  622. package/dist/native/source/components/ShapeChart/recorder.ts +20 -5
  623. package/dist/native/source/components/ShapeChart/types.ts +99 -6
  624. package/dist/native/source/manifest.ts +1 -0
  625. package/dist/taro/chart-a11y.d.ts +7 -0
  626. package/dist/taro/charts.d.ts +29 -6
  627. package/dist/taro/index.js +3129 -1902
  628. package/dist/taro/shape-charts.d.ts +99 -5
  629. package/dist/uni/AreaChart.vue +2 -1
  630. package/dist/uni/AreaChart.vue.d.ts +5 -1
  631. package/dist/uni/Badge.vue.d.ts +1 -1
  632. package/dist/uni/BarChart.vue +2 -1
  633. package/dist/uni/BarChart.vue.d.ts +5 -1
  634. package/dist/uni/BoxPlotChart.vue +2 -1
  635. package/dist/uni/BoxPlotChart.vue.d.ts +8 -0
  636. package/dist/uni/BubbleChart.vue +2 -1
  637. package/dist/uni/BubbleChart.vue.d.ts +4 -0
  638. package/dist/uni/BulletChart.vue.d.ts +4 -0
  639. package/dist/uni/CalendarHeatmap.vue.d.ts +2 -0
  640. package/dist/uni/CandlestickChart.vue +2 -1
  641. package/dist/uni/CandlestickChart.vue.d.ts +4 -0
  642. package/dist/uni/Chart.vue +2 -1
  643. package/dist/uni/Chart.vue.d.ts +4 -0
  644. package/dist/uni/ChordChart.vue +93 -0
  645. package/dist/uni/ChordChart.vue.d.ts +136 -0
  646. package/dist/uni/Divider.vue.d.ts +1 -1
  647. package/dist/uni/DonutChart.vue.d.ts +5 -1
  648. package/dist/uni/FunnelChart.vue.d.ts +4 -0
  649. package/dist/uni/GanttChart.vue +2 -1
  650. package/dist/uni/GanttChart.vue.d.ts +15 -0
  651. package/dist/uni/GaugeChart.vue.d.ts +5 -1
  652. package/dist/uni/HeatmapChart.vue +2 -1
  653. package/dist/uni/HeatmapChart.vue.d.ts +8 -2
  654. package/dist/uni/HistogramChart.vue +2 -1
  655. package/dist/uni/HistogramChart.vue.d.ts +4 -0
  656. package/dist/uni/HorizontalBarChart.vue +2 -1
  657. package/dist/uni/HorizontalBarChart.vue.d.ts +3 -1
  658. package/dist/uni/LineChart.vue +2 -1
  659. package/dist/uni/LineChart.vue.d.ts +4 -0
  660. package/dist/uni/MixedChart.vue +2 -1
  661. package/dist/uni/MixedChart.vue.d.ts +4 -0
  662. package/dist/uni/PieChart.vue.d.ts +5 -1
  663. package/dist/uni/QuadrantChart.vue +2 -1
  664. package/dist/uni/QuadrantChart.vue.d.ts +4 -0
  665. package/dist/uni/RadarChart.vue.d.ts +4 -0
  666. package/dist/uni/RadialBarChart.vue.d.ts +4 -0
  667. package/dist/uni/RangeAreaChart.vue +2 -1
  668. package/dist/uni/RangeAreaChart.vue.d.ts +4 -0
  669. package/dist/uni/SankeyChart.vue.d.ts +4 -0
  670. package/dist/uni/ScatterChart.vue +2 -1
  671. package/dist/uni/ScatterChart.vue.d.ts +4 -0
  672. package/dist/uni/Sparkline.vue +2 -1
  673. package/dist/uni/Sparkline.vue.d.ts +4 -0
  674. package/dist/uni/SunburstChart.vue.d.ts +4 -0
  675. package/dist/uni/ToastProvider.vue.d.ts +1 -1
  676. package/dist/uni/TreemapChart.vue.d.ts +4 -0
  677. package/dist/uni/WaterfallChart.vue +2 -1
  678. package/dist/uni/WaterfallChart.vue.d.ts +9 -0
  679. package/dist/uni/chart-a11y.d.ts +7 -0
  680. package/dist/uni/chart-a11y.js +29 -0
  681. package/dist/uni/chart-canvas.d.ts +12 -0
  682. package/dist/uni/chart-canvas.js +15 -1
  683. package/dist/uni/chart-types.d.ts +36 -5
  684. package/dist/uni/chart-types.js +31 -3
  685. package/dist/uni/charts-canvas.js +3 -2
  686. package/dist/uni/index.d.ts +2 -1
  687. package/dist/uni/index.js +1 -0
  688. package/dist/uni/manifest.d.ts +7 -0
  689. package/dist/uni/manifest.js +10 -0
  690. package/dist/uni/named-chart-options.d.ts +11 -2
  691. package/dist/uni/named-chart-options.js +21 -1
  692. package/dist/uni/shape-chart-canvas.d.ts +3 -3
  693. package/dist/uni/shape-chart-canvas.js +17 -58
  694. package/dist/uni/shape-chart-types.d.ts +53 -3
  695. package/dist/uni/shape-chart-types.js +45 -1
  696. package/dist/vue/charts-global.d.ts +48 -0
  697. package/dist/vue/charts.d.ts +18 -0
  698. package/dist/vue/charts.js +56 -0
  699. package/dist/vue/charts.js.map +1 -0
  700. package/dist/vue/components/Chart/Bar3DChart.vue.d.ts +2 -0
  701. package/dist/vue/components/Chart/BoxPlotChart.vue.d.ts +8 -0
  702. package/dist/vue/components/Chart/BoxPlotChart.vue.js.map +1 -1
  703. package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js +8 -2
  704. package/dist/vue/components/Chart/BoxPlotChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  705. package/dist/vue/components/Chart/ChordChart.vue.d.ts +153 -0
  706. package/dist/vue/components/Chart/ChordChart.vue.js +7 -0
  707. package/dist/vue/components/Chart/ChordChart.vue.js.map +1 -0
  708. package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js +81 -0
  709. package/dist/vue/components/Chart/ChordChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  710. package/dist/vue/components/Chart/DependencyGraph.vue.d.ts +181 -0
  711. package/dist/vue/components/Chart/DependencyGraph.vue.js +7 -0
  712. package/dist/vue/components/Chart/DependencyGraph.vue.js.map +1 -0
  713. package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js +65 -0
  714. package/dist/vue/components/Chart/DependencyGraph.vue_vue_type_script_setup_true_lang.js.map +1 -0
  715. package/dist/vue/components/Chart/GanttChart.vue.d.ts +19 -0
  716. package/dist/vue/components/Chart/GanttChart.vue.js.map +1 -1
  717. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js +12 -1
  718. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  719. package/dist/vue/components/Chart/GraphChart.vue.d.ts +186 -0
  720. package/dist/vue/components/Chart/GraphChart.vue.js +7 -0
  721. package/dist/vue/components/Chart/GraphChart.vue.js.map +1 -0
  722. package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js +62 -0
  723. package/dist/vue/components/Chart/GraphChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  724. package/dist/vue/components/Chart/HeatmapChart.vue.d.ts +9 -5
  725. package/dist/vue/components/Chart/HeatmapChart.vue.js.map +1 -1
  726. package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js +3 -1
  727. package/dist/vue/components/Chart/HeatmapChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  728. package/dist/vue/components/Chart/Line3DChart.vue.d.ts +2 -0
  729. package/dist/vue/components/Chart/OrderBookHeatmap.vue.d.ts +2 -0
  730. package/dist/vue/components/Chart/Scatter3DChart.vue.d.ts +2 -0
  731. package/dist/vue/components/Chart/Surface3DChart.vue.d.ts +2 -0
  732. package/dist/vue/components/Chart/TimeAndSales.vue.d.ts +2 -0
  733. package/dist/vue/components/Chart/TradingChart.vue.d.ts +58 -1
  734. package/dist/vue/components/Chart/TradingChart.vue.js.map +1 -1
  735. package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js +31 -0
  736. package/dist/vue/components/Chart/TradingChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  737. package/dist/vue/components/Chart/TreeChart.vue.d.ts +174 -0
  738. package/dist/vue/components/Chart/TreeChart.vue.js +7 -0
  739. package/dist/vue/components/Chart/TreeChart.vue.js.map +1 -0
  740. package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js +56 -0
  741. package/dist/vue/components/Chart/TreeChart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  742. package/dist/vue/components/Chart/WaterfallChart.vue.d.ts +12 -1
  743. package/dist/vue/components/Chart/WaterfallChart.vue.js.map +1 -1
  744. package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js +8 -2
  745. package/dist/vue/components/Chart/WaterfallChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  746. package/dist/vue/components/Chart/graph.d.ts +156 -0
  747. package/dist/vue/components/Chart/graph.js +137 -0
  748. package/dist/vue/components/Chart/graph.js.map +1 -0
  749. package/dist/vue/components/Chart/index.d.ts +5 -1
  750. package/dist/vue/components/Chart/index.js +5 -1
  751. package/dist/vue/components/Chart/orderbook.d.ts +5 -1
  752. package/dist/vue/components/Chart/orderbook.js +2 -0
  753. package/dist/vue/components/Chart/orderbook.js.map +1 -1
  754. package/dist/vue/components/Chart/three-d.d.ts +3 -0
  755. package/dist/vue/components/Chart/three-d.js +2 -0
  756. package/dist/vue/components/Chart/three-d.js.map +1 -1
  757. package/dist/vue/components/Chart/trading.d.ts +30 -3
  758. package/dist/vue/components/Chart/trading.js +9 -0
  759. package/dist/vue/components/Chart/trading.js.map +1 -1
  760. package/dist/vue/components/Chart/types.d.ts +74 -2
  761. package/dist/vue/global.d.ts +2 -38
  762. package/dist/vue/groups/charts.js +10 -2
  763. package/dist/vue/groups/charts.js.map +1 -1
  764. package/dist/vue/index.js +6 -2
  765. package/dist/vue/internal/register.d.ts +7 -0
  766. package/dist/vue/internal/register.js +14 -0
  767. package/dist/vue/internal/register.js.map +1 -0
  768. package/dist/vue/plugin.d.ts +9 -4
  769. package/dist/vue/plugin.js +6 -11
  770. package/dist/vue/plugin.js.map +1 -1
  771. package/dist/weapp/area-chart/index.wxml +1 -1
  772. package/dist/weapp/bar-chart/index.wxml +1 -1
  773. package/dist/weapp/box-plot-chart/index.wxml +1 -1
  774. package/dist/weapp/bubble-chart/index.wxml +1 -1
  775. package/dist/weapp/candlestick-chart/index.wxml +1 -1
  776. package/dist/weapp/chart/index.wxml +1 -1
  777. package/dist/weapp/charts/canvas.js +1987 -175
  778. package/dist/weapp/charts/core.js +3 -0
  779. package/dist/weapp/chord-chart/index.js +1 -0
  780. package/dist/weapp/chord-chart/index.json +1 -0
  781. package/dist/weapp/chord-chart/index.wxml +1 -0
  782. package/dist/weapp/chord-chart/index.wxss +1 -0
  783. package/dist/weapp/controls.js +148 -57
  784. package/dist/weapp/gantt-chart/index.wxml +1 -1
  785. package/dist/weapp/heatmap-chart/index.wxml +1 -1
  786. package/dist/weapp/histogram-chart/index.wxml +1 -1
  787. package/dist/weapp/horizontal-bar-chart/index.wxml +1 -1
  788. package/dist/weapp/line-chart/index.wxml +1 -1
  789. package/dist/weapp/mixed-chart/index.wxml +1 -1
  790. package/dist/weapp/quadrant-chart/index.wxml +1 -1
  791. package/dist/weapp/range-area-chart/index.wxml +1 -1
  792. package/dist/weapp/scatter-chart/index.wxml +1 -1
  793. package/dist/weapp/sparkline/index.wxml +1 -1
  794. package/dist/weapp/types.d.ts +96 -4
  795. package/dist/weapp/waterfall-chart/index.wxml +1 -1
  796. package/dist/web-components/components/chart/charts.d.ts +4 -2
  797. package/dist/web-components/components/chart/charts.js +8 -1
  798. package/dist/web-components/components/chart/charts.js.map +1 -1
  799. package/dist/web-components/components/chart/extended.d.ts +21 -7
  800. package/dist/web-components/components/chart/extended.js +29 -9
  801. package/dist/web-components/components/chart/extended.js.map +1 -1
  802. package/dist/web-components/components/chart/shapes-extended.d.ts +37 -1
  803. package/dist/web-components/components/chart/shapes-extended.js +27 -1
  804. package/dist/web-components/components/chart/shapes-extended.js.map +1 -1
  805. package/dist/web-components/components/chart-3d/chart-3d.d.ts +1 -1
  806. package/dist/web-components/components/chart-3d/chart-3d.js.map +1 -1
  807. package/dist/web-components/components/graph/graph.d.ts +156 -0
  808. package/dist/web-components/components/graph/graph.js +150 -0
  809. package/dist/web-components/components/graph/graph.js.map +1 -0
  810. package/dist/web-components/components/trading-chart/trading-chart.d.ts +49 -2
  811. package/dist/web-components/components/trading-chart/trading-chart.js +62 -0
  812. package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -1
  813. package/dist/web-components/elements/chart.d.ts +1 -1
  814. package/dist/web-components/elements/chart.js +6 -5
  815. package/dist/web-components/elements/chart.js.map +1 -1
  816. package/dist/web-components/elements/graph.d.ts +2 -0
  817. package/dist/web-components/elements/graph.js +12 -0
  818. package/dist/web-components/elements/graph.js.map +1 -0
  819. package/dist/web-components/html-custom-data.json +318 -4
  820. package/dist/web-components/types/react.d.ts +63 -4
  821. package/dist/web-components/types/solid.d.ts +55 -8
  822. package/dist/web-components/types/svelte.d.ts +55 -8
  823. package/dist/web-components/types/vue.d.ts +55 -4
  824. package/package.json +16 -1
@@ -1,2 +1,2 @@
1
- const e=require("../../internal/parts.cjs"),t=require("../../charts/src/engine/presets.cjs");require("../../charts/src/canvas.cjs");const n=require("./ChartBase.cjs");let r=require("react"),i=require("react-native"),a=require("react/jsx-runtime");function o(e,t,i){let{xAxis:a,yAxis:o,legend:s,tooltip:c,crosshair:l,annotations:u,interaction:d,padding:f,palette:p,ariaLabel:m,locale:h,labels:g}=e,_=typeof g==`object`?g:void 0,v=i?.orientation,y=i?.yAxis2;return(0,r.useMemo)(()=>({...n.engineOptions({series:t,xAxis:a,yAxis:o,legend:s,tooltip:c,crosshair:l,annotations:u,interaction:d,padding:f,palette:p,ariaLabel:m,locale:h,labels:_}),...v?{orientation:v}:null,...y?{yAxis2:y}:null}),[t,v,y,a,o,s,c,l,u,d,f,p,m,h,_])}var s=e=>({height:e.height,width:e.width,style:e.style,testID:e.testID,handleRef:e.ref,onHover:e.onHover,onPointClick:e.onPointClick,onPlotClick:e.onPlotClick,onZoom:e.onZoom,renderTooltip:e.renderTooltip});function c(e){let{series:t,orientation:r,yAxis2:i}=e,c=o(e,t,{orientation:r,yAxis2:i});return(0,a.jsx)(n.ChartBase,{options:c,...s(e)})}function l(e){let{series:i,area:c=!1}=e,l=o(e,(0,r.useMemo)(()=>t.lineSeries(i,c),[i,c]));return(0,a.jsx)(n.ChartBase,{options:l,...s(e)})}function u(e){let{series:i,stacked:c=!1}=e,l=o(e,(0,r.useMemo)(()=>t.barSeries(i,c),[i,c]));return(0,a.jsx)(n.ChartBase,{options:l,...s(e)})}function d(e){let{series:i,stacked:c=!1,labels:l=!1}=e,u=o(e,(0,r.useMemo)(()=>t.barSeries(i,c,l),[i,c,l]),{orientation:`horizontal`});return(0,a.jsx)(n.ChartBase,{options:u,...s(e)})}function f(e){let{series:i}=e,c=o(e,(0,r.useMemo)(()=>t.scatterSeries(i),[i]));return(0,a.jsx)(n.ChartBase,{options:c,...s(e)})}var p=[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`],m=[];function h(c){let{points:l,xDomain:u,yDomain:d,xSplit:f,ySplit:h,quadrants:g,xLabel:_,yLabel:v,axisLabels:y,showTicks:b,reverseX:x,showLabels:S,pointSize:C,name:w,draggable:T,onPointClick:E,onPointDrop:D,onQuadrantClick:O,renderTooltip:k,quadrantContent:A}=c,j=o(c,m),M=T??!!D,N=(0,r.useMemo)(()=>t.quadrantChartOptions({points:l,xDomain:u,yDomain:d,xSplit:f,ySplit:h,quadrants:g,xLabel:_,yLabel:v,axisLabels:y,showTicks:b,reverseX:x,showLabels:S,pointSize:C,name:w,draggable:M},j),[l,u,d,f,h,g,_,v,y,b,x,S,C,w,M,j]),P={xDomain:u,yDomain:d,xSplit:f,ySplit:h,reverseX:x},F=A?t=>{let[n,r]=u??[0,10],[o,s]=d??[0,10],c=f??(n+r)/2,l=h??(o+s)/2,m=(c-n)/(r-n||1),g=(l-o)/(s-o||1),_=t.width*(x?1-m:m),v=t.height*(1-g);return p.map(n=>{let r=A[n];if(r==null||r===!1)return null;let o=n.endsWith(`Left`),s=n.startsWith(`top`);return(0,a.jsx)(i.View,{pointerEvents:`box-none`,style:{position:`absolute`,left:o?0:_,top:s?0:v,width:o?_:t.width-_,height:s?v:t.height-v},...e.part(`chart`,`quadrant`,{corner:n}),children:r},n)})}:void 0;return(0,a.jsx)(n.ChartBase,{options:N,...s({...c,onPointClick:void 0,renderTooltip:void 0}),overlay:F,onPointClick:E?e=>{let t=e.items[0]?.index;t!==void 0&&l[t]&&E(l[t],t)}:void 0,onPlotClick:O?e=>O(t.quadrantOf(P,e.x,e.y),e):void 0,onDrop:D?e=>{let n=e.item.index;l[n]&&D(l[n],n,{x:e.x,y:e.y,quadrant:t.quadrantOf(P,e.x,e.y)})}:void 0,renderTooltip:k?e=>{let t=e.items[0]?.index;return t!==void 0&&l[t]?k(l[t],t):null}:void 0})}exports.BarChart=u,exports.Chart=c,exports.HorizontalBarChart=d,exports.LineChart=l,exports.QuadrantChart=h,exports.ScatterChart=f;
1
+ const e=require("../../internal/parts.cjs"),t=require("../../charts/src/engine/presets.cjs");require("../../charts/src/canvas.cjs");const n=require("./ChartBase.cjs");let r=require("react"),i=require("react-native"),a=require("react/jsx-runtime");function o(e,t,i){let{xAxis:a,yAxis:o,legend:s,tooltip:c,crosshair:l,annotations:u,interaction:d,padding:f,palette:p,ariaLabel:m,locale:h,labels:g}=e,_=typeof g==`object`?g:void 0,v=i?.orientation,y=i?.yAxis2,b=i?.dependencies;return(0,r.useMemo)(()=>({...n.engineOptions({series:t,xAxis:a,yAxis:o,legend:s,tooltip:c,crosshair:l,annotations:u,interaction:d,padding:f,palette:p,ariaLabel:m,locale:h,labels:_}),...v?{orientation:v}:null,...y?{yAxis2:y}:null,...b?{dependencies:b}:null}),[t,v,y,b,a,o,s,c,l,u,d,f,p,m,h,_])}var s=e=>({height:e.height,width:e.width,style:e.style,testID:e.testID,handleRef:e.ref,onHover:e.onHover,onPointClick:e.onPointClick,onPlotClick:e.onPlotClick,onZoom:e.onZoom,renderTooltip:e.renderTooltip});function c(e){let{series:t,orientation:r,yAxis2:i,dependencies:c}=e,l=o(e,t,{orientation:r,yAxis2:i,dependencies:c});return(0,a.jsx)(n.ChartBase,{options:l,...s(e)})}function l(e){let{series:i,area:c=!1}=e,l=o(e,(0,r.useMemo)(()=>t.lineSeries(i,c),[i,c]));return(0,a.jsx)(n.ChartBase,{options:l,...s(e)})}function u(e){let{series:i,stacked:c=!1}=e,l=o(e,(0,r.useMemo)(()=>t.barSeries(i,c),[i,c]));return(0,a.jsx)(n.ChartBase,{options:l,...s(e)})}function d(e){let{series:i,stacked:c=!1,labels:l=!1}=e,u=o(e,(0,r.useMemo)(()=>t.barSeries(i,c,l),[i,c,l]),{orientation:`horizontal`});return(0,a.jsx)(n.ChartBase,{options:u,...s(e)})}function f(e){let{series:i}=e,c=o(e,(0,r.useMemo)(()=>t.scatterSeries(i),[i]));return(0,a.jsx)(n.ChartBase,{options:c,...s(e)})}var p=[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`],m=[];function h(c){let{points:l,xDomain:u,yDomain:d,xSplit:f,ySplit:h,quadrants:g,xLabel:_,yLabel:v,axisLabels:y,showTicks:b,reverseX:x,showLabels:S,pointSize:C,name:w,draggable:T,onPointClick:E,onPointDrop:D,onQuadrantClick:O,renderTooltip:k,quadrantContent:A}=c,j=o(c,m),M=T??!!D,N=(0,r.useMemo)(()=>t.quadrantChartOptions({points:l,xDomain:u,yDomain:d,xSplit:f,ySplit:h,quadrants:g,xLabel:_,yLabel:v,axisLabels:y,showTicks:b,reverseX:x,showLabels:S,pointSize:C,name:w,draggable:M},j),[l,u,d,f,h,g,_,v,y,b,x,S,C,w,M,j]),P={xDomain:u,yDomain:d,xSplit:f,ySplit:h,reverseX:x},F=A?t=>{let[n,r]=u??[0,10],[o,s]=d??[0,10],c=f??(n+r)/2,l=h??(o+s)/2,m=(c-n)/(r-n||1),g=(l-o)/(s-o||1),_=t.width*(x?1-m:m),v=t.height*(1-g);return p.map(n=>{let r=A[n];if(r==null||r===!1)return null;let o=n.endsWith(`Left`),s=n.startsWith(`top`);return(0,a.jsx)(i.View,{pointerEvents:`box-none`,style:{position:`absolute`,left:o?0:_,top:s?0:v,width:o?_:t.width-_,height:s?v:t.height-v},...e.part(`chart`,`quadrant`,{corner:n}),children:r},n)})}:void 0;return(0,a.jsx)(n.ChartBase,{options:N,...s({...c,onPointClick:void 0,renderTooltip:void 0}),overlay:F,onPointClick:E?e=>{let t=e.items[0]?.index;t!==void 0&&l[t]&&E(l[t],t)}:void 0,onPlotClick:O?e=>O(t.quadrantOf(P,e.x,e.y),e):void 0,onDrop:D?e=>{let n=e.item.index;l[n]&&D(l[n],n,{x:e.x,y:e.y,quadrant:t.quadrantOf(P,e.x,e.y)})}:void 0,renderTooltip:k?e=>{let t=e.items[0]?.index;return t!==void 0&&l[t]?k(l[t],t):null}:void 0})}exports.BarChart=u,exports.Chart=c,exports.HorizontalBarChart=d,exports.LineChart=l,exports.QuadrantChart=h,exports.ScatterChart=f;
2
2
  //# sourceMappingURL=charts.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.cjs","names":["useMemo","engineOptions","ChartBase","lineSeries","barSeries","scatterSeries","quadrantChartOptions","View","part","quadrantOf","require_parts","require_presets","require_ChartBase","react","react_native","react_jsx_runtime","useEngineOptions","labelsProp","props","labels","orientation","extra","yAxis2","series","xAxis","yAxis","legend","tooltip","crosshair","annotations","interaction","padding","palette","ariaLabel","locale","frameProps","Chart","options","LineChart","input","area","BarChart","stacked","HorizontalBarChart","ScatterChart","CORNERS","NO_SERIES","QuadrantChart","base","dragPoints","draggable","onPointDrop","points","xDomain","yDomain","xSplit","ySplit","quadrants","xLabel","yLabel","axisLabels","showTicks","reverseX","showLabels","pointSize","name","geometry","overlay","quadrantContent","x0","x1","y0","y1","xs","ys","fx","fy","sx","plot","sy","content","corner","left","top","onPointClick","index","event","onQuadrantClick","at","renderTooltip"],"sources":["../../../../../native/src/components/Chart/charts.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { View } from \"react-native\";\nimport {\n barSeries,\n lineSeries,\n quadrantChartOptions,\n quadrantOf,\n scatterSeries,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartRect,\n type ChartSeries,\n type QuadrantCorner,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { ChartBase, engineOptions } from \"./ChartBase\";\nimport type {\n BarChartProps,\n ChartCommonProps,\n ChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n QuadrantChartProps,\n ScatterChartProps,\n} from \"./types\";\n\n/** Engine options of the common props, kept while the props are the same */\nfunction useEngineOptions(\n props: Omit<\n ChartCommonProps,\n \"onPointClick\" | \"onPlotClick\" | \"renderTooltip\" | \"labels\"\n > & {\n /** Texts of the engine (a boolean is the `labels` of a bar chart) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n },\n series: readonly ChartSeries[],\n extra?: Pick<ChartOptions, \"orientation\" | \"yAxis2\">,\n): ChartOptions {\n const {\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels: labelsProp,\n } = props;\n const labels = typeof labelsProp === \"object\" ? labelsProp : undefined;\n const orientation = extra?.orientation;\n const yAxis2 = extra?.yAxis2;\n return useMemo(\n () => ({\n ...engineOptions({\n series,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n }),\n ...(orientation ? { orientation } : null),\n ...(yAxis2 ? { yAxis2 } : null),\n }),\n [\n series,\n orientation,\n yAxis2,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n}\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/**\n * Chart mixing line, area, bar and scatter series, drawn with views:\n * tap for the tooltip, pinch to zoom, drag to pan, double tap to reset.\n * Themed by the closest `MinervaProvider` (light / dark).\n */\nexport function Chart(props: ChartProps) {\n const { series, orientation, yAxis2 } = props;\n const options = useEngineOptions(props, series, { orientation, yAxis2 });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Line (or area) chart; large series are decimated to the pixel columns */\nexport function LineChart(props: LineChartProps) {\n const { series: input, area = false } = props;\n const series = useMemo(() => lineSeries(input, area), [input, area]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bar chart: grouped side by side, or stacked */\nexport function BarChart(props: BarChartProps) {\n const { series: input, stacked = false } = props;\n const series = useMemo(() => barSeries(input, stacked), [input, stacked]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Horizontal bar chart: categories down the left side (rankings, long\n * names, surveys), grouped, stacked or with the values at the bar ends\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n const { series: input, stacked = false, labels = false } = props;\n const series = useMemo(\n () => barSeries(input, stacked, labels),\n [input, stacked, labels],\n );\n const options = useEngineOptions(props, series, {\n orientation: \"horizontal\",\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Scatter chart: zooms on both axes; large point sets are merged per cell */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const base = useEngineOptions(props, NO_SERIES);\n const dragPoints = draggable ?? !!onPointDrop;\n const options = useMemo(\n () =>\n quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: dragPoints,\n },\n base,\n ),\n [\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n dragPoints,\n base,\n ],\n );\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n // split point relative to the plot area\n const sx = plot.width * (reverseX ? 1 - fx : fx);\n const sy = plot.height * (1 - fy);\n return CORNERS.map((corner) => {\n const content = quadrantContent[corner];\n if (content === undefined || content === null || content === false)\n return null;\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return (\n <View\n key={corner}\n pointerEvents=\"box-none\"\n style={{\n position: \"absolute\",\n left: left ? 0 : sx,\n top: top ? 0 : sy,\n width: left ? sx : plot.width - sx,\n height: top ? sy : plot.height - sy,\n }}\n {...part(\"chart\", \"quadrant\", { corner })}\n >\n {content}\n </View>\n );\n });\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event: ChartHoverEvent) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n"],"mappings":"uPA2BA,SAASgB,EACP,EAOA,EACA,EACc,CACd,GAAM,CACJ,QACA,QACA,SACA,UACA,YACA,cACA,cACA,UACA,UACA,YACA,SACA,OAAQC,GACNC,EACEC,EAAS,OAAOF,GAAe,SAAWA,EAAa,IAAA,GACvDG,EAAcC,GAAO,YACrBC,EAASD,GAAO,OACtB,OAAA,EAAOrB,EAAAA,QAAAA,MACE,CACL,GAAGC,EAAAA,cAAc,CACf,SACA,QACA,QACA,SACA,UACA,YACA,cACA,cACA,UACA,UACA,YACA,SACA,QACF,CAAC,EACD,GAAImB,EAAc,CAAE,aAAY,EAAI,KACpC,GAAIE,EAAS,CAAE,QAAO,EAAI,IAC5B,GACA,CACEC,EACAH,EACAE,EACAE,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAf,CACF,CACF,CACF,CAEA,IAAMgB,EAAc,IAA6C,CAC/D,OAAQjB,EAAM,OACd,MAAOA,EAAM,MACb,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,UAAWA,EAAM,IACjB,QAASA,EAAM,QACf,aAAcA,EAAM,aACpB,YAAaA,EAAM,YACnB,OAAQA,EAAM,OACd,cAAeA,EAAM,aACvB,GAOA,SAAgBkB,EAAM,EAAmB,CACvC,GAAM,CAAE,SAAQ,cAAa,UAAWlB,EAClCmB,EAAUrB,EAAiBE,EAAOK,EAAQ,CAAE,cAAa,QAAO,CAAC,EACvE,OAAO,EAAAR,EAAA,IAAA,CAACb,EAAAA,UAAD,CAAoB,UAAS,GAAIiC,EAAWjB,CAAK,CAAI,CAAA,CAC9D,CAGA,SAAgBoB,EAAU,EAAuB,CAC/C,GAAM,CAAE,OAAQC,EAAO,OAAO,IAAUrB,EAElCmB,EAAUrB,EAAiBE,GAAA,EADlBlB,EAAAA,QA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,MAAOG,EAAOL,EAAKC,EAAK,MAAQD,EAChC,OAAQM,EAAMJ,EAAKD,EAAK,OAASC,CACnC,EACA,GAAIvE,EAAAA,KAAK,QAAS,WAAY,CAAE,QAAO,CAAC,EAEvC,SAAAwE,CACG,EAZCC,CAYD,CAEV,CAAC,CACH,EACA,IAAA,GAEJ,OACE,EAAAlE,EAAA,IAAA,CAACb,EAAAA,UAAD,CACW,UACT,GAAIiC,EAAW,CACb,GAAGjB,EACH,aAAc,IAAA,GACd,cAAe,IAAA,EACjB,CAAC,EACQ,UACT,aACEkE,EACK,GAA2B,CAC1B,IAAMC,EAAQC,EAAM,MAAM,EAAE,EAAE,MAC1BD,IAAU,IAAA,IAAajC,EAAOiC,IAChCD,EAAahC,EAAOiC,GAAQA,CAAK,CACrC,EACA,IAAA,GAEN,YACEE,EACK,GAAOA,EAAgB9E,EAAAA,WAAWyD,EAAUsB,EAAG,EAAGA,EAAG,CAAC,EAAGA,CAAE,EAC5D,IAAA,GAEN,OACErC,EACK,GAAU,CACT,IAAMkC,EAAQC,EAAM,KAAK,MACpBlC,EAAOiC,IACZlC,EAAYC,EAAOiC,GAAQA,EAAO,CAChC,EAAGC,EAAM,EACT,EAAGA,EAAM,EACT,SAAU7E,EAAAA,WAAWyD,EAAUoB,EAAM,EAAGA,EAAM,CAAC,CACjD,CAAC,CACH,EACA,IAAA,GAEN,cACEG,EACK,GAAU,CACT,IAAMJ,EAAQC,EAAM,MAAM,EAAE,EAAE,MAC9B,OAAOD,IAAU,IAAA,IAAajC,EAAOiC,GACjCI,EAAcrC,EAAOiC,GAAQA,CAAK,EAClC,IACN,EACA,IAAA,EAEP,CAAA,CAEL"}
1
+ {"version":3,"file":"charts.cjs","names":["useMemo","engineOptions","ChartBase","lineSeries","barSeries","scatterSeries","quadrantChartOptions","View","part","quadrantOf","require_parts","require_presets","require_ChartBase","react","react_native","react_jsx_runtime","useEngineOptions","labelsProp","props","labels","orientation","extra","yAxis2","dependencies","series","xAxis","yAxis","legend","tooltip","crosshair","annotations","interaction","padding","palette","ariaLabel","locale","frameProps","Chart","options","LineChart","input","area","BarChart","stacked","HorizontalBarChart","ScatterChart","CORNERS","NO_SERIES","QuadrantChart","base","dragPoints","draggable","onPointDrop","points","xDomain","yDomain","xSplit","ySplit","quadrants","xLabel","yLabel","axisLabels","showTicks","reverseX","showLabels","pointSize","name","geometry","overlay","quadrantContent","x0","x1","y0","y1","xs","ys","fx","fy","sx","plot","sy","content","corner","left","top","onPointClick","index","event","onQuadrantClick","at","renderTooltip"],"sources":["../../../../../native/src/components/Chart/charts.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { View } from \"react-native\";\nimport {\n barSeries,\n lineSeries,\n quadrantChartOptions,\n quadrantOf,\n scatterSeries,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartRect,\n type ChartSeries,\n type QuadrantCorner,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { ChartBase, engineOptions } from \"./ChartBase\";\nimport type {\n BarChartProps,\n ChartCommonProps,\n ChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n QuadrantChartProps,\n ScatterChartProps,\n} from \"./types\";\n\n/** Engine options of the common props, kept while the props are the same */\nfunction useEngineOptions(\n props: Omit<\n ChartCommonProps,\n \"onPointClick\" | \"onPlotClick\" | \"renderTooltip\" | \"labels\"\n > & {\n /** Texts of the engine (a boolean is the `labels` of a bar chart) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n },\n series: readonly ChartSeries[],\n extra?: Pick<ChartOptions, \"orientation\" | \"yAxis2\" | \"dependencies\">,\n): ChartOptions {\n const {\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels: labelsProp,\n } = props;\n const labels = typeof labelsProp === \"object\" ? labelsProp : undefined;\n const orientation = extra?.orientation;\n const yAxis2 = extra?.yAxis2;\n const dependencies = extra?.dependencies;\n return useMemo(\n () => ({\n ...engineOptions({\n series,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n }),\n ...(orientation ? { orientation } : null),\n ...(yAxis2 ? { yAxis2 } : null),\n ...(dependencies ? { dependencies } : null),\n }),\n [\n series,\n orientation,\n yAxis2,\n dependencies,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n}\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/**\n * Chart mixing line, area, bar and scatter series, drawn with views:\n * tap for the tooltip, pinch to zoom, drag to pan, double tap to reset.\n * Themed by the closest `MinervaProvider` (light / dark).\n */\nexport function Chart(props: ChartProps) {\n const { series, orientation, yAxis2, dependencies } = props;\n const options = useEngineOptions(props, series, {\n orientation,\n yAxis2,\n dependencies,\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Line (or area) chart; large series are decimated to the pixel columns */\nexport function LineChart(props: LineChartProps) {\n const { series: input, area = false } = props;\n const series = useMemo(() => lineSeries(input, area), [input, area]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bar chart: grouped side by side, or stacked */\nexport function BarChart(props: BarChartProps) {\n const { series: input, stacked = false } = props;\n const series = useMemo(() => barSeries(input, stacked), [input, stacked]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Horizontal bar chart: categories down the left side (rankings, long\n * names, surveys), grouped, stacked or with the values at the bar ends\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n const { series: input, stacked = false, labels = false } = props;\n const series = useMemo(\n () => barSeries(input, stacked, labels),\n [input, stacked, labels],\n );\n const options = useEngineOptions(props, series, {\n orientation: \"horizontal\",\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Scatter chart: zooms on both axes; large point sets are merged per cell */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const base = useEngineOptions(props, NO_SERIES);\n const dragPoints = draggable ?? !!onPointDrop;\n const options = useMemo(\n () =>\n quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: dragPoints,\n },\n base,\n ),\n [\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n dragPoints,\n base,\n ],\n );\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n // split point relative to the plot area\n const sx = plot.width * (reverseX ? 1 - fx : fx);\n const sy = plot.height * (1 - fy);\n return CORNERS.map((corner) => {\n const content = quadrantContent[corner];\n if (content === undefined || content === null || content === false)\n return null;\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return (\n <View\n key={corner}\n pointerEvents=\"box-none\"\n style={{\n position: \"absolute\",\n left: left ? 0 : sx,\n top: top ? 0 : sy,\n width: left ? sx : plot.width - sx,\n height: top ? sy : plot.height - sy,\n }}\n {...part(\"chart\", \"quadrant\", { corner })}\n >\n {content}\n </View>\n );\n });\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event: ChartHoverEvent) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n"],"mappings":"uPA2BA,SAASgB,EACP,EAOA,EACA,EACc,CACd,GAAM,CACJ,QACA,QACA,SACA,UACA,YACA,cACA,cACA,UACA,UACA,YACA,SACA,OAAQC,GACNC,EACEC,EAAS,OAAOF,GAAe,SAAWA,EAAa,IAAA,GACv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AEJ,OACE,EAAAnE,EAAA,IAAA,CAACb,EAAAA,UAAD,CACW,UACT,GAAIkC,EAAW,CACb,GAAGlB,EACH,aAAc,IAAA,GACd,cAAe,IAAA,EACjB,CAAC,EACQ,UACT,aACEmE,EACK,GAA2B,CAC1B,IAAMC,EAAQC,EAAM,MAAM,EAAE,EAAE,MAC1BD,IAAU,IAAA,IAAajC,EAAOiC,IAChCD,EAAahC,EAAOiC,GAAQA,CAAK,CACrC,EACA,IAAA,GAEN,YACEE,EACK,GAAOA,EAAgB/E,EAAAA,WAAW0D,EAAUsB,EAAG,EAAGA,EAAG,CAAC,EAAGA,CAAE,EAC5D,IAAA,GAEN,OACErC,EACK,GAAU,CACT,IAAMkC,EAAQC,EAAM,KAAK,MACpBlC,EAAOiC,IACZlC,EAAYC,EAAOiC,GAAQA,EAAO,CAChC,EAAGC,EAAM,EACT,EAAGA,EAAM,EACT,SAAU9E,EAAAA,WAAW0D,EAAUoB,EAAM,EAAGA,EAAM,CAAC,CACjD,CAAC,CACH,EACA,IAAA,GAEN,cACEG,EACK,GAAU,CACT,IAAMJ,EAAQC,EAAM,MAAM,EAAE,EAAE,MAC9B,OAAOD,IAAU,IAAA,IAAajC,EAAOiC,GACjCI,EAAcrC,EAAOiC,GAAQA,CAAK,EAClC,IACN,EACA,IAAA,EAEP,CAAA,CAEL"}
@@ -7,7 +7,7 @@ import { View as l } from "react-native";
7
7
  import { jsx as u } from "react/jsx-runtime";
8
8
  //#region src/components/Chart/charts.tsx
9
9
  function d(e, t, n) {
10
- let { xAxis: r, yAxis: i, legend: a, tooltip: o, crosshair: l, annotations: u, interaction: d, padding: f, palette: p, ariaLabel: m, locale: h, labels: g } = e, _ = typeof g == "object" ? g : void 0, v = n?.orientation, y = n?.yAxis2;
10
+ let { xAxis: r, yAxis: i, legend: a, tooltip: o, crosshair: l, annotations: u, interaction: d, padding: f, palette: p, ariaLabel: m, locale: h, labels: g } = e, _ = typeof g == "object" ? g : void 0, v = n?.orientation, y = n?.yAxis2, b = n?.dependencies;
11
11
  return c(() => ({
12
12
  ...s({
13
13
  series: t,
@@ -25,11 +25,13 @@ function d(e, t, n) {
25
25
  labels: _
26
26
  }),
27
27
  ...v ? { orientation: v } : null,
28
- ...y ? { yAxis2: y } : null
28
+ ...y ? { yAxis2: y } : null,
29
+ ...b ? { dependencies: b } : null
29
30
  }), [
30
31
  t,
31
32
  v,
32
33
  y,
34
+ b,
33
35
  r,
34
36
  i,
35
37
  a,
@@ -57,12 +59,13 @@ var f = (e) => ({
57
59
  renderTooltip: e.renderTooltip
58
60
  });
59
61
  function p(e) {
60
- let { series: t, orientation: n, yAxis2: r } = e, i = d(e, t, {
62
+ let { series: t, orientation: n, yAxis2: r, dependencies: i } = e, a = d(e, t, {
61
63
  orientation: n,
62
- yAxis2: r
64
+ yAxis2: r,
65
+ dependencies: i
63
66
  });
64
67
  return /* @__PURE__ */ u(o, {
65
- options: i,
68
+ options: a,
66
69
  ...f(e)
67
70
  });
68
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","names":["useEngineOptions","labelsProp","props","labels","orientation","extra","yAxis2","useMemo","engineOptions","series","xAxis","yAxis","legend","tooltip","crosshair","annotations","interaction","padding","palette","ariaLabel","locale","frameProps","Chart","options","ChartBase","LineChart","input","lineSeries","area","BarChart","barSeries","stacked","HorizontalBarChart","ScatterChart","scatterSeries","CORNERS","NO_SERIES","QuadrantChart","base","dragPoints","draggable","onPointDrop","quadrantChartOptions","points","xDomain","yDomain","xSplit","ySplit","quadrants","xLabel","yLabel","axisLabels","showTicks","reverseX","showLabels","pointSize","name","geometry","overlay","quadrantContent","x0","x1","y0","y1","xs","ys","fx","fy","sx","plot","sy","content","corner","left","top","View","part","onPointClick","index","event","onQuadrantClick","quadrantOf","at","renderTooltip"],"sources":["../../../../../native/src/components/Chart/charts.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { View } from \"react-native\";\nimport {\n barSeries,\n lineSeries,\n quadrantChartOptions,\n quadrantOf,\n scatterSeries,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartRect,\n type ChartSeries,\n type QuadrantCorner,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { ChartBase, engineOptions } from \"./ChartBase\";\nimport type {\n BarChartProps,\n ChartCommonProps,\n ChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n QuadrantChartProps,\n ScatterChartProps,\n} from \"./types\";\n\n/** Engine options of the common props, kept while the props are the same */\nfunction useEngineOptions(\n props: Omit<\n ChartCommonProps,\n \"onPointClick\" | \"onPlotClick\" | \"renderTooltip\" | \"labels\"\n > & {\n /** Texts of the engine (a boolean is the `labels` of a bar chart) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n },\n series: readonly ChartSeries[],\n extra?: Pick<ChartOptions, \"orientation\" | \"yAxis2\">,\n): ChartOptions {\n const {\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels: labelsProp,\n } = props;\n const labels = typeof labelsProp === \"object\" ? labelsProp : undefined;\n const orientation = extra?.orientation;\n const yAxis2 = extra?.yAxis2;\n return useMemo(\n () => ({\n ...engineOptions({\n series,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n }),\n ...(orientation ? { orientation } : null),\n ...(yAxis2 ? { yAxis2 } : null),\n }),\n [\n series,\n orientation,\n yAxis2,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n}\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/**\n * Chart mixing line, area, bar and scatter series, drawn with views:\n * tap for the tooltip, pinch to zoom, drag to pan, double tap to reset.\n * Themed by the closest `MinervaProvider` (light / dark).\n */\nexport function Chart(props: ChartProps) {\n const { series, orientation, yAxis2 } = props;\n const options = useEngineOptions(props, series, { orientation, yAxis2 });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Line (or area) chart; large series are decimated to the pixel columns */\nexport function LineChart(props: LineChartProps) {\n const { series: input, area = false } = props;\n const series = useMemo(() => lineSeries(input, area), [input, area]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bar chart: grouped side by side, or stacked */\nexport function BarChart(props: BarChartProps) {\n const { series: input, stacked = false } = props;\n const series = useMemo(() => barSeries(input, stacked), [input, stacked]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Horizontal bar chart: categories down the left side (rankings, long\n * names, surveys), grouped, stacked or with the values at the bar ends\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n const { series: input, stacked = false, labels = false } = props;\n const series = useMemo(\n () => barSeries(input, stacked, labels),\n [input, stacked, labels],\n );\n const options = useEngineOptions(props, series, {\n orientation: \"horizontal\",\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Scatter chart: zooms on both axes; large point sets are merged per cell */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const base = useEngineOptions(props, NO_SERIES);\n const dragPoints = draggable ?? !!onPointDrop;\n const options = useMemo(\n () =>\n quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: dragPoints,\n },\n base,\n ),\n [\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n dragPoints,\n base,\n ],\n );\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n // split point relative to the plot area\n const sx = plot.width * (reverseX ? 1 - fx : fx);\n const sy = plot.height * (1 - fy);\n return CORNERS.map((corner) => {\n const content = quadrantContent[corner];\n if (content === undefined || content === null || content === false)\n return null;\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return (\n <View\n key={corner}\n pointerEvents=\"box-none\"\n style={{\n position: \"absolute\",\n left: left ? 0 : sx,\n top: top ? 0 : sy,\n width: left ? sx : plot.width - sx,\n height: top ? sy : plot.height - sy,\n }}\n {...part(\"chart\", \"quadrant\", { corner })}\n >\n {content}\n </View>\n );\n });\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event: ChartHoverEvent) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n"],"mappings":";;;;;;;;AA2BA,SAASA,EACP,GAOA,GACA,GACc;CACd,IAAM,EACJ,UACA,UACA,WACA,YACA,cACA,gBACA,gBACA,YACA,YACA,cACA,WACA,QAAQC,MACNC,GACEC,IAAS,OAAOF,KAAe,WAAWA,IAAa,KAAA,GACvDG,IAAcC,GAAO,aACrBC,IAASD,GAAO;CACtB,OAAOE,SACE;EACL,GAAGC,EAAc;GACf;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,GAAIJ,IAAc,EAAE,eAAY,IAAI;EACpC,GAAIE,IAAS,EAAE,UAAO,IAAI;CAC5B,IACA;EACEG;EACAL;EACAE;EACAI;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAjB;CACF,CACF;AACF;AAEA,IAAMkB,KAAc,OAA6C;CAC/D,QAAQnB,EAAM;CACd,OAAOA,EAAM;CACb,OAAOA,EAAM;CACb,QAAQA,EAAM;CACd,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EAAM;CACnB,QAAQA,EAAM;C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AEE,eAAc;IACd,OAAO;KACL,UAAU;KACV,MAAMF,IAAO,IAAIL;KACjB,KAAKM,IAAM,IAAIJ;KACf,OAAOG,IAAOL,IAAKC,EAAK,QAAQD;KAChC,QAAQM,IAAMJ,IAAKD,EAAK,SAASC;IACnC;IACA,GAAIM,EAAK,SAAS,YAAY,EAAE,UAAO,CAAC;IAEvC,UAAAL;GACG,GAZCC,CAYD;EAEV,CAAC;CACH,IACA,KAAA;CAEJ,OACE,kBAAChD,GAAD;EACW;EACT,GAAIH,EAAW;GACb,GAAGnB;GACH,cAAc,KAAA;GACd,eAAe,KAAA;EACjB,CAAC;EACQ;EACT,cACE2E,KACK,MAA2B;GAC1B,IAAMC,IAAQC,EAAM,MAAM,EAAE,EAAE;GAC9B,AAAID,MAAU,KAAA,KAAanC,EAAOmC,MAChCD,EAAalC,EAAOmC,IAAQA,CAAK;EACrC,IACA,KAAA;EAEN,aACEE,KACK,MAAOA,EAAgBC,EAAWxB,GAAUyB,EAAG,GAAGA,EAAG,CAAC,GAAGA,CAAE,IAC5D,KAAA;EAEN,QACEzC,KACK,MAAU;GACT,IAAMqC,IAAQC,EAAM,KAAK;GACzB,AAAKpC,EAAOmC,MACZrC,EAAYE,EAAOmC,IAAQA,GAAO;IAChC,GAAGC,EAAM;IACT,GAAGA,EAAM;IACT,UAAUE,EAAWxB,GAAUsB,EAAM,GAAGA,EAAM,CAAC;GACjD,CAAC;EACH,IACA,KAAA;EAEN,eACEI,KACK,MAAU;GACT,IAAML,IAAQC,EAAM,MAAM,EAAE,EAAE;GAC9B,OAAOD,MAAU,KAAA,KAAanC,EAAOmC,KACjCK,EAAcxC,EAAOmC,IAAQA,CAAK,IAClC;EACN,IACA,KAAA;CAEP,CAAA;AAEL"}
1
+ {"version":3,"file":"charts.js","names":["useEngineOptions","labelsProp","props","labels","orientation","extra","yAxis2","dependencies","useMemo","engineOptions","series","xAxis","yAxis","legend","tooltip","crosshair","annotations","interaction","padding","palette","ariaLabel","locale","frameProps","Chart","options","ChartBase","LineChart","input","lineSeries","area","BarChart","barSeries","stacked","HorizontalBarChart","ScatterChart","scatterSeries","CORNERS","NO_SERIES","QuadrantChart","base","dragPoints","draggable","onPointDrop","quadrantChartOptions","points","xDomain","yDomain","xSplit","ySplit","quadrants","xLabel","yLabel","axisLabels","showTicks","reverseX","showLabels","pointSize","name","geometry","overlay","quadrantContent","x0","x1","y0","y1","xs","ys","fx","fy","sx","plot","sy","content","corner","left","top","View","part","onPointClick","index","event","onQuadrantClick","quadrantOf","at","renderTooltip"],"sources":["../../../../../native/src/components/Chart/charts.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { View } from \"react-native\";\nimport {\n barSeries,\n lineSeries,\n quadrantChartOptions,\n quadrantOf,\n scatterSeries,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartRect,\n type ChartSeries,\n type QuadrantCorner,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { ChartBase, engineOptions } from \"./ChartBase\";\nimport type {\n BarChartProps,\n ChartCommonProps,\n ChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n QuadrantChartProps,\n ScatterChartProps,\n} from \"./types\";\n\n/** Engine options of the common props, kept while the props are the same */\nfunction useEngineOptions(\n props: Omit<\n ChartCommonProps,\n \"onPointClick\" | \"onPlotClick\" | \"renderTooltip\" | \"labels\"\n > & {\n /** Texts of the engine (a boolean is the `labels` of a bar chart) */\n labels?: ChartCommonProps[\"labels\"] | boolean;\n },\n series: readonly ChartSeries[],\n extra?: Pick<ChartOptions, \"orientation\" | \"yAxis2\" | \"dependencies\">,\n): ChartOptions {\n const {\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels: labelsProp,\n } = props;\n const labels = typeof labelsProp === \"object\" ? labelsProp : undefined;\n const orientation = extra?.orientation;\n const yAxis2 = extra?.yAxis2;\n const dependencies = extra?.dependencies;\n return useMemo(\n () => ({\n ...engineOptions({\n series,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n }),\n ...(orientation ? { orientation } : null),\n ...(yAxis2 ? { yAxis2 } : null),\n ...(dependencies ? { dependencies } : null),\n }),\n [\n series,\n orientation,\n yAxis2,\n dependencies,\n xAxis,\n yAxis,\n legend,\n tooltip,\n crosshair,\n annotations,\n interaction,\n padding,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n}\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n style: props.style,\n testID: props.testID,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n renderTooltip: props.renderTooltip,\n});\n\n/**\n * Chart mixing line, area, bar and scatter series, drawn with views:\n * tap for the tooltip, pinch to zoom, drag to pan, double tap to reset.\n * Themed by the closest `MinervaProvider` (light / dark).\n */\nexport function Chart(props: ChartProps) {\n const { series, orientation, yAxis2, dependencies } = props;\n const options = useEngineOptions(props, series, {\n orientation,\n yAxis2,\n dependencies,\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Line (or area) chart; large series are decimated to the pixel columns */\nexport function LineChart(props: LineChartProps) {\n const { series: input, area = false } = props;\n const series = useMemo(() => lineSeries(input, area), [input, area]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Bar chart: grouped side by side, or stacked */\nexport function BarChart(props: BarChartProps) {\n const { series: input, stacked = false } = props;\n const series = useMemo(() => barSeries(input, stacked), [input, stacked]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/**\n * Horizontal bar chart: categories down the left side (rankings, long\n * names, surveys), grouped, stacked or with the values at the bar ends\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n const { series: input, stacked = false, labels = false } = props;\n const series = useMemo(\n () => barSeries(input, stacked, labels),\n [input, stacked, labels],\n );\n const options = useEngineOptions(props, series, {\n orientation: \"horizontal\",\n });\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\n/** Scatter chart: zooms on both axes; large point sets are merged per cell */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n const options = useEngineOptions(props, series);\n return <ChartBase options={options} {...frameProps(props)} />;\n}\n\nconst CORNERS: QuadrantCorner[] = [\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n];\n\nconst NO_SERIES: readonly ChartSeries[] = [];\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n } = props;\n const base = useEngineOptions(props, NO_SERIES);\n const dragPoints = draggable ?? !!onPointDrop;\n const options = useMemo(\n () =>\n quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: dragPoints,\n },\n base,\n ),\n [\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n dragPoints,\n base,\n ],\n );\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n\n const overlay = quadrantContent\n ? (plot: ChartRect) => {\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = (xs - x0) / (x1 - x0 || 1);\n const fy = (ys - y0) / (y1 - y0 || 1);\n // split point relative to the plot area\n const sx = plot.width * (reverseX ? 1 - fx : fx);\n const sy = plot.height * (1 - fy);\n return CORNERS.map((corner) => {\n const content = quadrantContent[corner];\n if (content === undefined || content === null || content === false)\n return null;\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return (\n <View\n key={corner}\n pointerEvents=\"box-none\"\n style={{\n position: \"absolute\",\n left: left ? 0 : sx,\n top: top ? 0 : sy,\n width: left ? sx : plot.width - sx,\n height: top ? sy : plot.height - sy,\n }}\n {...part(\"chart\", \"quadrant\", { corner })}\n >\n {content}\n </View>\n );\n });\n }\n : undefined;\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={\n onPointClick\n ? (event: ChartHoverEvent) => {\n const index = event.items[0]?.index;\n if (index !== undefined && points[index])\n onPointClick(points[index], index);\n }\n : undefined\n }\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onDrop={\n onPointDrop\n ? (event) => {\n const index = event.item.index;\n if (!points[index]) return;\n onPointDrop(points[index], index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n }\n : undefined\n }\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n"],"mappings":";;;;;;;;AA2BA,SAASA,EACP,GAOA,GACA,GACc;CACd,IAAM,EACJ,UACA,UACA,WACA,YACA,cACA,gBACA,gBACA,YACA,YACA,cACA,WACA,QAAQC,MACNC,GACEC,IAAS,OAAOF,KAAe,WAAWA,IAAa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EAAG,GAAGA,EAAG,CAAC,GAAGA,CAAE,IAC5D,KAAA;EAEN,QACEzC,KACK,MAAU;GACT,IAAMqC,IAAQC,EAAM,KAAK;GACzB,AAAKpC,EAAOmC,MACZrC,EAAYE,EAAOmC,IAAQA,GAAO;IAChC,GAAGC,EAAM;IACT,GAAGA,EAAM;IACT,UAAUE,EAAWxB,GAAUsB,EAAM,GAAGA,EAAM,CAAC;GACjD,CAAC;EACH,IACA,KAAA;EAEN,eACEI,KACK,MAAU;GACT,IAAML,IAAQC,EAAM,MAAM,EAAE,EAAE;GAC9B,OAAOD,MAAU,KAAA,KAAanC,EAAOmC,KACjCK,EAAcxC,EAAOmC,IAAQA,CAAK,IAClC;EACN,IACA,KAAA;CAEP,CAAA;AAEL"}
@@ -1,2 +1,2 @@
1
- const e=require("../../internal/parts.cjs"),t=require("../../charts/src/engine/color.cjs"),n=require("../../charts/src/engine/overlay.cjs"),r=require("../../charts/src/engine/controller.cjs");require("../../charts/src/canvas.cjs");const i=require("./measure.cjs");let a=require("react-native"),o=require("react/jsx-runtime");var s={linePoints:1200,dotsPerSeries:800,dots:2e3,barsPerSeries:600,bars:1500,areaColumns:200,dashes:200},c=`chart`,l=e=>Math.ceil(e*1.35),u=(e,t)=>Math.ceil(i.measureChartText(e,`${t.weight??400} ${t.size}px sans-serif`)*1.4+t.size*2);function d(e,t,n,r,i,s,c,d,f){let p=l(c.size),m=(p-c.size)/2,h=u(t,c),g=s===`top`?r-m:s===`bottom`?r-p+m:r-p/2,_=i===`left`?{left:n,width:h}:i===`right`?{right:d-n,width:h}:{left:n-h/2,width:h};return(0,o.jsx)(a.Text,{numberOfLines:1,style:[{position:`absolute`,top:g,..._,textAlign:i,fontSize:c.size,lineHeight:p,color:c.color,fontWeight:String(c.weight??400),includeFontPadding:!1,...c.family?{fontFamily:c.family}:null,...c.halo?{textShadowColor:c.halo,textShadowRadius:3,textShadowOffset:{width:0,height:0}}:null},f],children:t},e)}var f=(e,t,n,r,i,s,c)=>(0,o.jsx)(a.View,{style:[{position:`absolute`,left:t,top:n,width:r,height:i,backgroundColor:s},c]},e),p=(e,t,n,r,i,a)=>f(e,t-r/2,n-r/2,r,r,i,{borderRadius:r/2,...a}),m=(e,t,n,r,i,a,o)=>{let s=r-t,c=i-n,l=Math.hypot(s,c)+a;return f(e,(t+r)/2-l/2,(n+i)/2-a/2,l,a,o,{borderRadius:a/2,transform:[{rotate:`${Math.atan2(c,s)}rad`}]})};function h(e,t,n=s.dashes){let r=t.filter(e=>Number.isFinite(e)&&e>=0);r.length%2&&(r=[...r,...r]);let i=r.reduce((e,t)=>e+t,0);if(!r.length||i<=0)return[[0,e]];let a=e/i*(r.length/2),o=a>n?a/n:1,c=[],l=0;for(let t=0;l<e;t=(t+1)%r.length){let n=r[t]*o;t%2==0&&n>0&&c.push([l,Math.min(n,e-l)]),l+=Math.max(n,.5)}return c}var g=(e,t,n,r,i,a,o,s)=>h(i,s).map(([i,s],c)=>t===`y`?f(`${e}-${c}`,r+i,n,s,a,o):f(`${e}-${c}`,n,r+i,a,s,o)),_=(e,t=1)=>Math.round(e)+.5-t/2;function v(e,t){let n=e.length/2,r=n>t?Math.ceil(n/t):1,i=[];for(let t=0;t<n;t+=r){let n=e[t*2],r=e[t*2+1],a=i.length;a&&Math.hypot(n-i[a-2],r-i[a-1])<1.5||i.push(n,r)}let a=e[n*2-2],o=e[n*2-1],s=i.length;return n>1&&(i[s-2]!==a||i[s-1]!==o)&&i.push(a,o),i}function y(e,t,n,r,i,a,o,c=!1){let l=c?t.map((e,n)=>t[n%2?n-1:n+1]):t,u=c?{x:a.y,y:a.x,width:a.height,height:a.width}:a,d=l.length/2;if(d<2)return[];let p=l[0]<=l[d*2-2],m=e=>p?e:d-1-e,h=e=>l[m(e)*2],g=e=>l[m(e)*2+1],_=e=>o?o[m(e)]:n,v=Math.max(u.x,h(0)),y=Math.min(u.x+u.width,h(d-1));if(y<=v)return[];let b=Math.max(2,u.width/s.areaColumns),x=[],S=0;for(let t=Math.floor(v),n=0;t<y;n++){let a=Math.min(Math.ceil(y),Math.round(t+b)),o=(t+a)/2;for(;S<d-2&&h(S+1)<o;)S++;let s=h(S),l=h(S+1),p=l===s?0:Math.max(0,Math.min(1,(o-s)/(l-s))),m=g(S)+(g(S+1)-g(S))*p,v=_(S)+(_(S+1)-_(S))*p;if(Number.isFinite(m)&&Number.isFinite(v)){let o=Math.min(m,v),s=Math.abs(v-m);x.push(c?f(`${e}-${n}`,o-u.y,t-u.x,s,a-t,r,{opacity:i}):f(`${e}-${n}`,t-u.x,o-u.y,a-t,s,r,{opacity:i}))}t=a}return x}function b(e){let{plot:t}=e.layout,n=e.model.series.filter(e=>!e.hidden),r=n.filter(e=>e.type===`line`||e.type===`area`).length,i=n.filter(e=>e.type===`scatter`).length,a=Math.max(150,s.linePoints/Math.max(1,r)),o=Math.max(100,Math.min(s.dotsPerSeries,s.dots/Math.max(1,i)));return{perLine:a,options:{columnWidth:Math.max(3,t.width*4/a),maxDots:o,maxBars:s.barsPerSeries,dotCell:Math.max(4,Math.sqrt(t.width*t.height/o)*1.15+1)}}}function x(e){let{plot:t}=e.layout,{perLine:n,options:i}=b(e),a=r.scenePrimitives(e,i),o=t.x,c=t.y,l=[],u=s.dots,d=s.bars;return a.forEach((e,r)=>{let i=`${e.kind}${e.seriesIndex}-${r}`;if(e.kind===`area`){e.segments.forEach((n,r)=>l.push(...y(`${i}-${r}`,n,e.baseline,e.color,e.opacity,t,e.bottoms?.[r],e.horizontal)));return}if(e.kind===`line`){let t=0;for(let n of e.segments)t+=n.length/2;e.segments.forEach((r,a)=>{let s=v(r,Math.max(2,Math.round(n*r.length/2/Math.max(1,t))));if(s.length===2){l.push(p(`${i}-${a}`,s[0]-o,s[1]-c,e.width*1.5,e.color));return}for(let t=0;t+3<s.length;t+=2)l.push(m(`${i}-${a}-${t}`,s[t]-o,s[t+1]-c,s[t+2]-o,s[t+3]-c,e.width,e.color))});return}if(e.kind===`bars`){let t=e.rects.length/4,n=t>d?Math.ceil(t/Math.max(1,d)):1;for(let r=0;r<t;r+=n){let[t,n,a,s]=e.rects.slice(r*4,r*4+4),u=Math.min(e.radius??0,a/2,s/2);l.push(f(`${i}-${r}`,t-o,n-c,Math.max(a,.5),s,e.colors?.[r]??e.color,u>.5||e.opacity!==void 0?{...u>.5?{borderRadius:u}:null,...e.opacity===void 0?null:{opacity:e.opacity}}:void 0))}d=Math.max(0,d-Math.ceil(t/n));return}let a=e.dots.length/3,s=a>u?Math.ceil(a/Math.max(1,u)):1;for(let t=0;t<a;t+=s)l.push(p(`${i}-${t}`,e.dots[t*3]-o,e.dots[t*3+1]-c,e.dots[t*3+2],e.colors[t],{opacity:e.opacity}));u=Math.max(0,u-Math.ceil(a/s))}),l}var S=(e,n)=>t.toCss(e,n);function C(t,r){let{width:s,theme:l,model:u,layout:m,annotations:h}=t,{plot:g,scales:v,y2Ticks:y}=m,b=v.horizontal,x=b?u.y:u.x,C=b?u.x:u.y,w=b?m.yTicks:m.xTicks,T=b?m.xTicks:m.yTicks,E=b?v.yToPx:v.xToPx,D=b?v.xToPx:v.yToPx,O=l.fontSize,k=[];h.forEach((e,t)=>{if(e.type!==`rect`)return;let r=n.rectOf(e,v);r.width<=0||r.height<=0||k.push(f(`area-${t}`,r.x,r.y,r.width,r.height,S(e.color,e.opacity)))});let A=S(l.grid);C.grid&&T.values.forEach((e,t)=>{let n=D(e);n<g.y-1||n>g.y+g.height+1||k.push(f(`ygrid-${t}`,g.x,_(n),g.width,1,A))}),x.grid&&w.values.forEach((e,t)=>{let n=E(e);n<g.x-1||n>g.x+g.width+1||k.push(f(`xgrid-${t}`,_(n),g.y,1,g.height,A))});let j=Math.ceil(O*1.4),M={size:O,color:S(l.textMuted),family:r},N={size:O+1,weight:500,color:S(l.text,.8),family:r},P=g.y+g.height;if(x.visible){k.push(f(`xaxis`,g.x,_(P),g.width,1,S(l.axis)));let e=-1/0;w.values.map((e,t)=>({px:E(e),text:w.labels[t]??``})).sort((e,t)=>e.px-t.px).forEach(({px:t,text:n},r)=>{if(!n||t<g.x-.5||t>g.x+g.width+.5)return;let a=i.measureChartText(n,`400 ${O}px sans-serif`),o=Math.max(0,Math.min(s-a,t-a/2));o<e+6||(e=o+a,k.push(d(`xtick-${r}`,n,o+a/2,P+7,`center`,`top`,M,s)))}),x.title&&k.push(d(`xtitle`,x.title,g.x+g.width/2,P+j+10,`center`,`top`,N,s))}if(C.visible){let e=-1/0;T.values.map((e,t)=>({py:D(e),text:T.labels[t]??``})).sort((e,t)=>e.py-t.py).forEach(({py:t,text:n},r)=>{if(!(!n||t<g.y-.5||t>g.y+g.height+.5)){if(b){if(t-(O+2)/2<e)return;e=t+(O+2)/2}k.push(d(`ytick-${r}`,n,g.x-8,t,`right`,`middle`,M,s))}}),C.title&&k.push(d(`ytitle`,C.title,j/2+4,g.y+g.height/2,`center`,`middle`,N,s,{transform:[{rotate:`-90deg`}]}))}let F=b?null:u.y2;if(F&&y&&F.visible){let e=g.x+g.width;y.values.forEach((t,n)=>{let r=v.yToPx(t),i=y.labels[n];!i||r<g.y-.5||r>g.y+g.height+.5||k.push(d(`y2tick-${n}`,i,e+8,r,`left`,`middle`,M,s))}),F.title&&k.push(d(`y2title`,F.title,s-j/2-4,g.y+g.height/2,`center`,`middle`,N,s,{transform:[{rotate:`90deg`}]}))}if(t.legend)for(let n of t.legend.entries){let t=n.box.height/2,i=n.shape===`dot`?p(`swatch`,5,t,8,n.color):n.shape===`line`?f(`swatch`,0,t-1,10,2,n.color):f(`swatch`,1,t-4,8,8,n.color);k.push((0,o.jsxs)(a.View,{style:{position:`absolute`,left:n.box.x,top:n.box.y,width:n.box.width,height:n.box.height,opacity:n.hidden?.45:1},...e.part(c,`legend-item`,{hidden:n.hidden}),children:[i,d(`name`,n.name,14,t,`left`,`middle`,{size:12,color:S(l.textMuted),family:r},n.box.width,n.hidden?{textDecorationLine:`line-through`}:void 0)]},`legend-${n.id}`))}return k}function w(e,t){let{theme:r,annotations:a,layout:o}=e,{plot:s,scales:c}=o,l=r.fontSize,u=s.x,f=s.y,p=s.width,m=S(r.background,.9),h=l+4,v=[];a.forEach((e,r)=>{if(e.type!==`line`)return;let i=S(e.color),a=n.lineOf(e,c);if(a.vertical){let n=a.at;v.push(...g(`line-${r}`,`x`,_(n,e.width)-u,0,s.height,e.width,i,e.dash)),e.label&&v.push(d(`line-label-${r}`,e.label,n+5-u,5,`left`,`top`,{size:l,weight:500,color:i,halo:m,family:t},p))}else{let n=a.at;v.push(...g(`line-${r}`,`y`,_(n,e.width)-f,0,s.width,e.width,i,e.dash)),e.label&&v.push(d(`line-label-${r}`,e.label,s.width-6,n-3-f,`right`,`bottom`,{size:l,weight:500,color:i,halo:m,family:t},p))}}),a.forEach((e,r)=>{if(e.type!==`rect`||!e.label)return;let i=n.rectOf(e,c);if(i.width<=0||i.height<=0)return;let a=e.labelPosition,o=a.endsWith(`left`)?`left`:a.endsWith(`right`)?`right`:`center`,s=o===`left`?i.x+10:o===`right`?i.x+i.width-10:i.x+i.width/2,m=a.startsWith(`top`)?i.y+10:a.startsWith(`bottom`)?i.y+i.height-10-h:i.y+(i.height-h)/2;v.push(d(`area-label-${r}`,e.label,s-u,m-f,o,`top`,{size:l+1,weight:600,color:S(e.labelColor),family:t},p))}),a.forEach((e,r)=>{if(e.type!==`text`||!e.text)return;let a=i.measureChartText(e.text,`${e.weight} ${l}px sans-serif`),o=n.textBox(e,c,a,h);v.push(d(`text-${r}`,e.text,o.x-u,o.y+o.height/2-f,`left`,`middle`,{size:l,weight:e.weight,color:S(e.color),halo:m,family:t},p))});let y=S(r.text,.85);return e.pointLabels.forEach(({label:e,box:n},r)=>{v.push(d(`point-label-${r}`,e.text,n.x-u,n.y+n.height/2-f,`left`,`middle`,{size:l,color:y,halo:m,family:t},p))}),v}var T=e=>({position:`absolute`,left:e.x,top:e.y,width:e.width,height:e.height,overflow:`hidden`});function E(t,n){let{plot:r}=t.layout;return(0,o.jsxs)(o.Fragment,{children:[C(t,n),(0,o.jsx)(a.View,{style:T(r),...e.part(c,`data`),children:x(t)},`data`),(0,o.jsx)(a.View,{style:T(r),...e.part(c,`labels`),children:w(t,n)},`labels`)]})}function D(t,n,r){let{theme:i,layout:s,hover:l,dragging:u}=t,{plot:d}=s,m=S(i.background),h=[];l&&l.crosshairY!==null&&h.push((0,o.jsx)(a.View,{style:a.StyleSheet.absoluteFill,...e.part(c,`crosshair`),children:g(`dash`,`y`,Math.round(l.crosshairY),d.x,d.width,1,S(i.textMuted,.55),[3,3])},`crosshair-y`)),l&&l.crosshairX!==null&&h.push((0,o.jsx)(a.View,{style:a.StyleSheet.absoluteFill,...e.part(c,`crosshair`),children:g(`dash`,`x`,Math.round(l.crosshairX),d.y,d.height,1,S(i.textMuted,.55),[3,3])},`crosshair`)),l?.marks.forEach((e,t)=>{if(e.kind===`band`){h.push(f(`mark-${t}`,e.x,e.y,e.width,e.height,S(i.text,.05),{borderRadius:6}));return}if(e.kind===`cell`){h.push(f(`mark-${t}`,e.x-1.5,e.y-1.5,e.width+3,e.height+3,`transparent`,{borderRadius:4,borderWidth:1.5,borderColor:S(i.text,.55)}));return}h.push(p(`halo-${t}`,e.x,e.y,e.size+8,e.halo),p(`mark-${t}`,e.x,e.y,e.size,e.color,{borderWidth:2,borderColor:m}))}),u&&h.push((0,o.jsx)(a.View,{...e.part(c,`drag`),style:a.StyleSheet.absoluteFill,children:p(`ghost`,u.x,u.y,u.size+2,u.color,{opacity:.85,borderWidth:2,borderColor:m})},`drag`));let _=l?.tooltip;if(_&&!r){let{box:r,lineHeight:s,padding:l,content:u}=_,d=S(i.text),f=S(i.textMuted),p=(e,t)=>({fontSize:12,lineHeight:s,color:t,fontWeight:String(e),includeFontPadding:!1,...n?{fontFamily:n}:null}),m=e=>(0,o.jsx)(a.View,{style:{width:8,height:8,borderRadius:4,marginRight:6,backgroundColor:e}}),g={height:s,flexDirection:`row`,alignItems:`center`};h.push((0,o.jsx)(a.View,{...e.part(c,`tooltip`),style:[O(t),{left:r.x,top:r.y,width:r.width,height:r.height,paddingHorizontal:l+1,paddingVertical:l-1}],children:_.text?_.text.map((e,t)=>(0,o.jsx)(a.Text,{numberOfLines:1,style:p(400,d),children:e},t)):[(0,o.jsxs)(a.View,{style:g,children:[u.titleColor?m(u.titleColor):null,(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(600,d),{flexShrink:1}],children:u.title})]},`title`),...u.rows.map((e,t)=>(0,o.jsxs)(a.View,{style:g,children:[e.color?m(e.color):null,(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(400,f),{flexShrink:1}],children:e.name}),(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(600,d),{flexGrow:1,marginLeft:16,textAlign:`right`}],children:e.value})]},t))]},`tooltip`))}return h}var O=e=>({position:`absolute`,backgroundColor:S(e.theme.background),borderColor:S(e.theme.axis),borderWidth:1,borderRadius:8,shadowColor:`#0f172a`,shadowOpacity:.18,shadowRadius:8,shadowOffset:{width:0,height:6},elevation:6});exports.SHAPE_BUDGET=s,exports.dashRuns=h,exports.drawHover=D,exports.drawStatic=E,exports.primitiveLimits=b,exports.tooltipCard=O;
1
+ const e=require("../../internal/parts.cjs"),t=require("../../charts/src/engine/color.cjs"),n=require("../../charts/src/engine/overlay.cjs"),r=require("../../charts/src/engine/controller.cjs");require("../../charts/src/canvas.cjs");const i=require("./measure.cjs");let a=require("react-native"),o=require("react/jsx-runtime");var s={linePoints:1200,dotsPerSeries:800,dots:2e3,barsPerSeries:600,bars:1500,areaColumns:200,dashes:200},c=`chart`,l=e=>Math.ceil(e*1.35),u=(e,t)=>Math.ceil(i.measureChartText(e,`${t.weight??400} ${t.size}px sans-serif`)*1.4+t.size*2);function d(e,t,n,r,i,s,c,d,f){let p=l(c.size),m=(p-c.size)/2,h=u(t,c),g=s===`top`?r-m:s===`bottom`?r-p+m:r-p/2,_=i===`left`?{left:n,width:h}:i===`right`?{right:d-n,width:h}:{left:n-h/2,width:h};return(0,o.jsx)(a.Text,{numberOfLines:1,style:[{position:`absolute`,top:g,..._,textAlign:i,fontSize:c.size,lineHeight:p,color:c.color,fontWeight:String(c.weight??400),includeFontPadding:!1,...c.family?{fontFamily:c.family}:null,...c.halo?{textShadowColor:c.halo,textShadowRadius:3,textShadowOffset:{width:0,height:0}}:null},f],children:t},e)}var f=(e,t,n,r,i,s,c)=>(0,o.jsx)(a.View,{style:[{position:`absolute`,left:t,top:n,width:r,height:i,backgroundColor:s},c]},e),p=(e,t,n,r,i,a)=>f(e,t-r/2,n-r/2,r,r,i,{borderRadius:r/2,...a}),m=(e,t,n,r,i,a,o)=>{let s=r-t,c=i-n,l=Math.hypot(s,c)+a;return f(e,(t+r)/2-l/2,(n+i)/2-a/2,l,a,o,{borderRadius:a/2,transform:[{rotate:`${Math.atan2(c,s)}rad`}]})};function h(e,t,n=s.dashes){let r=t.filter(e=>Number.isFinite(e)&&e>=0);r.length%2&&(r=[...r,...r]);let i=r.reduce((e,t)=>e+t,0);if(!r.length||i<=0)return[[0,e]];let a=e/i*(r.length/2),o=a>n?a/n:1,c=[],l=0;for(let t=0;l<e;t=(t+1)%r.length){let n=r[t]*o;t%2==0&&n>0&&c.push([l,Math.min(n,e-l)]),l+=Math.max(n,.5)}return c}var g=(e,t,n,r,i,a,o,s)=>h(i,s).map(([i,s],c)=>t===`y`?f(`${e}-${c}`,r+i,n,s,a,o):f(`${e}-${c}`,n,r+i,a,s,o)),_=(e,t=1)=>Math.round(e)+.5-t/2,v=(e,t,n,r)=>{let i=[],s=t.width,c=t.points;for(let a=1;a<c.length;a++){let o=c[a-1],l=c[a],u=Math.min(o.x,l.x)-n,d=Math.min(o.y,l.y)-r;i.push(o.y===l.y?f(`${e}-${a}`,u-s/2,d-s/2,Math.abs(l.x-o.x)+s,s,t.color):f(`${e}-${a}`,u-s/2,d-s/2,s,Math.abs(l.y-o.y)+s,t.color))}let[l,u,d]=t.head,p=Math.hypot(l.x-(u.x+d.x)/2,l.y-(u.y+d.y)/2),m=Math.hypot(d.x-u.x,d.y-u.y)/2,h=`transparent`,g={position:`absolute`,width:0,height:0},_=(u.x+d.x)/2,v=(u.y+d.y)/2;if(Math.abs(l.x-_)>=Math.abs(l.y-v)){let e=l.x>_;Object.assign(g,{left:(e?_:l.x)-n,top:l.y-m-r,borderTopWidth:m,borderBottomWidth:m,borderTopColor:h,borderBottomColor:h,...e?{borderLeftWidth:p,borderLeftColor:t.color}:{borderRightWidth:p,borderRightColor:t.color}})}else{let e=l.y>v;Object.assign(g,{left:l.x-m-n,top:(e?v:l.y)-r,borderLeftWidth:m,borderRightWidth:m,borderLeftColor:h,borderRightColor:h,...e?{borderTopWidth:p,borderTopColor:t.color}:{borderBottomWidth:p,borderBottomColor:t.color}})}return i.push((0,o.jsx)(a.View,{style:g},`${e}-head`)),i};function y(e,t){let n=e.length/2,r=n>t?Math.ceil(n/t):1,i=[];for(let t=0;t<n;t+=r){let n=e[t*2],r=e[t*2+1],a=i.length;a&&Math.hypot(n-i[a-2],r-i[a-1])<1.5||i.push(n,r)}let a=e[n*2-2],o=e[n*2-1],s=i.length;return n>1&&(i[s-2]!==a||i[s-1]!==o)&&i.push(a,o),i}function b(e,t,n,r,i,a,o,c=!1){let l=c?t.map((e,n)=>t[n%2?n-1:n+1]):t,u=c?{x:a.y,y:a.x,width:a.height,height:a.width}:a,d=l.length/2;if(d<2)return[];let p=l[0]<=l[d*2-2],m=e=>p?e:d-1-e,h=e=>l[m(e)*2],g=e=>l[m(e)*2+1],_=e=>o?o[m(e)]:n,v=Math.max(u.x,h(0)),y=Math.min(u.x+u.width,h(d-1));if(y<=v)return[];let b=Math.max(2,u.width/s.areaColumns),x=[],S=0;for(let t=Math.floor(v),n=0;t<y;n++){let a=Math.min(Math.ceil(y),Math.round(t+b)),o=(t+a)/2;for(;S<d-2&&h(S+1)<o;)S++;let s=h(S),l=h(S+1),p=l===s?0:Math.max(0,Math.min(1,(o-s)/(l-s))),m=g(S)+(g(S+1)-g(S))*p,v=_(S)+(_(S+1)-_(S))*p;if(Number.isFinite(m)&&Number.isFinite(v)){let o=Math.min(m,v),s=Math.abs(v-m);x.push(c?f(`${e}-${n}`,o-u.y,t-u.x,s,a-t,r,{opacity:i}):f(`${e}-${n}`,t-u.x,o-u.y,a-t,s,r,{opacity:i}))}t=a}return x}function x(e){let{plot:t}=e.layout,n=e.model.series.filter(e=>!e.hidden),r=n.filter(e=>e.type===`line`||e.type===`area`).length,i=n.filter(e=>e.type===`scatter`).length,a=Math.max(150,s.linePoints/Math.max(1,r)),o=Math.max(100,Math.min(s.dotsPerSeries,s.dots/Math.max(1,i)));return{perLine:a,options:{columnWidth:Math.max(3,t.width*4/a),maxDots:o,maxBars:s.barsPerSeries,dotCell:Math.max(4,Math.sqrt(t.width*t.height/o)*1.15+1)}}}function S(e){let{plot:t}=e.layout,{perLine:n,options:i}=x(e),a=r.scenePrimitives(e,i),o=t.x,c=t.y,l=[],u=s.dots,d=s.bars;return a.forEach((e,r)=>{let i=`${e.kind}${e.seriesIndex}-${r}`;if(e.kind===`area`){e.segments.forEach((n,r)=>l.push(...b(`${i}-${r}`,n,e.baseline,e.color,e.opacity,t,e.bottoms?.[r],e.horizontal)));return}if(e.kind===`line`){let t=0;for(let n of e.segments)t+=n.length/2;e.segments.forEach((r,a)=>{let s=y(r,Math.max(2,Math.round(n*r.length/2/Math.max(1,t))));if(s.length===2){l.push(p(`${i}-${a}`,s[0]-o,s[1]-c,e.width*1.5,e.color));return}for(let t=0;t+3<s.length;t+=2)l.push(m(`${i}-${a}-${t}`,s[t]-o,s[t+1]-c,s[t+2]-o,s[t+3]-c,e.width,e.color))});return}if(e.kind===`bars`){let t=e.rects.length/4,n=t>d?Math.ceil(t/Math.max(1,d)):1;for(let r=0;r<t;r+=n){let[t,n,a,s]=e.rects.slice(r*4,r*4+4),u=Math.min(e.radius??0,a/2,s/2);l.push(f(`${i}-${r}`,t-o,n-c,Math.max(a,.5),s,e.colors?.[r]??e.color,u>.5||e.opacity!==void 0?{...u>.5?{borderRadius:u}:null,...e.opacity===void 0?null:{opacity:e.opacity}}:void 0))}d=Math.max(0,d-Math.ceil(t/n));return}let a=e.dots.length/3,s=a>u?Math.ceil(a/Math.max(1,u)):1,h=e.stroke??0;for(let t=0;t<a;t+=s){let n=e.colors[t]??`#888`;l.push(p(`${i}-${t}`,e.dots[t*3]-o,e.dots[t*3+1]-c,e.dots[t*3+2],e.opacity>0?n:`transparent`,h>0&&e.opacity<1?{borderWidth:h,borderColor:n,opacity:1}:{opacity:e.opacity}))}u=Math.max(0,u-Math.ceil(a/s))}),l}var C=(e,n)=>t.toCss(e,n);function w(t,r){let{width:s,theme:l,model:u,layout:m,annotations:h}=t,{plot:g,scales:v,y2Ticks:y}=m,b=v.horizontal,x=b?u.y:u.x,S=b?u.x:u.y,w=b?m.yTicks:m.xTicks,T=b?m.xTicks:m.yTicks,E=b?v.yToPx:v.xToPx,D=b?v.xToPx:v.yToPx,O=l.fontSize,k=[];h.forEach((e,t)=>{if(e.type!==`rect`)return;let r=n.rectOf(e,v);r.width<=0||r.height<=0||k.push(f(`area-${t}`,r.x,r.y,r.width,r.height,C(e.color,e.opacity)))});let A=C(l.grid);S.grid&&T.values.forEach((e,t)=>{let n=D(e);n<g.y-1||n>g.y+g.height+1||k.push(f(`ygrid-${t}`,g.x,_(n),g.width,1,A))}),x.grid&&w.values.forEach((e,t)=>{let n=E(e);n<g.x-1||n>g.x+g.width+1||k.push(f(`xgrid-${t}`,_(n),g.y,1,g.height,A))});let j=Math.ceil(O*1.4),M={size:O,color:C(l.textMuted),family:r},N={size:O+1,weight:500,color:C(l.text,.8),family:r},P=g.y+g.height;if(x.visible){k.push(f(`xaxis`,g.x,_(P),g.width,1,C(l.axis)));let e=-1/0;w.values.map((e,t)=>({px:E(e),text:w.labels[t]??``})).sort((e,t)=>e.px-t.px).forEach(({px:t,text:n},r)=>{if(!n||t<g.x-.5||t>g.x+g.width+.5)return;let a=i.measureChartText(n,`400 ${O}px sans-serif`),o=Math.max(0,Math.min(s-a,t-a/2));o<e+6||(e=o+a,k.push(d(`xtick-${r}`,n,o+a/2,P+7,`center`,`top`,M,s)))}),x.title&&k.push(d(`xtitle`,x.title,g.x+g.width/2,P+j+10,`center`,`top`,N,s))}if(S.visible){let e=-1/0;T.values.map((e,t)=>({py:D(e),text:T.labels[t]??``})).sort((e,t)=>e.py-t.py).forEach(({py:t,text:n},r)=>{if(!(!n||t<g.y-.5||t>g.y+g.height+.5)){if(b){if(t-(O+2)/2<e)return;e=t+(O+2)/2}k.push(d(`ytick-${r}`,n,g.x-8,t,`right`,`middle`,M,s))}}),S.title&&k.push(d(`ytitle`,S.title,j/2+4,g.y+g.height/2,`center`,`middle`,N,s,{transform:[{rotate:`-90deg`}]}))}let F=b?null:u.y2;if(F&&y&&F.visible){let e=g.x+g.width;y.values.forEach((t,n)=>{let r=v.yToPx(t),i=y.labels[n];!i||r<g.y-.5||r>g.y+g.height+.5||k.push(d(`y2tick-${n}`,i,e+8,r,`left`,`middle`,M,s))}),F.title&&k.push(d(`y2title`,F.title,s-j/2-4,g.y+g.height/2,`center`,`middle`,N,s,{transform:[{rotate:`90deg`}]}))}let I=t.legend?.colors;if(I){let{bar:t,stops:n}=I,i=t.width/Math.max(1,n.length);k.push((0,o.jsx)(a.View,{...e.part(c,`color-legend`),style:{position:`absolute`,left:t.x,top:t.y,width:t.width,height:t.height,borderRadius:t.height/2,overflow:`hidden`,flexDirection:`row`},children:n.map((e,n)=>(0,o.jsx)(a.View,{style:{width:i,height:t.height,backgroundColor:e}},n))},`color-legend`)),I.ticks.forEach((e,n)=>k.push(f(`color-tick-${n}`,Math.round(e),t.y-2,1,t.height+4,C(l.text,.35)))),I.labels.forEach((e,t)=>k.push(d(`color-label-${t}`,e.text,e.x,e.y,e.align,`middle`,{size:11,color:C(l.textMuted),family:r},s)))}if(t.legend)for(let n of t.legend.entries){let t=n.box.height/2,i=n.shape===`dot`?p(`swatch`,5,t,8,n.color):n.shape===`line`?f(`swatch`,0,t-1,10,2,n.color):f(`swatch`,1,t-4,8,8,n.color);k.push((0,o.jsxs)(a.View,{style:{position:`absolute`,left:n.box.x,top:n.box.y,width:n.box.width,height:n.box.height,opacity:n.hidden?.45:1},...e.part(c,`legend-item`,{hidden:n.hidden}),children:[i,d(`name`,n.name,14,t,`left`,`middle`,{size:12,color:C(l.textMuted),family:r},n.box.width,n.hidden?{textDecorationLine:`line-through`}:void 0)]},`legend-${n.id}`))}return k}function T(e,t){let{theme:r,annotations:a,layout:o}=e,{plot:s,scales:c}=o,l=r.fontSize,u=s.x,f=s.y,p=s.width,m=C(r.background,.9),h=l+4,y=[];e.connectors.forEach((e,t)=>{let n=e.y0===e.y1;y.push(...n?g(`connector-${t}`,`y`,_(e.y0,e.width)-f,Math.min(e.x0,e.x1)-u,Math.abs(e.x1-e.x0),e.width,e.color,e.dash):g(`connector-${t}`,`x`,_(e.x0,e.width)-u,Math.min(e.y0,e.y1)-f,Math.abs(e.y1-e.y0),e.width,e.color,e.dash))}),e.arrows.forEach((e,t)=>{y.push(...v(`arrow-${t}`,e,u,f))}),a.forEach((e,r)=>{if(e.type!==`line`)return;let i=C(e.color),a=n.lineOf(e,c);if(a.vertical){let n=a.at;y.push(...g(`line-${r}`,`x`,_(n,e.width)-u,0,s.height,e.width,i,e.dash)),e.label&&y.push(d(`line-label-${r}`,e.label,n+5-u,5,`left`,`top`,{size:l,weight:500,color:i,halo:m,family:t},p))}else{let n=a.at;y.push(...g(`line-${r}`,`y`,_(n,e.width)-f,0,s.width,e.width,i,e.dash)),e.label&&y.push(d(`line-label-${r}`,e.label,s.width-6,n-3-f,`right`,`bottom`,{size:l,weight:500,color:i,halo:m,family:t},p))}}),a.forEach((e,r)=>{if(e.type!==`rect`||!e.label)return;let i=n.rectOf(e,c);if(i.width<=0||i.height<=0)return;let a=e.labelPosition,o=a.endsWith(`left`)?`left`:a.endsWith(`right`)?`right`:`center`,s=o===`left`?i.x+10:o===`right`?i.x+i.width-10:i.x+i.width/2,m=a.startsWith(`top`)?i.y+10:a.startsWith(`bottom`)?i.y+i.height-10-h:i.y+(i.height-h)/2;y.push(d(`area-label-${r}`,e.label,s-u,m-f,o,`top`,{size:l+1,weight:600,color:C(e.labelColor),family:t},p))}),a.forEach((e,r)=>{if(e.type!==`text`||!e.text)return;let a=i.measureChartText(e.text,`${e.weight} ${l}px sans-serif`),o=n.textBox(e,c,a,h);y.push(d(`text-${r}`,e.text,o.x-u,o.y+o.height/2-f,`left`,`middle`,{size:l,weight:e.weight,color:C(e.color),halo:m,family:t},p))});let b=C(r.text,.85);return e.pointLabels.forEach(({label:e,box:n},r)=>{y.push(d(`point-label-${r}`,e.text,n.x-u,n.y+n.height/2-f,`left`,`middle`,{size:l,color:b,halo:m,family:t},p))}),y}var E=e=>({position:`absolute`,left:e.x,top:e.y,width:e.width,height:e.height,overflow:`hidden`});function D(t,n){let{plot:r}=t.layout;return(0,o.jsxs)(o.Fragment,{children:[w(t,n),(0,o.jsx)(a.View,{style:E(r),...e.part(c,`data`),children:S(t)},`data`),(0,o.jsx)(a.View,{style:E(r),...e.part(c,`labels`),children:T(t,n)},`labels`)]})}function O(t,n,r){let{theme:i,layout:s,hover:l,dragging:u}=t,{plot:d}=s,m=C(i.background),h=[];l&&l.crosshairY!==null&&h.push((0,o.jsx)(a.View,{style:a.StyleSheet.absoluteFill,...e.part(c,`crosshair`),children:g(`dash`,`y`,Math.round(l.crosshairY),d.x,d.width,1,C(i.textMuted,.55),[3,3])},`crosshair-y`)),l&&l.crosshairX!==null&&h.push((0,o.jsx)(a.View,{style:a.StyleSheet.absoluteFill,...e.part(c,`crosshair`),children:g(`dash`,`x`,Math.round(l.crosshairX),d.y,d.height,1,C(i.textMuted,.55),[3,3])},`crosshair`)),l?.marks.forEach((e,t)=>{if(e.kind===`band`){h.push(f(`mark-${t}`,e.x,e.y,e.width,e.height,C(i.text,.05),{borderRadius:6}));return}if(e.kind===`guide`){h.push(f(`mark-${t}`,e.x,e.y,e.width,e.height,C(i.text,.06)));return}if(e.kind===`cell`){let n=Math.min(3,e.width*.06,e.height*.06),r=Math.min(2,e.width/5,e.height/5);h.push(f(`mark-${t}`,e.x-n,e.y-n,e.width+n*2,e.height+n*2,e.color,{borderRadius:Math.max(2,e.radius),shadowColor:`#0f172a`,shadowOpacity:.45,shadowRadius:6,shadowOffset:{width:0,height:3},elevation:4})),e.width>8&&e.height>8&&h.push(f(`ring-${t}`,e.x-n+r,e.y-n+r,e.width+(n-r)*2,e.height+(n-r)*2,`transparent`,{borderRadius:Math.max(1,e.radius-r/2),borderWidth:1.5,borderColor:e.ring}));return}h.push(p(`halo-${t}`,e.x,e.y,e.size+8,e.halo),p(`mark-${t}`,e.x,e.y,e.size,e.color,{borderWidth:2,borderColor:m}))}),u&&h.push((0,o.jsx)(a.View,{...e.part(c,`drag`),style:a.StyleSheet.absoluteFill,children:p(`ghost`,u.x,u.y,u.size+2,u.color,{opacity:.85,borderWidth:2,borderColor:m})},`drag`));let _=l?.tooltip;if(_&&!r){let{box:r,lineHeight:s,padding:l,content:u}=_,d=C(i.text),f=C(i.textMuted),p=(e,t)=>({fontSize:12,lineHeight:s,color:t,fontWeight:String(e),includeFontPadding:!1,...n?{fontFamily:n}:null}),m=e=>(0,o.jsx)(a.View,{style:{width:8,height:8,borderRadius:4,marginRight:6,backgroundColor:e}}),g={height:s,flexDirection:`row`,alignItems:`center`};h.push((0,o.jsx)(a.View,{...e.part(c,`tooltip`),style:[k(t),{left:r.x,top:r.y,width:r.width,height:r.height,paddingHorizontal:l+1,paddingVertical:l-1}],children:_.text?_.text.map((e,t)=>(0,o.jsx)(a.Text,{numberOfLines:1,style:p(400,d),children:e},t)):[(0,o.jsxs)(a.View,{style:g,children:[u.titleColor?m(u.titleColor):null,(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(600,d),{flexShrink:1}],children:u.title})]},`title`),...u.subtitle?[(0,o.jsx)(a.View,{style:g,children:(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(400,f),{fontSize:11,paddingLeft:u.titleColor?14:0}],children:u.subtitle})},`subtitle`)]:[],...u.rows.map((e,t)=>(0,o.jsxs)(a.View,{style:g,children:[_.swatchWidth>0?(0,o.jsx)(a.View,{style:{width:_.swatchWidth},children:e.color?m(e.color):null}):null,(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(400,f),{flexShrink:1}],children:e.name}),(0,o.jsx)(a.Text,{numberOfLines:1,style:[p(600,d),{flexGrow:1,marginLeft:16,textAlign:`right`,fontVariant:[`tabular-nums`]}],children:e.value})]},t))]},`tooltip`))}return h}var k=e=>({position:`absolute`,backgroundColor:C(e.theme.background),borderColor:C(e.theme.axis),borderWidth:1,borderRadius:8,shadowColor:`#0f172a`,shadowOpacity:.18,shadowRadius:8,shadowOffset:{width:0,height:6},elevation:6});exports.SHAPE_BUDGET=s,exports.arrowViews=v,exports.dashRuns=h,exports.drawHover=O,exports.drawStatic=D,exports.primitiveLimits=x,exports.tooltipCard=k;
2
2
  //# sourceMappingURL=scene.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scene.cjs","names":["measureChartText","Text","View","scenePrimitives","toCss","annotationRect","part","annotationLine","annotationTextBox","_Fragment","StyleSheet","require_parts","require_color","require_overlay","require_controller","require_measure","react_native","react_jsx_runtime","SHAPE_BUDGET","C","lineHeightOf","size","slack","text","o","label","lh","pad","w","top","valign","y","horizontal","align","x","frameWidth","extra","key","box","color","dot","cx","d","cy","segment","dx","x2","x1","dy","y2","y1","length","width","dashRuns","pattern","dash","v","period","a","b","runs","scale","max","out","at","i","step","dashedLine","start","run","axis","from","crisp","thin","stride","k","lx","ly","areaStrips","transposed","points","plot","frame","n","forward","xs","ys","bs","bottom","baseline","to","column","j","left","c","right","mid","x0","t","h","primitiveLimits","scene","visible","s","lines","scatters","perLine","maxDots","drawData","primitives","options","ox","oy","dotsLeft","barsLeft","p","total","pts","r","count","radius","css","alpha","drawBackground","layout","scales","bottomAxis","model","leftAxis","bottomTicks","leftTicks","bottomPx","leftPx","fs","theme","annotations","grid","py","px","line","tick","title","lastRight","lastBottom","y2Ticks","e","swatch","drawForeground","fw","halo","labelHeight","where","pos","tx","ty","pointColor","l","clip","drawStatic","family","drawHover","background","hover","m","dragging","tip","customTooltip","muted","font","weight","row","lineHeight","tooltipCard","padding","content"],"sources":["../../../../../native/src/components/Chart/scene.tsx"],"sourcesContent":["// Draws a chart scene (`ChartController.getScene()`) with plain views: no\n// canvas, SVG or native drawing module. The engine already resolves every\n// position in pixels; this file only turns them into absolutely positioned\n// <View> / <Text> elements, keeping the number of views bounded by the size\n// of the chart (lines decimated per column, dots merged per cell, bars\n// merged per pixel column), whatever the size of the data.\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport {\n StyleSheet,\n Text,\n View,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport {\n annotationLine,\n annotationRect,\n annotationTextBox,\n scenePrimitives,\n toCss,\n type ChartPrimitive,\n type ChartRect,\n type ChartScene,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { measureChartText } from \"./measure\";\n\ntype Rgba = ChartScene[\"theme\"][\"text\"];\n\n/** Upper bounds of the views drawn for the data of a chart */\nexport const SHAPE_BUDGET = {\n /** Points of all the lines (one view per segment) */\n linePoints: 1200,\n /** Dots of one scatter series before they are merged per cell */\n dotsPerSeries: 800,\n /** Dots of all the series */\n dots: 2000,\n /** Bars of one series before neighbors are merged per pixel column */\n barsPerSeries: 600,\n /** Bars of all the series */\n bars: 1500,\n /** Vertical strips filling one area */\n areaColumns: 200,\n /** Dashes of one dashed line */\n dashes: 200,\n} as const;\n\nconst C = \"chart\";\n\n// ------------------------------------------------------------------ text\n\ninterface TextOptions {\n size: number;\n color: string;\n weight?: number;\n family?: string;\n /** Halo color: keeps the text readable over the data */\n halo?: string;\n}\n\ntype Align = \"left\" | \"center\" | \"right\";\ntype VAlign = \"top\" | \"middle\" | \"bottom\";\n\nconst lineHeightOf = (size: number) => Math.ceil(size * 1.35);\n\n/** Box wide enough for the estimated width (the real one may differ) */\nconst slack = (text: string, o: TextOptions) =>\n Math.ceil(\n measureChartText(text, `${o.weight ?? 400} ${o.size}px sans-serif`) * 1.4 +\n o.size * 2,\n );\n\n/**\n * A one-line text anchored at (x, y) of a container `frameWidth` wide:\n * `left` starts there, `right` ends there, `center` is centered on it;\n * `top` / `bottom` place the em box like the canvas text baselines\n */\nfunction label(\n key: string,\n text: string,\n x: number,\n y: number,\n align: Align,\n valign: VAlign,\n o: TextOptions,\n frameWidth: number,\n extra?: TextStyle,\n): ReactElement {\n const lh = lineHeightOf(o.size);\n const pad = (lh - o.size) / 2;\n const w = slack(text, o);\n const top =\n valign === \"top\"\n ? y - pad\n : valign === \"bottom\"\n ? y - lh + pad\n : y - lh / 2;\n const horizontal: TextStyle =\n align === \"left\"\n ? { left: x, width: w }\n : align === \"right\"\n ? { right: frameWidth - x, width: w }\n : { left: x - w / 2, width: w };\n return (\n <Text\n key={key}\n numberOfLines={1}\n style={[\n {\n position: \"absolute\",\n top,\n ...horizontal,\n textAlign: align,\n fontSize: o.size,\n lineHeight: lh,\n color: o.color,\n fontWeight: String(o.weight ?? 400) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(o.family ? { fontFamily: o.family } : null),\n ...(o.halo\n ? {\n textShadowColor: o.halo,\n textShadowRadius: 3,\n textShadowOffset: { width: 0, height: 0 },\n }\n : null),\n },\n extra,\n ]}\n >\n {text}\n </Text>\n );\n}\n\n// ---------------------------------------------------------------- shapes\n\nconst box = (\n key: string,\n x: number,\n y: number,\n width: number,\n height: number,\n color: string,\n extra?: ViewStyle,\n): ReactElement => (\n <View\n key={key}\n style={[\n {\n position: \"absolute\",\n left: x,\n top: y,\n width,\n height,\n backgroundColor: color,\n },\n extra,\n ]}\n />\n);\n\nconst dot = (\n key: string,\n cx: number,\n cy: number,\n d: number,\n color: string,\n extra?: ViewStyle,\n) =>\n box(key, cx - d / 2, cy - d / 2, d, d, color, {\n borderRadius: d / 2,\n ...extra,\n });\n\n/** A straight stroke: one view, rotated around its center */\nconst segment = (\n key: string,\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n width: number,\n color: string,\n) => {\n const dx = x2 - x1;\n const dy = y2 - y1;\n const length = Math.hypot(dx, dy) + width;\n return box(\n key,\n (x1 + x2) / 2 - length / 2,\n (y1 + y2) / 2 - width / 2,\n length,\n width,\n color,\n {\n borderRadius: width / 2,\n transform: [{ rotate: `${Math.atan2(dy, dx)}rad` }],\n },\n );\n};\n\n/** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */\nexport function dashRuns(\n length: number,\n dash: readonly number[],\n max: number = SHAPE_BUDGET.dashes,\n): [number, number][] {\n let pattern = dash.filter((v) => Number.isFinite(v) && v >= 0);\n // odd patterns repeat twice, like the canvas\n if (pattern.length % 2) pattern = [...pattern, ...pattern];\n const period = pattern.reduce((a, b) => a + b, 0);\n if (!pattern.length || period <= 0) return [[0, length]];\n const runs = (length / period) * (pattern.length / 2);\n const scale = runs > max ? runs / max : 1;\n const out: [number, number][] = [];\n let at = 0;\n for (let i = 0; at < length; i = (i + 1) % pattern.length) {\n const step = pattern[i] * scale;\n if (i % 2 === 0 && step > 0) out.push([at, Math.min(step, length - at)]);\n at += Math.max(step, 0.5);\n }\n return out;\n}\n\nconst dashedLine = (\n key: string,\n axis: \"x\" | \"y\",\n at: number,\n from: number,\n length: number,\n width: number,\n color: string,\n dash: readonly number[],\n) =>\n dashRuns(length, dash).map(([start, run], i) =>\n axis === \"y\"\n ? box(`${key}-${i}`, from + start, at, run, width, color)\n : box(`${key}-${i}`, at, from + start, width, run, color),\n );\n\nconst crisp = (v: number, width = 1) => Math.round(v) + 0.5 - width / 2;\n\n// ------------------------------------------------------------------ data\n\n/** Thins a run of interleaved points to `max` points and drops sub-pixel steps */\nfunction thin(run: readonly number[], max: number): number[] {\n const n = run.length / 2;\n const stride = n > max ? Math.ceil(n / max) : 1;\n const out: number[] = [];\n for (let i = 0; i < n; i += stride) {\n const x = run[i * 2];\n const y = run[i * 2 + 1];\n const k = out.length;\n if (k && Math.hypot(x - out[k - 2], y - out[k - 1]) < 1.5) continue;\n out.push(x, y);\n }\n const lx = run[n * 2 - 2];\n const ly = run[n * 2 - 1];\n const k = out.length;\n if (n > 1 && (out[k - 2] !== lx || out[k - 1] !== ly)) out.push(lx, ly);\n return out;\n}\n\n/**\n * Vertical strips between the line and the baseline (or the stack below),\n * one per column; horizontal strips, one per row, for horizontal charts\n */\nfunction areaStrips(\n key: string,\n points: readonly number[],\n baseline: number,\n color: string,\n opacity: number,\n frame: ChartRect,\n /** Y pixel (x pixel when `transposed`) of the bottom edge under every point */\n bottom?: readonly number[],\n /** Horizontal charts: the area grows from the left edge */\n transposed = false,\n): ReactElement[] {\n // horizontal charts are filled like vertical ones with x and y swapped\n const run = transposed\n ? points.map((_, i) => points[i % 2 ? i - 1 : i + 1])\n : points;\n const plot = transposed\n ? { x: frame.y, y: frame.x, width: frame.height, height: frame.width }\n : frame;\n const n = run.length / 2;\n if (n < 2) return [];\n // left to right (reversed axes list their points right to left)\n const forward = run[0] <= run[n * 2 - 2];\n const at = (i: number) => (forward ? i : n - 1 - i);\n const xs = (i: number) => run[at(i) * 2];\n const ys = (i: number) => run[at(i) * 2 + 1];\n const bs = (i: number) => (bottom ? bottom[at(i)] : baseline);\n const from = Math.max(plot.x, xs(0));\n const to = Math.min(plot.x + plot.width, xs(n - 1));\n if (to <= from) return [];\n const column = Math.max(2, plot.width / SHAPE_BUDGET.areaColumns);\n const out: ReactElement[] = [];\n let j = 0;\n for (let left = Math.floor(from), c = 0; left < to; c++) {\n const right = Math.min(Math.ceil(to), Math.round(left + column));\n const mid = (left + right) / 2;\n while (j < n - 2 && xs(j + 1) < mid) j++;\n const x0 = xs(j);\n const x1 = xs(j + 1);\n const t = x1 === x0 ? 0 : Math.max(0, Math.min(1, (mid - x0) / (x1 - x0)));\n const y = ys(j) + (ys(j + 1) - ys(j)) * t;\n const b = bs(j) + (bs(j + 1) - bs(j)) * t;\n if (Number.isFinite(y) && Number.isFinite(b)) {\n const top = Math.min(y, b);\n const h = Math.abs(b - y);\n out.push(\n transposed\n ? box(\n `${key}-${c}`,\n top - plot.y,\n left - plot.x,\n h,\n right - left,\n color,\n {\n opacity,\n },\n )\n : box(\n `${key}-${c}`,\n left - plot.x,\n top - plot.y,\n right - left,\n h,\n color,\n {\n opacity,\n },\n ),\n );\n }\n left = right;\n }\n return out;\n}\n\n/** Limits of `scenePrimitives` for the views budget */\nexport function primitiveLimits(scene: ChartScene) {\n const { plot } = scene.layout;\n const visible = scene.model.series.filter((s) => !s.hidden);\n const lines = visible.filter(\n (s) => s.type === \"line\" || s.type === \"area\",\n ).length;\n const scatters = visible.filter((s) => s.type === \"scatter\").length;\n const perLine = Math.max(150, SHAPE_BUDGET.linePoints / Math.max(1, lines));\n const maxDots = Math.max(\n 100,\n Math.min(\n SHAPE_BUDGET.dotsPerSeries,\n SHAPE_BUDGET.dots / Math.max(1, scatters),\n ),\n );\n return {\n perLine,\n options: {\n // decimation keeps up to 4 points per column\n columnWidth: Math.max(3, (plot.width * 4) / perLine),\n maxDots,\n maxBars: SHAPE_BUDGET.barsPerSeries,\n dotCell: Math.max(\n 4,\n Math.sqrt((plot.width * plot.height) / maxDots) * 1.15 + 1,\n ),\n },\n };\n}\n\nfunction drawData(scene: ChartScene): ReactElement[] {\n const { plot } = scene.layout;\n const { perLine, options } = primitiveLimits(scene);\n const primitives: ChartPrimitive[] = scenePrimitives(scene, options);\n const ox = plot.x;\n const oy = plot.y;\n const out: ReactElement[] = [];\n let dotsLeft: number = SHAPE_BUDGET.dots;\n let barsLeft: number = SHAPE_BUDGET.bars;\n primitives.forEach((p, k) => {\n const key = `${p.kind}${p.seriesIndex}-${k}`;\n if (p.kind === \"area\") {\n p.segments.forEach((run, r) =>\n out.push(\n ...areaStrips(\n `${key}-${r}`,\n run,\n p.baseline,\n p.color,\n p.opacity,\n plot,\n p.bottoms?.[r],\n p.horizontal,\n ),\n ),\n );\n return;\n }\n if (p.kind === \"line\") {\n let total = 0;\n for (const run of p.segments) total += run.length / 2;\n p.segments.forEach((run, r) => {\n const pts = thin(\n run,\n Math.max(\n 2,\n Math.round((perLine * run.length) / 2 / Math.max(1, total)),\n ),\n );\n if (pts.length === 2) {\n out.push(\n dot(\n `${key}-${r}`,\n pts[0] - ox,\n pts[1] - oy,\n p.width * 1.5,\n p.color,\n ),\n );\n return;\n }\n for (let i = 0; i + 3 < pts.length; i += 2) {\n out.push(\n segment(\n `${key}-${r}-${i}`,\n pts[i] - ox,\n pts[i + 1] - oy,\n pts[i + 2] - ox,\n pts[i + 3] - oy,\n p.width,\n p.color,\n ),\n );\n }\n });\n return;\n }\n if (p.kind === \"bars\") {\n const count = p.rects.length / 4;\n const stride =\n count > barsLeft ? Math.ceil(count / Math.max(1, barsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n const [x, y, w, h] = p.rects.slice(i * 4, i * 4 + 4);\n const radius = Math.min(p.radius ?? 0, w / 2, h / 2);\n out.push(\n box(\n `${key}-${i}`,\n x - ox,\n y - oy,\n Math.max(w, 0.5),\n h,\n p.colors?.[i] ?? p.color,\n radius > 0.5 || p.opacity !== undefined\n ? {\n ...(radius > 0.5 ? { borderRadius: radius } : null),\n ...(p.opacity !== undefined ? { opacity: p.opacity } : null),\n }\n : undefined,\n ),\n );\n }\n barsLeft = Math.max(0, barsLeft - Math.ceil(count / stride));\n return;\n }\n const count = p.dots.length / 3;\n const stride =\n count > dotsLeft ? Math.ceil(count / Math.max(1, dotsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n out.push(\n dot(\n `${key}-${i}`,\n p.dots[i * 3] - ox,\n p.dots[i * 3 + 1] - oy,\n p.dots[i * 3 + 2],\n p.colors[i],\n {\n opacity: p.opacity,\n },\n ),\n );\n }\n dotsLeft = Math.max(0, dotsLeft - Math.ceil(count / stride));\n });\n return out;\n}\n\n// ------------------------------------------------------------ background\n\nconst css = (c: Rgba, alpha?: number) => toCss(c, alpha);\n\nfunction drawBackground(scene: ChartScene, family?: string): ReactElement[] {\n const { width, theme, model, layout, annotations } = scene;\n const { plot, scales, y2Ticks } = layout;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const horizontal = scales.horizontal;\n const bottomAxis = horizontal ? model.y : model.x;\n const leftAxis = horizontal ? model.x : model.y;\n const bottomTicks = horizontal ? layout.yTicks : layout.xTicks;\n const leftTicks = horizontal ? layout.xTicks : layout.yTicks;\n const bottomPx = horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = horizontal ? scales.xToPx : scales.yToPx;\n const fs = theme.fontSize;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\") return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n out.push(\n box(`area-${i}`, r.x, r.y, r.width, r.height, css(a.color, a.opacity)),\n );\n });\n\n const grid = css(theme.grid);\n if (leftAxis.grid) {\n leftTicks.values.forEach((v, i) => {\n const py = leftPx(v);\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) return;\n out.push(box(`ygrid-${i}`, plot.x, crisp(py), plot.width, 1, grid));\n });\n }\n if (bottomAxis.grid) {\n bottomTicks.values.forEach((v, i) => {\n const px = bottomPx(v);\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) return;\n out.push(box(`xgrid-${i}`, crisp(px), plot.y, 1, plot.height, grid));\n });\n }\n\n const line = Math.ceil(fs * 1.4);\n const tick: TextOptions = { size: fs, color: css(theme.textMuted), family };\n const title: TextOptions = {\n size: fs + 1,\n weight: 500,\n color: css(theme.text, 0.8),\n family,\n };\n const bottom = plot.y + plot.height;\n\n if (bottomAxis.visible) {\n out.push(\n box(\"xaxis\", plot.x, crisp(bottom), plot.width, 1, css(theme.axis)),\n );\n let lastRight = -Infinity;\n bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.px - b.px)\n .forEach(({ px, text }, i) => {\n if (!text || px < plot.x - 0.5 || px > plot.x + plot.width + 0.5)\n return;\n const w = measureChartText(text, `400 ${fs}px sans-serif`);\n const left = Math.max(0, Math.min(width - w, px - w / 2));\n if (left < lastRight + 6) return;\n lastRight = left + w;\n out.push(\n label(\n `xtick-${i}`,\n text,\n left + w / 2,\n bottom + 7,\n \"center\",\n \"top\",\n tick,\n width,\n ),\n );\n });\n if (bottomAxis.title)\n out.push(\n label(\n \"xtitle\",\n bottomAxis.title,\n plot.x + plot.width / 2,\n bottom + line + 10,\n \"center\",\n \"top\",\n title,\n width,\n ),\n );\n }\n\n if (leftAxis.visible) {\n let lastBottom = -Infinity;\n leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.py - b.py)\n .forEach(({ py, text }, i) => {\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5)\n return;\n // category rows of horizontal charts never overlap\n if (horizontal) {\n if (py - (fs + 2) / 2 < lastBottom) return;\n lastBottom = py + (fs + 2) / 2;\n }\n out.push(\n label(\n `ytick-${i}`,\n text,\n plot.x - 8,\n py,\n \"right\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (leftAxis.title)\n out.push(\n label(\n \"ytitle\",\n leftAxis.title,\n line / 2 + 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"-90deg\" }],\n },\n ),\n );\n }\n\n const y2 = horizontal ? null : model.y2;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n const text = y2Ticks.labels[i];\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n out.push(\n label(\n `y2tick-${i}`,\n text,\n right + 8,\n py,\n \"left\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (y2.title)\n out.push(\n label(\n \"y2title\",\n y2.title,\n width - line / 2 - 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"90deg\" }],\n },\n ),\n );\n }\n\n if (scene.legend) {\n for (const e of scene.legend.entries) {\n // coordinates relative to the entry box\n const cy = e.box.height / 2;\n const swatch =\n e.shape === \"dot\"\n ? dot(\"swatch\", 5, cy, 8, e.color)\n : e.shape === \"line\"\n ? box(\"swatch\", 0, cy - 1, 10, 2, e.color)\n : box(\"swatch\", 1, cy - 4, 8, 8, e.color);\n out.push(\n <View\n key={`legend-${e.id}`}\n style={{\n position: \"absolute\",\n left: e.box.x,\n top: e.box.y,\n width: e.box.width,\n height: e.box.height,\n opacity: e.hidden ? 0.45 : 1,\n }}\n {...part(C, \"legend-item\", { hidden: e.hidden })}\n >\n {swatch}\n {label(\n \"name\",\n e.name,\n 14,\n cy,\n \"left\",\n \"middle\",\n { size: 12, color: css(theme.textMuted), family },\n e.box.width,\n e.hidden ? { textDecorationLine: \"line-through\" } : undefined,\n )}\n </View>,\n );\n }\n }\n return out;\n}\n\n// ------------------------------------------------------------ foreground\n\nfunction drawForeground(scene: ChartScene, family?: string): ReactElement[] {\n const { theme, annotations, layout } = scene;\n const { plot, scales } = layout;\n const fs = theme.fontSize;\n const ox = plot.x;\n const oy = plot.y;\n const fw = plot.width;\n const halo = css(theme.background, 0.9);\n const labelHeight = fs + 4;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"line\") return;\n const color = css(a.color);\n const where = annotationLine(a, scales);\n if (!where.vertical) {\n const py = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"y\",\n crisp(py, a.width) - oy,\n 0,\n plot.width,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n plot.width - 6,\n py - 3 - oy,\n \"right\",\n \"bottom\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n } else {\n const px = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"x\",\n crisp(px, a.width) - ox,\n 0,\n plot.height,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n px + 5 - ox,\n 5,\n \"left\",\n \"top\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n }\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\" || !a.label) return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n const pad = 10;\n const pos = a.labelPosition;\n const align: Align = pos.endsWith(\"left\")\n ? \"left\"\n : pos.endsWith(\"right\")\n ? \"right\"\n : \"center\";\n const tx =\n align === \"left\"\n ? r.x + pad\n : align === \"right\"\n ? r.x + r.width - pad\n : r.x + r.width / 2;\n const ty = pos.startsWith(\"top\")\n ? r.y + pad\n : pos.startsWith(\"bottom\")\n ? r.y + r.height - pad - labelHeight\n : r.y + (r.height - labelHeight) / 2;\n out.push(\n label(\n `area-label-${i}`,\n a.label,\n tx - ox,\n ty - oy,\n align,\n \"top\",\n { size: fs + 1, weight: 600, color: css(a.labelColor), family },\n fw,\n ),\n );\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"text\" || !a.text) return;\n const w = measureChartText(a.text, `${a.weight} ${fs}px sans-serif`);\n const b = annotationTextBox(a, scales, w, labelHeight);\n out.push(\n label(\n `text-${i}`,\n a.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, weight: a.weight, color: css(a.color), halo, family },\n fw,\n ),\n );\n });\n\n const pointColor = css(theme.text, 0.85);\n scene.pointLabels.forEach(({ label: l, box: b }, i) => {\n out.push(\n label(\n `point-label-${i}`,\n l.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, color: pointColor, halo, family },\n fw,\n ),\n );\n });\n return out;\n}\n\nconst clip = (plot: ChartRect): ViewStyle => ({\n position: \"absolute\",\n left: plot.x,\n top: plot.y,\n width: plot.width,\n height: plot.height,\n overflow: \"hidden\",\n});\n\n/**\n * Everything but the hover state: axes, grid, legend, annotations, data and\n * labels (cached by the caller while the model, view and size are the same)\n */\nexport function drawStatic(scene: ChartScene, family?: string): ReactNode {\n const { plot } = scene.layout;\n return (\n <>\n {drawBackground(scene, family)}\n <View key=\"data\" style={clip(plot)} {...part(C, \"data\")}>\n {drawData(scene)}\n </View>\n <View key=\"labels\" style={clip(plot)} {...part(C, \"labels\")}>\n {drawForeground(scene, family)}\n </View>\n </>\n );\n}\n\n/** Crosshair, highlighted points, dragged point and the default tooltip */\nexport function drawHover(\n scene: ChartScene,\n family: string | undefined,\n customTooltip: boolean,\n): ReactNode {\n const { theme, layout, hover, dragging } = scene;\n const { plot } = layout;\n const background = css(theme.background);\n const out: ReactElement[] = [];\n if (hover && hover.crosshairY !== null) {\n out.push(\n <View\n key=\"crosshair-y\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"y\",\n Math.round(hover.crosshairY),\n plot.x,\n plot.width,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n if (hover && hover.crosshairX !== null) {\n out.push(\n <View\n key=\"crosshair\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"x\",\n Math.round(hover.crosshairX),\n plot.y,\n plot.height,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n hover?.marks.forEach((m, i) => {\n if (m.kind === \"band\") {\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.05), {\n borderRadius: 6,\n }),\n );\n return;\n }\n if (m.kind === \"cell\") {\n out.push(\n box(\n `mark-${i}`,\n m.x - 1.5,\n m.y - 1.5,\n m.width + 3,\n m.height + 3,\n \"transparent\",\n {\n borderRadius: 4,\n borderWidth: 1.5,\n borderColor: css(theme.text, 0.55),\n },\n ),\n );\n return;\n }\n // soft halo, then the dot with a thin ring in the background color\n out.push(\n dot(`halo-${i}`, m.x, m.y, m.size + 8, m.halo),\n dot(`mark-${i}`, m.x, m.y, m.size, m.color, {\n borderWidth: 2,\n borderColor: background,\n }),\n );\n });\n if (dragging) {\n out.push(\n <View key=\"drag\" {...part(C, \"drag\")} style={StyleSheet.absoluteFill}>\n {dot(\n \"ghost\",\n dragging.x,\n dragging.y,\n dragging.size + 2,\n dragging.color,\n {\n opacity: 0.85,\n borderWidth: 2,\n borderColor: background,\n },\n )}\n </View>,\n );\n }\n const tip = hover?.tooltip;\n if (tip && !customTooltip) {\n const { box: b, lineHeight, padding, content } = tip;\n const text = css(theme.text);\n const muted = css(theme.textMuted);\n const font = (weight: number, color: string): TextStyle => ({\n fontSize: 12,\n lineHeight,\n color,\n fontWeight: String(weight) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(family ? { fontFamily: family } : null),\n });\n const swatch = (color: string) => (\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n marginRight: 6,\n backgroundColor: color,\n }}\n />\n );\n const row: ViewStyle = {\n height: lineHeight,\n flexDirection: \"row\",\n alignItems: \"center\",\n };\n out.push(\n <View\n key=\"tooltip\"\n {...part(C, \"tooltip\")}\n style={[\n tooltipCard(scene),\n {\n left: b.x,\n top: b.y,\n width: b.width,\n height: b.height,\n paddingHorizontal: padding + 1,\n paddingVertical: padding - 1,\n },\n ]}\n >\n {tip.text\n ? tip.text.map((t, i) => (\n <Text key={i} numberOfLines={1} style={font(400, text)}>\n {t}\n </Text>\n ))\n : [\n <View key=\"title\" style={row}>\n {content.titleColor ? swatch(content.titleColor) : null}\n <Text\n numberOfLines={1}\n style={[font(600, text), { flexShrink: 1 }]}\n >\n {content.title}\n </Text>\n </View>,\n ...content.rows.map((r, i) => (\n <View key={i} style={row}>\n {r.color ? swatch(r.color) : null}\n <Text\n numberOfLines={1}\n style={[font(400, muted), { flexShrink: 1 }]}\n >\n {r.name}\n </Text>\n <Text\n numberOfLines={1}\n style={[\n font(600, text),\n { flexGrow: 1, marginLeft: 16, textAlign: \"right\" },\n ]}\n >\n {r.value}\n </Text>\n </View>\n )),\n ]}\n </View>,\n );\n }\n return out;\n}\n\n/** Look of the tooltips (default and `renderTooltip` content) */\nexport const tooltipCard = (scene: ChartScene): ViewStyle => ({\n position: \"absolute\",\n backgroundColor: css(scene.theme.background),\n borderColor: css(scene.theme.axis),\n borderWidth: 1,\n borderRadius: 8,\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.18,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 6 },\n elevation: 6,\n});\n"],"mappings":"qUA+BA,IAAakB,EAAe,CAE1B,WAAY,KAEZ,cAAe,IAEf,KAAM,IAEN,cAAe,IAEf,KAAM,KAEN,YAAa,IAEb,OAAQ,GACV,EAEMC,EAAI,QAgBJC,EAAgB,GAAiB,KAAK,KAAKC,EAAO,IAAI,EAGtDC,GAAS,EAAc,IAC3B,KAAK,KACHtB,EAAAA,iBAAiBuB,EAAM,GAAGC,EAAE,QAAU,IAAI,GAAGA,EAAE,KAAK,cAAc,EAAI,IACpEA,EAAE,KAAO,CACb,EAOF,SAASC,EACP,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACc,CACd,IAAMC,EAAKN,EAAaI,EAAE,IAAI,EACxBG,GAAOD,EAAKF,EAAE,MAAQ,EACtBI,EAAIN,EAAMC,EAAMC,CAAC,EACjBK,EACJC,IAAW,MACPC,EAAIJ,EACJG,IAAW,SACTC,EAAIL,EAAKC,EACTI,EAAIL,EAAK,EACXM,EACJC,IAAU,OACN,CAAE,KAAMC,EAAG,MAAON,CAAE,EACpBK,IAAU,QACR,CAAE,MAAOE,EAAaD,EAAG,MAAON,CAAE,EAClC,CAAE,KAAMM,EAAIN,EAAI,EAAG,MAAOA,CAAE,EACpC,OACE,EAAAX,EAAA,IAAA,CAAChB,EAAAA,KAAD,CAEE,cAAe,EACf,MAAO,CACL,CACE,SAAU,WACV,MACA,GAAG+B,EACH,UAAWC,EACX,SAAUT,EAAE,KACZ,WAAYE,EACZ,MAAOF,EAAE,MACT,WAAY,OA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,MAAQ4B,EAAO5B,EAAE,KAAK,EAAI,MAC7B,EAAArG,EAAA,IAAA,CAAChB,EAAAA,KAAD,CACE,cAAe,EACf,MAAO,CAACuK,EAAK,IAAKD,CAAK,EAAG,CAAE,WAAY,CAAE,CAAC,EAE1C,SAAAjD,EAAE,IACC,CAAA,GACN,EAAArG,EAAA,IAAA,CAAChB,EAAAA,KAAD,CACE,cAAe,EACf,MAAO,CACLuK,EAAK,IAAKjJ,CAAI,EACd,CAAE,SAAU,EAAG,WAAY,GAAI,UAAW,OAAQ,CACpD,EAEC,SAAA+F,EAAE,KACC,CAAA,CACF,CAjBK,EAAArD,CAiBL,CACP,CACH,CACA,EAnDA,SAmDA,CACR,CACF,CACA,OAAOF,CACT,CAGA,IAAa6G,EAAe,IAAkC,CAC5D,SAAU,WACV,gBAAiBnD,EAAIpB,EAAM,MAAM,UAAU,EAC3C,YAAaoB,EAAIpB,EAAM,MAAM,IAAI,EACjC,YAAa,EACb,aAAc,EACd,YAAa,UACb,cAAe,IACf,aAAc,EACd,aAAc,CAAE,MAAO,EAAG,OAAQ,CAAE,EACpC,UAAW,CACb"}
1
+ {"version":3,"file":"scene.cjs","names":["measureChartText","Text","View","scenePrimitives","toCss","annotationRect","part","annotationLine","annotationTextBox","_Fragment","StyleSheet","require_parts","require_color","require_overlay","require_controller","require_measure","react_native","react_jsx_runtime","SHAPE_BUDGET","C","lineHeightOf","size","slack","text","o","label","lh","pad","w","top","valign","y","horizontal","align","x","frameWidth","extra","key","box","color","dot","cx","d","cy","segment","dx","x2","x1","dy","y2","y1","length","width","dashRuns","pattern","dash","v","period","a","b","runs","scale","max","out","at","i","step","dashedLine","start","run","axis","from","crisp","arrowViews","arrow","pts","k","p","q","x0","ox","y0","oy","tip","b0","b1","half","clear","style","baseX","baseY","right","down","thin","stride","lx","ly","areaStrips","transposed","points","plot","frame","n","forward","xs","ys","bs","bottom","baseline","to","column","j","left","c","mid","t","h","primitiveLimits","scene","visible","s","lines","scatters","perLine","maxDots","drawData","primitives","options","dotsLeft","barsLeft","total","r","count","radius","stroke","css","alpha","drawBackground","layout","scales","bottomAxis","model","leftAxis","bottomTicks","leftTicks","bottomPx","leftPx","fs","theme","annotations","grid","py","px","line","tick","title","lastRight","lastBottom","y2Ticks","ramp","bar","stops","l","e","swatch","drawForeground","fw","halo","labelHeight","along","where","pos","tx","ty","pointColor","clip","drawStatic","family","drawHover","background","hover","m","grow","inset","dragging","customTooltip","muted","font","weight","row","lineHeight","tooltipCard","padding","content"],"sources":["../../../../../native/src/components/Chart/scene.tsx"],"sourcesContent":["// Draws a chart scene (`ChartController.getScene()`) with plain views: no\n// canvas, SVG or native drawing module. The engine already resolves every\n// position in pixels; this file only turns them into absolutely positioned\n// <View> / <Text> elements, keeping the number of views bounded by the size\n// of the chart (lines decimated per column, dots merged per cell, bars\n// merged per pixel column), whatever the size of the data.\n\nimport type { ReactElement, ReactNode } from \"react\";\nimport {\n StyleSheet,\n Text,\n View,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport {\n annotationLine,\n annotationRect,\n annotationTextBox,\n scenePrimitives,\n toCss,\n type ChartPrimitive,\n type ChartRect,\n type ChartScene,\n} from \"@minerva/charts/canvas\";\nimport { part } from \"../../internal/parts\";\nimport { measureChartText } from \"./measure\";\n\ntype Rgba = ChartScene[\"theme\"][\"text\"];\n\n/** Upper bounds of the views drawn for the data of a chart */\nexport const SHAPE_BUDGET = {\n /** Points of all the lines (one view per segment) */\n linePoints: 1200,\n /** Dots of one scatter series before they are merged per cell */\n dotsPerSeries: 800,\n /** Dots of all the series */\n dots: 2000,\n /** Bars of one series before neighbors are merged per pixel column */\n barsPerSeries: 600,\n /** Bars of all the series */\n bars: 1500,\n /** Vertical strips filling one area */\n areaColumns: 200,\n /** Dashes of one dashed line */\n dashes: 200,\n} as const;\n\nconst C = \"chart\";\n\n// ------------------------------------------------------------------ text\n\ninterface TextOptions {\n size: number;\n color: string;\n weight?: number;\n family?: string;\n /** Halo color: keeps the text readable over the data */\n halo?: string;\n}\n\ntype Align = \"left\" | \"center\" | \"right\";\ntype VAlign = \"top\" | \"middle\" | \"bottom\";\n\nconst lineHeightOf = (size: number) => Math.ceil(size * 1.35);\n\n/** Box wide enough for the estimated width (the real one may differ) */\nconst slack = (text: string, o: TextOptions) =>\n Math.ceil(\n measureChartText(text, `${o.weight ?? 400} ${o.size}px sans-serif`) * 1.4 +\n o.size * 2,\n );\n\n/**\n * A one-line text anchored at (x, y) of a container `frameWidth` wide:\n * `left` starts there, `right` ends there, `center` is centered on it;\n * `top` / `bottom` place the em box like the canvas text baselines\n */\nfunction label(\n key: string,\n text: string,\n x: number,\n y: number,\n align: Align,\n valign: VAlign,\n o: TextOptions,\n frameWidth: number,\n extra?: TextStyle,\n): ReactElement {\n const lh = lineHeightOf(o.size);\n const pad = (lh - o.size) / 2;\n const w = slack(text, o);\n const top =\n valign === \"top\"\n ? y - pad\n : valign === \"bottom\"\n ? y - lh + pad\n : y - lh / 2;\n const horizontal: TextStyle =\n align === \"left\"\n ? { left: x, width: w }\n : align === \"right\"\n ? { right: frameWidth - x, width: w }\n : { left: x - w / 2, width: w };\n return (\n <Text\n key={key}\n numberOfLines={1}\n style={[\n {\n position: \"absolute\",\n top,\n ...horizontal,\n textAlign: align,\n fontSize: o.size,\n lineHeight: lh,\n color: o.color,\n fontWeight: String(o.weight ?? 400) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(o.family ? { fontFamily: o.family } : null),\n ...(o.halo\n ? {\n textShadowColor: o.halo,\n textShadowRadius: 3,\n textShadowOffset: { width: 0, height: 0 },\n }\n : null),\n },\n extra,\n ]}\n >\n {text}\n </Text>\n );\n}\n\n// ---------------------------------------------------------------- shapes\n\nconst box = (\n key: string,\n x: number,\n y: number,\n width: number,\n height: number,\n color: string,\n extra?: ViewStyle,\n): ReactElement => (\n <View\n key={key}\n style={[\n {\n position: \"absolute\",\n left: x,\n top: y,\n width,\n height,\n backgroundColor: color,\n },\n extra,\n ]}\n />\n);\n\nconst dot = (\n key: string,\n cx: number,\n cy: number,\n d: number,\n color: string,\n extra?: ViewStyle,\n) =>\n box(key, cx - d / 2, cy - d / 2, d, d, color, {\n borderRadius: d / 2,\n ...extra,\n });\n\n/** A straight stroke: one view, rotated around its center */\nconst segment = (\n key: string,\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n width: number,\n color: string,\n) => {\n const dx = x2 - x1;\n const dy = y2 - y1;\n const length = Math.hypot(dx, dy) + width;\n return box(\n key,\n (x1 + x2) / 2 - length / 2,\n (y1 + y2) / 2 - width / 2,\n length,\n width,\n color,\n {\n borderRadius: width / 2,\n transform: [{ rotate: `${Math.atan2(dy, dx)}rad` }],\n },\n );\n};\n\n/** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */\nexport function dashRuns(\n length: number,\n dash: readonly number[],\n max: number = SHAPE_BUDGET.dashes,\n): [number, number][] {\n let pattern = dash.filter((v) => Number.isFinite(v) && v >= 0);\n // odd patterns repeat twice, like the canvas\n if (pattern.length % 2) pattern = [...pattern, ...pattern];\n const period = pattern.reduce((a, b) => a + b, 0);\n if (!pattern.length || period <= 0) return [[0, length]];\n const runs = (length / period) * (pattern.length / 2);\n const scale = runs > max ? runs / max : 1;\n const out: [number, number][] = [];\n let at = 0;\n for (let i = 0; at < length; i = (i + 1) % pattern.length) {\n const step = pattern[i] * scale;\n if (i % 2 === 0 && step > 0) out.push([at, Math.min(step, length - at)]);\n at += Math.max(step, 0.5);\n }\n return out;\n}\n\nconst dashedLine = (\n key: string,\n axis: \"x\" | \"y\",\n at: number,\n from: number,\n length: number,\n width: number,\n color: string,\n dash: readonly number[],\n) =>\n dashRuns(length, dash).map(([start, run], i) =>\n axis === \"y\"\n ? box(`${key}-${i}`, from + start, at, run, width, color)\n : box(`${key}-${i}`, at, from + start, width, run, color),\n );\n\nconst crisp = (v: number, width = 1) => Math.round(v) + 0.5 - width / 2;\n\n/**\n * Views of an elbow arrow (relative to `ox`, `oy`): a thin box per leg (the\n * legs are horizontal or vertical) and a triangle made of borders\n */\nexport const arrowViews = (\n key: string,\n arrow: ChartScene[\"arrows\"][number],\n ox: number,\n oy: number,\n): ReactElement[] => {\n const out: ReactElement[] = [];\n const w = arrow.width;\n const pts = arrow.points;\n for (let k = 1; k < pts.length; k++) {\n const p = pts[k - 1]!;\n const q = pts[k]!;\n const x0 = Math.min(p.x, q.x) - ox;\n const y0 = Math.min(p.y, q.y) - oy;\n // legs overlap by half a width so the corners are closed\n out.push(\n p.y === q.y\n ? box(\n `${key}-${k}`,\n x0 - w / 2,\n y0 - w / 2,\n Math.abs(q.x - p.x) + w,\n w,\n arrow.color,\n )\n : box(\n `${key}-${k}`,\n x0 - w / 2,\n y0 - w / 2,\n w,\n Math.abs(q.y - p.y) + w,\n arrow.color,\n ),\n );\n }\n const [tip, b0, b1] = arrow.head;\n const length = Math.hypot(\n tip.x - (b0.x + b1.x) / 2,\n tip.y - (b0.y + b1.y) / 2,\n );\n const half = Math.hypot(b1.x - b0.x, b1.y - b0.y) / 2;\n const clear = \"transparent\";\n const style: ViewStyle = { position: \"absolute\", width: 0, height: 0 };\n const baseX = (b0.x + b1.x) / 2;\n const baseY = (b0.y + b1.y) / 2;\n if (Math.abs(tip.x - baseX) >= Math.abs(tip.y - baseY)) {\n const right = tip.x > baseX;\n Object.assign(style, {\n left: (right ? baseX : tip.x) - ox,\n top: tip.y - half - oy,\n borderTopWidth: half,\n borderBottomWidth: half,\n borderTopColor: clear,\n borderBottomColor: clear,\n ...(right\n ? { borderLeftWidth: length, borderLeftColor: arrow.color }\n : { borderRightWidth: length, borderRightColor: arrow.color }),\n });\n } else {\n const down = tip.y > baseY;\n Object.assign(style, {\n left: tip.x - half - ox,\n top: (down ? baseY : tip.y) - oy,\n borderLeftWidth: half,\n borderRightWidth: half,\n borderLeftColor: clear,\n borderRightColor: clear,\n ...(down\n ? { borderTopWidth: length, borderTopColor: arrow.color }\n : { borderBottomWidth: length, borderBottomColor: arrow.color }),\n });\n }\n out.push(<View key={`${key}-head`} style={style} />);\n return out;\n};\n\n// ------------------------------------------------------------------ data\n\n/** Thins a run of interleaved points to `max` points and drops sub-pixel steps */\nfunction thin(run: readonly number[], max: number): number[] {\n const n = run.length / 2;\n const stride = n > max ? Math.ceil(n / max) : 1;\n const out: number[] = [];\n for (let i = 0; i < n; i += stride) {\n const x = run[i * 2];\n const y = run[i * 2 + 1];\n const k = out.length;\n if (k && Math.hypot(x - out[k - 2], y - out[k - 1]) < 1.5) continue;\n out.push(x, y);\n }\n const lx = run[n * 2 - 2];\n const ly = run[n * 2 - 1];\n const k = out.length;\n if (n > 1 && (out[k - 2] !== lx || out[k - 1] !== ly)) out.push(lx, ly);\n return out;\n}\n\n/**\n * Vertical strips between the line and the baseline (or the stack below),\n * one per column; horizontal strips, one per row, for horizontal charts\n */\nfunction areaStrips(\n key: string,\n points: readonly number[],\n baseline: number,\n color: string,\n opacity: number,\n frame: ChartRect,\n /** Y pixel (x pixel when `transposed`) of the bottom edge under every point */\n bottom?: readonly number[],\n /** Horizontal charts: the area grows from the left edge */\n transposed = false,\n): ReactElement[] {\n // horizontal charts are filled like vertical ones with x and y swapped\n const run = transposed\n ? points.map((_, i) => points[i % 2 ? i - 1 : i + 1])\n : points;\n const plot = transposed\n ? { x: frame.y, y: frame.x, width: frame.height, height: frame.width }\n : frame;\n const n = run.length / 2;\n if (n < 2) return [];\n // left to right (reversed axes list their points right to left)\n const forward = run[0] <= run[n * 2 - 2];\n const at = (i: number) => (forward ? i : n - 1 - i);\n const xs = (i: number) => run[at(i) * 2];\n const ys = (i: number) => run[at(i) * 2 + 1];\n const bs = (i: number) => (bottom ? bottom[at(i)] : baseline);\n const from = Math.max(plot.x, xs(0));\n const to = Math.min(plot.x + plot.width, xs(n - 1));\n if (to <= from) return [];\n const column = Math.max(2, plot.width / SHAPE_BUDGET.areaColumns);\n const out: ReactElement[] = [];\n let j = 0;\n for (let left = Math.floor(from), c = 0; left < to; c++) {\n const right = Math.min(Math.ceil(to), Math.round(left + column));\n const mid = (left + right) / 2;\n while (j < n - 2 && xs(j + 1) < mid) j++;\n const x0 = xs(j);\n const x1 = xs(j + 1);\n const t = x1 === x0 ? 0 : Math.max(0, Math.min(1, (mid - x0) / (x1 - x0)));\n const y = ys(j) + (ys(j + 1) - ys(j)) * t;\n const b = bs(j) + (bs(j + 1) - bs(j)) * t;\n if (Number.isFinite(y) && Number.isFinite(b)) {\n const top = Math.min(y, b);\n const h = Math.abs(b - y);\n out.push(\n transposed\n ? box(\n `${key}-${c}`,\n top - plot.y,\n left - plot.x,\n h,\n right - left,\n color,\n {\n opacity,\n },\n )\n : box(\n `${key}-${c}`,\n left - plot.x,\n top - plot.y,\n right - left,\n h,\n color,\n {\n opacity,\n },\n ),\n );\n }\n left = right;\n }\n return out;\n}\n\n/** Limits of `scenePrimitives` for the views budget */\nexport function primitiveLimits(scene: ChartScene) {\n const { plot } = scene.layout;\n const visible = scene.model.series.filter((s) => !s.hidden);\n const lines = visible.filter(\n (s) => s.type === \"line\" || s.type === \"area\",\n ).length;\n const scatters = visible.filter((s) => s.type === \"scatter\").length;\n const perLine = Math.max(150, SHAPE_BUDGET.linePoints / Math.max(1, lines));\n const maxDots = Math.max(\n 100,\n Math.min(\n SHAPE_BUDGET.dotsPerSeries,\n SHAPE_BUDGET.dots / Math.max(1, scatters),\n ),\n );\n return {\n perLine,\n options: {\n // decimation keeps up to 4 points per column\n columnWidth: Math.max(3, (plot.width * 4) / perLine),\n maxDots,\n maxBars: SHAPE_BUDGET.barsPerSeries,\n dotCell: Math.max(\n 4,\n Math.sqrt((plot.width * plot.height) / maxDots) * 1.15 + 1,\n ),\n },\n };\n}\n\nfunction drawData(scene: ChartScene): ReactElement[] {\n const { plot } = scene.layout;\n const { perLine, options } = primitiveLimits(scene);\n const primitives: ChartPrimitive[] = scenePrimitives(scene, options);\n const ox = plot.x;\n const oy = plot.y;\n const out: ReactElement[] = [];\n let dotsLeft: number = SHAPE_BUDGET.dots;\n let barsLeft: number = SHAPE_BUDGET.bars;\n primitives.forEach((p, k) => {\n const key = `${p.kind}${p.seriesIndex}-${k}`;\n if (p.kind === \"area\") {\n p.segments.forEach((run, r) =>\n out.push(\n ...areaStrips(\n `${key}-${r}`,\n run,\n p.baseline,\n p.color,\n p.opacity,\n plot,\n p.bottoms?.[r],\n p.horizontal,\n ),\n ),\n );\n return;\n }\n if (p.kind === \"line\") {\n let total = 0;\n for (const run of p.segments) total += run.length / 2;\n p.segments.forEach((run, r) => {\n const pts = thin(\n run,\n Math.max(\n 2,\n Math.round((perLine * run.length) / 2 / Math.max(1, total)),\n ),\n );\n if (pts.length === 2) {\n out.push(\n dot(\n `${key}-${r}`,\n pts[0] - ox,\n pts[1] - oy,\n p.width * 1.5,\n p.color,\n ),\n );\n return;\n }\n for (let i = 0; i + 3 < pts.length; i += 2) {\n out.push(\n segment(\n `${key}-${r}-${i}`,\n pts[i] - ox,\n pts[i + 1] - oy,\n pts[i + 2] - ox,\n pts[i + 3] - oy,\n p.width,\n p.color,\n ),\n );\n }\n });\n return;\n }\n if (p.kind === \"bars\") {\n const count = p.rects.length / 4;\n const stride =\n count > barsLeft ? Math.ceil(count / Math.max(1, barsLeft)) : 1;\n for (let i = 0; i < count; i += stride) {\n const [x, y, w, h] = p.rects.slice(i * 4, i * 4 + 4);\n const radius = Math.min(p.radius ?? 0, w / 2, h / 2);\n out.push(\n box(\n `${key}-${i}`,\n x - ox,\n y - oy,\n Math.max(w, 0.5),\n h,\n p.colors?.[i] ?? p.color,\n radius > 0.5 || p.opacity !== undefined\n ? {\n ...(radius > 0.5 ? { borderRadius: radius } : null),\n ...(p.opacity !== undefined ? { opacity: p.opacity } : null),\n }\n : undefined,\n ),\n );\n }\n barsLeft = Math.max(0, barsLeft - Math.ceil(count / stride));\n return;\n }\n const count = p.dots.length / 3;\n const stride =\n count > dotsLeft ? Math.ceil(count / Math.max(1, dotsLeft)) : 1;\n const stroke = p.stroke ?? 0;\n for (let i = 0; i < count; i += stride) {\n const color = p.colors[i] ?? \"#888\";\n out.push(\n dot(\n `${key}-${i}`,\n p.dots[i * 3] - ox,\n p.dots[i * 3 + 1] - oy,\n p.dots[i * 3 + 2],\n // rings (hollow box plot outliers): the border only\n p.opacity > 0 ? color : \"transparent\",\n stroke > 0 && p.opacity < 1\n ? { borderWidth: stroke, borderColor: color, opacity: 1 }\n : { opacity: p.opacity },\n ),\n );\n }\n dotsLeft = Math.max(0, dotsLeft - Math.ceil(count / stride));\n });\n return out;\n}\n\n// ------------------------------------------------------------ background\n\nconst css = (c: Rgba, alpha?: number) => toCss(c, alpha);\n\nfunction drawBackground(scene: ChartScene, family?: string): ReactElement[] {\n const { width, theme, model, layout, annotations } = scene;\n const { plot, scales, y2Ticks } = layout;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const horizontal = scales.horizontal;\n const bottomAxis = horizontal ? model.y : model.x;\n const leftAxis = horizontal ? model.x : model.y;\n const bottomTicks = horizontal ? layout.yTicks : layout.xTicks;\n const leftTicks = horizontal ? layout.xTicks : layout.yTicks;\n const bottomPx = horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = horizontal ? scales.xToPx : scales.yToPx;\n const fs = theme.fontSize;\n const out: ReactElement[] = [];\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\") return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n out.push(\n box(`area-${i}`, r.x, r.y, r.width, r.height, css(a.color, a.opacity)),\n );\n });\n\n const grid = css(theme.grid);\n if (leftAxis.grid) {\n leftTicks.values.forEach((v, i) => {\n const py = leftPx(v);\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) return;\n out.push(box(`ygrid-${i}`, plot.x, crisp(py), plot.width, 1, grid));\n });\n }\n if (bottomAxis.grid) {\n bottomTicks.values.forEach((v, i) => {\n const px = bottomPx(v);\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) return;\n out.push(box(`xgrid-${i}`, crisp(px), plot.y, 1, plot.height, grid));\n });\n }\n\n const line = Math.ceil(fs * 1.4);\n const tick: TextOptions = { size: fs, color: css(theme.textMuted), family };\n const title: TextOptions = {\n size: fs + 1,\n weight: 500,\n color: css(theme.text, 0.8),\n family,\n };\n const bottom = plot.y + plot.height;\n\n if (bottomAxis.visible) {\n out.push(\n box(\"xaxis\", plot.x, crisp(bottom), plot.width, 1, css(theme.axis)),\n );\n let lastRight = -Infinity;\n bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.px - b.px)\n .forEach(({ px, text }, i) => {\n if (!text || px < plot.x - 0.5 || px > plot.x + plot.width + 0.5)\n return;\n const w = measureChartText(text, `400 ${fs}px sans-serif`);\n const left = Math.max(0, Math.min(width - w, px - w / 2));\n if (left < lastRight + 6) return;\n lastRight = left + w;\n out.push(\n label(\n `xtick-${i}`,\n text,\n left + w / 2,\n bottom + 7,\n \"center\",\n \"top\",\n tick,\n width,\n ),\n );\n });\n if (bottomAxis.title)\n out.push(\n label(\n \"xtitle\",\n bottomAxis.title,\n plot.x + plot.width / 2,\n bottom + line + 10,\n \"center\",\n \"top\",\n title,\n width,\n ),\n );\n }\n\n if (leftAxis.visible) {\n let lastBottom = -Infinity;\n leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] ?? \"\" }))\n .sort((a, b) => a.py - b.py)\n .forEach(({ py, text }, i) => {\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5)\n return;\n // category rows of horizontal charts never overlap\n if (horizontal) {\n if (py - (fs + 2) / 2 < lastBottom) return;\n lastBottom = py + (fs + 2) / 2;\n }\n out.push(\n label(\n `ytick-${i}`,\n text,\n plot.x - 8,\n py,\n \"right\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (leftAxis.title)\n out.push(\n label(\n \"ytitle\",\n leftAxis.title,\n line / 2 + 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"-90deg\" }],\n },\n ),\n );\n }\n\n const y2 = horizontal ? null : model.y2;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n const text = y2Ticks.labels[i];\n if (!text || py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n out.push(\n label(\n `y2tick-${i}`,\n text,\n right + 8,\n py,\n \"left\",\n \"middle\",\n tick,\n width,\n ),\n );\n });\n if (y2.title)\n out.push(\n label(\n \"y2title\",\n y2.title,\n width - line / 2 - 4,\n plot.y + plot.height / 2,\n \"center\",\n \"middle\",\n title,\n width,\n {\n transform: [{ rotate: \"90deg\" }],\n },\n ),\n );\n }\n\n const ramp = scene.legend?.colors;\n if (ramp) {\n // visual map: the ramp in even steps, the values at its ends\n const { bar, stops } = ramp;\n const step = bar.width / Math.max(1, stops.length);\n out.push(\n <View\n key=\"color-legend\"\n {...part(C, \"color-legend\")}\n style={{\n position: \"absolute\",\n left: bar.x,\n top: bar.y,\n width: bar.width,\n height: bar.height,\n borderRadius: bar.height / 2,\n overflow: \"hidden\",\n flexDirection: \"row\",\n }}\n >\n {stops.map((c, k) => (\n <View\n key={k}\n style={{ width: step, height: bar.height, backgroundColor: c }}\n />\n ))}\n </View>,\n );\n ramp.ticks.forEach((t, k) =>\n out.push(\n box(\n `color-tick-${k}`,\n Math.round(t),\n bar.y - 2,\n 1,\n bar.height + 4,\n css(theme.text, 0.35),\n ),\n ),\n );\n ramp.labels.forEach((l, k) =>\n out.push(\n label(\n `color-label-${k}`,\n l.text,\n l.x,\n l.y,\n l.align,\n \"middle\",\n { size: 11, color: css(theme.textMuted), family },\n width,\n ),\n ),\n );\n }\n\n if (scene.legend) {\n for (const e of scene.legend.entries) {\n // coordinates relative to the entry box\n const cy = e.box.height / 2;\n const swatch =\n e.shape === \"dot\"\n ? dot(\"swatch\", 5, cy, 8, e.color)\n : e.shape === \"line\"\n ? box(\"swatch\", 0, cy - 1, 10, 2, e.color)\n : box(\"swatch\", 1, cy - 4, 8, 8, e.color);\n out.push(\n <View\n key={`legend-${e.id}`}\n style={{\n position: \"absolute\",\n left: e.box.x,\n top: e.box.y,\n width: e.box.width,\n height: e.box.height,\n opacity: e.hidden ? 0.45 : 1,\n }}\n {...part(C, \"legend-item\", { hidden: e.hidden })}\n >\n {swatch}\n {label(\n \"name\",\n e.name,\n 14,\n cy,\n \"left\",\n \"middle\",\n { size: 12, color: css(theme.textMuted), family },\n e.box.width,\n e.hidden ? { textDecorationLine: \"line-through\" } : undefined,\n )}\n </View>,\n );\n }\n }\n return out;\n}\n\n// ------------------------------------------------------------ foreground\n\nfunction drawForeground(scene: ChartScene, family?: string): ReactElement[] {\n const { theme, annotations, layout } = scene;\n const { plot, scales } = layout;\n const fs = theme.fontSize;\n const ox = plot.x;\n const oy = plot.y;\n const fw = plot.width;\n const halo = css(theme.background, 0.9);\n const labelHeight = fs + 4;\n const out: ReactElement[] = [];\n\n // waterfall connectors: thin dashed lines between the bars\n scene.connectors.forEach((c, i) => {\n const along = c.y0 === c.y1;\n out.push(\n ...(along\n ? dashedLine(\n `connector-${i}`,\n \"y\",\n crisp(c.y0, c.width) - oy,\n Math.min(c.x0, c.x1) - ox,\n Math.abs(c.x1 - c.x0),\n c.width,\n c.color,\n c.dash,\n )\n : dashedLine(\n `connector-${i}`,\n \"x\",\n crisp(c.x0, c.width) - ox,\n Math.min(c.y0, c.y1) - oy,\n Math.abs(c.y1 - c.y0),\n c.width,\n c.color,\n c.dash,\n )),\n );\n });\n\n // dependency arrows (Gantt charts): axis-aligned legs and a border triangle\n scene.arrows.forEach((a, i) => {\n out.push(...arrowViews(`arrow-${i}`, a, ox, oy));\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"line\") return;\n const color = css(a.color);\n const where = annotationLine(a, scales);\n if (!where.vertical) {\n const py = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"y\",\n crisp(py, a.width) - oy,\n 0,\n plot.width,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n plot.width - 6,\n py - 3 - oy,\n \"right\",\n \"bottom\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n } else {\n const px = where.at;\n out.push(\n ...dashedLine(\n `line-${i}`,\n \"x\",\n crisp(px, a.width) - ox,\n 0,\n plot.height,\n a.width,\n color,\n a.dash,\n ),\n );\n if (a.label)\n out.push(\n label(\n `line-label-${i}`,\n a.label,\n px + 5 - ox,\n 5,\n \"left\",\n \"top\",\n { size: fs, weight: 500, color, halo, family },\n fw,\n ),\n );\n }\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"rect\" || !a.label) return;\n const r = annotationRect(a, scales);\n if (r.width <= 0 || r.height <= 0) return;\n const pad = 10;\n const pos = a.labelPosition;\n const align: Align = pos.endsWith(\"left\")\n ? \"left\"\n : pos.endsWith(\"right\")\n ? \"right\"\n : \"center\";\n const tx =\n align === \"left\"\n ? r.x + pad\n : align === \"right\"\n ? r.x + r.width - pad\n : r.x + r.width / 2;\n const ty = pos.startsWith(\"top\")\n ? r.y + pad\n : pos.startsWith(\"bottom\")\n ? r.y + r.height - pad - labelHeight\n : r.y + (r.height - labelHeight) / 2;\n out.push(\n label(\n `area-label-${i}`,\n a.label,\n tx - ox,\n ty - oy,\n align,\n \"top\",\n { size: fs + 1, weight: 600, color: css(a.labelColor), family },\n fw,\n ),\n );\n });\n\n annotations.forEach((a, i) => {\n if (a.type !== \"text\" || !a.text) return;\n const w = measureChartText(a.text, `${a.weight} ${fs}px sans-serif`);\n const b = annotationTextBox(a, scales, w, labelHeight);\n out.push(\n label(\n `text-${i}`,\n a.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, weight: a.weight, color: css(a.color), halo, family },\n fw,\n ),\n );\n });\n\n const pointColor = css(theme.text, 0.85);\n scene.pointLabels.forEach(({ label: l, box: b }, i) => {\n out.push(\n label(\n `point-label-${i}`,\n l.text,\n b.x - ox,\n b.y + b.height / 2 - oy,\n \"left\",\n \"middle\",\n { size: fs, color: pointColor, halo, family },\n fw,\n ),\n );\n });\n return out;\n}\n\nconst clip = (plot: ChartRect): ViewStyle => ({\n position: \"absolute\",\n left: plot.x,\n top: plot.y,\n width: plot.width,\n height: plot.height,\n overflow: \"hidden\",\n});\n\n/**\n * Everything but the hover state: axes, grid, legend, annotations, data and\n * labels (cached by the caller while the model, view and size are the same)\n */\nexport function drawStatic(scene: ChartScene, family?: string): ReactNode {\n const { plot } = scene.layout;\n return (\n <>\n {drawBackground(scene, family)}\n <View key=\"data\" style={clip(plot)} {...part(C, \"data\")}>\n {drawData(scene)}\n </View>\n <View key=\"labels\" style={clip(plot)} {...part(C, \"labels\")}>\n {drawForeground(scene, family)}\n </View>\n </>\n );\n}\n\n/** Crosshair, highlighted points, dragged point and the default tooltip */\nexport function drawHover(\n scene: ChartScene,\n family: string | undefined,\n customTooltip: boolean,\n): ReactNode {\n const { theme, layout, hover, dragging } = scene;\n const { plot } = layout;\n const background = css(theme.background);\n const out: ReactElement[] = [];\n if (hover && hover.crosshairY !== null) {\n out.push(\n <View\n key=\"crosshair-y\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"y\",\n Math.round(hover.crosshairY),\n plot.x,\n plot.width,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n if (hover && hover.crosshairX !== null) {\n out.push(\n <View\n key=\"crosshair\"\n style={StyleSheet.absoluteFill}\n {...part(C, \"crosshair\")}\n >\n {dashedLine(\n \"dash\",\n \"x\",\n Math.round(hover.crosshairX),\n plot.y,\n plot.height,\n 1,\n css(theme.textMuted, 0.55),\n [3, 3],\n )}\n </View>,\n );\n }\n hover?.marks.forEach((m, i) => {\n if (m.kind === \"band\") {\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.05), {\n borderRadius: 6,\n }),\n );\n return;\n }\n if (m.kind === \"guide\") {\n // the row / column of the hovered heatmap cell\n out.push(\n box(`mark-${i}`, m.x, m.y, m.width, m.height, css(theme.text, 0.06)),\n );\n return;\n }\n if (m.kind === \"cell\") {\n // lifted: a little larger, a shadow, a ring inside its edge\n const grow = Math.min(3, m.width * 0.06, m.height * 0.06);\n const inset = Math.min(2, m.width / 5, m.height / 5);\n out.push(\n box(\n `mark-${i}`,\n m.x - grow,\n m.y - grow,\n m.width + grow * 2,\n m.height + grow * 2,\n m.color,\n {\n borderRadius: Math.max(2, m.radius),\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.45,\n shadowRadius: 6,\n shadowOffset: { width: 0, height: 3 },\n elevation: 4,\n },\n ),\n );\n if (m.width > 8 && m.height > 8)\n out.push(\n box(\n `ring-${i}`,\n m.x - grow + inset,\n m.y - grow + inset,\n m.width + (grow - inset) * 2,\n m.height + (grow - inset) * 2,\n \"transparent\",\n {\n borderRadius: Math.max(1, m.radius - inset / 2),\n borderWidth: 1.5,\n borderColor: m.ring,\n },\n ),\n );\n return;\n }\n // soft halo, then the dot with a thin ring in the background color\n out.push(\n dot(`halo-${i}`, m.x, m.y, m.size + 8, m.halo),\n dot(`mark-${i}`, m.x, m.y, m.size, m.color, {\n borderWidth: 2,\n borderColor: background,\n }),\n );\n });\n if (dragging) {\n out.push(\n <View key=\"drag\" {...part(C, \"drag\")} style={StyleSheet.absoluteFill}>\n {dot(\n \"ghost\",\n dragging.x,\n dragging.y,\n dragging.size + 2,\n dragging.color,\n {\n opacity: 0.85,\n borderWidth: 2,\n borderColor: background,\n },\n )}\n </View>,\n );\n }\n const tip = hover?.tooltip;\n if (tip && !customTooltip) {\n const { box: b, lineHeight, padding, content } = tip;\n const text = css(theme.text);\n const muted = css(theme.textMuted);\n const font = (weight: number, color: string): TextStyle => ({\n fontSize: 12,\n lineHeight,\n color,\n fontWeight: String(weight) as TextStyle[\"fontWeight\"],\n includeFontPadding: false,\n ...(family ? { fontFamily: family } : null),\n });\n const swatch = (color: string) => (\n <View\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n marginRight: 6,\n backgroundColor: color,\n }}\n />\n );\n const row: ViewStyle = {\n height: lineHeight,\n flexDirection: \"row\",\n alignItems: \"center\",\n };\n out.push(\n <View\n key=\"tooltip\"\n {...part(C, \"tooltip\")}\n style={[\n tooltipCard(scene),\n {\n left: b.x,\n top: b.y,\n width: b.width,\n height: b.height,\n paddingHorizontal: padding + 1,\n paddingVertical: padding - 1,\n },\n ]}\n >\n {tip.text\n ? tip.text.map((t, i) => (\n <Text key={i} numberOfLines={1} style={font(400, text)}>\n {t}\n </Text>\n ))\n : [\n <View key=\"title\" style={row}>\n {content.titleColor ? swatch(content.titleColor) : null}\n <Text\n numberOfLines={1}\n style={[font(600, text), { flexShrink: 1 }]}\n >\n {content.title}\n </Text>\n </View>,\n ...(content.subtitle\n ? [\n <View key=\"subtitle\" style={row}>\n <Text\n numberOfLines={1}\n style={[\n font(400, muted),\n {\n fontSize: 11,\n paddingLeft: content.titleColor ? 14 : 0,\n },\n ]}\n >\n {content.subtitle}\n </Text>\n </View>,\n ]\n : []),\n // a label column (after the swatch column) and right-aligned values\n ...content.rows.map((r, i) => (\n <View key={i} style={row}>\n {tip.swatchWidth > 0 ? (\n <View style={{ width: tip.swatchWidth }}>\n {r.color ? swatch(r.color) : null}\n </View>\n ) : null}\n <Text\n numberOfLines={1}\n style={[font(400, muted), { flexShrink: 1 }]}\n >\n {r.name}\n </Text>\n <Text\n numberOfLines={1}\n style={[\n font(600, text),\n {\n flexGrow: 1,\n marginLeft: 16,\n textAlign: \"right\",\n fontVariant: [\"tabular-nums\"],\n },\n ]}\n >\n {r.value}\n </Text>\n </View>\n )),\n ]}\n </View>,\n );\n }\n return out;\n}\n\n/** Look of the tooltips (default and `renderTooltip` content) */\nexport const tooltipCard = (scene: ChartScene): ViewStyle => ({\n position: \"absolute\",\n backgroundColor: css(scene.theme.background),\n borderColor: css(scene.theme.axis),\n borderWidth: 1,\n borderRadius: 8,\n shadowColor: \"#0f172a\",\n shadowOpacity: 0.18,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 6 },\n elevation: 6,\n});\n"],"mappings":"qUA+BA,IAAakB,EAAe,CAE1B,WAAY,KAEZ,cAAe,IAEf,KAAM,IAEN,cAAe,IAEf,KAAM,KAEN,YAAa,IAEb,OAAQ,GACV,EAEMC,EAAI,QAgBJC,EAAgB,GAAiB,KAAK,KAAKC,EAAO,IAAI,EAGtDC,GAAS,EAAc,IAC3B,KAAK,KACHtB,EAAAA,iBAAiBuB,EAAM,GAAGC,EAAE,QAAU,IAAI,GAAGA,EAAE,KAAK,cAAc,EAAI,IACpEA,EAAE,KAAO,CACb,EAOF,SAASC,EACP,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACc,CACd,IAAMC,EAAKN,EAAaI,EAAE,IAAI,EACxBG,GAAOD,EAAKF,EAAE,MAAQ,EACtBI,EAAIN,EAAMC,EAAMC,CAAC,EACjBK,EACJC,IAAW,MACPC,EAAIJ,EACJG,IAAW,SACTC,EAAIL,EAAKC,EACTI,EAAIL,EAAK,EACXM,EACJC,IAAU,OACN,CAAE,KAAMC,EAAG,MAAON,CAAE,EACpBK,IAAU,QACR,CAAE,MAAOE,EAAaD,EAAG,MAAON,CAAE,EAClC,CAAE,KAAMM,EAAIN,EAAI,EAAG,MAAOA,CAAE,EACpC,OACE,EAAAX,EAAA,IAAA,CAAChB,EAAAA,KAAD,CAEE,cAAe,EACf,MAAO,CACL,CACE,SAAU,WACV,MACA,GAAG+B,EACH,UAAWC,EACX,SAAUT,EAAE,KACZ,WAAYE,EACZ,MAAOF,EAAE,MACT,WAAY,OAAOA,EAAE,QAAU,GAAG,EAClC,mBAAoB,GACpB,GAAIA,EAAE,OAAS,CAAE,WAAYA,EAAE,MAAO,EAAI,KAC1C,GAAIA,EAAE,KACF,CACE,gBAAiBA,EAAE,KACnB,iBAAkB,EAClB,iBAAkB,CAAE,MAAO,EAAG,OAAQ,CAAE,CA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AO,CAAC0L,EAAK,IAAKD,CAAK,EAAG,CAAE,WAAY,CAAE,CAAC,EAE1C,SAAAvD,EAAE,IACC,CAAA,GACN,EAAAlH,EAAA,IAAA,CAAChB,EAAAA,KAAD,CACE,cAAe,EACf,MAAO,CACL0L,EAAK,IAAKpK,CAAI,EACd,CACE,SAAU,EACV,WAAY,GACZ,UAAW,QACX,YAAa,CAAC,cAAc,CAC9B,CACF,EAEC,SAAA4G,EAAE,KACC,CAAA,CACF,CA1BK,EAAAlE,CA0BL,CACP,CACH,CACA,EA/EA,SA+EA,CACR,CACF,CACA,OAAOF,CACT,CAGA,IAAagI,EAAe,IAAkC,CAC5D,SAAU,WACV,gBAAiBxD,EAAIjB,EAAM,MAAM,UAAU,EAC3C,YAAaiB,EAAIjB,EAAM,MAAM,IAAI,EACjC,YAAa,EACb,aAAc,EACd,YAAa,UACb,cAAe,IACf,aAAc,EACd,aAAc,CAAE,MAAO,EAAG,OAAQ,CAAE,EACpC,UAAW,CACb"}
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  import { ChartScene } from '../../../charts/canvas.cjs';
4
4
  /** Upper bounds of the views drawn for the data of a chart */
@@ -20,6 +20,11 @@ export declare const SHAPE_BUDGET: {
20
20
  };
21
21
  /** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */
22
22
  export declare function dashRuns(length: number, dash: readonly number[], max?: number): [number, number][];
23
+ /**
24
+ * Views of an elbow arrow (relative to `ox`, `oy`): a thin box per leg (the
25
+ * legs are horizontal or vertical) and a triangle made of borders
26
+ */
27
+ export declare const arrowViews: (key: string, arrow: ChartScene["arrows"][number], ox: number, oy: number) => ReactElement[];
23
28
  /** Limits of `scenePrimitives` for the views budget */
24
29
  export declare function primitiveLimits(scene: ChartScene): {
25
30
  perLine: number;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  import { ChartScene } from '../../../charts/canvas.js';
4
4
  /** Upper bounds of the views drawn for the data of a chart */
@@ -20,6 +20,11 @@ export declare const SHAPE_BUDGET: {
20
20
  };
21
21
  /** Dash runs `[start, length]` along a line (canvas `setLineDash` pattern) */
22
22
  export declare function dashRuns(length: number, dash: readonly number[], max?: number): [number, number][];
23
+ /**
24
+ * Views of an elbow arrow (relative to `ox`, `oy`): a thin box per leg (the
25
+ * legs are horizontal or vertical) and a triangle made of borders
26
+ */
27
+ export declare const arrowViews: (key: string, arrow: ChartScene["arrows"][number], ox: number, oy: number) => ReactElement[];
23
28
  /** Limits of `scenePrimitives` for the views budget */
24
29
  export declare function primitiveLimits(scene: ChartScene): {
25
30
  perLine: number;