minerva-design 1.5.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 (457) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/custom-elements.json +122 -5
  3. package/dist/angular/fesm2022/minerva-angular.mjs +55 -0
  4. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  5. package/dist/angular/types/minerva-angular.d.ts +23 -2
  6. package/dist/charts/canvas.d.cts +2 -1
  7. package/dist/charts/canvas.d.ts +2 -1
  8. package/dist/charts/core.d.cts +1 -1
  9. package/dist/charts/core.d.ts +1 -1
  10. package/dist/charts/engine/canvas.cjs +1 -1
  11. package/dist/charts/engine/canvas.cjs.map +1 -1
  12. package/dist/charts/engine/canvas.js +2 -1
  13. package/dist/charts/engine/canvas.js.map +1 -1
  14. package/dist/charts/engine/chart.cjs +1 -1
  15. package/dist/charts/engine/chart.cjs.map +1 -1
  16. package/dist/charts/engine/chart.js +144 -143
  17. package/dist/charts/engine/chart.js.map +1 -1
  18. package/dist/charts/engine/controller.cjs +2 -2
  19. package/dist/charts/engine/controller.cjs.map +1 -1
  20. package/dist/charts/engine/controller.d.cts +3 -1
  21. package/dist/charts/engine/controller.d.ts +3 -1
  22. package/dist/charts/engine/controller.js +130 -132
  23. package/dist/charts/engine/controller.js.map +1 -1
  24. package/dist/charts/engine/defaults.cjs.map +1 -1
  25. package/dist/charts/engine/defaults.d.cts +4 -4
  26. package/dist/charts/engine/defaults.d.ts +4 -4
  27. package/dist/charts/engine/defaults.js.map +1 -1
  28. package/dist/charts/engine/graph/chart.cjs +1 -1
  29. package/dist/charts/engine/graph/chart.cjs.map +1 -1
  30. package/dist/charts/engine/graph/chart.js +740 -597
  31. package/dist/charts/engine/graph/chart.js.map +1 -1
  32. package/dist/charts/engine/graph/dag.cjs +1 -1
  33. package/dist/charts/engine/graph/dag.cjs.map +1 -1
  34. package/dist/charts/engine/graph/dag.js +191 -166
  35. package/dist/charts/engine/graph/dag.js.map +1 -1
  36. package/dist/charts/engine/graph/force.cjs +1 -1
  37. package/dist/charts/engine/graph/force.cjs.map +1 -1
  38. package/dist/charts/engine/graph/force.d.cts +9 -0
  39. package/dist/charts/engine/graph/force.d.ts +9 -0
  40. package/dist/charts/engine/graph/force.js +279 -181
  41. package/dist/charts/engine/graph/force.js.map +1 -1
  42. package/dist/charts/engine/graph/geometry.cjs +1 -1
  43. package/dist/charts/engine/graph/geometry.cjs.map +1 -1
  44. package/dist/charts/engine/graph/geometry.d.cts +14 -1
  45. package/dist/charts/engine/graph/geometry.d.ts +14 -1
  46. package/dist/charts/engine/graph/geometry.js +77 -24
  47. package/dist/charts/engine/graph/geometry.js.map +1 -1
  48. package/dist/charts/engine/graph/model.cjs +1 -1
  49. package/dist/charts/engine/graph/model.cjs.map +1 -1
  50. package/dist/charts/engine/graph/model.d.cts +9 -0
  51. package/dist/charts/engine/graph/model.d.ts +9 -0
  52. package/dist/charts/engine/graph/model.js +63 -43
  53. package/dist/charts/engine/graph/model.js.map +1 -1
  54. package/dist/charts/engine/graph/types.d.cts +14 -0
  55. package/dist/charts/engine/graph/types.d.ts +14 -0
  56. package/dist/charts/engine/graph/worker.cjs +12 -6
  57. package/dist/charts/engine/graph/worker.cjs.map +1 -1
  58. package/dist/charts/engine/graph/worker.js +12 -6
  59. package/dist/charts/engine/graph/worker.js.map +1 -1
  60. package/dist/charts/engine/labels.cjs.map +1 -1
  61. package/dist/charts/engine/labels.d.cts +17 -0
  62. package/dist/charts/engine/labels.d.ts +17 -0
  63. package/dist/charts/engine/labels.js.map +1 -1
  64. package/dist/charts/engine/model.cjs +1 -1
  65. package/dist/charts/engine/model.cjs.map +1 -1
  66. package/dist/charts/engine/model.d.cts +33 -0
  67. package/dist/charts/engine/model.d.ts +33 -0
  68. package/dist/charts/engine/model.js +149 -126
  69. package/dist/charts/engine/model.js.map +1 -1
  70. package/dist/charts/engine/orderbook/field.cjs +37 -0
  71. package/dist/charts/engine/orderbook/field.cjs.map +1 -0
  72. package/dist/charts/engine/orderbook/field.d.cts +92 -0
  73. package/dist/charts/engine/orderbook/field.d.ts +92 -0
  74. package/dist/charts/engine/orderbook/field.js +297 -0
  75. package/dist/charts/engine/orderbook/field.js.map +1 -0
  76. package/dist/charts/engine/orderbook/heatmap.cjs +1 -1
  77. package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -1
  78. package/dist/charts/engine/orderbook/heatmap.js +413 -441
  79. package/dist/charts/engine/orderbook/heatmap.js.map +1 -1
  80. package/dist/charts/engine/orderbook/host.cjs +1 -1
  81. package/dist/charts/engine/orderbook/host.cjs.map +1 -1
  82. package/dist/charts/engine/orderbook/host.d.cts +8 -1
  83. package/dist/charts/engine/orderbook/host.d.ts +8 -1
  84. package/dist/charts/engine/orderbook/host.js +27 -5
  85. package/dist/charts/engine/orderbook/host.js.map +1 -1
  86. package/dist/charts/engine/orderbook/ladder.cjs +1 -1
  87. package/dist/charts/engine/orderbook/ladder.cjs.map +1 -1
  88. package/dist/charts/engine/orderbook/ladder.js +1 -1
  89. package/dist/charts/engine/orderbook/ladder.js.map +1 -1
  90. package/dist/charts/engine/orderbook/layout.cjs +1 -1
  91. package/dist/charts/engine/orderbook/layout.cjs.map +1 -1
  92. package/dist/charts/engine/orderbook/layout.d.cts +5 -0
  93. package/dist/charts/engine/orderbook/layout.d.ts +5 -0
  94. package/dist/charts/engine/orderbook/layout.js +8 -2
  95. package/dist/charts/engine/orderbook/layout.js.map +1 -1
  96. package/dist/charts/engine/orderbook/tape.cjs +1 -1
  97. package/dist/charts/engine/orderbook/tape.cjs.map +1 -1
  98. package/dist/charts/engine/orderbook/tape.js +3 -3
  99. package/dist/charts/engine/orderbook/tape.js.map +1 -1
  100. package/dist/charts/engine/orderbook/types.d.cts +12 -4
  101. package/dist/charts/engine/orderbook/types.d.ts +12 -4
  102. package/dist/charts/engine/overlay.cjs +1 -1
  103. package/dist/charts/engine/overlay.cjs.map +1 -1
  104. package/dist/charts/engine/overlay.d.cts +17 -0
  105. package/dist/charts/engine/overlay.d.ts +17 -0
  106. package/dist/charts/engine/overlay.js +29 -13
  107. package/dist/charts/engine/overlay.js.map +1 -1
  108. package/dist/charts/engine/presets.cjs +1 -1
  109. package/dist/charts/engine/presets.cjs.map +1 -1
  110. package/dist/charts/engine/presets.d.cts +12 -2
  111. package/dist/charts/engine/presets.d.ts +12 -2
  112. package/dist/charts/engine/presets.js +8 -2
  113. package/dist/charts/engine/presets.js.map +1 -1
  114. package/dist/charts/engine/renderers/canvas2d.cjs +1 -1
  115. package/dist/charts/engine/renderers/canvas2d.cjs.map +1 -1
  116. package/dist/charts/engine/renderers/canvas2d.js +13 -9
  117. package/dist/charts/engine/renderers/canvas2d.js.map +1 -1
  118. package/dist/charts/engine/renderers/follow.cjs +2 -0
  119. package/dist/charts/engine/renderers/follow.cjs.map +1 -0
  120. package/dist/charts/engine/renderers/follow.d.cts +8 -0
  121. package/dist/charts/engine/renderers/follow.d.ts +8 -0
  122. package/dist/charts/engine/renderers/follow.js +10 -0
  123. package/dist/charts/engine/renderers/follow.js.map +1 -0
  124. package/dist/charts/engine/renderers/gl-budget.cjs +2 -0
  125. package/dist/charts/engine/renderers/gl-budget.cjs.map +1 -0
  126. package/dist/charts/engine/renderers/gl-budget.d.cts +32 -0
  127. package/dist/charts/engine/renderers/gl-budget.d.ts +32 -0
  128. package/dist/charts/engine/renderers/gl-budget.js +95 -0
  129. package/dist/charts/engine/renderers/gl-budget.js.map +1 -0
  130. package/dist/charts/engine/renderers/gl.cjs +1 -1
  131. package/dist/charts/engine/renderers/gl.cjs.map +1 -1
  132. package/dist/charts/engine/renderers/gl.js +1 -1
  133. package/dist/charts/engine/renderers/gl.js.map +1 -1
  134. package/dist/charts/engine/renderers/shaders.cjs +9 -6
  135. package/dist/charts/engine/renderers/shaders.cjs.map +1 -1
  136. package/dist/charts/engine/renderers/shaders.d.cts +1 -1
  137. package/dist/charts/engine/renderers/shaders.d.ts +1 -1
  138. package/dist/charts/engine/renderers/shaders.js +9 -6
  139. package/dist/charts/engine/renderers/shaders.js.map +1 -1
  140. package/dist/charts/engine/renderers/types.cjs.map +1 -1
  141. package/dist/charts/engine/renderers/types.d.cts +2 -0
  142. package/dist/charts/engine/renderers/types.d.ts +2 -0
  143. package/dist/charts/engine/renderers/types.js.map +1 -1
  144. package/dist/charts/engine/renderers/webgl.cjs +1 -1
  145. package/dist/charts/engine/renderers/webgl.cjs.map +1 -1
  146. package/dist/charts/engine/renderers/webgl.js +85 -64
  147. package/dist/charts/engine/renderers/webgl.js.map +1 -1
  148. package/dist/charts/engine/renderers/webgl2.cjs +1 -1
  149. package/dist/charts/engine/renderers/webgl2.cjs.map +1 -1
  150. package/dist/charts/engine/renderers/webgl2.js +72 -58
  151. package/dist/charts/engine/renderers/webgl2.js.map +1 -1
  152. package/dist/charts/engine/renderers/webgpu.cjs +1 -1
  153. package/dist/charts/engine/renderers/webgpu.cjs.map +1 -1
  154. package/dist/charts/engine/renderers/webgpu.js +1 -1
  155. package/dist/charts/engine/renderers/webgpu.js.map +1 -1
  156. package/dist/charts/engine/scene.cjs +1 -1
  157. package/dist/charts/engine/scene.cjs.map +1 -1
  158. package/dist/charts/engine/scene.d.cts +51 -4
  159. package/dist/charts/engine/scene.d.ts +51 -4
  160. package/dist/charts/engine/scene.js +188 -122
  161. package/dist/charts/engine/scene.js.map +1 -1
  162. package/dist/charts/engine/shapes/chord.cjs +1 -1
  163. package/dist/charts/engine/shapes/chord.cjs.map +1 -1
  164. package/dist/charts/engine/shapes/chord.js +108 -103
  165. package/dist/charts/engine/shapes/chord.js.map +1 -1
  166. package/dist/charts/engine/shapes/types.d.cts +5 -3
  167. package/dist/charts/engine/shapes/types.d.ts +5 -3
  168. package/dist/charts/engine/three-d/canvas2d.cjs +1 -1
  169. package/dist/charts/engine/three-d/canvas2d.cjs.map +1 -1
  170. package/dist/charts/engine/three-d/canvas2d.d.cts +36 -1
  171. package/dist/charts/engine/three-d/canvas2d.d.ts +36 -1
  172. package/dist/charts/engine/three-d/canvas2d.js +155 -80
  173. package/dist/charts/engine/three-d/canvas2d.js.map +1 -1
  174. package/dist/charts/engine/three-d/chart.cjs +1 -1
  175. package/dist/charts/engine/three-d/chart.cjs.map +1 -1
  176. package/dist/charts/engine/three-d/chart.js +219 -215
  177. package/dist/charts/engine/three-d/chart.js.map +1 -1
  178. package/dist/charts/engine/three-d/oit.cjs +109 -0
  179. package/dist/charts/engine/three-d/oit.cjs.map +1 -0
  180. package/dist/charts/engine/three-d/oit.d.cts +34 -0
  181. package/dist/charts/engine/three-d/oit.d.ts +34 -0
  182. package/dist/charts/engine/three-d/oit.js +111 -0
  183. package/dist/charts/engine/three-d/oit.js.map +1 -0
  184. package/dist/charts/engine/three-d/render-types.cjs +1 -1
  185. package/dist/charts/engine/three-d/render-types.cjs.map +1 -1
  186. package/dist/charts/engine/three-d/render-types.d.cts +16 -3
  187. package/dist/charts/engine/three-d/render-types.d.ts +16 -3
  188. package/dist/charts/engine/three-d/render-types.js +6 -9
  189. package/dist/charts/engine/three-d/render-types.js.map +1 -1
  190. package/dist/charts/engine/three-d/shaders.cjs +52 -26
  191. package/dist/charts/engine/three-d/shaders.cjs.map +1 -1
  192. package/dist/charts/engine/three-d/shaders.d.cts +11 -3
  193. package/dist/charts/engine/three-d/shaders.d.ts +11 -3
  194. package/dist/charts/engine/three-d/shaders.js +84 -40
  195. package/dist/charts/engine/three-d/shaders.js.map +1 -1
  196. package/dist/charts/engine/three-d/sort.cjs +1 -1
  197. package/dist/charts/engine/three-d/sort.cjs.map +1 -1
  198. package/dist/charts/engine/three-d/sort.d.cts +6 -4
  199. package/dist/charts/engine/three-d/sort.d.ts +6 -4
  200. package/dist/charts/engine/three-d/sort.js +51 -39
  201. package/dist/charts/engine/three-d/sort.js.map +1 -1
  202. package/dist/charts/engine/three-d/types.d.cts +9 -0
  203. package/dist/charts/engine/three-d/types.d.ts +9 -0
  204. package/dist/charts/engine/three-d/webgl.cjs +1 -1
  205. package/dist/charts/engine/three-d/webgl.cjs.map +1 -1
  206. package/dist/charts/engine/three-d/webgl.d.cts +9 -0
  207. package/dist/charts/engine/three-d/webgl.d.ts +9 -0
  208. package/dist/charts/engine/three-d/webgl.js +199 -76
  209. package/dist/charts/engine/three-d/webgl.js.map +1 -1
  210. package/dist/charts/engine/three-d/webgpu.cjs +1 -1
  211. package/dist/charts/engine/three-d/webgpu.cjs.map +1 -1
  212. package/dist/charts/engine/three-d/webgpu.js +225 -99
  213. package/dist/charts/engine/three-d/webgpu.js.map +1 -1
  214. package/dist/charts/engine/trading/chart.cjs +1 -1
  215. package/dist/charts/engine/trading/chart.cjs.map +1 -1
  216. package/dist/charts/engine/trading/chart.d.cts +0 -1
  217. package/dist/charts/engine/trading/chart.d.ts +0 -1
  218. package/dist/charts/engine/trading/chart.js +1048 -883
  219. package/dist/charts/engine/trading/chart.js.map +1 -1
  220. package/dist/charts/engine/trading/drawings.cjs +2 -2
  221. package/dist/charts/engine/trading/drawings.cjs.map +1 -1
  222. package/dist/charts/engine/trading/drawings.d.cts +6 -0
  223. package/dist/charts/engine/trading/drawings.d.ts +6 -0
  224. package/dist/charts/engine/trading/drawings.js +100 -88
  225. package/dist/charts/engine/trading/drawings.js.map +1 -1
  226. package/dist/charts/engine/trading/format.cjs +1 -1
  227. package/dist/charts/engine/trading/format.cjs.map +1 -1
  228. package/dist/charts/engine/trading/format.d.cts +6 -0
  229. package/dist/charts/engine/trading/format.d.ts +6 -0
  230. package/dist/charts/engine/trading/format.js +42 -30
  231. package/dist/charts/engine/trading/format.js.map +1 -1
  232. package/dist/charts/engine/trading/geometry.cjs +1 -1
  233. package/dist/charts/engine/trading/geometry.cjs.map +1 -1
  234. package/dist/charts/engine/trading/geometry.d.cts +16 -0
  235. package/dist/charts/engine/trading/geometry.d.ts +16 -0
  236. package/dist/charts/engine/trading/geometry.js +19 -4
  237. package/dist/charts/engine/trading/geometry.js.map +1 -1
  238. package/dist/charts/engine/trading/labels.cjs +1 -1
  239. package/dist/charts/engine/trading/labels.cjs.map +1 -1
  240. package/dist/charts/engine/trading/labels.js +24 -4
  241. package/dist/charts/engine/trading/labels.js.map +1 -1
  242. package/dist/charts/engine/trading/studies.cjs +1 -1
  243. package/dist/charts/engine/trading/studies.cjs.map +1 -1
  244. package/dist/charts/engine/trading/studies.d.cts +8 -0
  245. package/dist/charts/engine/trading/studies.d.ts +8 -0
  246. package/dist/charts/engine/trading/studies.js +4 -1
  247. package/dist/charts/engine/trading/studies.js.map +1 -1
  248. package/dist/charts/engine/trading/types.d.cts +34 -11
  249. package/dist/charts/engine/trading/types.d.ts +34 -11
  250. package/dist/charts/engine/types.d.cts +25 -4
  251. package/dist/charts/engine/types.d.ts +25 -4
  252. package/dist/charts/react/charts.cjs +1 -1
  253. package/dist/charts/react/charts.cjs.map +1 -1
  254. package/dist/charts/react/charts.js +20 -15
  255. package/dist/charts/react/charts.js.map +1 -1
  256. package/dist/charts/react/graph.cjs +1 -1
  257. package/dist/charts/react/graph.cjs.map +1 -1
  258. package/dist/charts/react/graph.d.cts +6 -0
  259. package/dist/charts/react/graph.d.ts +6 -0
  260. package/dist/charts/react/graph.js +28 -27
  261. package/dist/charts/react/graph.js.map +1 -1
  262. package/dist/charts/react/orderbook.cjs +1 -1
  263. package/dist/charts/react/orderbook.cjs.map +1 -1
  264. package/dist/charts/react/orderbook.d.cts +3 -1
  265. package/dist/charts/react/orderbook.d.ts +3 -1
  266. package/dist/charts/react/orderbook.js +1 -0
  267. package/dist/charts/react/orderbook.js.map +1 -1
  268. package/dist/charts/react/shapes.cjs.map +1 -1
  269. package/dist/charts/react/shapes.d.cts +4 -3
  270. package/dist/charts/react/shapes.d.ts +4 -3
  271. package/dist/charts/react/shapes.js.map +1 -1
  272. package/dist/charts/react/three-d.cjs +1 -1
  273. package/dist/charts/react/three-d.cjs.map +1 -1
  274. package/dist/charts/react/three-d.d.cts +7 -0
  275. package/dist/charts/react/three-d.d.ts +7 -0
  276. package/dist/charts/react/three-d.js +14 -13
  277. package/dist/charts/react/three-d.js.map +1 -1
  278. package/dist/charts/react/trading.cjs.map +1 -1
  279. package/dist/charts/react/trading.d.cts +3 -3
  280. package/dist/charts/react/trading.d.ts +3 -3
  281. package/dist/charts/react/trading.js.map +1 -1
  282. package/dist/core/contracts.cjs +1 -1
  283. package/dist/core/contracts.cjs.map +1 -1
  284. package/dist/core/contracts.js +1 -1
  285. package/dist/core/contracts.js.map +1 -1
  286. package/dist/native/charts/src/canvas.cjs +1 -1
  287. package/dist/native/charts/src/canvas.js +4 -3
  288. package/dist/native/charts/src/engine/controller.cjs +2 -2
  289. package/dist/native/charts/src/engine/controller.cjs.map +1 -1
  290. package/dist/native/charts/src/engine/controller.js +102 -104
  291. package/dist/native/charts/src/engine/controller.js.map +1 -1
  292. package/dist/native/charts/src/engine/labels.cjs +1 -1
  293. package/dist/native/charts/src/engine/labels.cjs.map +1 -1
  294. package/dist/native/charts/src/engine/labels.js +14 -1
  295. package/dist/native/charts/src/engine/labels.js.map +1 -1
  296. package/dist/native/charts/src/engine/model.cjs +1 -1
  297. package/dist/native/charts/src/engine/model.cjs.map +1 -1
  298. package/dist/native/charts/src/engine/model.js +180 -157
  299. package/dist/native/charts/src/engine/model.js.map +1 -1
  300. package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
  301. package/dist/native/charts/src/engine/overlay.js.map +1 -1
  302. package/dist/native/charts/src/engine/presets.cjs +1 -1
  303. package/dist/native/charts/src/engine/presets.cjs.map +1 -1
  304. package/dist/native/charts/src/engine/presets.js +8 -2
  305. package/dist/native/charts/src/engine/presets.js.map +1 -1
  306. package/dist/native/charts/src/engine/scene.cjs +1 -1
  307. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  308. package/dist/native/charts/src/engine/scene.js +188 -122
  309. package/dist/native/charts/src/engine/scene.js.map +1 -1
  310. package/dist/native/charts/src/engine/shapes/chord.cjs +1 -1
  311. package/dist/native/charts/src/engine/shapes/chord.cjs.map +1 -1
  312. package/dist/native/charts/src/engine/shapes/chord.js +108 -103
  313. package/dist/native/charts/src/engine/shapes/chord.js.map +1 -1
  314. package/dist/native/charts/src/engine/shapes/layout.cjs +2 -2
  315. package/dist/native/charts/src/engine/shapes/layout.cjs.map +1 -1
  316. package/dist/native/charts/src/engine/shapes/layout.js +88 -73
  317. package/dist/native/charts/src/engine/shapes/layout.js.map +1 -1
  318. package/dist/native/components/Chart/ChartBase.cjs +1 -1
  319. package/dist/native/components/Chart/ChartBase.cjs.map +1 -1
  320. package/dist/native/components/Chart/ChartBase.js +127 -115
  321. package/dist/native/components/Chart/ChartBase.js.map +1 -1
  322. package/dist/native/components/Chart/charts.cjs +1 -1
  323. package/dist/native/components/Chart/charts.cjs.map +1 -1
  324. package/dist/native/components/Chart/charts.js +8 -5
  325. package/dist/native/components/Chart/charts.js.map +1 -1
  326. package/dist/native/components/Chart/scene.cjs +1 -1
  327. package/dist/native/components/Chart/scene.cjs.map +1 -1
  328. package/dist/native/components/Chart/scene.d.cts +6 -1
  329. package/dist/native/components/Chart/scene.d.ts +6 -1
  330. package/dist/native/components/Chart/scene.js +99 -50
  331. package/dist/native/components/Chart/scene.js.map +1 -1
  332. package/dist/native/components/Chart/types.d.cts +7 -1
  333. package/dist/native/components/Chart/types.d.ts +7 -1
  334. package/dist/native/components/Charts/charts.cjs +1 -1
  335. package/dist/native/components/Charts/charts.cjs.map +1 -1
  336. package/dist/native/components/Charts/charts.js +23 -18
  337. package/dist/native/components/Charts/charts.js.map +1 -1
  338. package/dist/native/components/ShapeChart/ShapeChartBase.cjs +1 -1
  339. package/dist/native/components/ShapeChart/ShapeChartBase.cjs.map +1 -1
  340. package/dist/native/components/ShapeChart/ShapeChartBase.d.cts +1 -1
  341. package/dist/native/components/ShapeChart/ShapeChartBase.d.ts +1 -1
  342. package/dist/native/components/ShapeChart/ShapeChartBase.js +97 -107
  343. package/dist/native/components/ShapeChart/ShapeChartBase.js.map +1 -1
  344. package/dist/native/components/ShapeChart/geometry.cjs +1 -1
  345. package/dist/native/components/ShapeChart/geometry.cjs.map +1 -1
  346. package/dist/native/components/ShapeChart/geometry.js +120 -36
  347. package/dist/native/components/ShapeChart/geometry.js.map +1 -1
  348. package/dist/native/components/ShapeChart/types.d.cts +6 -4
  349. package/dist/native/components/ShapeChart/types.d.ts +6 -4
  350. package/dist/native/source/components/Chart/ChartBase.tsx +19 -6
  351. package/dist/native/source/components/Chart/charts.tsx +10 -3
  352. package/dist/native/source/components/Chart/scene.tsx +85 -0
  353. package/dist/native/source/components/Chart/types.ts +7 -0
  354. package/dist/native/source/components/Charts/charts.tsx +7 -0
  355. package/dist/native/source/components/ShapeChart/ShapeChartBase.tsx +10 -36
  356. package/dist/native/source/components/ShapeChart/geometry.ts +188 -18
  357. package/dist/native/source/components/ShapeChart/types.ts +6 -4
  358. package/dist/taro/chart-a11y.d.ts +7 -0
  359. package/dist/taro/charts.d.ts +4 -1
  360. package/dist/taro/index.js +3212 -3049
  361. package/dist/taro/shape-charts.d.ts +6 -4
  362. package/dist/uni/AreaChart.vue +2 -1
  363. package/dist/uni/AreaChart.vue.d.ts +1 -1
  364. package/dist/uni/BarChart.vue +2 -1
  365. package/dist/uni/BarChart.vue.d.ts +1 -1
  366. package/dist/uni/BoxPlotChart.vue +2 -1
  367. package/dist/uni/BubbleChart.vue +2 -1
  368. package/dist/uni/CandlestickChart.vue +2 -1
  369. package/dist/uni/Chart.vue +2 -1
  370. package/dist/uni/Divider.vue.d.ts +1 -1
  371. package/dist/uni/DonutChart.vue.d.ts +1 -1
  372. package/dist/uni/GanttChart.vue +2 -1
  373. package/dist/uni/GanttChart.vue.d.ts +11 -0
  374. package/dist/uni/GaugeChart.vue.d.ts +1 -1
  375. package/dist/uni/HeatmapChart.vue +2 -1
  376. package/dist/uni/HistogramChart.vue +2 -1
  377. package/dist/uni/HorizontalBarChart.vue +2 -1
  378. package/dist/uni/HorizontalBarChart.vue.d.ts +1 -1
  379. package/dist/uni/LineChart.vue +2 -1
  380. package/dist/uni/MixedChart.vue +2 -1
  381. package/dist/uni/PieChart.vue.d.ts +1 -1
  382. package/dist/uni/QuadrantChart.vue +2 -1
  383. package/dist/uni/RangeAreaChart.vue +2 -1
  384. package/dist/uni/ScatterChart.vue +2 -1
  385. package/dist/uni/Sparkline.vue +2 -1
  386. package/dist/uni/WaterfallChart.vue +2 -1
  387. package/dist/uni/chart-a11y.d.ts +7 -0
  388. package/dist/uni/chart-a11y.js +29 -0
  389. package/dist/uni/chart-canvas.d.ts +9 -0
  390. package/dist/uni/chart-canvas.js +11 -1
  391. package/dist/uni/chart-types.d.ts +8 -1
  392. package/dist/uni/chart-types.js +5 -1
  393. package/dist/uni/charts-canvas.js +2 -1
  394. package/dist/uni/named-chart-options.d.ts +2 -0
  395. package/dist/uni/named-chart-options.js +3 -0
  396. package/dist/uni/shape-chart-canvas.d.ts +0 -2
  397. package/dist/uni/shape-chart-canvas.js +4 -36
  398. package/dist/uni/shape-chart-types.d.ts +2 -2
  399. package/dist/uni/shape-chart-types.js +2 -2
  400. package/dist/vue/components/Chart/Bar3DChart.vue.d.ts +2 -0
  401. package/dist/vue/components/Chart/DependencyGraph.vue.d.ts +2 -0
  402. package/dist/vue/components/Chart/GanttChart.vue.d.ts +15 -0
  403. package/dist/vue/components/Chart/GanttChart.vue.js.map +1 -1
  404. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js +8 -0
  405. package/dist/vue/components/Chart/GanttChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  406. package/dist/vue/components/Chart/GraphChart.vue.d.ts +2 -0
  407. package/dist/vue/components/Chart/Line3DChart.vue.d.ts +2 -0
  408. package/dist/vue/components/Chart/Scatter3DChart.vue.d.ts +2 -0
  409. package/dist/vue/components/Chart/Surface3DChart.vue.d.ts +2 -0
  410. package/dist/vue/components/Chart/TradingChart.vue.d.ts +9 -0
  411. package/dist/vue/components/Chart/TreeChart.vue.d.ts +2 -0
  412. package/dist/vue/components/Chart/graph.d.ts +3 -0
  413. package/dist/vue/components/Chart/graph.js +2 -0
  414. package/dist/vue/components/Chart/graph.js.map +1 -1
  415. package/dist/vue/components/Chart/three-d.d.ts +3 -0
  416. package/dist/vue/components/Chart/three-d.js +2 -0
  417. package/dist/vue/components/Chart/three-d.js.map +1 -1
  418. package/dist/vue/components/Chart/trading.d.ts +7 -2
  419. package/dist/vue/components/Chart/trading.js +1 -0
  420. package/dist/vue/components/Chart/trading.js.map +1 -1
  421. package/dist/weapp/area-chart/index.wxml +1 -1
  422. package/dist/weapp/bar-chart/index.wxml +1 -1
  423. package/dist/weapp/box-plot-chart/index.wxml +1 -1
  424. package/dist/weapp/bubble-chart/index.wxml +1 -1
  425. package/dist/weapp/candlestick-chart/index.wxml +1 -1
  426. package/dist/weapp/chart/index.wxml +1 -1
  427. package/dist/weapp/charts/canvas.js +326 -54
  428. package/dist/weapp/charts/core.js +2 -0
  429. package/dist/weapp/controls.js +58 -27
  430. package/dist/weapp/gantt-chart/index.wxml +1 -1
  431. package/dist/weapp/heatmap-chart/index.wxml +1 -1
  432. package/dist/weapp/histogram-chart/index.wxml +1 -1
  433. package/dist/weapp/horizontal-bar-chart/index.wxml +1 -1
  434. package/dist/weapp/line-chart/index.wxml +1 -1
  435. package/dist/weapp/mixed-chart/index.wxml +1 -1
  436. package/dist/weapp/quadrant-chart/index.wxml +1 -1
  437. package/dist/weapp/range-area-chart/index.wxml +1 -1
  438. package/dist/weapp/scatter-chart/index.wxml +1 -1
  439. package/dist/weapp/sparkline/index.wxml +1 -1
  440. package/dist/weapp/types.d.ts +11 -2
  441. package/dist/weapp/waterfall-chart/index.wxml +1 -1
  442. package/dist/web-components/components/chart/extended.d.ts +4 -0
  443. package/dist/web-components/components/chart/extended.js +8 -2
  444. package/dist/web-components/components/chart/extended.js.map +1 -1
  445. package/dist/web-components/components/chart-3d/chart-3d.d.ts +1 -1
  446. package/dist/web-components/components/chart-3d/chart-3d.js.map +1 -1
  447. package/dist/web-components/components/graph/graph.d.ts +2 -0
  448. package/dist/web-components/components/graph/graph.js +3 -2
  449. package/dist/web-components/components/graph/graph.js.map +1 -1
  450. package/dist/web-components/components/trading-chart/trading-chart.d.ts +1 -1
  451. package/dist/web-components/components/trading-chart/trading-chart.js.map +1 -1
  452. package/dist/web-components/html-custom-data.json +45 -0
  453. package/dist/web-components/types/react.d.ts +4 -4
  454. package/dist/web-components/types/solid.d.ts +8 -8
  455. package/dist/web-components/types/svelte.d.ts +8 -8
  456. package/dist/web-components/types/vue.d.ts +4 -4
  457. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- const e=require("./color.cjs"),t=require("./layout.cjs");var n=(e,t=e.fontSize,n=400)=>`${n} ${t}px ${e.fontFamily}`,r=e=>Math.round(e)+.5,i=(e,n,r,i)=>{let{plot:a}=n,o=t.toScreen(n,e.x??0,e.y??0),s=n.horizontal?{x:e.y===void 0,y:e.x===void 0}:{x:e.x===void 0,y:e.y===void 0},c=s.x?a.x+a.width/2:o.x,l=s.y?a.y+a.height/2:o.y,u=c-r/2,d=l-i/2;return e.anchor===`top`?d=l+6:e.anchor===`bottom`?d=l-6-i:e.anchor===`left`?u=c+6:e.anchor===`right`&&(u=c-6-r),u=Math.max(a.x+6,Math.min(u,a.x+a.width-6-r)),d=Math.max(a.y+2,Math.min(d,a.y+a.height-2-i)),{x:u,y:d,width:r,height:i}},a=(e,n)=>{let{plot:r}=n,[i,a]=n.horizontal?[r.y,r.y+r.height]:[r.x,r.x+r.width],[o,s]=n.horizontal?[r.x,r.x+r.width]:[r.y,r.y+r.height],c=(e,t,n)=>e<t?t:e>n?n:e;return t.screenRect(n,c(n.xToPx(e.x0??-1/0),i,a),c(n.xToPx(e.x1??1/0),i,a),c(n.yToPx(e.y0??-1/0),o,s),c(n.yToPx(e.y1??1/0),o,s))},o=(e,t)=>({vertical:e.axis===`x`!==t.horizontal,at:e.axis===`x`?t.xToPx(e.value):t.yToPx(e.value)}),s=(t,i)=>{let{scales:o,theme:s,xTicks:c,yTicks:l}=i,{plot:u}=o,d=o.horizontal?i.y:i.x,f=o.horizontal?i.x:i.y,p=o.horizontal?l:c,m=o.horizontal?c:l,h=o.horizontal?o.yToPx:o.xToPx,g=o.horizontal?o.xToPx:o.yToPx;t.clearRect(0,0,i.width,i.height),t.save(),t.beginPath(),t.rect(u.x,u.y,u.width,u.height),t.clip();for(let n of i.annotations){if(n.type!==`rect`)continue;let r=a(n,o);r.width<=0||r.height<=0||(t.fillStyle=e.toCss(n.color,n.opacity),t.fillRect(r.x,r.y,r.width,r.height))}if(t.restore(),t.lineWidth=1,t.strokeStyle=e.toCss(s.grid),t.beginPath(),f.grid)for(let e of m.values){let n=r(g(e));n<u.y-1||n>u.y+u.height+1||(t.moveTo(u.x,n),t.lineTo(u.x+u.width,n))}if(d.grid)for(let e of p.values){let n=r(h(e));n<u.x-1||n>u.x+u.width+1||(t.moveTo(n,u.y),t.lineTo(n,u.y+u.height))}t.stroke();let _=Math.ceil(s.fontSize*1.4);if(t.font=n(s),t.fillStyle=e.toCss(s.textMuted),d.visible){t.strokeStyle=e.toCss(s.axis),t.beginPath();let a=r(u.y+u.height);t.moveTo(u.x,a),t.lineTo(u.x+u.width,a),t.stroke(),t.textBaseline=`top`,t.textAlign=`center`;let o=-1/0,c=p.values.map((e,t)=>({px:h(e),text:p.labels[t]})).sort((e,t)=>e.px-t.px);for(let{px:e,text:n}of c){if(e<u.x-.5||e>u.x+u.width+.5)continue;let r=t.measureText(n).width,a=Math.max(0,Math.min(i.width-r,e-r/2));a<o+6||(o=a+r,t.fillText(n,a+r/2,u.y+u.height+7))}d.title&&(t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.fillText(d.title,u.x+u.width/2,u.y+u.height+_+10))}if(f.visible){t.font=n(s),t.fillStyle=e.toCss(s.textMuted),t.textAlign=`right`,t.textBaseline=`middle`;let r=-1/0,i=m.values.map((e,t)=>({py:g(e),text:m.labels[t]})).sort((e,t)=>e.py-t.py),a=s.fontSize+2;for(let{py:e,text:n}of i)if(!(e<u.y-.5||e>u.y+u.height+.5)){if(o.horizontal){if(e-a/2<r)continue;r=e+a/2}t.fillText(n,u.x-8,e)}f.title&&(t.save(),t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.translate(_/2+4,u.y+u.height/2),t.rotate(-Math.PI/2),t.textAlign=`center`,t.fillText(f.title,0,0),t.restore())}let v=o.horizontal?null:i.y2,y=i.y2Ticks;if(v&&y&&v.visible){let r=u.x+u.width;t.font=n(s),t.fillStyle=e.toCss(s.textMuted),t.textAlign=`left`,t.textBaseline=`middle`,y.values.forEach((e,n)=>{let i=o.yToPx(e);i<u.y-.5||i>u.y+u.height+.5||t.fillText(y.labels[n],r+8,i)}),v.title&&(t.save(),t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.translate(i.width-_/2-4,u.y+u.height/2),t.rotate(Math.PI/2),t.textAlign=`center`,t.fillText(v.title,0,0),t.restore())}},c=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,l=(e,t)=>e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height,u=(e,t,n,r,i,a)=>{e.lineWidth=3,e.lineJoin=`round`,e.strokeStyle=a,e.strokeText(t,n,r),e.fillStyle=i,e.fillText(t,n,r)},d=(e,t,n,r,i=[])=>{let a=[];for(let o of e){let e=n(o.text),s=o.r+4,u={x:o.x-e/2,y:o.y-s-r,width:e,height:r},d={x:o.x-e/2,y:o.y+s,width:e,height:r},f={x:o.x+s,y:o.y-r/2,width:e,height:r},p={x:o.x-s-e,y:o.y-r/2,width:e,height:r},m=(o.placement===`above`?[u]:o.placement===`below`?[d]:o.placement===`right`?[f,p]:o.placement===`left`?[p,f]:[{x:o.x+s,y:o.y-r/2,width:e,height:r},{x:o.x-s-e,y:o.y-r/2,width:e,height:r},u,d]).find(e=>l(e,t)&&!i.some(t=>c(t,e)));m&&(i.push(m),a.push({label:o,box:m}))}return a},f=(t,s)=>{let{scales:c,theme:l}=s,{plot:f}=c;s.clear!==!1&&t.clearRect(0,0,s.width,s.height),t.save(),t.beginPath(),t.rect(f.x,f.y,f.width,f.height),t.clip();for(let e of s.connectors??[]){t.strokeStyle=e.color,t.lineWidth=e.width,t.setLineDash([...e.dash]),t.beginPath();let n=e.y0===e.y1,i=n?e.x0:r(e.x0),a=n?r(e.y0):e.y0;t.moveTo(i,a),t.lineTo(n?e.x1:i,n?a:e.y1),t.stroke()}t.setLineDash([]);let p=e.toCss(l.background,.9),m=[],h=l.fontSize+4;for(let i of s.annotations){if(i.type!==`line`)continue;let a=e.toCss(i.color);t.strokeStyle=a,t.lineWidth=i.width,t.setLineDash(i.dash),t.beginPath();let s=o(i,c);if(s.vertical){let e=r(s.at);t.moveTo(e,f.y),t.lineTo(e,f.y+f.height),t.stroke(),i.label&&(t.setLineDash([]),t.font=n(l,l.fontSize,500),t.textAlign=`left`,t.textBaseline=`top`,u(t,i.label,e+5,f.y+5,a,p))}else{let e=r(s.at);t.moveTo(f.x,e),t.lineTo(f.x+f.width,e),t.stroke(),i.label&&(t.setLineDash([]),t.font=n(l,l.fontSize,500),t.textAlign=`right`,t.textBaseline=`bottom`,u(t,i.label,f.x+f.width-6,e-3,a,p))}}t.setLineDash([]),t.font=n(l,l.fontSize+1,600);for(let n of s.annotations){if(n.type!==`rect`||!n.label)continue;let r=a(n,c);if(r.width<=0||r.height<=0)continue;let i=t.measureText(n.label).width,o=n.labelPosition,s=o.endsWith(`left`)?r.x+10:o.endsWith(`right`)?r.x+r.width-10-i:r.x+(r.width-i)/2,l=o.startsWith(`top`)?r.y+10:o.startsWith(`bottom`)?r.y+r.height-10-h:r.y+(r.height-h)/2;t.textAlign=`left`,t.textBaseline=`top`,t.fillStyle=e.toCss(n.labelColor),t.fillText(n.label,s,l),m.push({x:s,y:l,width:i,height:h})}for(let r of s.annotations){if(r.type!==`text`||!r.text)continue;t.font=n(l,l.fontSize,r.weight);let a=i(r,c,t.measureText(r.text).width,h);t.textAlign=`left`,t.textBaseline=`middle`,u(t,r.text,a.x,a.y+a.height/2,e.toCss(r.color),p),m.push(a)}if(s.pointLabels.length){t.font=n(l),t.textAlign=`left`,t.textBaseline=`middle`;let r=e.toCss(l.text,.85),i=d(s.pointLabels,f,e=>t.measureText(e).width,h-2,m);for(let{label:e,box:n}of i)u(t,e.text,n.x,n.y+n.height/2,r,p)}t.restore()};exports.drawBackground=s,exports.drawForeground=f,exports.font=n,exports.lineOf=o,exports.placeLabels=d,exports.rectOf=a,exports.textBox=i;
1
+ const e=require("./color.cjs"),t=require("./layout.cjs");var n=(e,t=e.fontSize,n=400)=>`${n} ${t}px ${e.fontFamily}`,r=e=>Math.round(e)+.5,i=(e,n,r,i)=>{let{plot:a}=n,o=t.toScreen(n,e.x??0,e.y??0),s=n.horizontal?{x:e.y===void 0,y:e.x===void 0}:{x:e.x===void 0,y:e.y===void 0},c=s.x?a.x+a.width/2:o.x,l=s.y?a.y+a.height/2:o.y,u=c-r/2,d=l-i/2;return e.anchor===`top`?d=l+6:e.anchor===`bottom`?d=l-6-i:e.anchor===`left`?u=c+6:e.anchor===`right`&&(u=c-6-r),u=Math.max(a.x+6,Math.min(u,a.x+a.width-6-r)),d=Math.max(a.y+2,Math.min(d,a.y+a.height-2-i)),{x:u,y:d,width:r,height:i}},a=(e,n)=>{let{plot:r}=n,[i,a]=n.horizontal?[r.y,r.y+r.height]:[r.x,r.x+r.width],[o,s]=n.horizontal?[r.x,r.x+r.width]:[r.y,r.y+r.height],c=(e,t,n)=>e<t?t:e>n?n:e;return t.screenRect(n,c(n.xToPx(e.x0??-1/0),i,a),c(n.xToPx(e.x1??1/0),i,a),c(n.yToPx(e.y0??-1/0),o,s),c(n.yToPx(e.y1??1/0),o,s))},o=(e,t)=>({vertical:e.axis===`x`!==t.horizontal,at:e.axis===`x`?t.xToPx(e.value):t.yToPx(e.value)}),s=(t,i)=>{let{scales:o,theme:s,xTicks:c,yTicks:l}=i,{plot:u}=o,d=o.horizontal?i.y:i.x,f=o.horizontal?i.x:i.y,p=o.horizontal?l:c,m=o.horizontal?c:l,h=o.horizontal?o.yToPx:o.xToPx,g=o.horizontal?o.xToPx:o.yToPx;t.clearRect(0,0,i.width,i.height),t.save(),t.beginPath(),t.rect(u.x,u.y,u.width,u.height),t.clip();for(let n of i.annotations){if(n.type!==`rect`)continue;let r=a(n,o);r.width<=0||r.height<=0||(t.fillStyle=e.toCss(n.color,n.opacity),t.fillRect(r.x,r.y,r.width,r.height))}if(t.restore(),t.lineWidth=1,t.strokeStyle=e.toCss(s.grid),t.beginPath(),f.grid)for(let e of m.values){let n=r(g(e));n<u.y-1||n>u.y+u.height+1||(t.moveTo(u.x,n),t.lineTo(u.x+u.width,n))}if(d.grid)for(let e of p.values){let n=r(h(e));n<u.x-1||n>u.x+u.width+1||(t.moveTo(n,u.y),t.lineTo(n,u.y+u.height))}t.stroke();let _=Math.ceil(s.fontSize*1.4);if(t.font=n(s),t.fillStyle=e.toCss(s.textMuted),d.visible){t.strokeStyle=e.toCss(s.axis),t.beginPath();let a=r(u.y+u.height);t.moveTo(u.x,a),t.lineTo(u.x+u.width,a),t.stroke(),t.textBaseline=`top`,t.textAlign=`center`;let o=-1/0,c=p.values.map((e,t)=>({px:h(e),text:p.labels[t]})).sort((e,t)=>e.px-t.px);for(let{px:e,text:n}of c){if(e<u.x-.5||e>u.x+u.width+.5)continue;let r=t.measureText(n).width,a=Math.max(0,Math.min(i.width-r,e-r/2));a<o+6||(o=a+r,t.fillText(n,a+r/2,u.y+u.height+7))}d.title&&(t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.fillText(d.title,u.x+u.width/2,u.y+u.height+_+10))}if(f.visible){t.font=n(s),t.fillStyle=e.toCss(s.textMuted),t.textAlign=`right`,t.textBaseline=`middle`;let r=-1/0,i=m.values.map((e,t)=>({py:g(e),text:m.labels[t]})).sort((e,t)=>e.py-t.py),a=s.fontSize+2;for(let{py:e,text:n}of i)if(!(e<u.y-.5||e>u.y+u.height+.5)){if(o.horizontal){if(e-a/2<r)continue;r=e+a/2}t.fillText(n,u.x-8,e)}f.title&&(t.save(),t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.translate(_/2+4,u.y+u.height/2),t.rotate(-Math.PI/2),t.textAlign=`center`,t.fillText(f.title,0,0),t.restore())}let v=o.horizontal?null:i.y2,y=i.y2Ticks;if(v&&y&&v.visible){let r=u.x+u.width;t.font=n(s),t.fillStyle=e.toCss(s.textMuted),t.textAlign=`left`,t.textBaseline=`middle`,y.values.forEach((e,n)=>{let i=o.yToPx(e);i<u.y-.5||i>u.y+u.height+.5||t.fillText(y.labels[n],r+8,i)}),v.title&&(t.save(),t.font=n(s,s.fontSize+1,500),t.fillStyle=e.toCss(s.text,.8),t.translate(i.width-_/2-4,u.y+u.height/2),t.rotate(Math.PI/2),t.textAlign=`center`,t.fillText(v.title,0,0),t.restore())}},c=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,l=(e,t)=>e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height,u=(e,t,n,r,i,a)=>{e.lineWidth=3,e.lineJoin=`round`,e.strokeStyle=a,e.strokeText(t,n,r),e.fillStyle=i,e.fillText(t,n,r)},d=(e,t,n,r,i=[])=>{let a=[];for(let o of e){let e=n(o.text),s=o.r+4,u={x:o.x-e/2,y:o.y-s-r,width:e,height:r},d={x:o.x-e/2,y:o.y+s,width:e,height:r},f={x:o.x+s,y:o.y-r/2,width:e,height:r},p={x:o.x-s-e,y:o.y-r/2,width:e,height:r},m=(o.placement===`above`?[u]:o.placement===`below`?[d]:o.placement===`right`?[f,p]:o.placement===`left`?[p,f]:[{x:o.x+s,y:o.y-r/2,width:e,height:r},{x:o.x-s-e,y:o.y-r/2,width:e,height:r},u,d]).find(e=>l(e,t)&&!i.some(t=>c(t,e)));m&&(i.push(m),a.push({label:o,box:m}))}return a},f=(e,t)=>{for(let n of t){let t=n.points,r=t[0];if(!r)continue;e.strokeStyle=n.color,e.fillStyle=n.color,e.lineWidth=n.width,e.lineJoin=`round`,e.setLineDash([]),e.beginPath(),e.moveTo(r.x,r.y);for(let n=1;n<t.length;n++){let r=t[n],i=t[n+1],a=t[n-1];if(i&&typeof e.arcTo==`function`){let t=Math.min(4,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(i.x-r.x,i.y-r.y)/2);e.arcTo(r.x,r.y,i.x,i.y,t)}else e.lineTo(r.x,r.y)}e.stroke();let[i,a,o]=n.head;i&&a&&o&&(e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(a.x,a.y),e.lineTo(o.x,o.y),e.closePath(),e.fill())}},p=(t,s)=>{let{scales:c,theme:l}=s,{plot:p}=c;s.clear!==!1&&t.clearRect(0,0,s.width,s.height),t.save(),t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip();for(let e of s.connectors??[]){t.strokeStyle=e.color,t.lineWidth=e.width,t.setLineDash([...e.dash]),t.beginPath();let n=e.y0===e.y1,i=n?e.x0:r(e.x0),a=n?r(e.y0):e.y0;t.moveTo(i,a),t.lineTo(n?e.x1:i,n?a:e.y1),t.stroke()}t.setLineDash([]),s.arrows?.length&&f(t,s.arrows);let m=e.toCss(l.background,.9),h=[],g=l.fontSize+4;for(let i of s.annotations){if(i.type!==`line`)continue;let a=e.toCss(i.color);t.strokeStyle=a,t.lineWidth=i.width,t.setLineDash(i.dash),t.beginPath();let s=o(i,c);if(s.vertical){let e=r(s.at);t.moveTo(e,p.y),t.lineTo(e,p.y+p.height),t.stroke(),i.label&&(t.setLineDash([]),t.font=n(l,l.fontSize,500),t.textAlign=`left`,t.textBaseline=`top`,u(t,i.label,e+5,p.y+5,a,m))}else{let e=r(s.at);t.moveTo(p.x,e),t.lineTo(p.x+p.width,e),t.stroke(),i.label&&(t.setLineDash([]),t.font=n(l,l.fontSize,500),t.textAlign=`right`,t.textBaseline=`bottom`,u(t,i.label,p.x+p.width-6,e-3,a,m))}}t.setLineDash([]),t.font=n(l,l.fontSize+1,600);for(let n of s.annotations){if(n.type!==`rect`||!n.label)continue;let r=a(n,c);if(r.width<=0||r.height<=0)continue;let i=t.measureText(n.label).width,o=n.labelPosition,s=o.endsWith(`left`)?r.x+10:o.endsWith(`right`)?r.x+r.width-10-i:r.x+(r.width-i)/2,l=o.startsWith(`top`)?r.y+10:o.startsWith(`bottom`)?r.y+r.height-10-g:r.y+(r.height-g)/2;t.textAlign=`left`,t.textBaseline=`top`,t.fillStyle=e.toCss(n.labelColor),t.fillText(n.label,s,l),h.push({x:s,y:l,width:i,height:g})}for(let r of s.annotations){if(r.type!==`text`||!r.text)continue;t.font=n(l,l.fontSize,r.weight);let a=i(r,c,t.measureText(r.text).width,g);t.textAlign=`left`,t.textBaseline=`middle`,u(t,r.text,a.x,a.y+a.height/2,e.toCss(r.color),m),h.push(a)}if(s.pointLabels.length){t.font=n(l),t.textAlign=`left`,t.textBaseline=`middle`;let r=e.toCss(l.text,.85),i=d(s.pointLabels,p,e=>t.measureText(e).width,g-2,h);for(let{label:e,box:n}of i)u(t,e.text,n.x,n.y+n.height/2,r,m)}t.restore()};exports.drawArrows=f,exports.drawBackground=s,exports.drawForeground=p,exports.font=n,exports.lineOf=o,exports.placeLabels=d,exports.rectOf=a,exports.textBox=i;
2
2
  //# sourceMappingURL=overlay.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.cjs","names":["toScreen","screenRect","toCss","require_color","require_layout","font","theme","weight","size","crisp","v","textBox","s","at","a","free","px","plot","py","x","width","y","height","rectOf","xLo","xHi","yLo","yHi","along","lo","hi","lineOf","drawBackground","input","scales","bottomTicks","yTicks","xTicks","leftTicks","bottomPx","leftPx","ctx","line","base","lastRight","order","i","b","w","text","left","lastBottom","rows","rowHeight","y2","y2Ticks","right","overlaps","inside","r","haloText","halo","color","placeLabels","placed","label","labels","measure","gap","above","below","box","c","occupied","o","drawForeground","x0","y0","labelHeight","where","pos","tx","ty","textColor","t"],"sources":["../../../../charts/src/engine/overlay.ts"],"sourcesContent":["// Canvas2D layers around the data: background (areas, grid, axes, tick\n// labels) and foreground (reference lines, annotation and point labels).\n\nimport { toCss, type Rgba } from \"./color\";\nimport type { AxisTicks } from \"./axis\";\nimport { screenRect, toScreen, type Rect, type Scales } from \"./layout\";\nimport type { AxisModel } from \"./model\";\nimport type { ChartTheme } from \"./theme\";\nimport type { ChartLabelPosition } from \"./types\";\n\nexport interface ResolvedRect {\n type: \"rect\";\n x0?: number;\n x1?: number;\n y0?: number;\n y1?: number;\n color: Rgba;\n opacity: number;\n label?: string;\n labelPosition: ChartLabelPosition;\n labelColor: Rgba;\n}\n\nexport interface ResolvedLine {\n type: \"line\";\n axis: \"x\" | \"y\";\n value: number;\n color: Rgba;\n width: number;\n dash: number[];\n label?: string;\n}\n\nexport interface ResolvedText {\n type: \"text\";\n x?: number;\n y?: number;\n text: string;\n anchor: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n color: Rgba;\n weight: number;\n}\n\nexport type ResolvedAnnotation = ResolvedRect | ResolvedLine | ResolvedText;\n\nexport interface PointLabel {\n x: number;\n y: number;\n /** Radius of the dot */\n r: number;\n text: string;\n /**\n * Fixed side (bar values: above / below, left / right of horizontal\n * bars); any free side around the dot otherwise\n */\n placement?: \"above\" | \"below\" | \"left\" | \"right\";\n}\n\nexport const font = (theme: ChartTheme, size = theme.fontSize, weight = 400) =>\n `${weight} ${size}px ${theme.fontFamily}`;\n\nconst crisp = (v: number) => Math.round(v) + 0.5;\n\n/** Box of a text annotation, kept inside the plot */\nexport const textBox = (\n a: ResolvedText,\n s: Scales,\n width: number,\n height: number,\n): Rect => {\n const { plot } = s;\n const at = toScreen(s, a.x ?? 0, a.y ?? 0);\n const free = s.horizontal\n ? { x: a.y === undefined, y: a.x === undefined }\n : { x: a.x === undefined, y: a.y === undefined };\n const px = free.x ? plot.x + plot.width / 2 : at.x;\n const py = free.y ? plot.y + plot.height / 2 : at.y;\n const gap = 6;\n let x = px - width / 2;\n let y = py - height / 2;\n if (a.anchor === \"top\") y = py + gap;\n else if (a.anchor === \"bottom\") y = py - gap - height;\n else if (a.anchor === \"left\") x = px + gap;\n else if (a.anchor === \"right\") x = px - gap - width;\n x = Math.max(plot.x + gap, Math.min(x, plot.x + plot.width - gap - width));\n y = Math.max(plot.y + 2, Math.min(y, plot.y + plot.height - 2 - height));\n return { x, y, width, height };\n};\n\n/** Screen box of an area annotation, clipped to the plot */\nexport const rectOf = (a: ResolvedRect, s: Scales): Rect => {\n const { plot } = s;\n // clamp every edge to the plot first: an open edge maps to ±Infinity and\n // `Infinity - Infinity` would make the size NaN (nothing drawn)\n const [xLo, xHi] = s.horizontal\n ? [plot.y, plot.y + plot.height]\n : [plot.x, plot.x + plot.width];\n const [yLo, yHi] = s.horizontal\n ? [plot.x, plot.x + plot.width]\n : [plot.y, plot.y + plot.height];\n const along = (px: number, lo: number, hi: number) =>\n px < lo ? lo : px > hi ? hi : px;\n return screenRect(\n s,\n along(s.xToPx(a.x0 ?? -Infinity), xLo, xHi),\n along(s.xToPx(a.x1 ?? Infinity), xLo, xHi),\n along(s.yToPx(a.y0 ?? -Infinity), yLo, yHi),\n along(s.yToPx(a.y1 ?? Infinity), yLo, yHi),\n );\n};\n\n/**\n * Where a reference line goes: `vertical` lines run at screen x `at`,\n * horizontal ones at screen y `at`\n */\nexport const lineOf = (\n a: ResolvedLine,\n s: Scales,\n): { vertical: boolean; at: number } => {\n const vertical = (a.axis === \"x\") !== s.horizontal;\n return {\n vertical,\n at: a.axis === \"x\" ? s.xToPx(a.value) : s.yToPx(a.value),\n };\n};\n\nexport interface BackgroundInput {\n width: number;\n height: number;\n scales: Scales;\n x: AxisModel;\n y: AxisModel;\n xTicks: AxisTicks;\n yTicks: AxisTicks;\n /** Right axis (dual axis charts) */\n y2?: AxisModel | null;\n y2Ticks?: AxisTicks | null;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n}\n\nexport const drawBackground = (\n ctx: CanvasRenderingContext2D,\n input: BackgroundInput,\n) => {\n const { scales, theme, xTicks, yTicks } = input;\n const { plot } = scales;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const x = scales.horizontal ? input.y : input.x;\n const y = scales.horizontal ? input.x : input.y;\n const bottomTicks = scales.horizontal ? yTicks : xTicks;\n const leftTicks = scales.horizontal ? xTicks : yTicks;\n const bottomPx = scales.horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = scales.horizontal ? scales.xToPx : scales.yToPx;\n ctx.clearRect(0, 0, input.width, input.height);\n\n // areas\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n for (const a of input.annotations) {\n if (a.type !== \"rect\") continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n ctx.fillStyle = toCss(a.color, a.opacity);\n ctx.fillRect(r.x, r.y, r.width, r.height);\n }\n ctx.restore();\n\n // grid\n ctx.lineWidth = 1;\n ctx.strokeStyle = toCss(theme.grid);\n ctx.beginPath();\n if (y.grid) {\n for (const v of leftTicks.values) {\n const py = crisp(leftPx(v));\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) continue;\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n }\n }\n if (x.grid) {\n for (const v of bottomTicks.values) {\n const px = crisp(bottomPx(v));\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) continue;\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n }\n }\n ctx.stroke();\n\n const line = Math.ceil(theme.fontSize * 1.4);\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n\n // x axis\n if (x.visible) {\n ctx.strokeStyle = toCss(theme.axis);\n ctx.beginPath();\n const base = crisp(plot.y + plot.height);\n ctx.moveTo(plot.x, base);\n ctx.lineTo(plot.x + plot.width, base);\n ctx.stroke();\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"center\";\n let lastRight = -Infinity;\n // left to right (reversed axes list their ticks right to left)\n const order = bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] }))\n .sort((a, b) => a.px - b.px);\n for (const { px, text } of order) {\n if (px < plot.x - 0.5 || px > plot.x + plot.width + 0.5) continue;\n const w = ctx.measureText(text).width;\n const left = Math.max(0, Math.min(input.width - w, px - w / 2));\n if (left < lastRight + 6) continue;\n lastRight = left + w;\n ctx.fillText(text, left + w / 2, plot.y + plot.height + 7);\n }\n if (x.title) {\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.fillText(\n x.title,\n plot.x + plot.width / 2,\n plot.y + plot.height + line + 10,\n );\n }\n }\n\n // y axis\n if (y.visible) {\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"middle\";\n let lastBottom = -Infinity;\n // top to bottom: category rows of horizontal charts never overlap\n const rows = leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] }))\n .sort((a, b) => a.py - b.py);\n const rowHeight = theme.fontSize + 2;\n for (const { py, text } of rows) {\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) continue;\n if (scales.horizontal) {\n if (py - rowHeight / 2 < lastBottom) continue;\n lastBottom = py + rowHeight / 2;\n }\n ctx.fillText(text, plot.x - 8, py);\n }\n if (y.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(line / 2 + 4, plot.y + plot.height / 2);\n ctx.rotate(-Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y.title, 0, 0);\n ctx.restore();\n }\n }\n\n // right axis\n const y2 = scales.horizontal ? null : input.y2;\n const y2Ticks = input.y2Ticks;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n ctx.fillText(y2Ticks.labels[i], right + 8, py);\n });\n if (y2.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(input.width - line / 2 - 4, plot.y + plot.height / 2);\n ctx.rotate(Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y2.title, 0, 0);\n ctx.restore();\n }\n }\n};\n\nconst overlaps = (a: Rect, b: Rect) =>\n a.x < b.x + b.width &&\n b.x < a.x + a.width &&\n a.y < b.y + b.height &&\n b.y < a.y + a.height;\n\nconst inside = (r: Rect, plot: Rect) =>\n r.x >= plot.x &&\n r.y >= plot.y &&\n r.x + r.width <= plot.x + plot.width &&\n r.y + r.height <= plot.y + plot.height;\n\n/** Text with a halo in the background color (readable over data) */\nconst haloText = (\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n color: string,\n halo: string,\n) => {\n ctx.lineWidth = 3;\n ctx.lineJoin = \"round\";\n ctx.strokeStyle = halo;\n ctx.strokeText(text, x, y);\n ctx.fillStyle = color;\n ctx.fillText(text, x, y);\n};\n\n/** Greedy placement: right, left, above, below the dot; skipped when no slot is free */\nexport const placeLabels = (\n labels: readonly PointLabel[],\n plot: Rect,\n measure: (text: string) => number,\n height: number,\n occupied: Rect[] = [],\n): { label: PointLabel; box: Rect }[] => {\n const placed: { label: PointLabel; box: Rect }[] = [];\n for (const label of labels) {\n const w = measure(label.text);\n const gap = label.r + 4;\n const above = {\n x: label.x - w / 2,\n y: label.y - gap - height,\n width: w,\n height,\n };\n const below = { x: label.x - w / 2, y: label.y + gap, width: w, height };\n const right = {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const left = {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const candidates: Rect[] =\n label.placement === \"above\"\n ? [above]\n : label.placement === \"below\"\n ? [below]\n : label.placement === \"right\"\n ? [right, left]\n : label.placement === \"left\"\n ? [left, right]\n : [\n {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n },\n {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n },\n above,\n below,\n ];\n const box = candidates.find(\n (c) => inside(c, plot) && !occupied.some((o) => overlaps(o, c)),\n );\n if (!box) continue;\n occupied.push(box);\n placed.push({ label, box });\n }\n return placed;\n};\n\nexport interface ForegroundInput {\n width: number;\n height: number;\n scales: Scales;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n pointLabels: readonly PointLabel[];\n /**\n * Clears the canvas first (off when the layers share one canvas)\n * @default true\n */\n clear?: boolean;\n /** Lines between consecutive bars (waterfall connectors), drawn first */\n connectors?: readonly {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n color: string;\n width: number;\n dash: readonly number[];\n }[];\n}\n\nexport const drawForeground = (\n ctx: CanvasRenderingContext2D,\n input: ForegroundInput,\n) => {\n const { scales, theme } = input;\n const { plot } = scales;\n if (input.clear !== false) ctx.clearRect(0, 0, input.width, input.height);\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n\n for (const c of input.connectors ?? []) {\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.width;\n ctx.setLineDash([...c.dash]);\n ctx.beginPath();\n // crisp hairlines along the pixel grid\n const along = c.y0 === c.y1;\n const x0 = along ? c.x0 : crisp(c.x0);\n const y0 = along ? crisp(c.y0) : c.y0;\n ctx.moveTo(x0, y0);\n ctx.lineTo(along ? c.x1 : x0, along ? y0 : c.y1);\n ctx.stroke();\n }\n ctx.setLineDash([]);\n\n const halo = toCss(theme.background, 0.9);\n const occupied: Rect[] = [];\n const labelHeight = theme.fontSize + 4;\n\n for (const a of input.annotations) {\n if (a.type !== \"line\") continue;\n const color = toCss(a.color);\n ctx.strokeStyle = color;\n ctx.lineWidth = a.width;\n ctx.setLineDash(a.dash);\n ctx.beginPath();\n const where = lineOf(a, scales);\n if (!where.vertical) {\n const py = crisp(where.at);\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"bottom\";\n haloText(ctx, a.label, plot.x + plot.width - 6, py - 3, color, halo);\n }\n } else {\n const px = crisp(where.at);\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n haloText(ctx, a.label, px + 5, plot.y + 5, color, halo);\n }\n }\n }\n ctx.setLineDash([]);\n\n // labels of areas\n ctx.font = font(theme, theme.fontSize + 1, 600);\n for (const a of input.annotations) {\n if (a.type !== \"rect\" || !a.label) continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n const pad = 10;\n const w = ctx.measureText(a.label).width;\n const pos = a.labelPosition;\n const tx = pos.endsWith(\"left\")\n ? r.x + pad\n : pos.endsWith(\"right\")\n ? r.x + r.width - pad - w\n : r.x + (r.width - w) / 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 ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n ctx.fillStyle = toCss(a.labelColor);\n ctx.fillText(a.label, tx, ty);\n occupied.push({ x: tx, y: ty, width: w, height: labelHeight });\n }\n\n // free texts\n for (const a of input.annotations) {\n if (a.type !== \"text\" || !a.text) continue;\n ctx.font = font(theme, theme.fontSize, a.weight);\n const box = textBox(a, scales, ctx.measureText(a.text).width, labelHeight);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n haloText(ctx, a.text, box.x, box.y + box.height / 2, toCss(a.color), halo);\n occupied.push(box);\n }\n\n // point labels\n if (input.pointLabels.length) {\n ctx.font = font(theme);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n const textColor = toCss(theme.text, 0.85);\n const placed = placeLabels(\n input.pointLabels,\n plot,\n (t) => ctx.measureText(t).width,\n labelHeight - 2,\n occupied,\n );\n for (const { label, box } of placed) {\n haloText(ctx, label.text, box.x, box.y + box.height / 2, textColor, halo);\n }\n }\n ctx.restore();\n};\n"],"mappings":"yDA0DA,IAAaK,GAAQ,EAAmB,EAAOC,EAAM,SAAU,EAAS,MACtE,GAAGC,EAAO,GAAGC,EAAK,KAAKF,EAAM,aAEzBG,EAAS,GAAc,KAAK,MAAMC,CAAC,EAAI,GAGhCC,GACX,EACA,EACA,EACA,IACS,CACT,GAAM,CAAE,QAASC,EACXC,EAAKb,EAAAA,SAASY,EAAGE,EAAE,GAAK,EAAGA,EAAE,GAAK,CAAC,EACnCC,EAAOH,EAAE,WACX,CAAE,EAAGE,EAAE,IAAM,IAAA,GAAW,EAAGA,EAAE,IAAM,IAAA,EAAU,EAC7C,CAAE,EAAGA,EAAE,IAAM,IAAA,GAAW,EAAGA,EAAE,IAAM,IAAA,EAAU,EAC3CE,EAAKD,EAAK,EAAIE,EAAK,EAAIA,EAAK,MAAQ,EAAIJ,EAAG,EAC3CK,EAAKH,EAAK,EAAIE,EAAK,EAAIA,EAAK,OAAS,EAAIJ,EAAG,EAE9CM,EAAIH,EAAKI,EAAQ,EACjBC,EAAIH,EAAKI,EAAS,EAOtB,OANIR,EAAE,SAAW,MAAO,EAAII,EAAK,EACxBJ,EAAE,SAAW,SAAU,EAAII,EAAK,EAAMI,EACtCR,EAAE,SAAW,OAAQ,EAAIE,EAAK,EAC9BF,EAAE,SAAW,UAAS,EAAIE,EAAK,EAAM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C,CAAC,MAC1BN,EAAc,EACdL,CACF,EACA,IAAK,GAAM,CAAE,QAAO,SAAST,EAC3BJ,EAASnB,EAAKwB,EAAM,KAAMM,EAAI,EAAGA,EAAI,EAAIA,EAAI,OAAS,EAAGY,EAAWtB,CAAI,CAE5E,CACApB,EAAI,QAAQ,CACd"}
1
+ {"version":3,"file":"overlay.cjs","names":["toScreen","screenRect","toCss","require_color","require_layout","font","theme","weight","size","crisp","v","textBox","s","at","a","free","px","plot","py","x","width","y","height","rectOf","xLo","xHi","yLo","yHi","along","lo","hi","lineOf","drawBackground","input","scales","bottomTicks","yTicks","xTicks","leftTicks","bottomPx","leftPx","ctx","line","base","lastRight","order","i","b","w","text","left","lastBottom","rows","rowHeight","y2","y2Ticks","right","overlaps","inside","r","haloText","halo","color","placeLabels","placed","label","labels","measure","gap","above","below","box","c","occupied","o","drawArrows","arrows","pts","first","p","next","prev","tip","b0","b1","drawForeground","x0","y0","labelHeight","where","pos","tx","ty","textColor","t"],"sources":["../../../../charts/src/engine/overlay.ts"],"sourcesContent":["// Canvas2D layers around the data: background (areas, grid, axes, tick\n// labels) and foreground (reference lines, annotation and point labels).\n\nimport { toCss, type Rgba } from \"./color\";\nimport type { AxisTicks } from \"./axis\";\nimport { screenRect, toScreen, type Rect, type Scales } from \"./layout\";\nimport type { AxisModel } from \"./model\";\nimport type { ChartTheme } from \"./theme\";\nimport type { ChartLabelPosition } from \"./types\";\n\nexport interface ResolvedRect {\n type: \"rect\";\n x0?: number;\n x1?: number;\n y0?: number;\n y1?: number;\n color: Rgba;\n opacity: number;\n label?: string;\n labelPosition: ChartLabelPosition;\n labelColor: Rgba;\n}\n\nexport interface ResolvedLine {\n type: \"line\";\n axis: \"x\" | \"y\";\n value: number;\n color: Rgba;\n width: number;\n dash: number[];\n label?: string;\n}\n\nexport interface ResolvedText {\n type: \"text\";\n x?: number;\n y?: number;\n text: string;\n anchor: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n color: Rgba;\n weight: number;\n}\n\nexport type ResolvedAnnotation = ResolvedRect | ResolvedLine | ResolvedText;\n\nexport interface PointLabel {\n x: number;\n y: number;\n /** Radius of the dot */\n r: number;\n text: string;\n /**\n * Fixed side (bar values: above / below, left / right of horizontal\n * bars); any free side around the dot otherwise\n */\n placement?: \"above\" | \"below\" | \"left\" | \"right\";\n}\n\nexport const font = (theme: ChartTheme, size = theme.fontSize, weight = 400) =>\n `${weight} ${size}px ${theme.fontFamily}`;\n\nconst crisp = (v: number) => Math.round(v) + 0.5;\n\n/** Box of a text annotation, kept inside the plot */\nexport const textBox = (\n a: ResolvedText,\n s: Scales,\n width: number,\n height: number,\n): Rect => {\n const { plot } = s;\n const at = toScreen(s, a.x ?? 0, a.y ?? 0);\n const free = s.horizontal\n ? { x: a.y === undefined, y: a.x === undefined }\n : { x: a.x === undefined, y: a.y === undefined };\n const px = free.x ? plot.x + plot.width / 2 : at.x;\n const py = free.y ? plot.y + plot.height / 2 : at.y;\n const gap = 6;\n let x = px - width / 2;\n let y = py - height / 2;\n if (a.anchor === \"top\") y = py + gap;\n else if (a.anchor === \"bottom\") y = py - gap - height;\n else if (a.anchor === \"left\") x = px + gap;\n else if (a.anchor === \"right\") x = px - gap - width;\n x = Math.max(plot.x + gap, Math.min(x, plot.x + plot.width - gap - width));\n y = Math.max(plot.y + 2, Math.min(y, plot.y + plot.height - 2 - height));\n return { x, y, width, height };\n};\n\n/** Screen box of an area annotation, clipped to the plot */\nexport const rectOf = (a: ResolvedRect, s: Scales): Rect => {\n const { plot } = s;\n // clamp every edge to the plot first: an open edge maps to ±Infinity and\n // `Infinity - Infinity` would make the size NaN (nothing drawn)\n const [xLo, xHi] = s.horizontal\n ? [plot.y, plot.y + plot.height]\n : [plot.x, plot.x + plot.width];\n const [yLo, yHi] = s.horizontal\n ? [plot.x, plot.x + plot.width]\n : [plot.y, plot.y + plot.height];\n const along = (px: number, lo: number, hi: number) =>\n px < lo ? lo : px > hi ? hi : px;\n return screenRect(\n s,\n along(s.xToPx(a.x0 ?? -Infinity), xLo, xHi),\n along(s.xToPx(a.x1 ?? Infinity), xLo, xHi),\n along(s.yToPx(a.y0 ?? -Infinity), yLo, yHi),\n along(s.yToPx(a.y1 ?? Infinity), yLo, yHi),\n );\n};\n\n/**\n * Where a reference line goes: `vertical` lines run at screen x `at`,\n * horizontal ones at screen y `at`\n */\nexport const lineOf = (\n a: ResolvedLine,\n s: Scales,\n): { vertical: boolean; at: number } => {\n const vertical = (a.axis === \"x\") !== s.horizontal;\n return {\n vertical,\n at: a.axis === \"x\" ? s.xToPx(a.value) : s.yToPx(a.value),\n };\n};\n\nexport interface BackgroundInput {\n width: number;\n height: number;\n scales: Scales;\n x: AxisModel;\n y: AxisModel;\n xTicks: AxisTicks;\n yTicks: AxisTicks;\n /** Right axis (dual axis charts) */\n y2?: AxisModel | null;\n y2Ticks?: AxisTicks | null;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n}\n\nexport const drawBackground = (\n ctx: CanvasRenderingContext2D,\n input: BackgroundInput,\n) => {\n const { scales, theme, xTicks, yTicks } = input;\n const { plot } = scales;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const x = scales.horizontal ? input.y : input.x;\n const y = scales.horizontal ? input.x : input.y;\n const bottomTicks = scales.horizontal ? yTicks : xTicks;\n const leftTicks = scales.horizontal ? xTicks : yTicks;\n const bottomPx = scales.horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = scales.horizontal ? scales.xToPx : scales.yToPx;\n ctx.clearRect(0, 0, input.width, input.height);\n\n // areas\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n for (const a of input.annotations) {\n if (a.type !== \"rect\") continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n ctx.fillStyle = toCss(a.color, a.opacity);\n ctx.fillRect(r.x, r.y, r.width, r.height);\n }\n ctx.restore();\n\n // grid\n ctx.lineWidth = 1;\n ctx.strokeStyle = toCss(theme.grid);\n ctx.beginPath();\n if (y.grid) {\n for (const v of leftTicks.values) {\n const py = crisp(leftPx(v));\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) continue;\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n }\n }\n if (x.grid) {\n for (const v of bottomTicks.values) {\n const px = crisp(bottomPx(v));\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) continue;\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n }\n }\n ctx.stroke();\n\n const line = Math.ceil(theme.fontSize * 1.4);\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n\n // x axis\n if (x.visible) {\n ctx.strokeStyle = toCss(theme.axis);\n ctx.beginPath();\n const base = crisp(plot.y + plot.height);\n ctx.moveTo(plot.x, base);\n ctx.lineTo(plot.x + plot.width, base);\n ctx.stroke();\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"center\";\n let lastRight = -Infinity;\n // left to right (reversed axes list their ticks right to left)\n const order = bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] }))\n .sort((a, b) => a.px - b.px);\n for (const { px, text } of order) {\n if (px < plot.x - 0.5 || px > plot.x + plot.width + 0.5) continue;\n const w = ctx.measureText(text).width;\n const left = Math.max(0, Math.min(input.width - w, px - w / 2));\n if (left < lastRight + 6) continue;\n lastRight = left + w;\n ctx.fillText(text, left + w / 2, plot.y + plot.height + 7);\n }\n if (x.title) {\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.fillText(\n x.title,\n plot.x + plot.width / 2,\n plot.y + plot.height + line + 10,\n );\n }\n }\n\n // y axis\n if (y.visible) {\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"middle\";\n let lastBottom = -Infinity;\n // top to bottom: category rows of horizontal charts never overlap\n const rows = leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] }))\n .sort((a, b) => a.py - b.py);\n const rowHeight = theme.fontSize + 2;\n for (const { py, text } of rows) {\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) continue;\n if (scales.horizontal) {\n if (py - rowHeight / 2 < lastBottom) continue;\n lastBottom = py + rowHeight / 2;\n }\n ctx.fillText(text, plot.x - 8, py);\n }\n if (y.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(line / 2 + 4, plot.y + plot.height / 2);\n ctx.rotate(-Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y.title, 0, 0);\n ctx.restore();\n }\n }\n\n // right axis\n const y2 = scales.horizontal ? null : input.y2;\n const y2Ticks = input.y2Ticks;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n ctx.fillText(y2Ticks.labels[i], right + 8, py);\n });\n if (y2.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(input.width - line / 2 - 4, plot.y + plot.height / 2);\n ctx.rotate(Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y2.title, 0, 0);\n ctx.restore();\n }\n }\n};\n\nconst overlaps = (a: Rect, b: Rect) =>\n a.x < b.x + b.width &&\n b.x < a.x + a.width &&\n a.y < b.y + b.height &&\n b.y < a.y + a.height;\n\nconst inside = (r: Rect, plot: Rect) =>\n r.x >= plot.x &&\n r.y >= plot.y &&\n r.x + r.width <= plot.x + plot.width &&\n r.y + r.height <= plot.y + plot.height;\n\n/** Text with a halo in the background color (readable over data) */\nconst haloText = (\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n color: string,\n halo: string,\n) => {\n ctx.lineWidth = 3;\n ctx.lineJoin = \"round\";\n ctx.strokeStyle = halo;\n ctx.strokeText(text, x, y);\n ctx.fillStyle = color;\n ctx.fillText(text, x, y);\n};\n\n/** Greedy placement: right, left, above, below the dot; skipped when no slot is free */\nexport const placeLabels = (\n labels: readonly PointLabel[],\n plot: Rect,\n measure: (text: string) => number,\n height: number,\n occupied: Rect[] = [],\n): { label: PointLabel; box: Rect }[] => {\n const placed: { label: PointLabel; box: Rect }[] = [];\n for (const label of labels) {\n const w = measure(label.text);\n const gap = label.r + 4;\n const above = {\n x: label.x - w / 2,\n y: label.y - gap - height,\n width: w,\n height,\n };\n const below = { x: label.x - w / 2, y: label.y + gap, width: w, height };\n const right = {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const left = {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const candidates: Rect[] =\n label.placement === \"above\"\n ? [above]\n : label.placement === \"below\"\n ? [below]\n : label.placement === \"right\"\n ? [right, left]\n : label.placement === \"left\"\n ? [left, right]\n : [\n {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n },\n {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n },\n above,\n below,\n ];\n const box = candidates.find(\n (c) => inside(c, plot) && !occupied.some((o) => overlaps(o, c)),\n );\n if (!box) continue;\n occupied.push(box);\n placed.push({ label, box });\n }\n return placed;\n};\n\nexport interface ForegroundInput {\n width: number;\n height: number;\n scales: Scales;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n pointLabels: readonly PointLabel[];\n /**\n * Clears the canvas first (off when the layers share one canvas)\n * @default true\n */\n clear?: boolean;\n /** Lines between consecutive bars (waterfall connectors), drawn first */\n connectors?: readonly {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n color: string;\n width: number;\n dash: readonly number[];\n }[];\n /** Dependency arrows (Gantt charts), drawn over the connectors */\n arrows?: readonly ArrowPath[];\n}\n\n/** An elbow arrow in stage pixels (see `dependencyArrows`) */\nexport interface ArrowPath {\n points: readonly { x: number; y: number }[];\n head: readonly { x: number; y: number }[];\n color: string;\n width: number;\n}\n\n/** Elbow arrows: polylines with rounded corners and filled heads */\nexport const drawArrows = (\n ctx: CanvasRenderingContext2D,\n arrows: readonly ArrowPath[],\n) => {\n for (const a of arrows) {\n const pts = a.points;\n const first = pts[0];\n if (!first) continue;\n ctx.strokeStyle = a.color;\n ctx.fillStyle = a.color;\n ctx.lineWidth = a.width;\n ctx.lineJoin = \"round\";\n ctx.setLineDash([]);\n ctx.beginPath();\n ctx.moveTo(first.x, first.y);\n for (let i = 1; i < pts.length; i++) {\n const p = pts[i]!;\n const next = pts[i + 1];\n const prev = pts[i - 1]!;\n if (next && typeof ctx.arcTo === \"function\") {\n // rounded elbow, at most half of the shorter leg\n const r = Math.min(\n 4,\n Math.hypot(p.x - prev.x, p.y - prev.y) / 2,\n Math.hypot(next.x - p.x, next.y - p.y) / 2,\n );\n ctx.arcTo(p.x, p.y, next.x, next.y, r);\n } else {\n ctx.lineTo(p.x, p.y);\n }\n }\n ctx.stroke();\n const [tip, b0, b1] = a.head;\n if (tip && b0 && b1) {\n ctx.beginPath();\n ctx.moveTo(tip.x, tip.y);\n ctx.lineTo(b0.x, b0.y);\n ctx.lineTo(b1.x, b1.y);\n ctx.closePath();\n ctx.fill();\n }\n }\n};\n\nexport const drawForeground = (\n ctx: CanvasRenderingContext2D,\n input: ForegroundInput,\n) => {\n const { scales, theme } = input;\n const { plot } = scales;\n if (input.clear !== false) ctx.clearRect(0, 0, input.width, input.height);\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n\n for (const c of input.connectors ?? []) {\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.width;\n ctx.setLineDash([...c.dash]);\n ctx.beginPath();\n // crisp hairlines along the pixel grid\n const along = c.y0 === c.y1;\n const x0 = along ? c.x0 : crisp(c.x0);\n const y0 = along ? crisp(c.y0) : c.y0;\n ctx.moveTo(x0, y0);\n ctx.lineTo(along ? c.x1 : x0, along ? y0 : c.y1);\n ctx.stroke();\n }\n ctx.setLineDash([]);\n if (input.arrows?.length) drawArrows(ctx, input.arrows);\n\n const halo = toCss(theme.background, 0.9);\n const occupied: Rect[] = [];\n const labelHeight = theme.fontSize + 4;\n\n for (const a of input.annotations) {\n if (a.type !== \"line\") continue;\n const color = toCss(a.color);\n ctx.strokeStyle = color;\n ctx.lineWidth = a.width;\n ctx.setLineDash(a.dash);\n ctx.beginPath();\n const where = lineOf(a, scales);\n if (!where.vertical) {\n const py = crisp(where.at);\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"bottom\";\n haloText(ctx, a.label, plot.x + plot.width - 6, py - 3, color, halo);\n }\n } else {\n const px = crisp(where.at);\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n haloText(ctx, a.label, px + 5, plot.y + 5, color, halo);\n }\n }\n }\n ctx.setLineDash([]);\n\n // labels of areas\n ctx.font = font(theme, theme.fontSize + 1, 600);\n for (const a of input.annotations) {\n if (a.type !== \"rect\" || !a.label) continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n const pad = 10;\n const w = ctx.measureText(a.label).width;\n const pos = a.labelPosition;\n const tx = pos.endsWith(\"left\")\n ? r.x + pad\n : pos.endsWith(\"right\")\n ? r.x + r.width - pad - w\n : r.x + (r.width - w) / 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 ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n ctx.fillStyle = toCss(a.labelColor);\n ctx.fillText(a.label, tx, ty);\n occupied.push({ x: tx, y: ty, width: w, height: labelHeight });\n }\n\n // free texts\n for (const a of input.annotations) {\n if (a.type !== \"text\" || !a.text) continue;\n ctx.font = font(theme, theme.fontSize, a.weight);\n const box = textBox(a, scales, ctx.measureText(a.text).width, labelHeight);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n haloText(ctx, a.text, box.x, box.y + box.height / 2, toCss(a.color), halo);\n occupied.push(box);\n }\n\n // point labels\n if (input.pointLabels.length) {\n ctx.font = font(theme);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n const textColor = toCss(theme.text, 0.85);\n const placed = placeLabels(\n input.pointLabels,\n plot,\n (t) => ctx.measureText(t).width,\n labelHeight - 2,\n occupied,\n );\n for (const { label, box } of placed) {\n haloText(ctx, label.text, box.x, box.y + box.height / 2, textColor, halo);\n }\n }\n ctx.restore();\n};\n"],"mappings":"yDA0DA,IAAaK,GAAQ,EAAmB,EAAOC,EAAM,SAAU,EAAS,MACtE,GAAGC,EAAO,GAAGC,EAAK,KAAKF,EAAM,aAEzBG,EAAS,GAAc,KAAK,MAAMC,CAAC,EAAI,GAGhCC,GACX,EACA,EACA,EACA,IACS,CACT,GAAM,CAAE,QAASC,EACXC,EAAKb,EAAAA,SAASY,EAAGE,EAAE,GAAK,EAAGA,EAAE,GAAK,CAAC,EACnCC,EAAOH,EAAE,WACX,CAAE,EAAGE,EAAE,IAAM,IAAA,GAAW,EAAGA,EAAE,IAAM,IAAA,EAAU,EAC7C,CAAE,EAAGA,EAAE,IAAM,IAAA,GAAW,EAAGA,EAAE,IAAM,IAAA,EAAU,EAC3CE,EAAKD,EAAK,EAAIE,EAAK,EAAIA,EAAK,MAAQ,EAAI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,KAAK,EAAG+C,CAAI,EACzEY,EAAS,KAAKF,CAAG,CACnB,CAGA,GAAItC,EAAM,YAAY,OAAQ,CAC5B,EAAI,KAAO5B,EAAKC,CAAK,EACrB,EAAI,UAAY,OAChB,EAAI,aAAe,SACnB,IAAMuF,EAAY3F,EAAAA,MAAMI,EAAM,KAAM,GAAI,EAClC0D,EAASD,EACb9B,EAAM,YACNhB,EACC,GAAMwB,EAAI,YAAYqD,CAAC,CAAC,CAAC,MAC1BN,EAAc,EACdf,CACF,EACA,IAAK,GAAM,CAAE,QAAO,SAAST,EAC3BJ,EAASnB,EAAKwB,EAAM,KAAMM,EAAI,EAAGA,EAAI,EAAIA,EAAI,OAAS,EAAGsB,EAAWhC,CAAI,CAE5E,CACApB,EAAI,QAAQ,CACd"}
@@ -102,5 +102,22 @@ export interface ForegroundInput {
102
102
  width: number;
103
103
  dash: readonly number[];
104
104
  }[];
105
+ /** Dependency arrows (Gantt charts), drawn over the connectors */
106
+ arrows?: readonly ArrowPath[];
105
107
  }
108
+ /** An elbow arrow in stage pixels (see `dependencyArrows`) */
109
+ export interface ArrowPath {
110
+ points: readonly {
111
+ x: number;
112
+ y: number;
113
+ }[];
114
+ head: readonly {
115
+ x: number;
116
+ y: number;
117
+ }[];
118
+ color: string;
119
+ width: number;
120
+ }
121
+ /** Elbow arrows: polylines with rounded corners and filled heads */
122
+ export declare const drawArrows: (ctx: CanvasRenderingContext2D, arrows: readonly ArrowPath[]) => void;
106
123
  export declare const drawForeground: (ctx: CanvasRenderingContext2D, input: ForegroundInput) => void;
@@ -102,5 +102,22 @@ export interface ForegroundInput {
102
102
  width: number;
103
103
  dash: readonly number[];
104
104
  }[];
105
+ /** Dependency arrows (Gantt charts), drawn over the connectors */
106
+ arrows?: readonly ArrowPath[];
105
107
  }
108
+ /** An elbow arrow in stage pixels (see `dependencyArrows`) */
109
+ export interface ArrowPath {
110
+ points: readonly {
111
+ x: number;
112
+ y: number;
113
+ }[];
114
+ head: readonly {
115
+ x: number;
116
+ y: number;
117
+ }[];
118
+ color: string;
119
+ width: number;
120
+ }
121
+ /** Elbow arrows: polylines with rounded corners and filled heads */
122
+ export declare const drawArrows: (ctx: CanvasRenderingContext2D, arrows: readonly ArrowPath[]) => void;
106
123
  export declare const drawForeground: (ctx: CanvasRenderingContext2D, input: ForegroundInput) => void;
@@ -124,7 +124,23 @@ var r = (e, t = e.fontSize, n = 400) => `${n} ${t}px ${e.fontFamily}`, i = (e) =
124
124
  }));
125
125
  }
126
126
  return a;
127
- }, p = (t, n) => {
127
+ }, p = (e, t) => {
128
+ for (let n of t) {
129
+ let t = n.points, r = t[0];
130
+ if (!r) continue;
131
+ e.strokeStyle = n.color, e.fillStyle = n.color, e.lineWidth = n.width, e.lineJoin = "round", e.setLineDash([]), e.beginPath(), e.moveTo(r.x, r.y);
132
+ for (let n = 1; n < t.length; n++) {
133
+ let r = t[n], i = t[n + 1], a = t[n - 1];
134
+ if (i && typeof e.arcTo == "function") {
135
+ let t = Math.min(4, Math.hypot(r.x - a.x, r.y - a.y) / 2, Math.hypot(i.x - r.x, i.y - r.y) / 2);
136
+ e.arcTo(r.x, r.y, i.x, i.y, t);
137
+ } else e.lineTo(r.x, r.y);
138
+ }
139
+ e.stroke();
140
+ let [i, a, o] = n.head;
141
+ i && a && o && (e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(a.x, a.y), e.lineTo(o.x, o.y), e.closePath(), e.fill());
142
+ }
143
+ }, m = (t, n) => {
128
144
  let { scales: c, theme: l } = n, { plot: u } = c;
129
145
  n.clear !== !1 && t.clearRect(0, 0, n.width, n.height), t.save(), t.beginPath(), t.rect(u.x, u.y, u.width, u.height), t.clip();
130
146
  for (let e of n.connectors ?? []) {
@@ -132,8 +148,8 @@ var r = (e, t = e.fontSize, n = 400) => `${n} ${t}px ${e.fontFamily}`, i = (e) =
132
148
  let n = e.y0 === e.y1, r = n ? e.x0 : i(e.x0), a = n ? i(e.y0) : e.y0;
133
149
  t.moveTo(r, a), t.lineTo(n ? e.x1 : r, n ? a : e.y1), t.stroke();
134
150
  }
135
- t.setLineDash([]);
136
- let p = e(l.background, .9), m = [], h = l.fontSize + 4;
151
+ t.setLineDash([]), n.arrows?.length && p(t, n.arrows);
152
+ let m = e(l.background, .9), h = [], g = l.fontSize + 4;
137
153
  for (let a of n.annotations) {
138
154
  if (a.type !== "line") continue;
139
155
  let n = e(a.color);
@@ -141,10 +157,10 @@ var r = (e, t = e.fontSize, n = 400) => `${n} ${t}px ${e.fontFamily}`, i = (e) =
141
157
  let o = s(a, c);
142
158
  if (o.vertical) {
143
159
  let e = i(o.at);
144
- t.moveTo(e, u.y), t.lineTo(e, u.y + u.height), t.stroke(), a.label && (t.setLineDash([]), t.font = r(l, l.fontSize, 500), t.textAlign = "left", t.textBaseline = "top", d(t, a.label, e + 5, u.y + 5, n, p));
160
+ t.moveTo(e, u.y), t.lineTo(e, u.y + u.height), t.stroke(), a.label && (t.setLineDash([]), t.font = r(l, l.fontSize, 500), t.textAlign = "left", t.textBaseline = "top", d(t, a.label, e + 5, u.y + 5, n, m));
145
161
  } else {
146
162
  let e = i(o.at);
147
- t.moveTo(u.x, e), t.lineTo(u.x + u.width, e), t.stroke(), a.label && (t.setLineDash([]), t.font = r(l, l.fontSize, 500), t.textAlign = "right", t.textBaseline = "bottom", d(t, a.label, u.x + u.width - 6, e - 3, n, p));
163
+ t.moveTo(u.x, e), t.lineTo(u.x + u.width, e), t.stroke(), a.label && (t.setLineDash([]), t.font = r(l, l.fontSize, 500), t.textAlign = "right", t.textBaseline = "bottom", d(t, a.label, u.x + u.width - 6, e - 3, n, m));
148
164
  }
149
165
  }
150
166
  t.setLineDash([]), t.font = r(l, l.fontSize + 1, 600);
@@ -152,28 +168,28 @@ var r = (e, t = e.fontSize, n = 400) => `${n} ${t}px ${e.fontFamily}`, i = (e) =
152
168
  if (r.type !== "rect" || !r.label) continue;
153
169
  let n = o(r, c);
154
170
  if (n.width <= 0 || n.height <= 0) continue;
155
- let i = t.measureText(r.label).width, a = r.labelPosition, s = a.endsWith("left") ? n.x + 10 : a.endsWith("right") ? n.x + n.width - 10 - i : n.x + (n.width - i) / 2, l = a.startsWith("top") ? n.y + 10 : a.startsWith("bottom") ? n.y + n.height - 10 - h : n.y + (n.height - h) / 2;
156
- t.textAlign = "left", t.textBaseline = "top", t.fillStyle = e(r.labelColor), t.fillText(r.label, s, l), m.push({
171
+ let i = t.measureText(r.label).width, a = r.labelPosition, s = a.endsWith("left") ? n.x + 10 : a.endsWith("right") ? n.x + n.width - 10 - i : n.x + (n.width - i) / 2, l = a.startsWith("top") ? n.y + 10 : a.startsWith("bottom") ? n.y + n.height - 10 - g : n.y + (n.height - g) / 2;
172
+ t.textAlign = "left", t.textBaseline = "top", t.fillStyle = e(r.labelColor), t.fillText(r.label, s, l), h.push({
157
173
  x: s,
158
174
  y: l,
159
175
  width: i,
160
- height: h
176
+ height: g
161
177
  });
162
178
  }
163
179
  for (let i of n.annotations) {
164
180
  if (i.type !== "text" || !i.text) continue;
165
181
  t.font = r(l, l.fontSize, i.weight);
166
- let n = a(i, c, t.measureText(i.text).width, h);
167
- t.textAlign = "left", t.textBaseline = "middle", d(t, i.text, n.x, n.y + n.height / 2, e(i.color), p), m.push(n);
182
+ let n = a(i, c, t.measureText(i.text).width, g);
183
+ t.textAlign = "left", t.textBaseline = "middle", d(t, i.text, n.x, n.y + n.height / 2, e(i.color), m), h.push(n);
168
184
  }
169
185
  if (n.pointLabels.length) {
170
186
  t.font = r(l), t.textAlign = "left", t.textBaseline = "middle";
171
- let i = e(l.text, .85), a = f(n.pointLabels, u, (e) => t.measureText(e).width, h - 2, m);
172
- for (let { label: e, box: n } of a) d(t, e.text, n.x, n.y + n.height / 2, i, p);
187
+ let i = e(l.text, .85), a = f(n.pointLabels, u, (e) => t.measureText(e).width, g - 2, h);
188
+ for (let { label: e, box: n } of a) d(t, e.text, n.x, n.y + n.height / 2, i, m);
173
189
  }
174
190
  t.restore();
175
191
  };
176
192
  //#endregion
177
- export { c as drawBackground, p as drawForeground, r as font, s as lineOf, f as placeLabels, o as rectOf, a as textBox };
193
+ export { p as drawArrows, c as drawBackground, m as drawForeground, r as font, s as lineOf, f as placeLabels, o as rectOf, a as textBox };
178
194
 
179
195
  //# sourceMappingURL=overlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.js","names":["font","theme","weight","size","crisp","v","textBox","s","at","toScreen","a","free","px","plot","py","x","width","y","height","rectOf","xLo","xHi","yLo","yHi","along","lo","hi","screenRect","lineOf","drawBackground","input","scales","bottomTicks","yTicks","xTicks","leftTicks","bottomPx","leftPx","ctx","r","toCss","line","base","lastRight","order","i","b","w","text","left","lastBottom","rows","rowHeight","y2","y2Ticks","right","overlaps","inside","haloText","halo","color","placeLabels","placed","label","labels","measure","gap","above","below","box","c","occupied","o","drawForeground","x0","y0","labelHeight","where","pos","tx","ty","textColor","t"],"sources":["../../../../charts/src/engine/overlay.ts"],"sourcesContent":["// Canvas2D layers around the data: background (areas, grid, axes, tick\n// labels) and foreground (reference lines, annotation and point labels).\n\nimport { toCss, type Rgba } from \"./color\";\nimport type { AxisTicks } from \"./axis\";\nimport { screenRect, toScreen, type Rect, type Scales } from \"./layout\";\nimport type { AxisModel } from \"./model\";\nimport type { ChartTheme } from \"./theme\";\nimport type { ChartLabelPosition } from \"./types\";\n\nexport interface ResolvedRect {\n type: \"rect\";\n x0?: number;\n x1?: number;\n y0?: number;\n y1?: number;\n color: Rgba;\n opacity: number;\n label?: string;\n labelPosition: ChartLabelPosition;\n labelColor: Rgba;\n}\n\nexport interface ResolvedLine {\n type: \"line\";\n axis: \"x\" | \"y\";\n value: number;\n color: Rgba;\n width: number;\n dash: number[];\n label?: string;\n}\n\nexport interface ResolvedText {\n type: \"text\";\n x?: number;\n y?: number;\n text: string;\n anchor: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n color: Rgba;\n weight: number;\n}\n\nexport type ResolvedAnnotation = ResolvedRect | ResolvedLine | ResolvedText;\n\nexport interface PointLabel {\n x: number;\n y: number;\n /** Radius of the dot */\n r: number;\n text: string;\n /**\n * Fixed side (bar values: above / below, left / right of horizontal\n * bars); any free side around the dot otherwise\n */\n placement?: \"above\" | \"below\" | \"left\" | \"right\";\n}\n\nexport const font = (theme: ChartTheme, size = theme.fontSize, weight = 400) =>\n `${weight} ${size}px ${theme.fontFamily}`;\n\nconst crisp = (v: number) => Math.round(v) + 0.5;\n\n/** Box of a text annotation, kept inside the plot */\nexport const textBox = (\n a: ResolvedText,\n s: Scales,\n width: number,\n height: number,\n): Rect => {\n const { plot } = s;\n const at = toScreen(s, a.x ?? 0, a.y ?? 0);\n const free = s.horizontal\n ? { x: a.y === undefined, y: a.x === undefined }\n : { x: a.x === undefined, y: a.y === undefined };\n const px = free.x ? plot.x + plot.width / 2 : at.x;\n const py = free.y ? plot.y + plot.height / 2 : at.y;\n const gap = 6;\n let x = px - width / 2;\n let y = py - height / 2;\n if (a.anchor === \"top\") y = py + gap;\n else if (a.anchor === \"bottom\") y = py - gap - height;\n else if (a.anchor === \"left\") x = px + gap;\n else if (a.anchor === \"right\") x = px - gap - width;\n x = Math.max(plot.x + gap, Math.min(x, plot.x + plot.width - gap - width));\n y = Math.max(plot.y + 2, Math.min(y, plot.y + plot.height - 2 - height));\n return { x, y, width, height };\n};\n\n/** Screen box of an area annotation, clipped to the plot */\nexport const rectOf = (a: ResolvedRect, s: Scales): Rect => {\n const { plot } = s;\n // clamp every edge to the plot first: an open edge maps to ±Infinity and\n // `Infinity - Infinity` would make the size NaN (nothing drawn)\n const [xLo, xHi] = s.horizontal\n ? [plot.y, plot.y + plot.height]\n : [plot.x, plot.x + plot.width];\n const [yLo, yHi] = s.horizontal\n ? [plot.x, plot.x + plot.width]\n : [plot.y, plot.y + plot.height];\n const along = (px: number, lo: number, hi: number) =>\n px < lo ? lo : px > hi ? hi : px;\n return screenRect(\n s,\n along(s.xToPx(a.x0 ?? -Infinity), xLo, xHi),\n along(s.xToPx(a.x1 ?? Infinity), xLo, xHi),\n along(s.yToPx(a.y0 ?? -Infinity), yLo, yHi),\n along(s.yToPx(a.y1 ?? Infinity), yLo, yHi),\n );\n};\n\n/**\n * Where a reference line goes: `vertical` lines run at screen x `at`,\n * horizontal ones at screen y `at`\n */\nexport const lineOf = (\n a: ResolvedLine,\n s: Scales,\n): { vertical: boolean; at: number } => {\n const vertical = (a.axis === \"x\") !== s.horizontal;\n return {\n vertical,\n at: a.axis === \"x\" ? s.xToPx(a.value) : s.yToPx(a.value),\n };\n};\n\nexport interface BackgroundInput {\n width: number;\n height: number;\n scales: Scales;\n x: AxisModel;\n y: AxisModel;\n xTicks: AxisTicks;\n yTicks: AxisTicks;\n /** Right axis (dual axis charts) */\n y2?: AxisModel | null;\n y2Ticks?: AxisTicks | null;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n}\n\nexport const drawBackground = (\n ctx: CanvasRenderingContext2D,\n input: BackgroundInput,\n) => {\n const { scales, theme, xTicks, yTicks } = input;\n const { plot } = scales;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const x = scales.horizontal ? input.y : input.x;\n const y = scales.horizontal ? input.x : input.y;\n const bottomTicks = scales.horizontal ? yTicks : xTicks;\n const leftTicks = scales.horizontal ? xTicks : yTicks;\n const bottomPx = scales.horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = scales.horizontal ? scales.xToPx : scales.yToPx;\n ctx.clearRect(0, 0, input.width, input.height);\n\n // areas\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n for (const a of input.annotations) {\n if (a.type !== \"rect\") continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n ctx.fillStyle = toCss(a.color, a.opacity);\n ctx.fillRect(r.x, r.y, r.width, r.height);\n }\n ctx.restore();\n\n // grid\n ctx.lineWidth = 1;\n ctx.strokeStyle = toCss(theme.grid);\n ctx.beginPath();\n if (y.grid) {\n for (const v of leftTicks.values) {\n const py = crisp(leftPx(v));\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) continue;\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n }\n }\n if (x.grid) {\n for (const v of bottomTicks.values) {\n const px = crisp(bottomPx(v));\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) continue;\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n }\n }\n ctx.stroke();\n\n const line = Math.ceil(theme.fontSize * 1.4);\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n\n // x axis\n if (x.visible) {\n ctx.strokeStyle = toCss(theme.axis);\n ctx.beginPath();\n const base = crisp(plot.y + plot.height);\n ctx.moveTo(plot.x, base);\n ctx.lineTo(plot.x + plot.width, base);\n ctx.stroke();\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"center\";\n let lastRight = -Infinity;\n // left to right (reversed axes list their ticks right to left)\n const order = bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] }))\n .sort((a, b) => a.px - b.px);\n for (const { px, text } of order) {\n if (px < plot.x - 0.5 || px > plot.x + plot.width + 0.5) continue;\n const w = ctx.measureText(text).width;\n const left = Math.max(0, Math.min(input.width - w, px - w / 2));\n if (left < lastRight + 6) continue;\n lastRight = left + w;\n ctx.fillText(text, left + w / 2, plot.y + plot.height + 7);\n }\n if (x.title) {\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.fillText(\n x.title,\n plot.x + plot.width / 2,\n plot.y + plot.height + line + 10,\n );\n }\n }\n\n // y axis\n if (y.visible) {\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"middle\";\n let lastBottom = -Infinity;\n // top to bottom: category rows of horizontal charts never overlap\n const rows = leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] }))\n .sort((a, b) => a.py - b.py);\n const rowHeight = theme.fontSize + 2;\n for (const { py, text } of rows) {\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) continue;\n if (scales.horizontal) {\n if (py - rowHeight / 2 < lastBottom) continue;\n lastBottom = py + rowHeight / 2;\n }\n ctx.fillText(text, plot.x - 8, py);\n }\n if (y.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(line / 2 + 4, plot.y + plot.height / 2);\n ctx.rotate(-Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y.title, 0, 0);\n ctx.restore();\n }\n }\n\n // right axis\n const y2 = scales.horizontal ? null : input.y2;\n const y2Ticks = input.y2Ticks;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n ctx.fillText(y2Ticks.labels[i], right + 8, py);\n });\n if (y2.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(input.width - line / 2 - 4, plot.y + plot.height / 2);\n ctx.rotate(Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y2.title, 0, 0);\n ctx.restore();\n }\n }\n};\n\nconst overlaps = (a: Rect, b: Rect) =>\n a.x < b.x + b.width &&\n b.x < a.x + a.width &&\n a.y < b.y + b.height &&\n b.y < a.y + a.height;\n\nconst inside = (r: Rect, plot: Rect) =>\n r.x >= plot.x &&\n r.y >= plot.y &&\n r.x + r.width <= plot.x + plot.width &&\n r.y + r.height <= plot.y + plot.height;\n\n/** Text with a halo in the background color (readable over data) */\nconst haloText = (\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n color: string,\n halo: string,\n) => {\n ctx.lineWidth = 3;\n ctx.lineJoin = \"round\";\n ctx.strokeStyle = halo;\n ctx.strokeText(text, x, y);\n ctx.fillStyle = color;\n ctx.fillText(text, x, y);\n};\n\n/** Greedy placement: right, left, above, below the dot; skipped when no slot is free */\nexport const placeLabels = (\n labels: readonly PointLabel[],\n plot: Rect,\n measure: (text: string) => number,\n height: number,\n occupied: Rect[] = [],\n): { label: PointLabel; box: Rect }[] => {\n const placed: { label: PointLabel; box: Rect }[] = [];\n for (const label of labels) {\n const w = measure(label.text);\n const gap = label.r + 4;\n const above = {\n x: label.x - w / 2,\n y: label.y - gap - height,\n width: w,\n height,\n };\n const below = { x: label.x - w / 2, y: label.y + gap, width: w, height };\n const right = {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const left = {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const candidates: Rect[] =\n label.placement === \"above\"\n ? [above]\n : label.placement === \"below\"\n ? [below]\n : label.placement === \"right\"\n ? [right, left]\n : label.placement === \"left\"\n ? [left, right]\n : [\n {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n },\n {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n },\n above,\n below,\n ];\n const box = candidates.find(\n (c) => inside(c, plot) && !occupied.some((o) => overlaps(o, c)),\n );\n if (!box) continue;\n occupied.push(box);\n placed.push({ label, box });\n }\n return placed;\n};\n\nexport interface ForegroundInput {\n width: number;\n height: number;\n scales: Scales;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n pointLabels: readonly PointLabel[];\n /**\n * Clears the canvas first (off when the layers share one canvas)\n * @default true\n */\n clear?: boolean;\n /** Lines between consecutive bars (waterfall connectors), drawn first */\n connectors?: readonly {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n color: string;\n width: number;\n dash: readonly number[];\n }[];\n}\n\nexport const drawForeground = (\n ctx: CanvasRenderingContext2D,\n input: ForegroundInput,\n) => {\n const { scales, theme } = input;\n const { plot } = scales;\n if (input.clear !== false) ctx.clearRect(0, 0, input.width, input.height);\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n\n for (const c of input.connectors ?? []) {\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.width;\n ctx.setLineDash([...c.dash]);\n ctx.beginPath();\n // crisp hairlines along the pixel grid\n const along = c.y0 === c.y1;\n const x0 = along ? c.x0 : crisp(c.x0);\n const y0 = along ? crisp(c.y0) : c.y0;\n ctx.moveTo(x0, y0);\n ctx.lineTo(along ? c.x1 : x0, along ? y0 : c.y1);\n ctx.stroke();\n }\n ctx.setLineDash([]);\n\n const halo = toCss(theme.background, 0.9);\n const occupied: Rect[] = [];\n const labelHeight = theme.fontSize + 4;\n\n for (const a of input.annotations) {\n if (a.type !== \"line\") continue;\n const color = toCss(a.color);\n ctx.strokeStyle = color;\n ctx.lineWidth = a.width;\n ctx.setLineDash(a.dash);\n ctx.beginPath();\n const where = lineOf(a, scales);\n if (!where.vertical) {\n const py = crisp(where.at);\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"bottom\";\n haloText(ctx, a.label, plot.x + plot.width - 6, py - 3, color, halo);\n }\n } else {\n const px = crisp(where.at);\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n haloText(ctx, a.label, px + 5, plot.y + 5, color, halo);\n }\n }\n }\n ctx.setLineDash([]);\n\n // labels of areas\n ctx.font = font(theme, theme.fontSize + 1, 600);\n for (const a of input.annotations) {\n if (a.type !== \"rect\" || !a.label) continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n const pad = 10;\n const w = ctx.measureText(a.label).width;\n const pos = a.labelPosition;\n const tx = pos.endsWith(\"left\")\n ? r.x + pad\n : pos.endsWith(\"right\")\n ? r.x + r.width - pad - w\n : r.x + (r.width - w) / 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 ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n ctx.fillStyle = toCss(a.labelColor);\n ctx.fillText(a.label, tx, ty);\n occupied.push({ x: tx, y: ty, width: w, height: labelHeight });\n }\n\n // free texts\n for (const a of input.annotations) {\n if (a.type !== \"text\" || !a.text) continue;\n ctx.font = font(theme, theme.fontSize, a.weight);\n const box = textBox(a, scales, ctx.measureText(a.text).width, labelHeight);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n haloText(ctx, a.text, box.x, box.y + box.height / 2, toCss(a.color), halo);\n occupied.push(box);\n }\n\n // point labels\n if (input.pointLabels.length) {\n ctx.font = font(theme);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n const textColor = toCss(theme.text, 0.85);\n const placed = placeLabels(\n input.pointLabels,\n plot,\n (t) => ctx.measureText(t).width,\n labelHeight - 2,\n occupied,\n );\n for (const { label, box } of placed) {\n haloText(ctx, label.text, box.x, box.y + box.height / 2, textColor, halo);\n }\n }\n ctx.restore();\n};\n"],"mappings":";;;AA0DA,IAAaA,KAAQ,GAAmB,IAAOC,EAAM,UAAU,IAAS,QACtE,GAAGC,EAAO,GAAGC,EAAK,KAAKF,EAAM,cAEzBG,KAAS,MAAc,KAAK,MAAMC,CAAC,IAAI,IAGhCC,KACX,GACA,GACA,GACA,MACS;CACT,IAAM,EAAE,YAASC,GACXC,IAAKC,EAASF,GAAGG,EAAE,KAAK,GAAGA,EAAE,KAAK,CAAC,GACnCC,IAAOJ,EAAE,aACX;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AAE,MAAM;EAClC,EAAI,OAAOV,EAAKC,GAAOA,EAAM,UAAUS,EAAE,MAAM;EAC/C,IAAM2D,IAAM/D,EAAQI,GAAGqB,GAAQO,EAAI,YAAY5B,EAAE,IAAI,CAAC,CAAC,OAAOkE,CAAW;EAIzE,AAHA,EAAI,YAAY,QAChB,EAAI,eAAe,UACnBlB,EAASpB,GAAK5B,EAAE,MAAM2D,EAAI,GAAGA,EAAI,IAAIA,EAAI,SAAS,GAAG7B,EAAM9B,EAAE,KAAK,GAAGiD,CAAI,GACzEY,EAAS,KAAKF,CAAG;CACnB;CAGA,IAAIvC,EAAM,YAAY,QAAQ;EAG5B,AAFA,EAAI,OAAO9B,EAAKC,CAAK,GACrB,EAAI,YAAY,QAChB,EAAI,eAAe;EACnB,IAAMgF,IAAYzC,EAAMvC,EAAM,MAAM,GAAI,GAClC6D,IAASD,EACb/B,EAAM,aACNjB,IACC,MAAMyB,EAAI,YAAY4C,CAAC,CAAC,CAAC,OAC1BN,IAAc,GACdL,CACF;EACA,KAAK,IAAM,EAAE,UAAO,YAAST,GAC3B,EAASxB,GAAKyB,EAAM,MAAMM,EAAI,GAAGA,EAAI,IAAIA,EAAI,SAAS,GAAGY,GAAWtB,CAAI;CAE5E;CACA,EAAI,QAAQ;AACd"}
1
+ {"version":3,"file":"overlay.js","names":["font","theme","weight","size","crisp","v","textBox","s","at","toScreen","a","free","px","plot","py","x","width","y","height","rectOf","xLo","xHi","yLo","yHi","along","lo","hi","screenRect","lineOf","drawBackground","input","scales","bottomTicks","yTicks","xTicks","leftTicks","bottomPx","leftPx","ctx","r","toCss","line","base","lastRight","order","i","b","w","text","left","lastBottom","rows","rowHeight","y2","y2Ticks","right","overlaps","inside","haloText","halo","color","placeLabels","placed","label","labels","measure","gap","above","below","box","c","occupied","o","drawArrows","arrows","pts","first","p","next","prev","tip","b0","b1","drawForeground","x0","y0","labelHeight","where","pos","tx","ty","textColor","t"],"sources":["../../../../charts/src/engine/overlay.ts"],"sourcesContent":["// Canvas2D layers around the data: background (areas, grid, axes, tick\n// labels) and foreground (reference lines, annotation and point labels).\n\nimport { toCss, type Rgba } from \"./color\";\nimport type { AxisTicks } from \"./axis\";\nimport { screenRect, toScreen, type Rect, type Scales } from \"./layout\";\nimport type { AxisModel } from \"./model\";\nimport type { ChartTheme } from \"./theme\";\nimport type { ChartLabelPosition } from \"./types\";\n\nexport interface ResolvedRect {\n type: \"rect\";\n x0?: number;\n x1?: number;\n y0?: number;\n y1?: number;\n color: Rgba;\n opacity: number;\n label?: string;\n labelPosition: ChartLabelPosition;\n labelColor: Rgba;\n}\n\nexport interface ResolvedLine {\n type: \"line\";\n axis: \"x\" | \"y\";\n value: number;\n color: Rgba;\n width: number;\n dash: number[];\n label?: string;\n}\n\nexport interface ResolvedText {\n type: \"text\";\n x?: number;\n y?: number;\n text: string;\n anchor: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n color: Rgba;\n weight: number;\n}\n\nexport type ResolvedAnnotation = ResolvedRect | ResolvedLine | ResolvedText;\n\nexport interface PointLabel {\n x: number;\n y: number;\n /** Radius of the dot */\n r: number;\n text: string;\n /**\n * Fixed side (bar values: above / below, left / right of horizontal\n * bars); any free side around the dot otherwise\n */\n placement?: \"above\" | \"below\" | \"left\" | \"right\";\n}\n\nexport const font = (theme: ChartTheme, size = theme.fontSize, weight = 400) =>\n `${weight} ${size}px ${theme.fontFamily}`;\n\nconst crisp = (v: number) => Math.round(v) + 0.5;\n\n/** Box of a text annotation, kept inside the plot */\nexport const textBox = (\n a: ResolvedText,\n s: Scales,\n width: number,\n height: number,\n): Rect => {\n const { plot } = s;\n const at = toScreen(s, a.x ?? 0, a.y ?? 0);\n const free = s.horizontal\n ? { x: a.y === undefined, y: a.x === undefined }\n : { x: a.x === undefined, y: a.y === undefined };\n const px = free.x ? plot.x + plot.width / 2 : at.x;\n const py = free.y ? plot.y + plot.height / 2 : at.y;\n const gap = 6;\n let x = px - width / 2;\n let y = py - height / 2;\n if (a.anchor === \"top\") y = py + gap;\n else if (a.anchor === \"bottom\") y = py - gap - height;\n else if (a.anchor === \"left\") x = px + gap;\n else if (a.anchor === \"right\") x = px - gap - width;\n x = Math.max(plot.x + gap, Math.min(x, plot.x + plot.width - gap - width));\n y = Math.max(plot.y + 2, Math.min(y, plot.y + plot.height - 2 - height));\n return { x, y, width, height };\n};\n\n/** Screen box of an area annotation, clipped to the plot */\nexport const rectOf = (a: ResolvedRect, s: Scales): Rect => {\n const { plot } = s;\n // clamp every edge to the plot first: an open edge maps to ±Infinity and\n // `Infinity - Infinity` would make the size NaN (nothing drawn)\n const [xLo, xHi] = s.horizontal\n ? [plot.y, plot.y + plot.height]\n : [plot.x, plot.x + plot.width];\n const [yLo, yHi] = s.horizontal\n ? [plot.x, plot.x + plot.width]\n : [plot.y, plot.y + plot.height];\n const along = (px: number, lo: number, hi: number) =>\n px < lo ? lo : px > hi ? hi : px;\n return screenRect(\n s,\n along(s.xToPx(a.x0 ?? -Infinity), xLo, xHi),\n along(s.xToPx(a.x1 ?? Infinity), xLo, xHi),\n along(s.yToPx(a.y0 ?? -Infinity), yLo, yHi),\n along(s.yToPx(a.y1 ?? Infinity), yLo, yHi),\n );\n};\n\n/**\n * Where a reference line goes: `vertical` lines run at screen x `at`,\n * horizontal ones at screen y `at`\n */\nexport const lineOf = (\n a: ResolvedLine,\n s: Scales,\n): { vertical: boolean; at: number } => {\n const vertical = (a.axis === \"x\") !== s.horizontal;\n return {\n vertical,\n at: a.axis === \"x\" ? s.xToPx(a.value) : s.yToPx(a.value),\n };\n};\n\nexport interface BackgroundInput {\n width: number;\n height: number;\n scales: Scales;\n x: AxisModel;\n y: AxisModel;\n xTicks: AxisTicks;\n yTicks: AxisTicks;\n /** Right axis (dual axis charts) */\n y2?: AxisModel | null;\n y2Ticks?: AxisTicks | null;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n}\n\nexport const drawBackground = (\n ctx: CanvasRenderingContext2D,\n input: BackgroundInput,\n) => {\n const { scales, theme, xTicks, yTicks } = input;\n const { plot } = scales;\n // horizontal charts: the value axis along the bottom, the x axis on the left\n const x = scales.horizontal ? input.y : input.x;\n const y = scales.horizontal ? input.x : input.y;\n const bottomTicks = scales.horizontal ? yTicks : xTicks;\n const leftTicks = scales.horizontal ? xTicks : yTicks;\n const bottomPx = scales.horizontal ? scales.yToPx : scales.xToPx;\n const leftPx = scales.horizontal ? scales.xToPx : scales.yToPx;\n ctx.clearRect(0, 0, input.width, input.height);\n\n // areas\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n for (const a of input.annotations) {\n if (a.type !== \"rect\") continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n ctx.fillStyle = toCss(a.color, a.opacity);\n ctx.fillRect(r.x, r.y, r.width, r.height);\n }\n ctx.restore();\n\n // grid\n ctx.lineWidth = 1;\n ctx.strokeStyle = toCss(theme.grid);\n ctx.beginPath();\n if (y.grid) {\n for (const v of leftTicks.values) {\n const py = crisp(leftPx(v));\n if (py < plot.y - 1 || py > plot.y + plot.height + 1) continue;\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n }\n }\n if (x.grid) {\n for (const v of bottomTicks.values) {\n const px = crisp(bottomPx(v));\n if (px < plot.x - 1 || px > plot.x + plot.width + 1) continue;\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n }\n }\n ctx.stroke();\n\n const line = Math.ceil(theme.fontSize * 1.4);\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n\n // x axis\n if (x.visible) {\n ctx.strokeStyle = toCss(theme.axis);\n ctx.beginPath();\n const base = crisp(plot.y + plot.height);\n ctx.moveTo(plot.x, base);\n ctx.lineTo(plot.x + plot.width, base);\n ctx.stroke();\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"center\";\n let lastRight = -Infinity;\n // left to right (reversed axes list their ticks right to left)\n const order = bottomTicks.values\n .map((v, i) => ({ px: bottomPx(v), text: bottomTicks.labels[i] }))\n .sort((a, b) => a.px - b.px);\n for (const { px, text } of order) {\n if (px < plot.x - 0.5 || px > plot.x + plot.width + 0.5) continue;\n const w = ctx.measureText(text).width;\n const left = Math.max(0, Math.min(input.width - w, px - w / 2));\n if (left < lastRight + 6) continue;\n lastRight = left + w;\n ctx.fillText(text, left + w / 2, plot.y + plot.height + 7);\n }\n if (x.title) {\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.fillText(\n x.title,\n plot.x + plot.width / 2,\n plot.y + plot.height + line + 10,\n );\n }\n }\n\n // y axis\n if (y.visible) {\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"middle\";\n let lastBottom = -Infinity;\n // top to bottom: category rows of horizontal charts never overlap\n const rows = leftTicks.values\n .map((v, i) => ({ py: leftPx(v), text: leftTicks.labels[i] }))\n .sort((a, b) => a.py - b.py);\n const rowHeight = theme.fontSize + 2;\n for (const { py, text } of rows) {\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) continue;\n if (scales.horizontal) {\n if (py - rowHeight / 2 < lastBottom) continue;\n lastBottom = py + rowHeight / 2;\n }\n ctx.fillText(text, plot.x - 8, py);\n }\n if (y.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(line / 2 + 4, plot.y + plot.height / 2);\n ctx.rotate(-Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y.title, 0, 0);\n ctx.restore();\n }\n }\n\n // right axis\n const y2 = scales.horizontal ? null : input.y2;\n const y2Ticks = input.y2Ticks;\n if (y2 && y2Ticks && y2.visible) {\n const right = plot.x + plot.width;\n ctx.font = font(theme);\n ctx.fillStyle = toCss(theme.textMuted);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n y2Ticks.values.forEach((v, i) => {\n const py = scales.yToPx(v);\n if (py < plot.y - 0.5 || py > plot.y + plot.height + 0.5) return;\n ctx.fillText(y2Ticks.labels[i], right + 8, py);\n });\n if (y2.title) {\n ctx.save();\n ctx.font = font(theme, theme.fontSize + 1, 500);\n ctx.fillStyle = toCss(theme.text, 0.8);\n ctx.translate(input.width - line / 2 - 4, plot.y + plot.height / 2);\n ctx.rotate(Math.PI / 2);\n ctx.textAlign = \"center\";\n ctx.fillText(y2.title, 0, 0);\n ctx.restore();\n }\n }\n};\n\nconst overlaps = (a: Rect, b: Rect) =>\n a.x < b.x + b.width &&\n b.x < a.x + a.width &&\n a.y < b.y + b.height &&\n b.y < a.y + a.height;\n\nconst inside = (r: Rect, plot: Rect) =>\n r.x >= plot.x &&\n r.y >= plot.y &&\n r.x + r.width <= plot.x + plot.width &&\n r.y + r.height <= plot.y + plot.height;\n\n/** Text with a halo in the background color (readable over data) */\nconst haloText = (\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n color: string,\n halo: string,\n) => {\n ctx.lineWidth = 3;\n ctx.lineJoin = \"round\";\n ctx.strokeStyle = halo;\n ctx.strokeText(text, x, y);\n ctx.fillStyle = color;\n ctx.fillText(text, x, y);\n};\n\n/** Greedy placement: right, left, above, below the dot; skipped when no slot is free */\nexport const placeLabels = (\n labels: readonly PointLabel[],\n plot: Rect,\n measure: (text: string) => number,\n height: number,\n occupied: Rect[] = [],\n): { label: PointLabel; box: Rect }[] => {\n const placed: { label: PointLabel; box: Rect }[] = [];\n for (const label of labels) {\n const w = measure(label.text);\n const gap = label.r + 4;\n const above = {\n x: label.x - w / 2,\n y: label.y - gap - height,\n width: w,\n height,\n };\n const below = { x: label.x - w / 2, y: label.y + gap, width: w, height };\n const right = {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const left = {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n };\n const candidates: Rect[] =\n label.placement === \"above\"\n ? [above]\n : label.placement === \"below\"\n ? [below]\n : label.placement === \"right\"\n ? [right, left]\n : label.placement === \"left\"\n ? [left, right]\n : [\n {\n x: label.x + gap,\n y: label.y - height / 2,\n width: w,\n height,\n },\n {\n x: label.x - gap - w,\n y: label.y - height / 2,\n width: w,\n height,\n },\n above,\n below,\n ];\n const box = candidates.find(\n (c) => inside(c, plot) && !occupied.some((o) => overlaps(o, c)),\n );\n if (!box) continue;\n occupied.push(box);\n placed.push({ label, box });\n }\n return placed;\n};\n\nexport interface ForegroundInput {\n width: number;\n height: number;\n scales: Scales;\n theme: ChartTheme;\n annotations: readonly ResolvedAnnotation[];\n pointLabels: readonly PointLabel[];\n /**\n * Clears the canvas first (off when the layers share one canvas)\n * @default true\n */\n clear?: boolean;\n /** Lines between consecutive bars (waterfall connectors), drawn first */\n connectors?: readonly {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n color: string;\n width: number;\n dash: readonly number[];\n }[];\n /** Dependency arrows (Gantt charts), drawn over the connectors */\n arrows?: readonly ArrowPath[];\n}\n\n/** An elbow arrow in stage pixels (see `dependencyArrows`) */\nexport interface ArrowPath {\n points: readonly { x: number; y: number }[];\n head: readonly { x: number; y: number }[];\n color: string;\n width: number;\n}\n\n/** Elbow arrows: polylines with rounded corners and filled heads */\nexport const drawArrows = (\n ctx: CanvasRenderingContext2D,\n arrows: readonly ArrowPath[],\n) => {\n for (const a of arrows) {\n const pts = a.points;\n const first = pts[0];\n if (!first) continue;\n ctx.strokeStyle = a.color;\n ctx.fillStyle = a.color;\n ctx.lineWidth = a.width;\n ctx.lineJoin = \"round\";\n ctx.setLineDash([]);\n ctx.beginPath();\n ctx.moveTo(first.x, first.y);\n for (let i = 1; i < pts.length; i++) {\n const p = pts[i]!;\n const next = pts[i + 1];\n const prev = pts[i - 1]!;\n if (next && typeof ctx.arcTo === \"function\") {\n // rounded elbow, at most half of the shorter leg\n const r = Math.min(\n 4,\n Math.hypot(p.x - prev.x, p.y - prev.y) / 2,\n Math.hypot(next.x - p.x, next.y - p.y) / 2,\n );\n ctx.arcTo(p.x, p.y, next.x, next.y, r);\n } else {\n ctx.lineTo(p.x, p.y);\n }\n }\n ctx.stroke();\n const [tip, b0, b1] = a.head;\n if (tip && b0 && b1) {\n ctx.beginPath();\n ctx.moveTo(tip.x, tip.y);\n ctx.lineTo(b0.x, b0.y);\n ctx.lineTo(b1.x, b1.y);\n ctx.closePath();\n ctx.fill();\n }\n }\n};\n\nexport const drawForeground = (\n ctx: CanvasRenderingContext2D,\n input: ForegroundInput,\n) => {\n const { scales, theme } = input;\n const { plot } = scales;\n if (input.clear !== false) ctx.clearRect(0, 0, input.width, input.height);\n ctx.save();\n ctx.beginPath();\n ctx.rect(plot.x, plot.y, plot.width, plot.height);\n ctx.clip();\n\n for (const c of input.connectors ?? []) {\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.width;\n ctx.setLineDash([...c.dash]);\n ctx.beginPath();\n // crisp hairlines along the pixel grid\n const along = c.y0 === c.y1;\n const x0 = along ? c.x0 : crisp(c.x0);\n const y0 = along ? crisp(c.y0) : c.y0;\n ctx.moveTo(x0, y0);\n ctx.lineTo(along ? c.x1 : x0, along ? y0 : c.y1);\n ctx.stroke();\n }\n ctx.setLineDash([]);\n if (input.arrows?.length) drawArrows(ctx, input.arrows);\n\n const halo = toCss(theme.background, 0.9);\n const occupied: Rect[] = [];\n const labelHeight = theme.fontSize + 4;\n\n for (const a of input.annotations) {\n if (a.type !== \"line\") continue;\n const color = toCss(a.color);\n ctx.strokeStyle = color;\n ctx.lineWidth = a.width;\n ctx.setLineDash(a.dash);\n ctx.beginPath();\n const where = lineOf(a, scales);\n if (!where.vertical) {\n const py = crisp(where.at);\n ctx.moveTo(plot.x, py);\n ctx.lineTo(plot.x + plot.width, py);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"bottom\";\n haloText(ctx, a.label, plot.x + plot.width - 6, py - 3, color, halo);\n }\n } else {\n const px = crisp(where.at);\n ctx.moveTo(px, plot.y);\n ctx.lineTo(px, plot.y + plot.height);\n ctx.stroke();\n if (a.label) {\n ctx.setLineDash([]);\n ctx.font = font(theme, theme.fontSize, 500);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n haloText(ctx, a.label, px + 5, plot.y + 5, color, halo);\n }\n }\n }\n ctx.setLineDash([]);\n\n // labels of areas\n ctx.font = font(theme, theme.fontSize + 1, 600);\n for (const a of input.annotations) {\n if (a.type !== \"rect\" || !a.label) continue;\n const r = rectOf(a, scales);\n if (r.width <= 0 || r.height <= 0) continue;\n const pad = 10;\n const w = ctx.measureText(a.label).width;\n const pos = a.labelPosition;\n const tx = pos.endsWith(\"left\")\n ? r.x + pad\n : pos.endsWith(\"right\")\n ? r.x + r.width - pad - w\n : r.x + (r.width - w) / 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 ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n ctx.fillStyle = toCss(a.labelColor);\n ctx.fillText(a.label, tx, ty);\n occupied.push({ x: tx, y: ty, width: w, height: labelHeight });\n }\n\n // free texts\n for (const a of input.annotations) {\n if (a.type !== \"text\" || !a.text) continue;\n ctx.font = font(theme, theme.fontSize, a.weight);\n const box = textBox(a, scales, ctx.measureText(a.text).width, labelHeight);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n haloText(ctx, a.text, box.x, box.y + box.height / 2, toCss(a.color), halo);\n occupied.push(box);\n }\n\n // point labels\n if (input.pointLabels.length) {\n ctx.font = font(theme);\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n const textColor = toCss(theme.text, 0.85);\n const placed = placeLabels(\n input.pointLabels,\n plot,\n (t) => ctx.measureText(t).width,\n labelHeight - 2,\n occupied,\n );\n for (const { label, box } of placed)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en:{value:`Value`,values:`Values`,count:`Count`,change:`Change`,tasks:`Tasks`,progress:`Progress`,milestones:`Milestones`},zh:{value:`数值`,values:`数值`,count:`数量`,change:`变化`,tasks:`任务`,progress:`进度`,milestones:`里程碑`},ja:{value:`値`,values:`値`,count:`件数`,change:`増減`,tasks:`タスク`,progress:`進捗`,milestones:`マイルストーン`},fr:{value:`Valeur`,values:`Valeurs`,count:`Effectif`,change:`Variation`,tasks:`Tâches`,progress:`Avancement`,milestones:`Jalons`}},i=t=>e.localeLabels(r,t),a=(e,t,n,r)=>e.map(e=>{let i=e.type??t;return{...e,type:i,...n!==void 0&&i===t?{stack:e.stack??n}:{},...r!==void 0&&(i===`line`||i===`area`)?{curve:e.curve??r}:{}}}),o=(e,t=!1,n={})=>a(e,t?`area`:`line`,n.stacked?`stack`:void 0,n.curve),s=(e,t={})=>o(e,!0,t),c=(e,t=!1,n=!1)=>a(e,`bar`,t?`stack`:void 0).map(e=>n&&e.type===`bar`?{...e,showLabels:e.showLabels??!0}:e),l=e=>a(e,`scatter`),u=e=>a(e,`candlestick`),d=(e,t={})=>{let n=e.data.some(e=>typeof e.x==`number`),r=e.data.some(e=>typeof e.y==`number`);return{...t,series:[{id:`heatmap`,name:e.name??i(t.locale).value,type:`heatmap`,data:e.data.map(e=>({x:e.x,y:e.y,value:e.value})),colorScale:e.colorScale,valueRange:e.valueRange,colorMidpoint:e.colorMidpoint,radius:e.radius,format:e.format}],xAxis:{...n?{}:{type:`category`,categories:e.xCategories},grid:!1,...t.xAxis},yAxis:{...r?{}:{type:`category`,categories:e.yCategories},grid:!1,...t.yAxis},legend:t.legend??!0,interaction:t.interaction??{zoom:!1},tooltip:t.tooltip??{mode:`nearest`}}},f=(e,t={})=>{let n=e.type??`line`;return{...t,series:[{id:`sparkline`,name:e.name??i(t.locale).value,type:n,data:e.data,color:e.color,curve:n===`bar`?void 0:e.curve??`smooth`,lineWidth:1.5,opacity:n===`area`?.22:void 0,radius:n===`bar`?1.5:void 0,format:e.format}],xAxis:{visible:!1,grid:!1,...t.xAxis},yAxis:{visible:!1,grid:!1,nice:!1,...t.yAxis},legend:!1,padding:t.padding??{top:4,right:4,bottom:4,left:4},interaction:t.interaction??{zoom:!1},annotations:e.reference===void 0?t.annotations:[...t.annotations??[],{type:`line`,axis:`y`,value:e.reference,dash:[2,3]}]}},p={topLeft:`var(--danger-color, #ef4444)`,topRight:`var(--primary-color, #4f46e5)`,bottomLeft:`var(--warning-color, #f59e0b)`,bottomRight:`var(--text-secondary-color, #64748b)`},m=`var(--border-strong-color, var(--border-color, #cbd5e1))`,h=e=>{let[t,n]=e.xDomain??[0,10],[r,i]=e.yDomain??[0,10];return{x0:t,x1:n,y0:r,y1:i,xs:e.xSplit??(t+n)/2,ys:e.ySplit??(r+i)/2}},g=(e,t,n)=>{let{xs:r,ys:i}=h(e),a=e.reverseX?t<r:t>=r;return n>=i?a?`topRight`:`topLeft`:a?`bottomRight`:`bottomLeft`},_=(e,t)=>{let{x0:n,x1:r,y0:i,y1:a,xs:o,ys:s}=h(e),c=t.endsWith(`Right`);return{x:(e.reverseX?!c:c)?(o+r)/2:(n+o)/2,y:t.startsWith(`top`)?(s+a)/2:(i+s)/2}},v=(e,t={})=>{let{x0:n,x1:r,y0:i,y1:a,xs:o,ys:s}=h(e),c=!!e.reverseX,l=t=>e.quadrants?.[t]?.color??p[t],u=[{type:`scatter`,name:e.name??``,pointSize:e.pointSize??12,showLabels:e.showLabels??!0,opacity:.9,data:e.points.map(t=>({x:t.x,y:t.y,label:t.label,size:t.size,color:t.color??l(g(e,t.x,t.y))}))}],d=c?[o,r]:[n,o],f=c?[n,o]:[o,r],_=(t,[n,r],[i,a],o)=>({type:`rect`,x0:n,x1:r,y0:i,y1:a,color:l(t),opacity:.07,label:e.quadrants?.[t]?.label,labelPosition:o}),v=e.axisLabels??{},y=c?r:n,b=c?n:r,x=[...v.top?[{type:`text`,x:o,y:a,text:v.top,anchor:`top`}]:[],...v.bottom?[{type:`text`,x:o,y:i,text:v.bottom,anchor:`bottom`}]:[],...v.left?[{type:`text`,x:y,y:s,text:v.left,anchor:`left`}]:[],...v.right?[{type:`text`,x:b,y:s,text:v.right,anchor:`right`}]:[]],S=[_(`topLeft`,d,[s,a],`top-left`),_(`topRight`,f,[s,a],`top-right`),_(`bottomLeft`,d,[i,s],`bottom-left`),_(`bottomRight`,f,[i,s],`bottom-right`),{type:`line`,axis:`x`,value:o,dash:[],color:m},{type:`line`,axis:`y`,value:s,dash:[],color:m},...x,...t.annotations??[]],C=e.showTicks??!0,w=t.interaction!==!1&&{zoom:!1,...typeof t.interaction==`object`?t.interaction:{},...e.draggable?{dragPoints:!0}:{}};return{...t,series:u,annotations:S,tooltip:t.tooltip??(C?void 0:{render:t=>{let n=t.items[0];if(!n)return null;let r=e.quadrants?.[g(e,n.x,n.y)]?.label;return[n.label??e.name??``,r??``].filter(Boolean).join(`
2
- `)}}),xAxis:{min:n,max:r,title:e.xLabel,reverse:c,nice:!1,grid:!1,tickCount:4,visible:C||!!e.xLabel,...C?{}:{format:()=>``}},yAxis:{min:i,max:a,title:e.yLabel,nice:!1,grid:!1,tickCount:4,visible:C||!!e.yLabel,...C?{}:{format:()=>``}},legend:t.legend??!1,padding:t.padding??(C?void 0:{top:4,right:4,bottom:4,left:4}),interaction:w}},y=e=>{let t=0;for(let n=0;n<e.length;n++)Number.isFinite(e[n])&&t++;let n=new Float64Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];Number.isFinite(i)&&(n[r++]=i)}return n.sort()},b=(e,t)=>{let n=e.length;if(!n)return NaN;let r=Math.min(1,Math.max(0,t))*(n-1),i=Math.floor(r),a=Math.min(n-1,i+1);return e[i]+(e[a]-e[i])*(r-i)},x=(e,t)=>{let n=y(e);return t.map(e=>b(n,e))},S=1e5,C=(e,t={})=>{let r=0,i=1/0,a=-1/0;for(let t=0;t<e.length;t++){let n=e[t];Number.isFinite(n)&&(r++,n<i&&(i=n),n>a&&(a=n))}let[o,s]=t.domain??[i,a];if(!r||!Number.isFinite(o)||!Number.isFinite(s))return{edges:[0,1],counts:[0],width:1,total:0};o>s&&([o,s]=[s,o]),s===o&&(o-=.5,s+=.5);let c=s-o,l=t.bins??`auto`,u=Math.ceil(Math.log2(r))+1,d;if(typeof l==`number`)d=Math.round(l);else if(l===`sturges`)d=u;else{let t=Math.max(1,Math.floor(e.length/S)),n=[];for(let r=0;r<e.length;r+=t){let t=e[r];Number.isFinite(t)&&n.push(t)}let i=Float64Array.from(n).sort(),a=2*(b(i,.75)-b(i,.25))/Math.cbrt(r);d=a>0?Math.ceil(c/a):u}d=Math.max(1,Math.min(1e3,d||1));let f=c/d,p=o;(t.nice??!0)&&(f=n.tickStep(o,s,d)||f,p=Math.floor(o/f+1e-9)*f,d=Math.max(1,Math.ceil((s-p)/f-1e-9)));let m=p+d*f,h=Array(d).fill(0),g=0;for(let t=0;t<e.length;t++){let n=e[t];if(!(n>=p&&n<=m))continue;let r=Math.min(d-1,Math.floor((n-p)/f));h[r]++,g++}let _=[];for(let e=0;e<=d;e++)_.push(Number((p+e*f).toPrecision(12)));return{edges:_,counts:h,width:f,total:g}},w=(t,n={})=>{let r=n.binned??C(t,n),a=e.resolveLocale(n.locale),o=n.format??(e=>T(e,a));return{id:`histogram`,name:n.name??i(a).count,type:`bar`,color:n.color,barWidth:1,radius:1,data:r.counts.map((e,t)=>{let n=r.edges[t]??0,i=r.edges[t+1]??n;return{x:(n+i)/2,y:e,label:`${o(n)} – ${o(i)}`}})}},T=(t,n)=>e.numberFormat(n,{maximumSignificantDigits:6}).format(t),E=(e,t={})=>{let n=y(e),r=n.length;if(!r)return{low:NaN,q1:NaN,median:NaN,q3:NaN,high:NaN,outliers:[],min:NaN,max:NaN,mean:NaN,count:0};let i=b(n,.25),a=b(n,.5),o=b(n,.75),s=n[0],c=n[r-1],l=0;for(let e=0;e<r;e++)l+=n[e];let u=t.whisker??1.5,d=s,f=c,p=[];if(u!==`minmax`){let e=(o-i)*u,t=i-e,a=o+e,s=0;for(;s<r&&n[s]<t;)p.push(n[s++]);d=s<r?n[s]:i;let c=r-1,l=[];for(;c>=0&&n[c]>a;)l.push(n[c--]);f=c>=0?n[c]:o,p.push(...l.reverse())}return{low:Math.min(d,i),q1:i,median:a,q3:o,high:Math.max(f,o),outliers:p,min:s,max:c,mean:l/r,count:r}},D=(e,t={})=>e.map(e=>{let n=E(e.values,t);return{x:e.x,y:Number.isFinite(n.median)?n.median:null,low:n.low,q1:n.q1,q3:n.q3,high:n.high,outliers:n.outliers,...e.color?{color:e.color}:{}}}),O=e=>a(e,`boxplot`),k=(e,t={})=>{let n=t.upColor??`var(--success-color, #16a34a)`,r=t.downColor??`var(--danger-color, #dc2626)`,a=t.totalColor??`var(--primary-color, #4f46e5)`,o=t.start??0,s=e.map(e=>{if(e.kind===`total`||e.kind===`subtotal`)return{x:e.label,y:o,color:e.color??a};let t=e.value??0,i=o;return o+=t,{x:e.label,y0:i,y:o,color:e.color??(t>=0?n:r)}});return{id:`waterfall`,name:t.name??i(t.locale).change,type:`bar`,color:a,data:s,showLabels:t.labels??!1,format:t.format,connector:t.connector??!0}},A=(e,t={})=>{let n=t.minSize??6,r=t.maxSize??48,i=e=>{if(typeof e!=`object`||!e)return null;if(!(`length`in e))return e.value??null;let t=e,n=new Float64Array(t.length).fill(NaN);for(let e=0;e<t.length;e++){let r=t[e];if(r&&typeof r==`object`&&!Array.isArray(r)){let t=r.value;typeof t==`number`&&(n[e]=t)}}return n},a=t.maxValue??0;if(t.maxValue===void 0)for(let t of e){let e=i(t.data);if(e)for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>a&&(a=n)}}let o=e=>Number.isFinite(e)&&a>0?Math.max(n,r*Math.sqrt(Math.min(1,Math.abs(e)/a))):n;return e.map(e=>{let t={...e,type:e.type??`scatter`,opacity:e.opacity??.68};if(t.type!==`scatter`)return t;let n=e.data;if(typeof n==`object`&&n&&!(`length`in n)){let e=n.value;if(!e)return t;let r=new Float32Array(e.length);for(let t=0;t<e.length;t++)r[t]=o(e[t]);return{...t,data:{...n,size:r}}}let r=n,i=[];for(let e=0;e<r.length;e++){let t=r[e];if(!t||typeof t!=`object`||Array.isArray(t))continue;let n=t;i.push({...n,size:n.size??o(typeof n.value==`number`?n.value:NaN)})}return i.sort((e,t)=>(t.size??0)-(e.size??0)),{...t,data:i}})},j=[`--primary-color`,`--success-color`,`--warning-color`,`--danger-color`,`--info-color`],M=[`#4f46e5`,`#10b981`,`#f59e0b`,`#ef4444`,`#0ea5e9`,`#8b5cf6`,`#14b8a6`,`#f97316`],N=e=>{let t=e%8,n=M[t]??`#4f46e5`,r=j[t];return r?`var(--chart-series-${t+1}, var(${r}, ${n}))`:`var(--chart-series-${t+1}, ${n})`},P=e=>e instanceof Date?e.getTime():e===void 0?NaN:e,F=(n,r={})=>{let a=e.resolveLocale(r.locale),o=i(a),s=t.chartLabels(a),c=r.taskName??o.tasks,l=r.progressName??o.progress,u=/^(zh|ja)\b/i.test(a)?`、`:`, `,d=[];for(let e of n){let t=e.group??c;!e.milestone&&!d.includes(t)&&d.push(t)}let f=e=>{let t=Math.max(0,d.indexOf(e));return r.colors?.[t]??N(t)},p=r.formatProgress??(t=>e.numberFormat(a,{style:`percent`,maximumFractionDigits:0}).format(t)),m=d.map(e=>({id:`gantt:${e}`,name:e,type:`bar`,stack:`gantt`,color:f(e),opacity:.3,barWidth:.62,radius:4,data:n.filter(t=>!t.milestone&&(t.group??c)===e).map(e=>{let t=[];return e.progress!==void 0&&t.push({name:l,value:p(Math.min(1,Math.max(0,e.progress)))}),e.dependencies?.length&&t.push({name:r.dependenciesName??s.dependencies,value:e.dependencies.join(u)}),{x:e.name,y0:P(e.start),y:P(e.end??e.start),...e.color?{color:e.color}:{},...t.length?{details:t}:{}}})})),h=n.filter(e=>!e.milestone&&e.progress!==void 0&&e.progress>0);h.length&&m.push({id:`gantt:progress`,name:l,type:`bar`,stack:`gantt`,tooltip:!1,color:`var(--text-secondary-color, #6b7280)`,radius:4,data:h.map(e=>{let t=P(e.start),n=P(e.end??e.start),r=Math.min(1,Math.max(0,e.progress??0));return{x:e.name,y0:t,y:t+(n-t)*r,label:p(r),color:e.color??f(e.group??c)}})});let g=n.filter(e=>e.milestone);g.length&&m.push({id:`gantt:milestones`,name:r.milestoneName??o.milestones,type:`scatter`,color:`var(--text-color, #1f2937)`,pointSize:13,opacity:1,data:g.map(e=>({x:e.name,y:P(e.start),...e.color?{color:e.color}:{}}))});let _=1/0,v=-1/0;for(let e of n)for(let t of[P(e.start),P(e.end??e.start)])t<_&&(_=t),t>v&&(v=t);let y=Number.isFinite(v-_)?Math.max((v-_)*.025,1):0;return{series:m,categories:n.map(e=>e.name),domain:Number.isFinite(_)?[_-y,v+y]:[0,1]}},I=(e,t)=>a(e,`area`,void 0,t).map(e=>e.type===`area`?{...e,lineWidth:e.lineWidth??1.5}:e);exports.DEFAULT_QUADRANT_COLORS=p,exports.areaSeries=s,exports.barSeries=c,exports.binValues=C,exports.boxplotData=D,exports.boxplotSeries=O,exports.boxplotStats=E,exports.bubbleSeries=A,exports.candlestickSeries=u,exports.ganttSeries=F,exports.heatmapChartOptions=d,exports.histogramSeries=w,exports.lineSeries=o,exports.paletteColor=N,exports.presetLabels=i,exports.quadrantCenter=_,exports.quadrantChartOptions=v,exports.quadrantOf=g,exports.quantiles=x,exports.rangeAreaSeries=I,exports.scatterSeries=l,exports.sparklineOptions=f,exports.waterfallSeries=k,exports.withSeriesType=a;
2
+ `)}}),xAxis:{min:n,max:r,title:e.xLabel,reverse:c,nice:!1,grid:!1,tickCount:4,visible:C||!!e.xLabel,...C?{}:{format:()=>``}},yAxis:{min:i,max:a,title:e.yLabel,nice:!1,grid:!1,tickCount:4,visible:C||!!e.yLabel,...C?{}:{format:()=>``}},legend:t.legend??!1,padding:t.padding??(C?void 0:{top:4,right:4,bottom:4,left:4}),interaction:w}},y=e=>{let t=0;for(let n=0;n<e.length;n++)Number.isFinite(e[n])&&t++;let n=new Float64Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];Number.isFinite(i)&&(n[r++]=i)}return n.sort()},b=(e,t)=>{let n=e.length;if(!n)return NaN;let r=Math.min(1,Math.max(0,t))*(n-1),i=Math.floor(r),a=Math.min(n-1,i+1);return e[i]+(e[a]-e[i])*(r-i)},x=(e,t)=>{let n=y(e);return t.map(e=>b(n,e))},S=1e5,C=(e,t={})=>{let r=0,i=1/0,a=-1/0;for(let t=0;t<e.length;t++){let n=e[t];Number.isFinite(n)&&(r++,n<i&&(i=n),n>a&&(a=n))}let[o,s]=t.domain??[i,a];if(!r||!Number.isFinite(o)||!Number.isFinite(s))return{edges:[0,1],counts:[0],width:1,total:0};o>s&&([o,s]=[s,o]),s===o&&(o-=.5,s+=.5);let c=s-o,l=t.bins??`auto`,u=Math.ceil(Math.log2(r))+1,d;if(typeof l==`number`)d=Math.round(l);else if(l===`sturges`)d=u;else{let t=Math.max(1,Math.floor(e.length/S)),n=[];for(let r=0;r<e.length;r+=t){let t=e[r];Number.isFinite(t)&&n.push(t)}let i=Float64Array.from(n).sort(),a=2*(b(i,.75)-b(i,.25))/Math.cbrt(r);d=a>0?Math.ceil(c/a):u}d=Math.max(1,Math.min(1e3,d||1));let f=c/d,p=o;(t.nice??!0)&&(f=n.tickStep(o,s,d)||f,p=Math.floor(o/f+1e-9)*f,d=Math.max(1,Math.ceil((s-p)/f-1e-9)));let m=p+d*f,h=Array(d).fill(0),g=0;for(let t=0;t<e.length;t++){let n=e[t];if(!(n>=p&&n<=m))continue;let r=Math.min(d-1,Math.floor((n-p)/f));h[r]++,g++}let _=[];for(let e=0;e<=d;e++)_.push(Number((p+e*f).toPrecision(12)));return{edges:_,counts:h,width:f,total:g}},w=(t,n={})=>{let r=n.binned??C(t,n),a=e.resolveLocale(n.locale),o=n.format??(e=>T(e,a));return{id:`histogram`,name:n.name??i(a).count,type:`bar`,color:n.color,barWidth:1,radius:1,data:r.counts.map((e,t)=>{let n=r.edges[t]??0,i=r.edges[t+1]??n;return{x:(n+i)/2,y:e,label:`${o(n)} – ${o(i)}`}})}},T=(t,n)=>e.numberFormat(n,{maximumSignificantDigits:6}).format(t),E=(e,t={})=>{let n=y(e),r=n.length;if(!r)return{low:NaN,q1:NaN,median:NaN,q3:NaN,high:NaN,outliers:[],min:NaN,max:NaN,mean:NaN,count:0};let i=b(n,.25),a=b(n,.5),o=b(n,.75),s=n[0],c=n[r-1],l=0;for(let e=0;e<r;e++)l+=n[e];let u=t.whisker??1.5,d=s,f=c,p=[];if(u!==`minmax`){let e=(o-i)*u,t=i-e,a=o+e,s=0;for(;s<r&&n[s]<t;)p.push(n[s++]);d=s<r?n[s]:i;let c=r-1,l=[];for(;c>=0&&n[c]>a;)l.push(n[c--]);f=c>=0?n[c]:o,p.push(...l.reverse())}return{low:Math.min(d,i),q1:i,median:a,q3:o,high:Math.max(f,o),outliers:p,min:s,max:c,mean:l/r,count:r}},D=(e,t={})=>e.map(e=>{let n=E(e.values,t);return{x:e.x,y:Number.isFinite(n.median)?n.median:null,low:n.low,q1:n.q1,q3:n.q3,high:n.high,outliers:n.outliers,...e.color?{color:e.color}:{}}}),O=e=>a(e,`boxplot`),k=(e,t={})=>{let n=t.upColor??`var(--success-color, #16a34a)`,r=t.downColor??`var(--danger-color, #dc2626)`,a=t.totalColor??`var(--primary-color, #4f46e5)`,o=t.start??0,s=e.map(e=>{if(e.kind===`total`||e.kind===`subtotal`)return{x:e.label,y:o,color:e.color??a};let t=e.value??0,i=o;return o+=t,{x:e.label,y0:i,y:o,color:e.color??(t>=0?n:r)}});return{id:`waterfall`,name:t.name??i(t.locale).change,type:`bar`,color:a,data:s,showLabels:t.labels??!1,format:t.format,connector:t.connector??!0}},A=(e,t={})=>{let n=t.minSize??6,r=t.maxSize??48,i=e=>{if(typeof e!=`object`||!e)return null;if(!(`length`in e))return e.value??null;let t=e,n=new Float64Array(t.length).fill(NaN);for(let e=0;e<t.length;e++){let r=t[e];if(r&&typeof r==`object`&&!Array.isArray(r)){let t=r.value;typeof t==`number`&&(n[e]=t)}}return n},a=t.maxValue??0;if(t.maxValue===void 0)for(let t of e){let e=i(t.data);if(e)for(let t=0;t<e.length;t++){let n=Math.abs(e[t]);n>a&&(a=n)}}let o=e=>Number.isFinite(e)&&a>0?Math.max(n,r*Math.sqrt(Math.min(1,Math.abs(e)/a))):n;return e.map(e=>{let t={...e,type:e.type??`scatter`,opacity:e.opacity??.68};if(t.type!==`scatter`)return t;let n=e.data;if(typeof n==`object`&&n&&!(`length`in n)){let e=n.value;if(!e)return t;let r=new Float32Array(e.length);for(let t=0;t<e.length;t++)r[t]=o(e[t]);return{...t,data:{...n,size:r}}}let r=n,i=[];for(let e=0;e<r.length;e++){let t=r[e];if(!t||typeof t!=`object`||Array.isArray(t))continue;let n=t;i.push({...n,size:n.size??o(typeof n.value==`number`?n.value:NaN)})}return i.sort((e,t)=>(t.size??0)-(e.size??0)),{...t,data:i}})},j=[`--primary-color`,`--success-color`,`--warning-color`,`--danger-color`,`--info-color`],M=[`#4f46e5`,`#10b981`,`#f59e0b`,`#ef4444`,`#0ea5e9`,`#8b5cf6`,`#14b8a6`,`#f97316`],N=e=>{let t=e%8,n=M[t]??`#4f46e5`,r=j[t];return r?`var(--chart-series-${t+1}, var(${r}, ${n}))`:`var(--chart-series-${t+1}, ${n})`},P=e=>e instanceof Date?e.getTime():e===void 0?NaN:e,F=(n,r={})=>{let a=e.resolveLocale(r.locale),o=i(a),s=t.chartLabels(a),c=r.taskName??o.tasks,l=r.progressName??o.progress,u=/^(zh|ja)\b/i.test(a)?`、`:`, `,d=[];for(let e of n){let t=e.group??c;!e.milestone&&!d.includes(t)&&d.push(t)}let f=e=>{let t=Math.max(0,d.indexOf(e));return r.colors?.[t]??N(t)},p=r.formatProgress??(t=>e.numberFormat(a,{style:`percent`,maximumFractionDigits:0}).format(t)),m=d.map(e=>({id:`gantt:${e}`,name:e,type:`bar`,stack:`gantt`,color:f(e),opacity:.3,barWidth:.62,radius:4,data:n.filter(t=>!t.milestone&&(t.group??c)===e).map(e=>{let t=[];return e.progress!==void 0&&t.push({name:l,value:p(Math.min(1,Math.max(0,e.progress)))}),e.dependencies?.length&&t.push({name:r.dependenciesName??s.dependencies,value:e.dependencies.join(u)}),{x:e.name,y0:P(e.start),y:P(e.end??e.start),...e.color?{color:e.color}:{},...t.length?{details:t}:{}}})})),h=n.filter(e=>!e.milestone&&e.progress!==void 0&&e.progress>0);h.length&&m.push({id:`gantt:progress`,name:l,type:`bar`,stack:`gantt`,tooltip:!1,color:`var(--text-secondary-color, #6b7280)`,radius:4,data:h.map(e=>{let t=P(e.start),n=P(e.end??e.start),r=Math.min(1,Math.max(0,e.progress??0));return{x:e.name,y0:t,y:t+(n-t)*r,label:p(r),color:e.color??f(e.group??c)}})});let g=n.filter(e=>e.milestone);g.length&&m.push({id:`gantt:milestones`,name:r.milestoneName??o.milestones,type:`scatter`,color:`var(--text-color, #1f2937)`,pointSize:13,opacity:1,data:g.map(e=>({x:e.name,y:P(e.start),...e.color?{color:e.color}:{}}))});let _=1/0,v=-1/0;for(let e of n)for(let t of[P(e.start),P(e.end??e.start)])t<_&&(_=t),t>v&&(v=t);let y=Number.isFinite(v-_)?Math.max((v-_)*.025,1):0,b=new Set(n.map(e=>e.name)),x=[];if(r.dependencyArrows!==!1)for(let e of n)for(let t of e.dependencies??[])t!==e.name&&b.has(t)&&x.push({from:t,to:e.name,...r.dependencyColor?{color:r.dependencyColor}:{}});return{series:m,categories:n.map(e=>e.name),domain:Number.isFinite(_)?[_-y,v+y]:[0,1],dependencies:x}},I=(e,t)=>a(e,`area`,void 0,t).map(e=>e.type===`area`?{...e,lineWidth:e.lineWidth??1.5}:e);exports.DEFAULT_QUADRANT_COLORS=p,exports.areaSeries=s,exports.barSeries=c,exports.binValues=C,exports.boxplotData=D,exports.boxplotSeries=O,exports.boxplotStats=E,exports.bubbleSeries=A,exports.candlestickSeries=u,exports.ganttSeries=F,exports.heatmapChartOptions=d,exports.histogramSeries=w,exports.lineSeries=o,exports.paletteColor=N,exports.presetLabels=i,exports.quadrantCenter=_,exports.quadrantChartOptions=v,exports.quadrantOf=g,exports.quantiles=x,exports.rangeAreaSeries=I,exports.scatterSeries=l,exports.sparklineOptions=f,exports.waterfallSeries=k,exports.withSeriesType=a;
3
3
  //# sourceMappingURL=presets.cjs.map