@jimka/typescript-ui 0.6.0 → 0.8.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 (306) hide show
  1. package/dist/lib/AbstractInput-Dt9ooHjo.js +2 -0
  2. package/dist/lib/AbstractInput-Dt9ooHjo.js.map +1 -0
  3. package/dist/lib/AccordionConstraints-DahZEfEp.js +2 -0
  4. package/dist/lib/AccordionConstraints-DahZEfEp.js.map +1 -0
  5. package/dist/lib/{Anchor-CwRhdP2J.js → Anchor-DdYgyn2V.js} +2 -2
  6. package/dist/lib/{Anchor-CwRhdP2J.js.map → Anchor-DdYgyn2V.js.map} +1 -1
  7. package/dist/lib/AnimatedDropdown-_KhHzX5D.js +2 -0
  8. package/dist/lib/AnimatedDropdown-_KhHzX5D.js.map +1 -0
  9. package/dist/lib/Border-BELbqMDJ.js +2 -0
  10. package/dist/lib/Border-BELbqMDJ.js.map +1 -0
  11. package/dist/lib/Button-CKzjQyqA.js +2 -0
  12. package/dist/lib/Button-CKzjQyqA.js.map +1 -0
  13. package/dist/lib/{Card-QYo27r5b.js → Card-CAp7LcB5.js} +2 -2
  14. package/dist/lib/{Card-QYo27r5b.js.map → Card-CAp7LcB5.js.map} +1 -1
  15. package/dist/lib/Checkbox-CvAZJ4_T.js +2 -0
  16. package/dist/lib/Checkbox-CvAZJ4_T.js.map +1 -0
  17. package/dist/lib/CodeEditor-DoGGdL1Y.js +2 -0
  18. package/dist/lib/CodeEditor-DoGGdL1Y.js.map +1 -0
  19. package/dist/lib/ComboBox-DgjMnpdh.js +2 -0
  20. package/dist/lib/ComboBox-DgjMnpdh.js.map +1 -0
  21. package/dist/lib/Component-YrLXKJZS.js +2 -0
  22. package/dist/lib/Component-YrLXKJZS.js.map +1 -0
  23. package/dist/lib/Container-C5cxnioS.js +2 -0
  24. package/dist/lib/{Container-abY5Ww3W.js.map → Container-C5cxnioS.js.map} +1 -1
  25. package/dist/lib/DOM-DDhDN8lQ.js +2 -0
  26. package/dist/lib/DOM-DDhDN8lQ.js.map +1 -0
  27. package/dist/lib/Diagnostics-MI6Yw-3E.js +2 -0
  28. package/dist/lib/Diagnostics-MI6Yw-3E.js.map +1 -0
  29. package/dist/lib/Dialog-CXQXRQQK.js +2 -0
  30. package/dist/lib/Dialog-CXQXRQQK.js.map +1 -0
  31. package/dist/lib/DragManager-D5pBaPPg.js +2 -0
  32. package/dist/lib/DragManager-D5pBaPPg.js.map +1 -0
  33. package/dist/lib/{FieldDecorator-BlYMfZ9L.js → FieldDecorator-37IgKHHm.js} +2 -2
  34. package/dist/lib/{FieldDecorator-BlYMfZ9L.js.map → FieldDecorator-37IgKHHm.js.map} +1 -1
  35. package/dist/lib/{Fit-BhlB-HAo.js → Fit-amTWlJM2.js} +2 -2
  36. package/dist/lib/{Fit-BhlB-HAo.js.map → Fit-amTWlJM2.js.map} +1 -1
  37. package/dist/lib/{FloatingPanel-DkJXsZ2D.js → FloatingPanel-CwsFPYbc.js} +2 -2
  38. package/dist/lib/{FloatingPanel-DkJXsZ2D.js.map → FloatingPanel-CwsFPYbc.js.map} +1 -1
  39. package/dist/lib/Glyph-Cof7BxfJ.js +2 -0
  40. package/dist/lib/Glyph-Cof7BxfJ.js.map +1 -0
  41. package/dist/lib/{Grid-Daiz7F5d.js → Grid-BQZ4UIUH.js} +2 -2
  42. package/dist/lib/{Grid-Daiz7F5d.js.map → Grid-BQZ4UIUH.js.map} +1 -1
  43. package/dist/lib/GridConstraints-BkXa62z0.js +2 -0
  44. package/dist/lib/GridConstraints-BkXa62z0.js.map +1 -0
  45. package/dist/lib/{Header-Dql3Zxc6.js → Header-Cj33ABP1.js} +2 -2
  46. package/dist/lib/{Header-Dql3Zxc6.js.map → Header-Cj33ABP1.js.map} +1 -1
  47. package/dist/lib/{IconText-PUjhTLlp.js → IconText-Dp64iq_q.js} +2 -2
  48. package/dist/lib/{IconText-PUjhTLlp.js.map → IconText-Dp64iq_q.js.map} +1 -1
  49. package/dist/lib/LabeledGrid-Dpelrc1k.js +2 -0
  50. package/dist/lib/LabeledGrid-Dpelrc1k.js.map +1 -0
  51. package/dist/lib/LayoutSerialization-DgLJSuew.js +2 -0
  52. package/dist/lib/LayoutSerialization-DgLJSuew.js.map +1 -0
  53. package/dist/lib/Link-DE8tE3u3.js +2 -0
  54. package/dist/lib/Link-DE8tE3u3.js.map +1 -0
  55. package/dist/lib/List-TfgHScl3.js +2 -0
  56. package/dist/lib/List-TfgHScl3.js.map +1 -0
  57. package/dist/lib/ListenerBag-DYRl4TSb.js +2 -0
  58. package/dist/lib/ListenerBag-DYRl4TSb.js.map +1 -0
  59. package/dist/lib/{MemoryStore-DhPoU-7X.js → MemoryStore-ByGDEKYI.js} +2 -2
  60. package/dist/lib/{MemoryStore-DhPoU-7X.js.map → MemoryStore-ByGDEKYI.js.map} +1 -1
  61. package/dist/lib/Menu-BCQISKiQ.js +2 -0
  62. package/dist/lib/Menu-BCQISKiQ.js.map +1 -0
  63. package/dist/lib/{MenuButton-DCXi0tsP.js → MenuButton-BO4y3jf2.js} +2 -2
  64. package/dist/lib/{MenuButton-DCXi0tsP.js.map → MenuButton-BO4y3jf2.js.map} +1 -1
  65. package/dist/lib/{OverlayFade-3pof2AJH.js → OverlayFade-C1yQKffL.js} +2 -2
  66. package/dist/lib/{OverlayFade-3pof2AJH.js.map → OverlayFade-C1yQKffL.js.map} +1 -1
  67. package/dist/lib/{Panel-Cy1pdlWO.js → Panel-DlsVVuvn.js} +2 -2
  68. package/dist/lib/{Panel-Cy1pdlWO.js.map → Panel-DlsVVuvn.js.map} +1 -1
  69. package/dist/lib/{Position-BwtxouxK.js → Position-DWR1nIpA.js} +2 -2
  70. package/dist/lib/Position-DWR1nIpA.js.map +1 -0
  71. package/dist/lib/ProgressSpinner-BI9tFIVm.js +2 -0
  72. package/dist/lib/ProgressSpinner-BI9tFIVm.js.map +1 -0
  73. package/dist/lib/RadioButton-BxcuFChp.js +2 -0
  74. package/dist/lib/RadioButton-BxcuFChp.js.map +1 -0
  75. package/dist/lib/RadioMenuRow-B2bthoxj.js +2 -0
  76. package/dist/lib/RadioMenuRow-B2bthoxj.js.map +1 -0
  77. package/dist/lib/{RovingTabIndex-pHEv5oLD.js → RovingTabIndex-BttlsARv.js} +2 -2
  78. package/dist/lib/{RovingTabIndex-pHEv5oLD.js.map → RovingTabIndex-BttlsARv.js.map} +1 -1
  79. package/dist/lib/Scrollbar-orAWHWap.js +2 -0
  80. package/dist/lib/Scrollbar-orAWHWap.js.map +1 -0
  81. package/dist/lib/SelectableText-BbS_lRzY.js +2 -0
  82. package/dist/lib/SelectableText-BbS_lRzY.js.map +1 -0
  83. package/dist/lib/Slider-BvXc-cx5.js +2 -0
  84. package/dist/lib/Slider-BvXc-cx5.js.map +1 -0
  85. package/dist/lib/Spacer-C6faKe1V.js +2 -0
  86. package/dist/lib/Spacer-C6faKe1V.js.map +1 -0
  87. package/dist/lib/StyleTraits-CAtzeyRR.js +2 -0
  88. package/dist/lib/StyleTraits-CAtzeyRR.js.map +1 -0
  89. package/dist/lib/TabButton-BQDaBszs.js +2 -0
  90. package/dist/lib/TabButton-BQDaBszs.js.map +1 -0
  91. package/dist/lib/TabCloseButton-B-iLVPGZ.js +2 -0
  92. package/dist/lib/TabCloseButton-B-iLVPGZ.js.map +1 -0
  93. package/dist/lib/Table-3McEw5gr.js +7 -0
  94. package/dist/lib/Table-3McEw5gr.js.map +1 -0
  95. package/dist/lib/Text-CGFXPhHD.js +2 -0
  96. package/dist/lib/Text-CGFXPhHD.js.map +1 -0
  97. package/dist/lib/Tooltip-DgRHQZhL.js +3 -0
  98. package/dist/lib/Tooltip-DgRHQZhL.js.map +1 -0
  99. package/dist/lib/Tree-Bq2pjjAz.js +2 -0
  100. package/dist/lib/Tree-Bq2pjjAz.js.map +1 -0
  101. package/dist/lib/{VBox-DfJPWXqc.js → VBox-hFIZAEpT.js} +2 -2
  102. package/dist/lib/{VBox-DfJPWXqc.js.map → VBox-hFIZAEpT.js.map} +1 -1
  103. package/dist/lib/{VirtualScroller-DTIn19o1.js → VirtualScroller-Csa3GBSM.js} +2 -2
  104. package/dist/lib/{VirtualScroller-DTIn19o1.js.map → VirtualScroller-Csa3GBSM.js.map} +1 -1
  105. package/dist/lib/Window-CQ14_65z.js +2 -0
  106. package/dist/lib/Window-CQ14_65z.js.map +1 -0
  107. package/dist/lib/component/button.es.js +1 -1
  108. package/dist/lib/component/button.es.js.map +1 -1
  109. package/dist/lib/component/chart.es.js +1 -1
  110. package/dist/lib/component/chart.es.js.map +1 -1
  111. package/dist/lib/component/container.es.js +1 -1
  112. package/dist/lib/component/container.es.js.map +1 -1
  113. package/dist/lib/component/diagram.es.js +1 -1
  114. package/dist/lib/component/diagram.es.js.map +1 -1
  115. package/dist/lib/component/display.es.js +1 -1
  116. package/dist/lib/component/display.es.js.map +1 -1
  117. package/dist/lib/component/editor.es.js +2 -2
  118. package/dist/lib/component/editor.es.js.map +1 -1
  119. package/dist/lib/component/input.es.js +1 -1
  120. package/dist/lib/component/input.es.js.map +1 -1
  121. package/dist/lib/component/list.es.js +1 -1
  122. package/dist/lib/component/list.es.js.map +1 -1
  123. package/dist/lib/component/menubar.es.js +1 -1
  124. package/dist/lib/component/menubar.es.js.map +1 -1
  125. package/dist/lib/component/table.es.js +1 -6
  126. package/dist/lib/component/table.es.js.map +1 -1
  127. package/dist/lib/component/tree.es.js +1 -1
  128. package/dist/lib/component/tree.es.js.map +1 -1
  129. package/dist/lib/core-DpzpKLWE.js +2 -0
  130. package/dist/lib/core-DpzpKLWE.js.map +1 -0
  131. package/dist/lib/core.es.js +1 -2
  132. package/dist/lib/data.es.js +1 -1
  133. package/dist/lib/diagnostics.es.js +24 -0
  134. package/dist/lib/diagnostics.es.js.map +1 -0
  135. package/dist/lib/glyphs/solid/index.es.js +1 -1
  136. package/dist/lib/layout.es.js +1 -1
  137. package/dist/lib/layout.es.js.map +1 -1
  138. package/dist/lib/overlay.es.js +1 -1
  139. package/dist/lib/overlay.es.js.map +1 -1
  140. package/dist/lib/primitive-8YvORgGS.js +2 -0
  141. package/dist/lib/primitive-8YvORgGS.js.map +1 -0
  142. package/dist/lib/primitive.es.js +1 -2
  143. package/dist/lib/router.es.js +1 -1
  144. package/dist/lib/selectionsEqual-DWdW5pxP.js +2 -0
  145. package/dist/lib/{selectionsEqual-gMG7gCVI.js.map → selectionsEqual-DWdW5pxP.js.map} +1 -1
  146. package/dist/lib/types/component/button/Button.d.ts +7 -6
  147. package/dist/lib/types/component/button/TabButton.d.ts +3 -0
  148. package/dist/lib/types/component/button/TabCloseButton.d.ts +3 -0
  149. package/dist/lib/types/component/button/ToggleButton.d.ts +2 -2
  150. package/dist/lib/types/component/chart/AbstractChart.d.ts +2 -0
  151. package/dist/lib/types/component/container/AccordionHeader.d.ts +6 -1
  152. package/dist/lib/types/component/container/AccordionIndicator.d.ts +2 -0
  153. package/dist/lib/types/component/container/FieldSet.d.ts +2 -0
  154. package/dist/lib/types/component/container/LabeledFieldSet.d.ts +1 -1
  155. package/dist/lib/types/component/container/LabeledGrid.d.ts +4 -1
  156. package/dist/lib/types/component/container/Legend.d.ts +2 -2
  157. package/dist/lib/types/component/container/MenuItem.d.ts +1 -0
  158. package/dist/lib/types/component/container/WindowBorder.d.ts +2 -2
  159. package/dist/lib/types/component/container/WindowHeader.d.ts +6 -0
  160. package/dist/lib/types/component/diagram/DiagramEdgeLayer.d.ts +10 -0
  161. package/dist/lib/types/component/diagram/DiagramGroupNode.d.ts +2 -0
  162. package/dist/lib/types/component/diagram/DiagramNode.d.ts +6 -2
  163. package/dist/lib/types/component/diagram/DiagramNodeLayer.d.ts +25 -0
  164. package/dist/lib/types/component/diagram/DiagramResidency.d.ts +11 -0
  165. package/dist/lib/types/component/diagram/DiagramView.d.ts +22 -0
  166. package/dist/lib/types/component/display/Markdown.d.ts +2 -1
  167. package/dist/lib/types/component/input/AbstractCalendarDropdown.d.ts +4 -2
  168. package/dist/lib/types/component/input/AbstractInput.d.ts +1 -0
  169. package/dist/lib/types/component/input/AbstractPickerField.d.ts +4 -0
  170. package/dist/lib/types/component/input/AutoCompleteDropdown.d.ts +2 -0
  171. package/dist/lib/types/component/input/AutoCompleteField.d.ts +1 -0
  172. package/dist/lib/types/component/input/ComboBox.d.ts +6 -1
  173. package/dist/lib/types/component/input/Link.d.ts +2 -0
  174. package/dist/lib/types/component/input/PasswordField.d.ts +2 -0
  175. package/dist/lib/types/component/input/PickerButton.d.ts +5 -2
  176. package/dist/lib/types/component/input/PickerInput.d.ts +2 -0
  177. package/dist/lib/types/component/input/SelectableText.d.ts +11 -0
  178. package/dist/lib/types/component/input/SpinButton.d.ts +3 -0
  179. package/dist/lib/types/component/input/Text.d.ts +12 -2
  180. package/dist/lib/types/component/input/TextArea.d.ts +2 -0
  181. package/dist/lib/types/component/input/TextField.d.ts +2 -0
  182. package/dist/lib/types/component/input/TextInput.d.ts +4 -0
  183. package/dist/lib/types/component/input/TimePickerDropdown.d.ts +3 -1
  184. package/dist/lib/types/component/input/UsernameField.d.ts +2 -0
  185. package/dist/lib/types/component/input/index.d.ts +2 -0
  186. package/dist/lib/types/component/list/AbstractMarkerList.d.ts +2 -0
  187. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +6 -2
  188. package/dist/lib/types/component/list/ListItem.d.ts +2 -1
  189. package/dist/lib/types/component/menubar/MenuBarButton.d.ts +3 -0
  190. package/dist/lib/types/component/menubar/ToolBar.d.ts +2 -0
  191. package/dist/lib/types/component/table/Body.d.ts +54 -20
  192. package/dist/lib/types/component/table/Column.d.ts +2 -0
  193. package/dist/lib/types/component/table/ColumnConfig.d.ts +1 -0
  194. package/dist/lib/types/component/table/Footer.d.ts +2 -0
  195. package/dist/lib/types/component/table/Header.d.ts +8 -1
  196. package/dist/lib/types/component/table/Row.d.ts +22 -2
  197. package/dist/lib/types/component/table/Table.d.ts +6 -1
  198. package/dist/lib/types/component/table/TableExporter.d.ts +3 -0
  199. package/dist/lib/types/component/table/TablePanel.d.ts +6 -0
  200. package/dist/lib/types/component/table/TreeTablePanel.d.ts +6 -0
  201. package/dist/lib/types/component/table/cell/Cell.d.ts +8 -2
  202. package/dist/lib/types/component/table/cell/Default.d.ts +1 -1
  203. package/dist/lib/types/component/table/cell/Header.d.ts +4 -0
  204. package/dist/lib/types/component/table/cell/ParentHeader.d.ts +4 -0
  205. package/dist/lib/types/component/table/cell/ResizeHandle.d.ts +1 -1
  206. package/dist/lib/types/component/table/cell/renderer/CellRenderer.d.ts +2 -2
  207. package/dist/lib/types/component/table/cell/renderer/String.d.ts +3 -1
  208. package/dist/lib/types/component/table/index.d.ts +1 -1
  209. package/dist/lib/types/component/tree/TreeRow.d.ts +2 -0
  210. package/dist/lib/types/core/AnimatedDropdown.d.ts +2 -0
  211. package/dist/lib/types/core/Binding.d.ts +1 -0
  212. package/dist/lib/types/core/ClassStyleRules.d.ts +69 -4
  213. package/dist/lib/types/core/Component.d.ts +69 -14
  214. package/dist/lib/types/core/DOM.d.ts +11 -1
  215. package/dist/lib/types/core/Diagnostics.d.ts +22 -0
  216. package/dist/lib/types/core/Event.d.ts +7 -0
  217. package/dist/lib/types/core/LayerManager.d.ts +3 -0
  218. package/dist/lib/types/core/ListenerBag.d.ts +1 -0
  219. package/dist/lib/types/core/StyleTarget.d.ts +14 -0
  220. package/dist/lib/types/core/StyleTraits.d.ts +4 -0
  221. package/dist/lib/types/core/Theme.d.ts +6 -2
  222. package/dist/lib/types/core/Util.d.ts +4 -0
  223. package/dist/lib/types/core/index.d.ts +6 -3
  224. package/dist/lib/types/diagnostics/DiagnosticsOverlay.d.ts +29 -0
  225. package/dist/lib/types/diagnostics/DiagnosticsSampler.d.ts +61 -0
  226. package/dist/lib/types/diagnostics/StyleAudit.d.ts +19 -0
  227. package/dist/lib/types/diagnostics/StyleAuditOverlay.d.ts +12 -0
  228. package/dist/lib/types/diagnostics/StyleAuditView.d.ts +13 -0
  229. package/dist/lib/types/diagnostics/index.d.ts +7 -0
  230. package/dist/lib/types/layout/LayoutManager.d.ts +3 -0
  231. package/dist/lib/types/layout/Table.d.ts +3 -0
  232. package/dist/lib/types/overlay/AbstractWindow.d.ts +36 -0
  233. package/dist/lib/types/overlay/ButtonGroup.d.ts +1 -0
  234. package/dist/lib/types/overlay/Dialog.d.ts +1 -0
  235. package/dist/lib/types/overlay/Menu.d.ts +2 -0
  236. package/dist/lib/types/overlay/Notification.d.ts +0 -1
  237. package/dist/lib/types/overlay/PopupPanel.d.ts +2 -0
  238. package/dist/lib/types/overlay/RailHandle.d.ts +4 -5
  239. package/dist/lib/types/overlay/TabWindow.d.ts +3 -0
  240. package/dist/lib/types/overlay/Tooltip.d.ts +1 -0
  241. package/dist/lib/types/overlay/Window.d.ts +4 -1
  242. package/dist/lib/validation.es.js +1 -1
  243. package/llms.txt +2 -0
  244. package/package.json +5 -1
  245. package/dist/lib/AbstractInput-sRNPzWel.js +0 -2
  246. package/dist/lib/AbstractInput-sRNPzWel.js.map +0 -1
  247. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js +0 -2
  248. package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js.map +0 -1
  249. package/dist/lib/Border-0DJFDiij.js +0 -2
  250. package/dist/lib/Border-0DJFDiij.js.map +0 -1
  251. package/dist/lib/Button-MpMIYBYJ.js +0 -2
  252. package/dist/lib/Button-MpMIYBYJ.js.map +0 -1
  253. package/dist/lib/Checkbox-D0JYK-wc.js +0 -2
  254. package/dist/lib/Checkbox-D0JYK-wc.js.map +0 -1
  255. package/dist/lib/CheckboxMenuRow-CesLhSnp.js +0 -2
  256. package/dist/lib/CheckboxMenuRow-CesLhSnp.js.map +0 -1
  257. package/dist/lib/CodeEditor-N1FQodcF.js +0 -2
  258. package/dist/lib/CodeEditor-N1FQodcF.js.map +0 -1
  259. package/dist/lib/ComboBox-Dx8Tk9yg.js +0 -2
  260. package/dist/lib/ComboBox-Dx8Tk9yg.js.map +0 -1
  261. package/dist/lib/Component-B0ShfPVi.js +0 -2
  262. package/dist/lib/Component-B0ShfPVi.js.map +0 -1
  263. package/dist/lib/Container-abY5Ww3W.js +0 -2
  264. package/dist/lib/DOM-C-Edb3tA.js +0 -2
  265. package/dist/lib/DOM-C-Edb3tA.js.map +0 -1
  266. package/dist/lib/Dialog-cbA9V17e.js +0 -2
  267. package/dist/lib/Dialog-cbA9V17e.js.map +0 -1
  268. package/dist/lib/Glyph-_VeBacS2.js +0 -2
  269. package/dist/lib/Glyph-_VeBacS2.js.map +0 -1
  270. package/dist/lib/GridConstraints-C58LuTqM.js +0 -2
  271. package/dist/lib/GridConstraints-C58LuTqM.js.map +0 -1
  272. package/dist/lib/LayoutSerialization-CMxunLfV.js +0 -2
  273. package/dist/lib/LayoutSerialization-CMxunLfV.js.map +0 -1
  274. package/dist/lib/List-nx8220Fi.js +0 -2
  275. package/dist/lib/List-nx8220Fi.js.map +0 -1
  276. package/dist/lib/ListenerBag-WPdKuuds.js +0 -2
  277. package/dist/lib/ListenerBag-WPdKuuds.js.map +0 -1
  278. package/dist/lib/Menu-Q0bpXXze.js +0 -2
  279. package/dist/lib/Menu-Q0bpXXze.js.map +0 -1
  280. package/dist/lib/Position-BwtxouxK.js.map +0 -1
  281. package/dist/lib/ProgressSpinner-DK8xEQ9y.js +0 -2
  282. package/dist/lib/ProgressSpinner-DK8xEQ9y.js.map +0 -1
  283. package/dist/lib/RadioButton-BEwpqg1k.js +0 -2
  284. package/dist/lib/RadioButton-BEwpqg1k.js.map +0 -1
  285. package/dist/lib/RadioMenuRow-DP5qPyFR.js +0 -2
  286. package/dist/lib/RadioMenuRow-DP5qPyFR.js.map +0 -1
  287. package/dist/lib/Scrollbar-t8fFrUVQ.js +0 -2
  288. package/dist/lib/Scrollbar-t8fFrUVQ.js.map +0 -1
  289. package/dist/lib/Slider-CTbwR6HR.js +0 -2
  290. package/dist/lib/Slider-CTbwR6HR.js.map +0 -1
  291. package/dist/lib/Spacer-srdN2d2b.js +0 -2
  292. package/dist/lib/Spacer-srdN2d2b.js.map +0 -1
  293. package/dist/lib/TabButton-DLoMQzky.js +0 -2
  294. package/dist/lib/TabButton-DLoMQzky.js.map +0 -1
  295. package/dist/lib/TabCloseButton-CY7BGitY.js +0 -2
  296. package/dist/lib/TabCloseButton-CY7BGitY.js.map +0 -1
  297. package/dist/lib/Text-CMKnK9uB.js +0 -2
  298. package/dist/lib/Text-CMKnK9uB.js.map +0 -1
  299. package/dist/lib/Tooltip-CUOJOqQi.js +0 -3
  300. package/dist/lib/Tooltip-CUOJOqQi.js.map +0 -1
  301. package/dist/lib/Tree-C64JNPWJ.js +0 -2
  302. package/dist/lib/Tree-C64JNPWJ.js.map +0 -1
  303. package/dist/lib/core.es.js.map +0 -1
  304. package/dist/lib/primitive.es.js.map +0 -1
  305. package/dist/lib/selectionsEqual-gMG7gCVI.js +0 -2
  306. package/dist/lib/types/component/table/CellGeometry.d.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"chart.es.js","names":["constant","curveLinear","x","pointX","y","pointY","array","zero","number","number","sequence","define","linear","constant","rgb","colorRgb","basis","basisClosed","value","value","number","constant","number","rgb","string","date","numberArray","object","number","constant","bisect","interpolateValue","interpolateNumber","number","interpolateRound","formatDecimal","formatRounded","formatPrefixAuto","identity","formatGroup","formatNumerals","formatTypes","formatTrim","exponent","locale","defaultLocale","formatLocale","exponent","exponent","exponent","precisionPrefix","precisionRound","precisionFixed","timeWeek","timeSecond"],"sources":["../../../../../node_modules/d3-shape/src/constant.js","../../../../../node_modules/d3-path/src/path.js","../../../../../node_modules/d3-shape/src/path.js","../../../../../node_modules/d3-shape/src/array.js","../../../../../node_modules/d3-shape/src/curve/linear.js","../../../../../node_modules/d3-shape/src/point.js","../../../../../node_modules/d3-shape/src/line.js","../../../../../node_modules/d3-shape/src/curve/monotone.js","../../../../../node_modules/d3-array/src/ascending.js","../../../../../node_modules/d3-array/src/descending.js","../../../../../node_modules/d3-array/src/bisector.js","../../../../../node_modules/d3-array/src/number.js","../../../../../node_modules/d3-array/src/bisect.js","../../../../../node_modules/d3-array/src/extent.js","../../../../../node_modules/internmap/src/index.js","../../../../../node_modules/d3-array/src/ticks.js","../../../../../node_modules/d3-array/src/max.js","../../../../../node_modules/d3-array/src/min.js","../../../../../node_modules/d3-array/src/range.js","../../../../../node_modules/d3-scale/src/init.js","../../../../../node_modules/d3-scale/src/ordinal.js","../../../../../node_modules/d3-scale/src/band.js","../../../../../node_modules/d3-color/src/define.js","../../../../../node_modules/d3-color/src/color.js","../../../../../node_modules/d3-interpolate/src/basis.js","../../../../../node_modules/d3-interpolate/src/basisClosed.js","../../../../../node_modules/d3-interpolate/src/constant.js","../../../../../node_modules/d3-interpolate/src/color.js","../../../../../node_modules/d3-interpolate/src/rgb.js","../../../../../node_modules/d3-interpolate/src/numberArray.js","../../../../../node_modules/d3-interpolate/src/array.js","../../../../../node_modules/d3-interpolate/src/date.js","../../../../../node_modules/d3-interpolate/src/number.js","../../../../../node_modules/d3-interpolate/src/object.js","../../../../../node_modules/d3-interpolate/src/string.js","../../../../../node_modules/d3-interpolate/src/value.js","../../../../../node_modules/d3-interpolate/src/round.js","../../../../../node_modules/d3-scale/src/constant.js","../../../../../node_modules/d3-scale/src/number.js","../../../../../node_modules/d3-scale/src/continuous.js","../../../../../node_modules/d3-format/src/formatDecimal.js","../../../../../node_modules/d3-format/src/exponent.js","../../../../../node_modules/d3-format/src/formatGroup.js","../../../../../node_modules/d3-format/src/formatNumerals.js","../../../../../node_modules/d3-format/src/formatSpecifier.js","../../../../../node_modules/d3-format/src/formatTrim.js","../../../../../node_modules/d3-format/src/formatPrefixAuto.js","../../../../../node_modules/d3-format/src/formatRounded.js","../../../../../node_modules/d3-format/src/formatTypes.js","../../../../../node_modules/d3-format/src/identity.js","../../../../../node_modules/d3-format/src/locale.js","../../../../../node_modules/d3-format/src/defaultLocale.js","../../../../../node_modules/d3-format/src/precisionFixed.js","../../../../../node_modules/d3-format/src/precisionPrefix.js","../../../../../node_modules/d3-format/src/precisionRound.js","../../../../../node_modules/d3-scale/src/tickFormat.js","../../../../../node_modules/d3-scale/src/linear.js","../../../../../node_modules/d3-scale/src/nice.js","../../../../../node_modules/d3-time/src/interval.js","../../../../../node_modules/d3-time/src/millisecond.js","../../../../../node_modules/d3-time/src/duration.js","../../../../../node_modules/d3-time/src/second.js","../../../../../node_modules/d3-time/src/minute.js","../../../../../node_modules/d3-time/src/hour.js","../../../../../node_modules/d3-time/src/day.js","../../../../../node_modules/d3-time/src/week.js","../../../../../node_modules/d3-time/src/month.js","../../../../../node_modules/d3-time/src/year.js","../../../../../node_modules/d3-time/src/ticks.js","../../../../../node_modules/d3-time-format/src/locale.js","../../../../../node_modules/d3-time-format/src/defaultLocale.js","../../../../../node_modules/d3-scale/src/time.js","../../../src/typescript/lib/component/chart/Scale.ts","../../../src/typescript/lib/component/chart/ChartAxis.ts","../../../src/typescript/lib/component/chart/ChartLegend.ts","../../../src/typescript/lib/component/chart/AbstractChart.ts","../../../src/typescript/lib/component/chart/LineChart.ts","../../../src/typescript/lib/component/chart/BarChart.ts"],"sourcesContent":["export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if (!isFinite(x) || x === 0) return null; // NaN, ±Infinity, ±0\n var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\"), coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return prefixExponent = undefined, x.toPrecision(p);\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier, options) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = (options && options.prefix !== undefined ? options.prefix : \"\") + (symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\"),\n suffix = (symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\") + (options && options.suffix !== undefined ? options.suffix : \"\");\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" && !isNaN(value) && prefixExponent !== undefined ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier), {suffix: prefixes[8 + e / 3]});\n return function(value) {\n return f(k * value);\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { scaleLinear, scaleBand, scaleTime } from \"d3-scale\";\nimport { extent, max, min } from \"d3-array\";\nimport type { ScaleLinear, ScaleBand, ScaleTime } from \"d3-scale\";\nimport type { ChartPoint } from \"~/component/chart/types.js\";\n\n/**\n * The union of scale kinds a chart passes around. Every member is d3's own\n * `(value) => pixel` projector: the continuous members ({@link ScaleLinear},\n * {@link ScaleTime}) additionally expose `.ticks()` / `.tickFormat()`, and the\n * discrete member ({@link ScaleBand}) exposes `.bandwidth()`. The scale itself\n * is the domain→pixel projector — `Scale.ts` is a thin adapter around it, not a\n * reimplementation.\n *\n * @category Components\n */\nexport type ChartScale =\n ScaleLinear<number, number> | ScaleTime<number, number> | ScaleBand<string>;\n\n/**\n * Default padding ratio (band-scale inner padding) between adjacent bar bands.\n * `0.1` leaves a tenth of each step as the gap — dense enough to read the bars\n * as a group while keeping the inter-bar gutter visible.\n */\nconst DEFAULT_BAND_PADDING = 0.1;\n\n/**\n * Builds a continuous linear value scale over `domain`, projecting onto the\n * pixel `range`, with `.nice()` applied so the domain rounds to human-friendly\n * bounds. Used for the line-chart x/y axes and the bar-chart y axis.\n *\n * @param domain - The `[min, max]` data-space domain.\n * @param range - The `[start, end]` pixel range (may be inverted, e.g. a y axis).\n *\n * @returns The configured d3 linear scale.\n */\nexport function linearScale(domain: [number, number], range: [number, number]): ScaleLinear<number, number> {\n return scaleLinear().domain(domain).range(range).nice();\n}\n\n/**\n * Builds a continuous time scale over a `[start, end]` date domain, projecting\n * onto the pixel `range`, with `.nice()` applied. Selected by a line chart when\n * `xScaleType === \"time\"`; its `d3-time` / `d3-time-format` transitive\n * dependencies ship with `d3-scale`.\n *\n * @param domain - The `[start, end]` date domain.\n * @param range - The `[start, end]` pixel range.\n *\n * @returns The configured d3 time scale.\n */\nexport function timeScale(domain: [Date, Date], range: [number, number]): ScaleTime<number, number> {\n return scaleTime().domain(domain).range(range).nice();\n}\n\n/**\n * Builds a discrete band scale over `categories`, projecting onto the pixel\n * `range` with symmetric inner/outer padding. Used for the bar-chart x axis;\n * each category gets an equal band of width `.bandwidth()`.\n *\n * @param categories - The ordered category labels.\n * @param range - The `[start, end]` pixel range.\n * @param padding - Inner padding ratio between bands (outer padding is half of\n * it); defaults to {@link DEFAULT_BAND_PADDING}.\n *\n * @returns The configured d3 band scale.\n */\nexport function bandScale(categories: string[], range: [number, number], padding: number = DEFAULT_BAND_PADDING): ScaleBand<string> {\n return scaleBand<string>()\n .domain(categories)\n .range(range)\n .paddingInner(padding)\n .paddingOuter(padding / 2);\n}\n\n/**\n * Narrows a {@link ChartScale} to the discrete band member by feature-detecting\n * its `.bandwidth()` method (which the continuous scales lack).\n *\n * @param scale - The scale to test.\n *\n * @returns `true` when `scale` is a band scale.\n */\nexport function isBandScale(scale: ChartScale): scale is ScaleBand<string> {\n return typeof (scale as ScaleBand<string>).bandwidth === \"function\";\n}\n\n/**\n * Returns the axis tick values for a scale: the nice tick values inside the\n * domain for a continuous scale, or the category labels for a band scale.\n *\n * @param scale - The scale to enumerate.\n * @param count - Requested tick count hint (ignored by band scales).\n *\n * @returns The tick values (numbers, `Date`s, or category strings).\n */\nexport function scaleTicks(scale: ChartScale, count: number): Array<number | Date | string> {\n if (isBandScale(scale)) {\n return scale.domain();\n }\n\n return (scale as ScaleLinear<number, number> | ScaleTime<number, number>).ticks(count);\n}\n\n/**\n * Returns the pixel position of a tick value: the projected position for a\n * continuous scale, or the band centre for a band scale.\n *\n * @param scale - The scale to project through.\n * @param value - The tick value to position.\n *\n * @returns The pixel position along the scale's range.\n */\nexport function tickPosition(scale: ChartScale, value: number | Date | string): number {\n if (isBandScale(scale)) {\n return (scale(value as string) ?? 0) + scale.bandwidth() / 2;\n }\n\n return (scale as ScaleLinear<number, number> | ScaleTime<number, number>)(value as number & Date);\n}\n\n/**\n * Returns a string formatter for a scale's tick values — d3's own\n * domain-appropriate `.tickFormat()` for a continuous scale (which picks a\n * sensible number/time format for the tick density), or `String` for a band\n * scale's already-textual categories.\n *\n * @param scale - The scale to format ticks for.\n * @param count - Tick-count hint passed to d3's continuous `.tickFormat()`.\n *\n * @returns A `(value) => string` formatter.\n */\nexport function tickFormatter(scale: ChartScale, count: number): (value: number | Date | string) => string {\n if (isBandScale(scale)) {\n return (value) => String(value);\n }\n\n const format = (scale as ScaleLinear<number, number> | ScaleTime<number, number>).tickFormat(count);\n\n return (value) => format(value as number & Date);\n}\n\n/**\n * Computes the `[min, max]` x-extent across a flat list of points, falling back\n * to `[0, 1]` for an empty list so a scale never receives a `NaN`/`undefined`\n * domain.\n *\n * @param points - The points to span.\n *\n * @returns The `[min, max]` x-extent.\n */\nexport function pointsXExtent(points: ChartPoint[]): [number, number] {\n const span = extent(points, (p) => p.x);\n\n return [span[0] ?? 0, span[1] ?? 1];\n}\n\n/**\n * Computes the y-domain bounds across a flat list of points. When\n * `includeZero` is set (the default) the lower bound is clamped to at most `0`\n * so a value axis starts at the baseline; the upper bound is the data maximum.\n * Falls back to `[0, 1]` for an empty list.\n *\n * @param points - The points to span.\n * @param includeZero - Whether to force the baseline `0` into the domain.\n *\n * @returns The `[lower, upper]` y-domain.\n */\nexport function pointsYBounds(points: ChartPoint[], includeZero: boolean = true): [number, number] {\n if (points.length === 0) {\n return [0, 1];\n }\n\n const dataMin = min(points, (p) => p.y) ?? 0;\n const dataMax = max(points, (p) => p.y) ?? 1;\n const lower = includeZero ? Math.min(0, dataMin) : dataMin;\n // A flat series (all-equal y) would collapse the domain to a point and make\n // `.nice()` produce a zero-height range; nudge the upper bound up by 1 so the\n // axis always has extent.\n const upper = dataMax > lower ? dataMax : lower + 1;\n\n return [lower, upper];\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from \"~/core/DOM.js\";\nimport { scaleTicks, tickPosition } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport type { MarkFactory, PlotRect } from \"~/component/chart/types.js\";\n\n/**\n * Which edge an axis is drawn on. `\"bottom\"` is the horizontal x axis under the\n * plot; `\"left\"` is the vertical y axis to its left.\n *\n * @category Components\n */\nexport type AxisOrientation = \"bottom\" | \"left\";\n\n/**\n * Length in px of each tick mark drawn outward from the axis line. Fixed rather\n * than themed: the tick is a structural cue whose length carries no design\n * meaning, and a constant keeps the margin arithmetic (which reserves this plus\n * the label extent) simple.\n */\nconst TICK_LENGTH = 6;\n\n/**\n * Gap in px between a tick mark and its label. Small, fixed breathing room so\n * the label does not touch the tick; mirrored into the reserved margin.\n */\nconst LABEL_GAP = 4;\n\n/**\n * Default number of ticks requested from a continuous scale. A hint, not a\n * guarantee — d3 rounds it to the nearest nice-number tick count. Eight reads\n * as a legible density for the plan's stated modest data sizes.\n */\nexport const DEFAULT_TICK_COUNT = 8;\n\n/**\n * Render options for one axis pass.\n *\n * @category Components\n */\nexport interface AxisRenderOptions {\n /** Requested tick count (continuous scales only). */\n tickCount: number;\n /** Tick-value formatter, typically from the scale's own `tickFormat`. */\n format: (value: number | Date | string) => string;\n /** Whether to draw gridlines spanning the plot at each tick. */\n grid: boolean;\n}\n\n/**\n * Measures the margin (px) a plot rectangle must reserve for an axis, from the\n * scale's tick labels — the max label width for a `\"left\"` axis, or the label\n * height for a `\"bottom\"` axis — plus the tick length and label gap. Measured\n * from the domain ticks (independent of the pixel range), so it can run *before*\n * the plot rectangle exists, breaking the margin↔layout feedback loop.\n *\n * @param orientation - The axis edge.\n * @param scale - The scale whose ticks are measured.\n * @param format - The tick-value formatter.\n * @param tickCount - Requested tick count hint.\n *\n * @returns The margin to reserve in px.\n */\nexport function measureAxisMargin(\n orientation: AxisOrientation,\n scale: ChartScale,\n format: (value: number | Date | string) => string,\n tickCount: number\n): number {\n const ticks = scaleTicks(scale, tickCount);\n\n if (orientation === \"left\") {\n let widest = 0;\n\n for (const value of ticks) {\n widest = Math.max(widest, DOM.source.measureText(format(value)).width);\n }\n\n return TICK_LENGTH + LABEL_GAP + Math.ceil(widest);\n }\n\n // Bottom axis: horizontal labels, so the reserved extent is one line's\n // height (the widest label height, which is font-driven and constant).\n const labelHeight = DOM.source.measureText(\"0\").height;\n\n return TICK_LENGTH + LABEL_GAP + Math.ceil(labelHeight);\n}\n\n/**\n * Draws an axis — its line, tick marks, tick labels, and optional gridlines —\n * into a mark group through the supplied {@link MarkFactory}, entirely natively\n * (no `d3-axis`, which would own a d3-selection and mutate the DOM). Colours and\n * stroke widths bind to `--ts-ui-chart-*` theme variables so a theme switch\n * re-cascades with no redraw.\n *\n * @param create - The mark factory bound to the axis group.\n * @param orientation - The axis edge.\n * @param scale - The scale to render.\n * @param plot - The plot rectangle in SVG user space.\n * @param opts - Tick count, formatter, and gridline flag.\n */\nexport function drawAxis(\n create: MarkFactory,\n orientation: AxisOrientation,\n scale: ChartScale,\n plot: PlotRect,\n opts: AxisRenderOptions\n): void {\n const axisStroke = { stroke: \"var(--ts-ui-chart-axis)\", \"stroke-width\": \"var(--ts-ui-chart-axis-width)\" };\n const gridStroke = { stroke: \"var(--ts-ui-chart-grid)\", \"stroke-width\": \"var(--ts-ui-chart-axis-width)\" };\n const labelFill = { fill: \"var(--ts-ui-chart-label)\" };\n\n const bottomEdge = plot.y + plot.height;\n const rightEdge = plot.x + plot.width;\n\n if (orientation === \"left\") {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(plot.y), x2: String(plot.x), y2: String(bottomEdge) }, style: axisStroke });\n } else {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(bottomEdge), x2: String(rightEdge), y2: String(bottomEdge) }, style: axisStroke });\n }\n\n for (const value of scaleTicks(scale, opts.tickCount)) {\n const pos = tickPosition(scale, value);\n const label = opts.format(value);\n\n if (orientation === \"left\") {\n drawLeftTick(create, plot, rightEdge, pos, label, opts.grid, gridStroke, axisStroke, labelFill);\n } else {\n drawBottomTick(create, plot, bottomEdge, pos, label, opts.grid, gridStroke, axisStroke, labelFill);\n }\n }\n}\n\n/**\n * Draws one left-axis tick: its optional gridline across the plot, the tick\n * mark, and the right-aligned, vertically-centred label.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n * @param rightEdge - The plot's right edge x coordinate.\n * @param pos - The tick's y position in SVG user space.\n * @param label - The formatted tick label.\n * @param grid - Whether to draw the gridline.\n * @param gridStroke - Gridline stroke style.\n * @param axisStroke - Tick-mark stroke style.\n * @param labelFill - Label fill style.\n */\nfunction drawLeftTick(\n create: MarkFactory,\n plot: PlotRect,\n rightEdge: number,\n pos: number,\n label: string,\n grid: boolean,\n gridStroke: Record<string, string>,\n axisStroke: Record<string, string>,\n labelFill: Record<string, string>\n): void {\n if (grid) {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(pos), x2: String(rightEdge), y2: String(pos) }, style: gridStroke });\n }\n\n create(\"line\", { setAttr: { x1: String(plot.x - TICK_LENGTH), y1: String(pos), x2: String(plot.x), y2: String(pos) }, style: axisStroke });\n\n create(\"text\", {\n setAttr: { x: String(plot.x - TICK_LENGTH - LABEL_GAP), y: String(pos), \"text-anchor\": \"end\", \"dominant-baseline\": \"middle\" },\n style: labelFill,\n text: label,\n });\n}\n\n/**\n * Draws one bottom-axis tick: its optional gridline up the plot, the tick mark,\n * and the centred label hanging below it.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n * @param bottomEdge - The plot's bottom edge y coordinate.\n * @param pos - The tick's x position in SVG user space.\n * @param label - The formatted tick label.\n * @param grid - Whether to draw the gridline.\n * @param gridStroke - Gridline stroke style.\n * @param axisStroke - Tick-mark stroke style.\n * @param labelFill - Label fill style.\n */\nfunction drawBottomTick(\n create: MarkFactory,\n plot: PlotRect,\n bottomEdge: number,\n pos: number,\n label: string,\n grid: boolean,\n gridStroke: Record<string, string>,\n axisStroke: Record<string, string>,\n labelFill: Record<string, string>\n): void {\n if (grid) {\n create(\"line\", { setAttr: { x1: String(pos), y1: String(plot.y), x2: String(pos), y2: String(bottomEdge) }, style: gridStroke });\n }\n\n create(\"line\", { setAttr: { x1: String(pos), y1: String(bottomEdge), x2: String(pos), y2: String(bottomEdge + TICK_LENGTH) }, style: axisStroke });\n\n create(\"text\", {\n setAttr: { x: String(pos), y: String(bottomEdge + TICK_LENGTH + LABEL_GAP), \"text-anchor\": \"middle\", \"dominant-baseline\": \"hanging\" },\n style: labelFill,\n text: label,\n });\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Panel, PanelOptions } from \"~/core/Panel.js\";\nimport { Component } from \"~/core/Component.js\";\nimport { Text } from \"~/component/input/Text.js\";\nimport { HBox } from \"~/layout/HBox.js\";\nimport { VBox } from \"~/layout/VBox.js\";\nimport { Insets } from \"~/primitive/Insets.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * One legend entry: a series' name, its resolved swatch colour, and whether the\n * legend has toggled it hidden (rendered greyed).\n *\n * @category Components\n */\nexport interface ChartLegendEntry {\n /** The series' display name. */\n name: string;\n /** The resolved swatch colour (a concrete colour or a `var(--…)` binding). */\n color: string;\n /** Whether the entry is toggled off (rendered dimmed). */\n hidden?: boolean;\n}\n\n/**\n * The direction the legend arranges its entries: a vertical stack (docked to the\n * plot's right) or a horizontal row (docked above or below).\n *\n * @category Components\n */\nexport type ChartLegendOrientation = \"vertical\" | \"horizontal\";\n\n/**\n * Construction-time options for {@link ChartLegend}.\n *\n * @category Components\n */\nexport interface ChartLegendOptions extends PanelOptions {\n /** The legend entries to render. */\n entries?: ChartLegendEntry[];\n /** Arrangement direction; defaults to `\"vertical\"`. */\n orientation?: ChartLegendOrientation;\n /** Construction-time listener bag for the `\"toggle\"` event. */\n listeners?: {\n toggle?: (seriesIndex: number) => void;\n };\n}\n\n/** Custom events emitted by {@link ChartLegend}. */\ntype ChartLegendEvent = \"toggle\";\n\n/** Swatch square edge length in px — a compact colour chip beside each label. */\nconst SWATCH_SIZE = 12;\n\n/** Opacity applied to a legend row whose series is toggled hidden. */\nconst HIDDEN_OPACITY = 0.4;\n\nconst _defaultChartLegendOptions: Partial<ChartLegendOptions> = {\n backgroundColor: \"transparent\",\n};\n\n/**\n * A clickable chart legend: one row per series (colour swatch + name). A click\n * on a row emits `\"toggle\"(seriesIndex)` so the owning chart can hide/show that\n * series and repaint. Composed from existing components — an `HBox`/`VBox`\n * `Panel` of per-entry rows, each an `HBox` of a swatch `Component` and a\n * `Text` — rather than a specialised component.\n *\n * @category Components\n */\nclass ChartLegend extends Panel<ChartLegendOptions> {\n\n private _listeners: ListenerBag<ChartLegendEvent> = new ListenerBag<ChartLegendEvent>();\n private _rows: Component[] = [];\n private _entries: ChartLegendEntry[] = [];\n private _orientation: ChartLegendOrientation = \"vertical\";\n\n /**\n * Builds the legend and dispatches its own options from the constructor body\n * (not `applyOptions`, which runs inside the `super()` cascade before the\n * `ListenerBag` and row list exist).\n *\n * @param options - Optional construction-time options.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults; subclasses forward their `_defaultXxxOptions`\n * constant here.\n */\n constructor(options?: ChartLegendOptions, subclassDefaults?: Partial<ChartLegendOptions>) {\n super(options, { ..._defaultChartLegendOptions, ...(subclassDefaults ?? {}) });\n\n this.clearInsets();\n this.applyOrientationLayout();\n\n this.dispatchLegendOptions(options);\n\n // A row click toggles its series. Subtree listener on self (never on a\n // child's own event surface), matching the framework's delegation rule.\n Event.addSubtreeListener(this, \"click\", this.handleRowClick);\n }\n\n /**\n * Dispatches the legend-specific options through their setters once the row\n * list and listener bag exist.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchLegendOptions(options?: ChartLegendOptions): void {\n if (!options) {\n return;\n }\n\n if (options.orientation !== undefined) {\n this.setOrientation(options.orientation);\n }\n\n if (options.entries !== undefined) {\n this.setEntries(options.entries);\n }\n\n this.applyListeners(options.listeners);\n }\n\n /**\n * Sets the arrangement direction and swaps the layout manager to match\n * (`VBox` for vertical, `HBox` for horizontal), then re-lays out.\n *\n * @param orientation - The arrangement direction.\n *\n * @returns This legend, for method chaining.\n */\n setOrientation(orientation: ChartLegendOrientation): this {\n if (this._orientation === orientation) {\n return this;\n }\n\n this._orientation = orientation;\n\n this.applyOrientationLayout();\n\n return this;\n }\n\n /**\n * Returns the current arrangement direction.\n *\n * @returns The legend orientation.\n */\n getOrientation(): ChartLegendOrientation {\n return this._orientation;\n }\n\n /** Installs the layout manager matching the current orientation. */\n private applyOrientationLayout(): void {\n this.setLayoutManager(\n this._orientation === \"vertical\"\n ? new VBox({ spacing: 2, stretching: false })\n : new HBox({ spacing: 10, stretching: false })\n );\n }\n\n /**\n * Rebuilds the legend rows from `entries`: one row (swatch + name) per\n * entry, dimmed when the entry is hidden. Replaces any previous rows.\n *\n * @param entries - The entries to render.\n *\n * @returns This legend, for method chaining.\n */\n setEntries(entries: ChartLegendEntry[]): this {\n if (this.entriesEqual(entries)) {\n return this;\n }\n\n this._entries = entries.map((e) => ({ ...e }));\n\n this.disposeAllComponents();\n this._rows = [];\n\n for (const entry of this._entries) {\n const row = this.buildRow(entry);\n\n this._rows.push(row);\n this.addComponent(row);\n }\n\n return this;\n }\n\n /**\n * Returns a copy of the current legend entries.\n *\n * @returns The entries.\n */\n getEntries(): ChartLegendEntry[] {\n return this._entries.map((e) => ({ ...e }));\n }\n\n /**\n * Reports whether `candidate` renders identically to the current entries —\n * same length and, per index, equal name, colour, and effective hidden state\n * (`undefined` hidden renders the same as `false`). Lets a no-op re-apply\n * skip the teardown/rebuild that would relay a preferred-size change to the\n * owning chart and re-arm the layout flush.\n *\n * @param candidate - The entries about to be applied.\n *\n * @returns `true` when `candidate` is value-equal to the current entries.\n */\n private entriesEqual(candidate: ChartLegendEntry[]): boolean {\n if (candidate.length !== this._entries.length) {\n return false;\n }\n\n for (let i = 0; i < candidate.length; i++) {\n const a = candidate[i];\n const b = this._entries[i];\n\n if (a.name !== b.name || a.color !== b.color || (a.hidden ?? false) !== (b.hidden ?? false)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Builds one legend row: a horizontal swatch + name pair, dimmed when the\n * entry is hidden, with a pointer cursor to signal it is clickable.\n *\n * @param entry - The entry to render.\n *\n * @returns The row component.\n */\n private buildRow(entry: ChartLegendEntry): Component {\n const swatch = new Component({\n preferredSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n minSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n maxSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n backgroundColor: entry.color,\n borderRadius: \"2px\",\n });\n\n const label = new Text(entry.name);\n\n return new Panel({\n layoutManager: new HBox({ spacing: 6, stretching: true }),\n insets: new Insets(2, 4, 2, 4),\n cursor: \"pointer\",\n opacity: entry.hidden ? HIDDEN_OPACITY : 1,\n components: [swatch, label],\n });\n }\n\n /**\n * Resolves a click to the row it landed in and emits `\"toggle\"` with that\n * row's index. Reads the event target through the source seam and matches it\n * against each row's element (never listening on a row's own surface).\n *\n * @param event - The DOM click event.\n */\n private handleRowClick = (event: MouseEvent): void => {\n if (!DOM.source.isNode(event.target)) {\n return;\n }\n\n const target = DOM.source.intern(event.target);\n\n for (let index = 0; index < this._rows.length; index++) {\n const element = this._rows[index].getElement();\n\n if (element && DOM.source.contains(element, target)) {\n this.emit(\"toggle\", index);\n\n return;\n }\n }\n };\n\n /**\n * Registers a `\"toggle\"` listener, fired with a series index when its row is\n * clicked.\n *\n * @param event - The `\"toggle\"` event.\n * @param listener - The callback invoked with the toggled series index.\n *\n * @returns This legend, for method chaining.\n */\n on(event: \"toggle\", listener: (seriesIndex: number) => void): this {\n this._listeners.add(event, listener);\n\n return this;\n }\n\n /**\n * Removes a previously registered `\"toggle\"` listener.\n *\n * @param event - The `\"toggle\"` event.\n * @param listener - The exact callback reference to remove.\n *\n * @returns This legend, for method chaining.\n */\n off(event: \"toggle\", listener: (seriesIndex: number) => void): this {\n this._listeners.remove(event, listener);\n\n return this;\n }\n\n /**\n * Fires every `\"toggle\"` listener with the toggled series index.\n *\n * @param event - The `\"toggle\"` event.\n * @param seriesIndex - The toggled series index.\n */\n protected emit(event: ChartLegendEvent, seriesIndex: number): void {\n this._listeners.fire(event, seriesIndex);\n }\n\n}\n\nconst ChartLegendCallable = callable(ChartLegend);\ntype ChartLegendCallable = ChartLegend;\nexport {\n ChartLegend as _ChartLegend,\n ChartLegendCallable as ChartLegend\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Panel, PanelOptions } from \"~/core/Panel.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle, ElementPatch } from \"~/core/DOM.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { Tooltip } from \"~/overlay/Tooltip.js\";\nimport { ThemeManager } from \"~/core/Theme.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { AbstractStore, StoreEvent } from \"~/data/AbstractStore.js\";\nimport { drawAxis, measureAxisMargin, DEFAULT_TICK_COUNT } from \"~/component/chart/ChartAxis.js\";\nimport { tickFormatter } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport { ChartLegend } from \"~/component/chart/ChartLegend.js\";\nimport type {\n ChartPoint,\n ChartSeries,\n ChartSeriesModel,\n ChartSelectionEvent,\n MarkFactory,\n PlotRect,\n} from \"~/component/chart/types.js\";\n\n/** The SVG namespace URI for every mark the chart creates through the sink. */\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/** The store events a bound chart subscribes to (mirrors ComboBox's binding). */\nconst STORE_EVENTS: readonly StoreEvent[] = [\"load\", \"add\", \"remove\", \"datachange\"];\n\n/** Size of the categorical palette; series colours cycle within it. */\nconst PALETTE_SIZE = 8;\n\n/** Padding (px) reserved above the plot so the top gridline/label has headroom. */\nconst TOP_PAD = 10;\n\n/** Padding (px) reserved right of the plot so the last x label is not clipped. */\nconst RIGHT_PAD = 12;\n\n/** Gap (px) between the plot and a docked legend. */\nconst LEGEND_GAP = 8;\n\n/** Extra band (px) reserved for an axis title beyond the tick labels. */\nconst AXIS_LABEL_BAND = 18;\n\n/** Radius (px) of the selection ring drawn around a clicked point. */\nconst SELECTION_RING_RADIUS = 6;\n\n/** Where the legend docks relative to the plot. */\nexport type ChartLegendPosition = \"top\" | \"right\" | \"bottom\";\n\n/** Custom events an {@link AbstractChart} emits. */\ntype ChartEvent = \"selection\";\n\n/**\n * Construction-time listener bag for a chart's custom events. A type alias (not\n * an interface) so it carries the implicit index signature `applyListeners`\n * requires.\n *\n * @category Components\n */\nexport type ChartListeners = {\n selection?: (event: ChartSelectionEvent) => void;\n};\n\n/**\n * Construction-time options common to every chart type.\n *\n * @category Components\n */\nexport interface AbstractChartOptions extends PanelOptions {\n /** In-memory series data (mutually exclusive with the store path). */\n series?: ChartSeries[];\n /** Store whose records supply the data (with the field options below). */\n store?: AbstractStore;\n /** Record field read for each point's `x` (store path). */\n xField?: string;\n /** Record field read for each point's `y` (store path). */\n yField?: string;\n /** Record field whose distinct values split records into series (store path). */\n seriesField?: string;\n /** Whether the legend is shown; defaults to `true`. */\n showLegend?: boolean;\n /** Where the legend docks; defaults to `\"right\"`. */\n legendPosition?: ChartLegendPosition;\n /** Optional x-axis title. */\n xAxisLabel?: string;\n /** Optional y-axis title. */\n yAxisLabel?: string;\n /** Construction-time listener bag for the `\"selection\"` event. */\n listeners?: ChartListeners;\n}\n\n// A sensible default envelope: a fixed preferred size, plus a small min so\n// the Panel can shrink (it clamps only to its explicit min/max).\nconst _defaultAbstractChartOptions: Partial<AbstractChartOptions> = {\n preferredSize: { width: 400, height: 300 },\n minSize: { width: 80, height: 60 },\n};\n\n/**\n * Shared SVG-first foundation for the chart family. An `AbstractChart` is a\n * `Panel` whose root `<div>` hosts a single raw `<svg>` drawing surface (a\n * tracked child created through the DOM sink, mirroring `Glyph`); axes,\n * gridlines, and series marks are SVG children drawn into that surface, never\n * framework components. Interactive HTML chrome — the legend — stays a real\n * child component positioned in `doLayout`.\n *\n * The computational layer (scales, ticks, path generation) delegates to pure\n * d3 submodules; all rendering, layout, interaction, and theming are native.\n * Concrete subtypes fill in the scale-building, series-drawing, and\n * point-anchor hooks.\n *\n * @typeParam O - The subtype's options interface.\n *\n * @remarks Abstract, so it is deliberately **not** wrapped with `callable()` (a\n * base with abstract members cannot be constructed); the concrete `LineChart` /\n * `BarChart` subclasses carry the callable export.\n *\n * @category Components\n */\nexport abstract class AbstractChart<O extends AbstractChartOptions = AbstractChartOptions> extends Panel<O> {\n\n private _listeners: ListenerBag<ChartEvent> = new ListenerBag<ChartEvent>();\n\n /** The resolved series model (points + hidden flag), rebuilt on data change. */\n protected _series: ChartSeriesModel[] = [];\n\n /** The clicked point, drawn with a selection ring; `null` when none. */\n protected _selectedPoint: { series: number; index: number } | null = null;\n\n private _boundStore: AbstractStore | null = null;\n private _xField: string = \"x\";\n private _yField: string = \"y\";\n private _seriesField: string | undefined = undefined;\n private readonly _onStoreRefresh: () => void = () => this.rebuildFromStore();\n\n private readonly _legend: ChartLegend = new ChartLegend();\n private _themeCleanup: (() => void) | null = null;\n\n // The raw SVG surface and its mark groups (created at first render, so null\n // until then). Groups paint back-to-front in creation order: axis/grid,\n // then series, then the selection overlay.\n private _svg: Handle | null = null;\n private _axisGroup: Handle | null = null;\n private _seriesGroup: Handle | null = null;\n private _overlayGroup: Handle | null = null;\n\n // Every mark created since the last repaint, with its parent group, so a\n // repaint can detach and release each one (an unreleased handle pins the\n // detached node in the registry — the Glyphs sprite-leak lesson).\n private _marks: Array<{ parent: Handle; handle: Handle }> = [];\n\n // The plot rectangle and scales from the last layout, cached so pointer\n // hit-testing (which runs outside layout, on every mousemove) can map the\n // cursor into data space without rebuilding them. Null until first layout.\n protected _plot: PlotRect | null = null;\n protected _xScale: ChartScale | null = null;\n protected _yScale: ChartScale | null = null;\n\n /**\n * Builds the chart shell: the legend child, the default size envelope, the\n * interaction listeners, and the theme subscription. Chart-specific options\n * are dispatched from the constructor body (not `applyOptions`) so the\n * `ListenerBag` and legend exist first.\n *\n * @param options - Optional construction-time options.\n * @param subclassDefaults - Optional subclass default options.\n */\n constructor(options?: O, subclassDefaults?: Partial<O>) {\n super(options, { ..._defaultAbstractChartOptions, ...(subclassDefaults ?? {}) } as Partial<O>);\n\n this.addComponent(this._legend);\n this._legend.on(\"toggle\", this.handleLegendToggle);\n\n Event.addSubtreeListener(this, \"mousemove\", this.handlePointerMove);\n Event.addSubtreeListener(this, \"mouseout\", this.handlePointerOut);\n Event.addSubtreeListener(this, \"click\", this.handlePointerClick);\n\n // Re-measure axis margins when the font changes (the label widths shift).\n this._themeCleanup = ThemeManager.onThemeChange(() => this.scheduleLayout());\n\n this.dispatchChartOptions(options);\n }\n\n /**\n * Dispatches the chart-specific options through their setters. Store and\n * in-memory series are mutually exclusive construction paths.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchChartOptions(options?: O): void {\n if (!options) {\n return;\n }\n\n if (options.store !== undefined) {\n this.setStore(options.store, options.xField ?? \"x\", options.yField ?? \"y\", options.seriesField);\n } else if (options.series !== undefined) {\n this.setSeries(options.series);\n }\n\n if (options.showLegend !== undefined) {\n this.setShowLegend(options.showLegend);\n }\n\n if (options.legendPosition !== undefined) {\n this.setLegendPosition(options.legendPosition);\n }\n\n if (options.xAxisLabel !== undefined) {\n this.setXAxisLabel(options.xAxisLabel);\n }\n\n if (options.yAxisLabel !== undefined) {\n this.setYAxisLabel(options.yAxisLabel);\n }\n\n this.applyListeners(options.listeners);\n }\n\n // ── Data ────────────────────────────────────────────────────────────────\n\n /**\n * Replaces the chart's data with an in-memory series array, resolving it\n * into the internal model (points copied, `hidden` flags preserved by name)\n * and repainting.\n *\n * @param series - The series to render.\n *\n * @returns This chart, for method chaining.\n */\n setSeries(series: ChartSeries[]): this {\n this._series = this.resolveModel(series);\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the chart's series as plain `ChartSeries` (points copied out of\n * the internal model).\n *\n * @returns The current series.\n */\n getSeries(): ChartSeries[] {\n return this._series.map((m) => ({\n name: m.name,\n data: m.points.map((p) => ({ x: p.x, y: p.y })),\n color: m.color,\n }));\n }\n\n /**\n * Binds the chart to a store, reading each point from the given fields and\n * (optionally) splitting records into series by `seriesField`. Unsubscribes\n * any previous store from all four data events before binding the next (no\n * listener accumulation), then rebuilds the model and repaints.\n *\n * @param store - The store to bind.\n * @param xField - Record field for each point's `x`.\n * @param yField - Record field for each point's `y`.\n * @param seriesField - Optional field whose values split records into series.\n *\n * @returns This chart, for method chaining.\n */\n setStore(store: AbstractStore, xField: string, yField: string, seriesField?: string): this {\n if (this._boundStore) {\n for (const event of STORE_EVENTS) {\n this._boundStore.off(event, this._onStoreRefresh);\n }\n }\n\n this._boundStore = store;\n this._xField = xField;\n this._yField = yField;\n this._seriesField = seriesField;\n\n for (const event of STORE_EVENTS) {\n store.on(event, this._onStoreRefresh);\n }\n\n this.rebuildFromStore();\n\n return this;\n }\n\n /**\n * Returns the bound store, or `null` when the chart uses in-memory series.\n *\n * @returns The bound store, or `null`.\n */\n getStore(): AbstractStore | null {\n return this._boundStore;\n }\n\n /**\n * Rebuilds the series model from the bound store's current records, grouping\n * by `seriesField` when configured, and repaints. Preserves each series'\n * hidden flag by name. An empty store yields zero series (no throw).\n */\n private rebuildFromStore(): void {\n if (!this._boundStore) {\n return;\n }\n\n this._series = this.resolveModel(this.seriesFromStore(this._boundStore));\n\n this.scheduleLayout();\n }\n\n /**\n * Reads the store's records into `ChartSeries`, splitting them into one\n * series per distinct `seriesField` value (in first-seen order) when that\n * field is configured, or a single series otherwise.\n *\n * @param store - The bound store.\n *\n * @returns The series read from the store.\n */\n private seriesFromStore(store: AbstractStore): ChartSeries[] {\n const records = store.getRecords();\n\n if (records.length === 0) {\n return [];\n }\n\n if (this._seriesField === undefined) {\n return [{\n name: this._yField,\n data: records.map((r) => ({ x: Number(r.get(this._xField)), y: Number(r.get(this._yField)) })),\n }];\n }\n\n const groups = new Map<string, ChartPoint[]>();\n\n for (const record of records) {\n const key = String(record.get(this._seriesField));\n const point: ChartPoint = { x: Number(record.get(this._xField)), y: Number(record.get(this._yField)) };\n const bucket = groups.get(key);\n\n if (bucket) {\n bucket.push(point);\n } else {\n groups.set(key, [point]);\n }\n }\n\n return Array.from(groups, ([name, data]) => ({ name, data }));\n }\n\n /**\n * Resolves a `ChartSeries` list into the internal model — points copied,\n * colour carried, and the `hidden` flag preserved from the current model by\n * series name so a data refresh does not un-hide a toggled series.\n *\n * @param series - The source series.\n *\n * @returns The resolved series model.\n */\n private resolveModel(series: ChartSeries[]): ChartSeriesModel[] {\n const prevHidden = new Map(this._series.map((m) => [m.name, m.hidden]));\n\n return series.map((s) => ({\n name: s.name,\n points: s.data.map((p) => ({ x: p.x, y: p.y })),\n color: s.color,\n hidden: prevHidden.get(s.name) ?? false,\n }));\n }\n\n // ── Chrome ──────────────────────────────────────────────────────────────\n\n /**\n * Shows or hides the legend and repaints.\n *\n * @param value - `true` to show the legend, `false` to hide it.\n *\n * @returns This chart, for method chaining.\n */\n setShowLegend(value: boolean): this {\n this._options.showLegend = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether the legend is shown (defaults to `true`).\n *\n * @returns `true` when the legend is shown.\n */\n isShowLegend(): boolean {\n return this._options.showLegend ?? true;\n }\n\n /**\n * Sets which edge the legend docks to and repaints.\n *\n * @param position - The legend edge.\n *\n * @returns This chart, for method chaining.\n */\n setLegendPosition(position: ChartLegendPosition): this {\n this._options.legendPosition = position;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the legend dock edge (defaults to `\"right\"`).\n *\n * @returns The legend position.\n */\n getLegendPosition(): ChartLegendPosition {\n return this._options.legendPosition ?? \"right\";\n }\n\n /**\n * Sets the x-axis title (reserving a margin band for it) and repaints.\n *\n * @param label - The axis title.\n *\n * @returns This chart, for method chaining.\n */\n setXAxisLabel(label: string): this {\n this._options.xAxisLabel = label;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the x-axis title, or `null` when unset.\n *\n * @returns The x-axis title, or `null`.\n */\n getXAxisLabel(): string | null {\n return this._options.xAxisLabel ?? null;\n }\n\n /**\n * Sets the y-axis title (reserving a margin band for it) and repaints.\n *\n * @param label - The axis title.\n *\n * @returns This chart, for method chaining.\n */\n setYAxisLabel(label: string): this {\n this._options.yAxisLabel = label;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the y-axis title, or `null` when unset.\n *\n * @returns The y-axis title, or `null`.\n */\n getYAxisLabel(): string | null {\n return this._options.yAxisLabel ?? null;\n }\n\n // ── Events ──────────────────────────────────────────────────────────────\n\n /**\n * Registers a `\"selection\"` listener, fired when a datum is clicked.\n *\n * @param event - The `\"selection\"` event.\n * @param listener - The callback invoked with the selection payload.\n *\n * @returns This chart, for method chaining.\n */\n on(event: \"selection\", listener: (event: ChartSelectionEvent) => void): this {\n this._listeners.add(event, listener);\n\n return this;\n }\n\n /**\n * Removes a previously registered `\"selection\"` listener.\n *\n * @param event - The `\"selection\"` event.\n * @param listener - The exact callback reference to remove.\n *\n * @returns This chart, for method chaining.\n */\n off(event: \"selection\", listener: (event: ChartSelectionEvent) => void): this {\n this._listeners.remove(event, listener);\n\n return this;\n }\n\n /**\n * Fires every `\"selection\"` listener with the payload.\n *\n * @param event - The `\"selection\"` event.\n * @param payload - The selection payload.\n */\n protected emit(event: ChartEvent, payload: ChartSelectionEvent): void {\n this._listeners.fire(event, payload);\n }\n\n // ── Rendering surface ─────────────────────────────────────────────────────\n\n /**\n * Creates the root `<div>` plus the tracked `<svg>` drawing surface and its\n * mark groups (axis, series, overlay), mirroring `Glyph.createRootElement`'s\n * raw-SVG-through-the-sink pattern.\n *\n * @returns The root element handle.\n */\n protected createRootElement(): Handle {\n const root = super.createRootElement();\n\n const svg = DOM.sink.createElementNS(SVG_NS, \"svg\");\n DOM.sink.apply(svg, { style: { position: \"absolute\", left: \"0\", top: \"0\", overflow: \"visible\" } });\n DOM.sink.appendChild(root, svg);\n this.trackHandle(svg);\n this._svg = svg;\n\n this._axisGroup = this.createGroup(svg);\n this._seriesGroup = this.createGroup(svg);\n this._overlayGroup = this.createGroup(svg);\n\n return root;\n }\n\n /**\n * Creates a tracked `<g>` group appended to the SVG surface.\n *\n * @param svg - The SVG surface handle.\n *\n * @returns The group handle.\n */\n private createGroup(svg: Handle): Handle {\n const group = DOM.sink.createElementNS(SVG_NS, \"g\");\n DOM.sink.appendChild(svg, group);\n this.trackHandle(group);\n\n return group;\n }\n\n // ── Layout ────────────────────────────────────────────────────────────────\n\n /**\n * Lays the chart out: sizes the SVG surface to the inner box, reserves the\n * legend band, measures the axis margins, computes the plot rectangle,\n * builds the final scales, and repaints. Reads only the cached inner size\n * (no live geometry), so the stale-DOM hazard does not arise.\n *\n * @returns This chart, for method chaining.\n */\n doLayout(): this {\n super.doLayout();\n\n const inner = this.getInnerSize();\n\n if (!inner || !this._svg) {\n return this;\n }\n\n const origin = this.getPerimeterSize();\n\n this.sizeSurface(inner);\n\n const plotOuter = this.reserveLegend(inner, origin);\n const plot = this.computePlot(plotOuter);\n const scales = this.buildScales(plot);\n\n this._plot = plot;\n this._xScale = scales.x;\n this._yScale = scales.y;\n\n this.repaint(plot, scales.x, scales.y);\n\n return this;\n }\n\n /**\n * Sizes and positions the SVG surface to cover the inner content box, with a\n * user-space viewBox matching so marks are drawn in inner-box pixels.\n *\n * @param inner - The inner content size.\n */\n private sizeSurface(inner: { width: number; height: number }): void {\n const origin = this.getPerimeterSize();\n\n DOM.sink.apply(this._svg!, {\n setAttr: { width: String(inner.width), height: String(inner.height), viewBox: `0 0 ${inner.width} ${inner.height}` },\n style: { position: \"absolute\", left: `${origin.left}px`, top: `${origin.top}px`, overflow: \"visible\" },\n });\n }\n\n /**\n * Reserves the legend's band on its docked edge and positions the legend\n * child there, returning the remaining rectangle for the plot. Hides the\n * legend (and reserves nothing) when it is off or there are no series.\n *\n * @param inner - The inner content size.\n * @param origin - The perimeter origin offset (inset + border + padding).\n *\n * @returns The rectangle left for the plot, in SVG user space.\n */\n private reserveLegend(inner: { width: number; height: number }, origin: { left: number; top: number }): PlotRect {\n const full: PlotRect = { x: 0, y: 0, width: inner.width, height: inner.height };\n\n if (!this.isShowLegend() || this._series.length === 0) {\n this._legend.setVisible(false);\n\n return full;\n }\n\n this._legend.setVisible(true);\n this._legend.setOrientation(this.getLegendPosition() === \"right\" ? \"vertical\" : \"horizontal\");\n this._legend.setEntries(this._series.map((m, i) => ({ name: m.name, color: this.seriesColor(i, m), hidden: m.hidden })));\n\n const pref = this._legend.getPreferredSize() ?? { width: 120, height: 60 };\n const position = this.getLegendPosition();\n\n if (position === \"right\") {\n const band = Math.min(pref.width, inner.width / 2);\n this.placeLegend(origin, inner.width - band, 0, band, inner.height);\n\n return { x: 0, y: 0, width: inner.width - band - LEGEND_GAP, height: inner.height };\n }\n\n const band = Math.min(pref.height, inner.height / 2);\n\n if (position === \"top\") {\n this.placeLegend(origin, 0, 0, inner.width, band);\n\n return { x: 0, y: band + LEGEND_GAP, width: inner.width, height: inner.height - band - LEGEND_GAP };\n }\n\n this.placeLegend(origin, 0, inner.height - band, inner.width, band);\n\n return { x: 0, y: 0, width: inner.width, height: inner.height - band - LEGEND_GAP };\n }\n\n /**\n * Positions the legend child at an inner-box rectangle, offset by the\n * perimeter origin so its coordinates align with the SVG surface.\n *\n * @param origin - The perimeter origin offset.\n * @param x - The rectangle's inner-box x.\n * @param y - The rectangle's inner-box y.\n * @param width - The rectangle width.\n * @param height - The rectangle height.\n */\n private placeLegend(origin: { left: number; top: number }, x: number, y: number, width: number, height: number): void {\n this._legend.setX(origin.left + x);\n this._legend.setY(origin.top + y);\n this._legend.setWidth(width);\n this._legend.setHeight(height);\n this._legend.doLayout();\n }\n\n /**\n * Computes the plot rectangle inside `plotOuter` by subtracting the measured\n * axis margins. Measures margins from provisional scales built against\n * `plotOuter` — the tick *values* (hence label widths) are range-independent,\n * so this one extra scale build breaks the margin↔layout feedback loop.\n *\n * @param plotOuter - The rectangle left after the legend band.\n *\n * @returns The plot rectangle for the series marks.\n */\n private computePlot(plotOuter: PlotRect): PlotRect {\n const provisional = this.buildScales(plotOuter);\n const xFormat = tickFormatter(provisional.x, DEFAULT_TICK_COUNT);\n const yFormat = tickFormatter(provisional.y, DEFAULT_TICK_COUNT);\n\n const leftMargin = measureAxisMargin(\"left\", provisional.y, yFormat, DEFAULT_TICK_COUNT)\n + (this._options.yAxisLabel ? AXIS_LABEL_BAND : 0);\n const bottomMargin = measureAxisMargin(\"bottom\", provisional.x, xFormat, DEFAULT_TICK_COUNT)\n + (this._options.xAxisLabel ? AXIS_LABEL_BAND : 0);\n\n return {\n x: plotOuter.x + leftMargin,\n y: plotOuter.y + TOP_PAD,\n width: Math.max(0, plotOuter.width - leftMargin - RIGHT_PAD),\n height: Math.max(0, plotOuter.height - bottomMargin - TOP_PAD),\n };\n }\n\n /**\n * Clears the previous marks and redraws the axes (with y-gridlines), the\n * series, and the selection ring from scratch.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n private repaint(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n this.clearMarks();\n\n const axis = this.markFactory(this._axisGroup!);\n\n drawAxis(axis, \"left\", yScale, plot, { tickCount: DEFAULT_TICK_COUNT, format: tickFormatter(yScale, DEFAULT_TICK_COUNT), grid: true });\n drawAxis(axis, \"bottom\", xScale, plot, { tickCount: DEFAULT_TICK_COUNT, format: tickFormatter(xScale, DEFAULT_TICK_COUNT), grid: false });\n\n this.drawAxisTitles(axis, plot);\n this.drawSeries(plot, xScale, yScale);\n this.drawSelection(plot, xScale, yScale);\n }\n\n /**\n * Draws the optional x/y axis titles centred on their axes.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n */\n private drawAxisTitles(create: MarkFactory, plot: PlotRect): void {\n const labelFill = { fill: \"var(--ts-ui-chart-label)\" };\n\n if (this._options.xAxisLabel) {\n create(\"text\", {\n setAttr: { x: String(plot.x + plot.width / 2), y: String(plot.y + plot.height + AXIS_LABEL_BAND + TOP_PAD), \"text-anchor\": \"middle\", \"dominant-baseline\": \"hanging\" },\n style: labelFill,\n text: this._options.xAxisLabel,\n });\n }\n\n if (this._options.yAxisLabel) {\n const cx = plot.x - AXIS_LABEL_BAND * 2;\n const cy = plot.y + plot.height / 2;\n\n create(\"text\", {\n setAttr: { x: String(cx), y: String(cy), \"text-anchor\": \"middle\", \"dominant-baseline\": \"middle\", transform: `rotate(-90 ${cx} ${cy})` },\n style: labelFill,\n text: this._options.yAxisLabel,\n });\n }\n }\n\n /**\n * Draws the selection ring around the currently selected point, if any and\n * its series is visible.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n private drawSelection(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n if (!this._selectedPoint) {\n return;\n }\n\n const model = this._series[this._selectedPoint.series];\n\n if (!model || model.hidden || this._selectedPoint.index >= model.points.length) {\n return;\n }\n\n const anchor = this.pointPixel(plot, xScale, yScale, this._selectedPoint.series, this._selectedPoint.index);\n\n if (!anchor) {\n return;\n }\n\n this.createMark(this._overlayGroup!, \"circle\", {\n setAttr: { cx: String(anchor.x), cy: String(anchor.y), r: String(SELECTION_RING_RADIUS) },\n style: { fill: \"none\", stroke: \"var(--ts-ui-chart-selection)\", \"stroke-width\": \"2\" },\n });\n }\n\n // ── Mark bookkeeping ───────────────────────────────────────────────────────\n\n /**\n * Returns a {@link MarkFactory} bound to a group, so a caller (e.g. the axis\n * renderer) creates marks that flow through this chart's centralised\n * clear/release bookkeeping.\n *\n * @param group - The parent group handle.\n *\n * @returns A factory creating tracked marks in that group.\n */\n private markFactory(group: Handle): MarkFactory {\n return (tag, patch) => this.createMark(group, tag, patch);\n }\n\n /**\n * Creates one SVG mark, applies a patch, appends it to a group, and tracks\n * it for release on the next repaint.\n *\n * @param parent - The parent group handle.\n * @param tag - The SVG element tag.\n * @param patch - The patch to apply.\n *\n * @returns The created mark handle.\n */\n private createMark(parent: Handle, tag: string, patch: ElementPatch): Handle {\n const mark = DOM.sink.createElementNS(SVG_NS, tag);\n DOM.sink.apply(mark, patch);\n DOM.sink.appendChild(parent, mark);\n this._marks.push({ parent, handle: mark });\n\n return mark;\n }\n\n /**\n * Creates a series mark in the series group, for subclass `drawSeries`\n * implementations.\n *\n * @param tag - The SVG element tag.\n * @param patch - The patch to apply.\n *\n * @returns The created mark handle.\n */\n protected seriesMark(tag: string, patch: ElementPatch): Handle {\n return this.createMark(this._seriesGroup!, tag, patch);\n }\n\n /** Detaches and releases every mark created since the last repaint. */\n private clearMarks(): void {\n for (const { parent, handle } of this._marks) {\n DOM.sink.removeChild(parent, handle);\n DOM.sink.release(handle);\n }\n\n this._marks.length = 0;\n }\n\n // ── Interaction ────────────────────────────────────────────────────────────\n\n /**\n * On pointer move over a mark carrying series/index data attributes, shows a\n * tooltip for that datum; hides it when the pointer is over blank space.\n *\n * @param event - The mouse-move event.\n */\n private handlePointerMove = (event: MouseEvent): void => {\n const hit = this.resolveHit(event);\n\n if (!hit) {\n Tooltip.hide();\n\n return;\n }\n\n const model = this._series[hit.series];\n // A whole-series mark (a line path, no point index) shows the series name\n // only; an indexed mark (a point marker or bar) shows the datum.\n const text = hit.index === null\n ? model.name\n : `${model.name}: (${model.points[hit.index].x}, ${model.points[hit.index].y})`;\n\n Tooltip.show(text, event.clientX, event.clientY);\n };\n\n /**\n * Hides the tooltip when the pointer truly leaves the chart. The subtree\n * `mouseout` also fires when the pointer crosses *between* internal marks\n * (a point marker onto the line path, say); hiding then would blank the\n * tooltip at every internal boundary, so a move whose `relatedTarget` is\n * still inside the chart is ignored.\n *\n * @param event - The mouse-out event.\n */\n private handlePointerOut = (event: MouseEvent): void => {\n const related = event.relatedTarget;\n const root = this.getElement();\n\n if (root && DOM.source.isNode(related) && DOM.source.contains(root, DOM.source.intern(related))) {\n return;\n }\n\n Tooltip.hide();\n };\n\n /**\n * On a click on a mark carrying series/index data attributes, selects that\n * datum (drawing a selection ring) and emits `\"selection\"`.\n *\n * @param event - The click event.\n */\n private handlePointerClick = (event: MouseEvent): void => {\n const hit = this.resolveHit(event);\n\n // Selection needs a concrete point — a whole-series mark (line path,\n // null index) carries no datum to select.\n if (!hit || hit.index === null) {\n return;\n }\n\n this.selectPoint(hit.series, hit.index);\n };\n\n /**\n * Toggles a series' visibility from a legend click and repaints.\n *\n * @param index - The toggled series index.\n */\n private handleLegendToggle = (index: number): void => {\n const model = this._series[index];\n\n if (model) {\n model.hidden = !model.hidden;\n\n this.scheduleLayout();\n }\n };\n\n /**\n * Resolves a pointer event to the datum (or whole series) it targets, or\n * `null` for a miss. The default reads the series/index data attributes off\n * the event's target mark ({@link hitMark}); subtypes whose marks are hard\n * to land on precisely (a thin line path) override this with a geometric\n * proximity test.\n *\n * @param event - The pointer event.\n *\n * @returns The hit `{ series, index }` (`index` null for a whole-series mark), or `null`.\n */\n protected resolveHit(event: MouseEvent): { series: number; index: number | null } | null {\n return this.hitMark(event);\n }\n\n /**\n * Maps a viewport (client) coordinate to the SVG surface's user space, whose\n * viewBox matches the inner-box pixels 1:1. Returns `null` before the surface\n * exists. Used by geometric hit-testing to place the cursor in mark space.\n *\n * @param clientX - The viewport x coordinate.\n * @param clientY - The viewport y coordinate.\n *\n * @returns The point in SVG user space, or `null`.\n */\n protected clientToSurface(clientX: number, clientY: number): { x: number; y: number } | null {\n if (!this._svg) {\n return null;\n }\n\n const rect = DOM.source.getElementRect(this._svg);\n\n return { x: clientX - rect.x, y: clientY - rect.y };\n }\n\n /**\n * Reads the series/index data attributes off the event's target mark. A mark\n * carrying only `data-series` (a line path) resolves to a whole-series hit\n * (`index: null`); a mark carrying `data-index` too (a point marker or bar)\n * resolves to that datum. Returns `null` when the target is not a series\n * mark, its series is hidden, or its index is out of range — so a series with\n * no point markers (`showPoints: false`) still hovers at the series level via\n * its path.\n *\n * @param event - The pointer event.\n *\n * @returns The hit `{ series, index }` (`index` null for a whole-series mark), or `null`.\n */\n private hitMark(event: MouseEvent): { series: number; index: number | null } | null {\n if (!DOM.source.isNode(event.target)) {\n return null;\n }\n\n const target = DOM.source.intern(event.target);\n const seriesRaw = DOM.source.getDataset(target, \"series\");\n\n if (seriesRaw === undefined) {\n return null;\n }\n\n const series = Number(seriesRaw);\n const model = this._series[series];\n\n if (!model || model.hidden) {\n return null;\n }\n\n const indexRaw = DOM.source.getDataset(target, \"index\");\n\n if (indexRaw === undefined) {\n return { series, index: null };\n }\n\n const index = Number(indexRaw);\n\n if (index >= model.points.length) {\n return null;\n }\n\n return { series, index };\n }\n\n /**\n * Selects a datum, repaints with the selection ring, and emits `\"selection\"`.\n *\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n */\n protected selectPoint(series: number, index: number): void {\n this._selectedPoint = { series, index };\n\n this.scheduleLayout();\n\n const model = this._series[series];\n\n this.emit(\"selection\", { series, index, point: model.points[index], seriesName: model.name });\n }\n\n // ── Colour resolution ──────────────────────────────────────────────────────\n\n /**\n * Resolves a series' mark colour: its explicit override, or the theme's\n * categorical palette slot for its index (cycling within the palette).\n *\n * @param index - The series index.\n * @param model - The series model.\n *\n * @returns A CSS colour or `var(--ts-ui-chart-series-N)` binding.\n */\n protected seriesColor(index: number, model: ChartSeriesModel): string {\n return model.color ?? `var(--ts-ui-chart-series-${(index % PALETTE_SIZE) + 1})`;\n }\n\n // ── Subtype hooks ──────────────────────────────────────────────────────────\n\n /**\n * Builds the x and y scales for the given plot rectangle. Reads the visible\n * series to compute domains; the subtype selects the scale kinds.\n *\n * @param plot - The plot rectangle whose edges form the pixel ranges.\n *\n * @returns The x and y scales.\n */\n protected abstract buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale };\n\n /**\n * Draws the series marks into the series group (via {@link seriesMark}),\n * carrying `data-series` / `data-index` for hit-testing and binding colours\n * to the palette variables. Hidden series draw nothing.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n protected abstract drawSeries(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void;\n\n /**\n * Returns the pixel anchor of a datum (for the selection ring) in SVG user\n * space, or `null` when it cannot be resolved.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The pixel anchor, or `null`.\n */\n protected abstract pointPixel(plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null;\n\n // ── Lifecycle ──────────────────────────────────────────────────────────────\n\n /**\n * Unbinds the store, removes the theme subscription, and hides any open\n * tooltip. Call when the chart is permanently removed.\n */\n protected destructor(): void {\n if (this._boundStore) {\n for (const event of STORE_EVENTS) {\n this._boundStore.off(event, this._onStoreRefresh);\n }\n\n this._boundStore = null;\n }\n\n if (this._themeCleanup) {\n this._themeCleanup();\n this._themeCleanup = null;\n }\n\n // Release the last repaint's marks. They deliberately bypass\n // `trackHandle` (only the <svg> and its groups are tracked, and released\n // by the destructor), and `release` is non-recursive, so without this\n // every mark stays pinned in the handle registry — the Glyphs sprite-leak\n // lesson at final teardown, not just per repaint.\n this.clearMarks();\n\n // `_legend` is registered via `addComponent`, so `super.destructor()`'s\n // child recursion below already disposes it — an explicit call here\n // would run `ChartLegend.destructor()` a second time.\n Tooltip.hide();\n\n super.destructor();\n }\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { line, curveMonotoneX, curveLinear } from \"d3-shape\";\nimport { AbstractChart, AbstractChartOptions } from \"~/component/chart/AbstractChart.js\";\nimport { linearScale, timeScale, pointsXExtent, pointsYBounds } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport { callable } from \"~/core/Callable.js\";\nimport type { ChartPoint, PlotRect } from \"~/component/chart/types.js\";\n\n/** The x-axis scale kind a line chart uses. */\nexport type LineChartScaleType = \"linear\" | \"time\";\n\n/**\n * Vertical distance (px) within which the pointer \"catches\" a line for hover.\n * A comfortable band so the thin stroke need not be hit exactly; the nearest\n * line within it wins.\n */\nconst HOVER_TOLERANCE = 16;\n\n/** Binary-search steps used to invert a curve segment's x(t) — sub-pixel at 24. */\nconst CURVE_SOLVE_STEPS = 24;\n\n/** One captured path segment as a cubic in pixel space: `[x0,y0, x1,y1, x2,y2, x3,y3]`. */\ntype CurveSegment = [number, number, number, number, number, number, number, number];\n\n/**\n * A minimal path \"context\" that records the segments d3's line generator emits.\n * Feeding this to `line().context(...)` captures the *exact* rendered curve —\n * straight (`curveLinear`) or monotone (`curveMonotoneX`) — as cubic segments in\n * pixel space, so hover hit-testing can evaluate the real curve instead of the\n * straight chord between data points (which, for a monotone curve, sits off the\n * visible line and biases the catch band to one side). Only the three calls a\n * d3 line curve makes are implemented; a straight `lineTo` is stored as a\n * degenerate cubic whose controls lie on the chord.\n */\nclass CurveTape {\n readonly segments: CurveSegment[] = [];\n private _x = 0;\n private _y = 0;\n\n moveTo(x: number, y: number): void {\n this._x = x;\n this._y = y;\n }\n\n lineTo(x: number, y: number): void {\n this.segments.push([this._x, this._y, this._x, this._y, x, y, x, y]);\n this._x = x;\n this._y = y;\n }\n\n bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.segments.push([this._x, this._y, x1, y1, x2, y2, x, y]);\n this._x = x;\n this._y = y;\n }\n\n closePath(): void {\n // Line paths are never closed; required only to satisfy the context shape.\n }\n}\n\n/** Evaluates a cubic Bézier component (one axis) at parameter `t`. */\nfunction cubicAt(a: number, b: number, c: number, d: number, t: number): number {\n const u = 1 - t;\n\n return u * u * u * a + 3 * u * u * t * b + 3 * u * t * t * c + t * t * t * d;\n}\n\n/**\n * Construction-time options for {@link LineChart}.\n *\n * @category Components\n */\nexport interface LineChartOptions extends AbstractChartOptions {\n /** Whether to draw a circle marker at each point; defaults to `true`. */\n showPoints?: boolean;\n /** Whether to smooth the line (monotone curve) vs straight segments; defaults to `false`. */\n curved?: boolean;\n /** The x-axis scale kind; defaults to `\"linear\"`. */\n xScaleType?: LineChartScaleType;\n}\n\n/**\n * A line chart: one path per series over a linear or time x axis and a linear y\n * axis, with optional point markers. The path `d` string is generated by the\n * pure `d3-shape` `line()` generator (optionally with a monotone curve) and fed\n * straight into a `setAttr({ d })` through the sink — no DOM-owning d3 code.\n *\n * @category Components\n */\nclass LineChart extends AbstractChart<LineChartOptions> {\n\n /**\n * Builds the line chart, then dispatches its own options from the\n * constructor body (after `super()` has wired the base chart).\n *\n * @param options - Optional construction-time options.\n */\n constructor(options?: LineChartOptions) {\n super(options);\n\n this.dispatchLineOptions(options);\n }\n\n /**\n * Dispatches the line-specific options through their setters.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchLineOptions(options?: LineChartOptions): void {\n if (!options) {\n return;\n }\n\n if (options.showPoints !== undefined) {\n this.setShowPoints(options.showPoints);\n }\n\n if (options.curved !== undefined) {\n this.setCurved(options.curved);\n }\n\n if (options.xScaleType !== undefined) {\n this.setXScaleType(options.xScaleType);\n }\n }\n\n /**\n * Sets whether point markers are drawn and repaints.\n *\n * @param value - `true` to draw circle markers at each point.\n *\n * @returns This chart, for method chaining.\n */\n setShowPoints(value: boolean): this {\n this._options.showPoints = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether point markers are drawn (defaults to `true`).\n *\n * @returns `true` when markers are drawn.\n */\n isShowPoints(): boolean {\n return this._options.showPoints ?? true;\n }\n\n /**\n * Sets whether the line is smoothed (monotone curve) and repaints.\n *\n * @param value - `true` to smooth the line.\n *\n * @returns This chart, for method chaining.\n */\n setCurved(value: boolean): this {\n this._options.curved = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether the line is smoothed (defaults to `false`).\n *\n * @returns `true` when smoothed.\n */\n isCurved(): boolean {\n return this._options.curved ?? false;\n }\n\n /**\n * Sets the x-axis scale kind and repaints.\n *\n * @param value - The scale kind.\n *\n * @returns This chart, for method chaining.\n */\n setXScaleType(value: LineChartScaleType): this {\n this._options.xScaleType = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the x-axis scale kind (defaults to `\"linear\"`).\n *\n * @returns The scale kind.\n */\n getXScaleType(): LineChartScaleType {\n return this._options.xScaleType ?? \"linear\";\n }\n\n /**\n * Flattens the points of every visible series into one array (for domain\n * computation).\n *\n * @returns The visible points.\n */\n private visiblePoints(): ChartPoint[] {\n return this._series.filter((m) => !m.hidden).flatMap((m) => m.points);\n }\n\n /**\n * Builds a linear or time x scale and a linear y scale against the plot\n * rectangle, from the visible points' extents.\n *\n * @param plot - The plot rectangle.\n *\n * @returns The x and y scales.\n */\n protected buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale } {\n const points = this.visiblePoints();\n const [xMin, xMax] = pointsXExtent(points);\n const yBounds = pointsYBounds(points);\n const xRange: [number, number] = [plot.x, plot.x + plot.width];\n const yRange: [number, number] = [plot.y + plot.height, plot.y];\n\n const x = this.getXScaleType() === \"time\"\n ? timeScale([new Date(xMin), new Date(xMax)], xRange)\n : linearScale([xMin, xMax], xRange);\n\n return { x, y: linearScale(yBounds, yRange) };\n }\n\n /**\n * Draws one path per visible series (plus optional point markers), tagging\n * each mark with its `data-series` / `data-index` and binding its colour to\n * the palette. The path `d` comes from `d3-shape`'s `line()` generator.\n *\n * @param plot - The plot rectangle (unused; the scales carry the geometry).\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n protected drawSeries(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n const project = this.projector(xScale, yScale);\n const curve = this.isCurved() ? curveMonotoneX : curveLinear;\n\n this._series.forEach((model, seriesIndex) => {\n if (model.hidden) {\n return;\n }\n\n const color = this.seriesColor(seriesIndex, model);\n const path = line<ChartPoint>().x((p) => project.x(p.x)).y((p) => project.y(p.y)).curve(curve)(model.points);\n\n // The path spans the whole series, so it carries `data-series` only\n // (no per-point `data-index`): hovering the line shows a series-level\n // tooltip, while per-point hover/selection rides on the point markers\n // below. With `showPoints: false` the line stays series-level hoverable.\n this.seriesMark(\"path\", {\n setAttr: { d: path ?? \"\", \"data-series\": String(seriesIndex) },\n style: { fill: \"none\", stroke: color, \"stroke-width\": \"var(--ts-ui-chart-line-width)\" },\n });\n\n if (this.isShowPoints()) {\n this.drawPoints(model.points, seriesIndex, color, project);\n }\n });\n }\n\n /**\n * Draws a circle marker per point, each hit-taggable via its\n * `data-series` / `data-index`.\n *\n * @param points - The series points.\n * @param seriesIndex - The series index.\n * @param color - The resolved series colour.\n * @param project - The point→pixel projectors.\n */\n private drawPoints(points: ChartPoint[], seriesIndex: number, color: string, project: { x: (v: number) => number; y: (v: number) => number }): void {\n points.forEach((point, index) => {\n this.seriesMark(\"circle\", {\n setAttr: { cx: String(project.x(point.x)), cy: String(project.y(point.y)), r: \"var(--ts-ui-chart-point-radius)\", \"data-series\": String(seriesIndex), \"data-index\": String(index) },\n style: { fill: color },\n });\n });\n }\n\n /**\n * Returns the pixel anchor of a datum for the selection ring.\n *\n * @param plot - The plot rectangle (unused).\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The pixel anchor, or `null` when out of range.\n */\n protected pointPixel(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null {\n const point = this._series[series]?.points[index];\n\n if (!point) {\n return null;\n }\n\n const project = this.projector(xScale, yScale);\n\n return { x: project.x(point.x), y: project.y(point.y) };\n }\n\n /**\n * Resolves a pointer to the vertically-nearest visible series' line at the\n * cursor's x, within {@link HOVER_TOLERANCE}. A thin line path is hard to\n * land on precisely, so instead of the base's data-attribute hit-testing\n * this interpolates each line's y at the pointer and picks the closest,\n * reporting that series' nearest point (so the tooltip shows its value and a\n * click selects it). Returns `null` before layout or when no line is near.\n *\n * @param event - The pointer event.\n *\n * @returns The nearest `{ series, index }`, or `null`.\n */\n protected resolveHit(event: MouseEvent): { series: number; index: number | null } | null {\n if (!this._plot || !this._xScale || !this._yScale) {\n return null;\n }\n\n const cursor = this.clientToSurface(event.clientX, event.clientY);\n\n if (!cursor) {\n return null;\n }\n\n const plot = this._plot;\n\n // Only inside the plot's horizontal band, and its vertical band widened\n // by the tolerance so a line at the very top/bottom edge still catches.\n if (cursor.x < plot.x || cursor.x > plot.x + plot.width\n || cursor.y < plot.y - HOVER_TOLERANCE || cursor.y > plot.y + plot.height + HOVER_TOLERANCE) {\n return null;\n }\n\n const project = this.projector(this._xScale, this._yScale);\n\n let bestSeries = -1;\n let bestDist = HOVER_TOLERANCE;\n\n this._series.forEach((model, seriesIndex) => {\n if (model.hidden || model.points.length === 0) {\n return;\n }\n\n const lineY = this.curveYAt(model.points, cursor.x, project);\n\n if (lineY === null) {\n return;\n }\n\n const dist = Math.abs(cursor.y - lineY);\n\n if (dist <= bestDist) {\n bestDist = dist;\n bestSeries = seriesIndex;\n }\n });\n\n if (bestSeries < 0) {\n return null;\n }\n\n return { series: bestSeries, index: this.nearestPointIndex(this._series[bestSeries].points, cursor.x, project) };\n }\n\n /**\n * Evaluates a series' rendered line at a pixel x, returning the curve's\n * pixel y (or `null` when the cursor is outside the series' x-extent). The\n * curve is captured exactly as drawn — via {@link CurveTape} fed to the same\n * `line()` generator {@link drawSeries} uses — so a monotone (curved) line is\n * followed faithfully rather than approximated by the straight chord, which\n * would sit off the visible line and make the catch band lopsided. Within the\n * bracketing segment (x is monotone across it for both curve kinds), a binary\n * search inverts x(t), then y(t) gives the height.\n *\n * @param points - The series points (x-ordered, as drawn).\n * @param px - The cursor's pixel x.\n * @param project - The point→pixel projectors.\n *\n * @returns The line's pixel y at `px`, or `null` when out of range.\n */\n private curveYAt(points: ChartPoint[], px: number, project: { x: (v: number) => number; y: (v: number) => number }): number | null {\n const tape = new CurveTape();\n // d3's context type is Canvas-shaped; CurveTape implements only the three\n // calls a line curve makes, so the cast bridges the structural gap.\n const generator = line<ChartPoint>()\n .x((p) => project.x(p.x))\n .y((p) => project.y(p.y))\n .curve(this.isCurved() ? curveMonotoneX : curveLinear)\n .context(tape as unknown as CanvasRenderingContext2D);\n\n generator(points);\n\n for (const [x0, y0, x1, y1, x2, y2, x3, y3] of tape.segments) {\n if (px < Math.min(x0, x3) || px > Math.max(x0, x3)) {\n continue;\n }\n\n const ascending = x3 >= x0;\n let lo = 0;\n let hi = 1;\n\n for (let step = 0; step < CURVE_SOLVE_STEPS; step++) {\n const mid = (lo + hi) / 2;\n\n if ((cubicAt(x0, x1, x2, x3, mid) <= px) === ascending) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return cubicAt(y0, y1, y2, y3, (lo + hi) / 2);\n }\n\n return null;\n }\n\n /**\n * Returns the index of the series point whose projected x is nearest the\n * cursor's pixel x — the datum a near-line hover reports.\n *\n * @param points - The series points.\n * @param px - The cursor's pixel x.\n * @param project - The point→pixel projectors.\n *\n * @returns The nearest point's index.\n */\n private nearestPointIndex(points: ChartPoint[], px: number, project: { x: (v: number) => number; y: (v: number) => number }): number {\n let best = 0;\n let bestDx = Infinity;\n\n points.forEach((point, index) => {\n const dx = Math.abs(project.x(point.x) - px);\n\n if (dx < bestDx) {\n bestDx = dx;\n best = index;\n }\n });\n\n return best;\n }\n\n /**\n * Adapts the continuous x/y scales into plain numeric projectors. The line\n * chart's x scale is always continuous (linear/time), so the band-scale arm\n * of the {@link ChartScale} union never applies here.\n *\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n *\n * @returns The `x` and `y` value→pixel projectors.\n */\n private projector(xScale: ChartScale, yScale: ChartScale): { x: (v: number) => number; y: (v: number) => number } {\n return {\n x: xScale as unknown as (v: number) => number,\n y: yScale as unknown as (v: number) => number,\n };\n }\n}\n\nconst LineChartCallable = callable(LineChart);\ntype LineChartCallable = LineChart;\nexport {\n LineChart as _LineChart,\n LineChartCallable as LineChart\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractChart, AbstractChartOptions } from \"~/component/chart/AbstractChart.js\";\nimport { bandScale, linearScale, isBandScale, pointsYBounds } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport type { ScaleBand } from \"d3-scale\";\nimport { callable } from \"~/core/Callable.js\";\nimport type { ChartPoint, ChartSeriesModel, PlotRect } from \"~/component/chart/types.js\";\n\n/**\n * Construction-time options for {@link BarChart}.\n *\n * @category Components\n */\nexport interface BarChartOptions extends AbstractChartOptions {\n /**\n * Whether multiple series are drawn as side-by-side grouped bars (`true`)\n * or stacked (`false`). Defaults to grouped when more than one series is\n * present.\n */\n grouped?: boolean;\n}\n\n/** One resolved bar rectangle, tagged with the datum it represents. */\ninterface BarRect {\n seriesIndex: number;\n pointIndex: number;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * A bar chart: a discrete band x axis and a linear y axis. Multiple series are\n * drawn grouped (side by side) or stacked. Bar rectangles are hand-computed from\n * the band scale — `d3-shape` adds nothing to axis-aligned rectangles.\n *\n * @category Components\n */\nclass BarChart extends AbstractChart<BarChartOptions> {\n\n /**\n * Builds the bar chart, then dispatches its own options from the constructor\n * body.\n *\n * @param options - Optional construction-time options.\n */\n constructor(options?: BarChartOptions) {\n super(options);\n\n if (options?.grouped !== undefined) {\n this.setGrouped(options.grouped);\n }\n }\n\n /**\n * Sets whether multiple series are grouped (vs stacked) and repaints.\n *\n * @param value - `true` for grouped bars, `false` for stacked.\n *\n * @returns This chart, for method chaining.\n */\n setGrouped(value: boolean): this {\n this._options.grouped = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether multiple series are grouped (defaults to grouped when more\n * than one series is present).\n *\n * @returns `true` when bars are grouped.\n */\n isGrouped(): boolean {\n return this._options.grouped ?? this._series.length > 1;\n }\n\n /**\n * Returns the distinct x categories across the visible series, in ascending\n * numeric order, as strings.\n *\n * @returns The ordered category labels.\n */\n private categories(): string[] {\n const values = new Set<number>();\n\n for (const model of this._series) {\n if (!model.hidden) {\n for (const point of model.points) {\n values.add(point.x);\n }\n }\n }\n\n return Array.from(values).sort((a, b) => a - b).map(String);\n }\n\n /**\n * Flattens the points of every visible series (for the y-domain).\n *\n * @returns The visible points.\n */\n private visiblePoints(): ChartPoint[] {\n return this._series.filter((m) => !m.hidden).flatMap((m) => m.points);\n }\n\n /**\n * Builds a band x scale over the categories and a linear y scale from zero\n * to the data max.\n *\n * @param plot - The plot rectangle.\n *\n * @returns The x and y scales.\n */\n protected buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale } {\n const x = bandScale(this.categories(), [plot.x, plot.x + plot.width]);\n const y = linearScale(pointsYBounds(this.visiblePoints()), [plot.y + plot.height, plot.y]);\n\n return { x, y };\n }\n\n /**\n * Draws one `<rect>` per (visible series × point), grouped or stacked, each\n * tagged with `data-series` / `data-index` and coloured from the palette.\n *\n * @param plot - The plot rectangle (unused; the scales carry the geometry).\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n */\n protected drawSeries(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n for (const bar of this.computeBars(xScale, yScale)) {\n const color = this.seriesColor(bar.seriesIndex, this._series[bar.seriesIndex]);\n\n this.seriesMark(\"rect\", {\n setAttr: { x: String(bar.x), y: String(bar.y), width: String(bar.width), height: String(bar.height), \"data-series\": String(bar.seriesIndex), \"data-index\": String(bar.pointIndex) },\n style: { fill: color },\n });\n }\n }\n\n /**\n * Computes the bar rectangles for the visible series against the scales,\n * subdividing each category band across grouped series or stacking them.\n *\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n *\n * @returns The bar rectangles.\n */\n private computeBars(xScale: ChartScale, yScale: ChartScale): BarRect[] {\n if (!isBandScale(xScale)) {\n return [];\n }\n\n const project = yScale as unknown as (v: number) => number;\n const baseline = project(0);\n const grouped = this.isGrouped();\n const visible = this._series\n .map((model, index) => ({ model, index }))\n .filter((entry) => !entry.model.hidden);\n const groupWidth = xScale.bandwidth();\n const barWidth = grouped ? groupWidth / Math.max(1, visible.length) : groupWidth;\n const stackTops = new Map<string, number>();\n const bars: BarRect[] = [];\n\n visible.forEach((entry, position) => {\n this.appendSeriesBars(bars, entry.model, entry.index, position, xScale, project, baseline, grouped, barWidth, stackTops);\n });\n\n return bars;\n }\n\n /**\n * Appends the bar rectangles for one series to `bars`.\n *\n * @param bars - The accumulating bar list.\n * @param model - The series model.\n * @param seriesIndex - The series' index in the full model.\n * @param position - The series' position among the visible series (grouped offset).\n * @param xScale - The band x scale.\n * @param project - The y value→pixel projector.\n * @param baseline - The pixel y of the zero baseline.\n * @param grouped - Whether bars are grouped (vs stacked).\n * @param barWidth - The per-bar width in px.\n * @param stackTops - Running stacked tops per category (mutated for stacking).\n */\n private appendSeriesBars(\n bars: BarRect[],\n model: ChartSeriesModel,\n seriesIndex: number,\n position: number,\n xScale: ScaleBand<string>,\n project: (v: number) => number,\n baseline: number,\n grouped: boolean,\n barWidth: number,\n stackTops: Map<string, number>\n ): void {\n model.points.forEach((point, pointIndex) => {\n const category = String(point.x);\n const bandStart = xScale(category) ?? 0;\n\n if (grouped) {\n const top = project(point.y);\n\n bars.push({ seriesIndex, pointIndex, x: bandStart + position * barWidth, y: Math.min(top, baseline), width: barWidth, height: Math.abs(baseline - top), });\n } else {\n const prev = stackTops.get(category) ?? 0;\n const cumulative = prev + point.y;\n const top = project(cumulative);\n const bottom = project(prev);\n\n bars.push({ seriesIndex, pointIndex, x: bandStart, y: Math.min(top, bottom), width: barWidth, height: Math.abs(bottom - top), });\n stackTops.set(category, cumulative);\n }\n });\n }\n\n /**\n * Returns the top-centre pixel of a datum's bar for the selection ring.\n *\n * @param plot - The plot rectangle (unused).\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The bar top-centre pixel, or `null` when not found.\n */\n protected pointPixel(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null {\n const bar = this.computeBars(xScale, yScale).find((b) => b.seriesIndex === series && b.pointIndex === index);\n\n if (!bar) {\n return null;\n }\n\n return { x: bar.x + bar.width / 2, y: bar.y };\n }\n}\n\nconst BarChartCallable = callable(BarChart);\ntype BarChartCallable = BarChart;\nexport {\n BarChart as _BarChart,\n BarChartCallable as BarChart\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11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G,MAAO,EAAU,OAAQ,KAAK,IAAI,EAAW,CAAG,CAAG,CAAC,CAC7J,KAAO,CACH,IAAM,EAAO,EAAU,IAAI,CAAQ,GAAK,EAClC,EAAa,EAAO,EAAM,EAC1B,EAAM,EAAQ,CAAU,EACxB,EAAS,EAAQ,CAAI,EAE3B,EAAK,KAAK,CAAE,cAAa,aAAY,EAAG,EAAW,EAAG,KAAK,IAAI,EAAK,CAAM,EAAG,MAAO,EAAU,OAAQ,KAAK,IAAI,EAAS,CAAG,CAAG,CAAC,EAC/H,EAAU,IAAI,EAAU,CAAU,CACtC,CACJ,CAAC,CACL,CAaA,WAAqB,EAAiB,EAAoB,EAAoB,EAAgB,EAAgD,CAC1I,IAAM,EAAM,KAAK,YAAY,EAAQ,CAAM,CAAC,CAAC,KAAM,GAAM,EAAE,cAAgB,GAAU,EAAE,aAAe,CAAK,EAM3G,OAJK,EAIE,CAAE,EAAG,EAAI,EAAI,EAAI,MAAQ,EAAG,EAAG,EAAI,CAAE,EAHjC,IAIf,CACJ,EAEM,GAAmB,EAAS,QAAQ"}
1
+ {"version":3,"file":"chart.es.js","names":["constant","curveLinear","x","pointX","y","pointY","array","zero","number","number","sequence","define","linear","constant","rgb","colorRgb","basis","basisClosed","value","value","number","constant","number","rgb","string","date","numberArray","object","number","constant","bisect","interpolateValue","interpolateNumber","number","interpolateRound","formatDecimal","formatRounded","formatPrefixAuto","identity","formatGroup","formatNumerals","formatTypes","formatTrim","exponent","locale","defaultLocale","formatLocale","exponent","exponent","exponent","precisionPrefix","precisionRound","precisionFixed","timeWeek","timeSecond"],"sources":["../../../../../node_modules/d3-shape/src/constant.js","../../../../../node_modules/d3-path/src/path.js","../../../../../node_modules/d3-shape/src/path.js","../../../../../node_modules/d3-shape/src/array.js","../../../../../node_modules/d3-shape/src/curve/linear.js","../../../../../node_modules/d3-shape/src/point.js","../../../../../node_modules/d3-shape/src/line.js","../../../../../node_modules/d3-shape/src/curve/monotone.js","../../../../../node_modules/d3-array/src/ascending.js","../../../../../node_modules/d3-array/src/descending.js","../../../../../node_modules/d3-array/src/bisector.js","../../../../../node_modules/d3-array/src/number.js","../../../../../node_modules/d3-array/src/bisect.js","../../../../../node_modules/d3-array/src/extent.js","../../../../../node_modules/internmap/src/index.js","../../../../../node_modules/d3-array/src/ticks.js","../../../../../node_modules/d3-array/src/max.js","../../../../../node_modules/d3-array/src/min.js","../../../../../node_modules/d3-array/src/range.js","../../../../../node_modules/d3-scale/src/init.js","../../../../../node_modules/d3-scale/src/ordinal.js","../../../../../node_modules/d3-scale/src/band.js","../../../../../node_modules/d3-color/src/define.js","../../../../../node_modules/d3-color/src/color.js","../../../../../node_modules/d3-interpolate/src/basis.js","../../../../../node_modules/d3-interpolate/src/basisClosed.js","../../../../../node_modules/d3-interpolate/src/constant.js","../../../../../node_modules/d3-interpolate/src/color.js","../../../../../node_modules/d3-interpolate/src/rgb.js","../../../../../node_modules/d3-interpolate/src/numberArray.js","../../../../../node_modules/d3-interpolate/src/array.js","../../../../../node_modules/d3-interpolate/src/date.js","../../../../../node_modules/d3-interpolate/src/number.js","../../../../../node_modules/d3-interpolate/src/object.js","../../../../../node_modules/d3-interpolate/src/string.js","../../../../../node_modules/d3-interpolate/src/value.js","../../../../../node_modules/d3-interpolate/src/round.js","../../../../../node_modules/d3-scale/src/constant.js","../../../../../node_modules/d3-scale/src/number.js","../../../../../node_modules/d3-scale/src/continuous.js","../../../../../node_modules/d3-format/src/formatDecimal.js","../../../../../node_modules/d3-format/src/exponent.js","../../../../../node_modules/d3-format/src/formatGroup.js","../../../../../node_modules/d3-format/src/formatNumerals.js","../../../../../node_modules/d3-format/src/formatSpecifier.js","../../../../../node_modules/d3-format/src/formatTrim.js","../../../../../node_modules/d3-format/src/formatPrefixAuto.js","../../../../../node_modules/d3-format/src/formatRounded.js","../../../../../node_modules/d3-format/src/formatTypes.js","../../../../../node_modules/d3-format/src/identity.js","../../../../../node_modules/d3-format/src/locale.js","../../../../../node_modules/d3-format/src/defaultLocale.js","../../../../../node_modules/d3-format/src/precisionFixed.js","../../../../../node_modules/d3-format/src/precisionPrefix.js","../../../../../node_modules/d3-format/src/precisionRound.js","../../../../../node_modules/d3-scale/src/tickFormat.js","../../../../../node_modules/d3-scale/src/linear.js","../../../../../node_modules/d3-scale/src/nice.js","../../../../../node_modules/d3-time/src/interval.js","../../../../../node_modules/d3-time/src/millisecond.js","../../../../../node_modules/d3-time/src/duration.js","../../../../../node_modules/d3-time/src/second.js","../../../../../node_modules/d3-time/src/minute.js","../../../../../node_modules/d3-time/src/hour.js","../../../../../node_modules/d3-time/src/day.js","../../../../../node_modules/d3-time/src/week.js","../../../../../node_modules/d3-time/src/month.js","../../../../../node_modules/d3-time/src/year.js","../../../../../node_modules/d3-time/src/ticks.js","../../../../../node_modules/d3-time-format/src/locale.js","../../../../../node_modules/d3-time-format/src/defaultLocale.js","../../../../../node_modules/d3-scale/src/time.js","../../../src/typescript/lib/component/chart/Scale.ts","../../../src/typescript/lib/component/chart/ChartAxis.ts","../../../src/typescript/lib/component/chart/ChartLegend.ts","../../../src/typescript/lib/component/chart/AbstractChart.ts","../../../src/typescript/lib/component/chart/LineChart.ts","../../../src/typescript/lib/component/chart/BarChart.ts"],"sourcesContent":["export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if (!isFinite(x) || x === 0) return null; // NaN, ±Infinity, ±0\n var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\"), coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return prefixExponent = undefined, x.toPrecision(p);\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier, options) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = (options && options.prefix !== undefined ? options.prefix : \"\") + (symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\"),\n suffix = (symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\") + (options && options.suffix !== undefined ? options.suffix : \"\");\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" && !isNaN(value) && prefixExponent !== undefined ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier), {suffix: prefixes[8 + e / 3]});\n return function(value) {\n return f(k * value);\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { scaleLinear, scaleBand, scaleTime } from \"d3-scale\";\nimport { extent, max, min } from \"d3-array\";\nimport type { ScaleLinear, ScaleBand, ScaleTime } from \"d3-scale\";\nimport type { ChartPoint } from \"~/component/chart/types.js\";\n\n/**\n * The union of scale kinds a chart passes around. Every member is d3's own\n * `(value) => pixel` projector: the continuous members ({@link ScaleLinear},\n * {@link ScaleTime}) additionally expose `.ticks()` / `.tickFormat()`, and the\n * discrete member ({@link ScaleBand}) exposes `.bandwidth()`. The scale itself\n * is the domain→pixel projector — `Scale.ts` is a thin adapter around it, not a\n * reimplementation.\n *\n * @category Components\n */\nexport type ChartScale =\n ScaleLinear<number, number> | ScaleTime<number, number> | ScaleBand<string>;\n\n/**\n * Default padding ratio (band-scale inner padding) between adjacent bar bands.\n * `0.1` leaves a tenth of each step as the gap — dense enough to read the bars\n * as a group while keeping the inter-bar gutter visible.\n */\nconst DEFAULT_BAND_PADDING = 0.1;\n\n/**\n * Builds a continuous linear value scale over `domain`, projecting onto the\n * pixel `range`, with `.nice()` applied so the domain rounds to human-friendly\n * bounds. Used for the line-chart x/y axes and the bar-chart y axis.\n *\n * @param domain - The `[min, max]` data-space domain.\n * @param range - The `[start, end]` pixel range (may be inverted, e.g. a y axis).\n *\n * @returns The configured d3 linear scale.\n */\nexport function linearScale(domain: [number, number], range: [number, number]): ScaleLinear<number, number> {\n return scaleLinear().domain(domain).range(range).nice();\n}\n\n/**\n * Builds a continuous time scale over a `[start, end]` date domain, projecting\n * onto the pixel `range`, with `.nice()` applied. Selected by a line chart when\n * `xScaleType === \"time\"`; its `d3-time` / `d3-time-format` transitive\n * dependencies ship with `d3-scale`.\n *\n * @param domain - The `[start, end]` date domain.\n * @param range - The `[start, end]` pixel range.\n *\n * @returns The configured d3 time scale.\n */\nexport function timeScale(domain: [Date, Date], range: [number, number]): ScaleTime<number, number> {\n return scaleTime().domain(domain).range(range).nice();\n}\n\n/**\n * Builds a discrete band scale over `categories`, projecting onto the pixel\n * `range` with symmetric inner/outer padding. Used for the bar-chart x axis;\n * each category gets an equal band of width `.bandwidth()`.\n *\n * @param categories - The ordered category labels.\n * @param range - The `[start, end]` pixel range.\n * @param padding - Inner padding ratio between bands (outer padding is half of\n * it); defaults to {@link DEFAULT_BAND_PADDING}.\n *\n * @returns The configured d3 band scale.\n */\nexport function bandScale(categories: string[], range: [number, number], padding: number = DEFAULT_BAND_PADDING): ScaleBand<string> {\n return scaleBand<string>()\n .domain(categories)\n .range(range)\n .paddingInner(padding)\n .paddingOuter(padding / 2);\n}\n\n/**\n * Narrows a {@link ChartScale} to the discrete band member by feature-detecting\n * its `.bandwidth()` method (which the continuous scales lack).\n *\n * @param scale - The scale to test.\n *\n * @returns `true` when `scale` is a band scale.\n */\nexport function isBandScale(scale: ChartScale): scale is ScaleBand<string> {\n return typeof (scale as ScaleBand<string>).bandwidth === \"function\";\n}\n\n/**\n * Returns the axis tick values for a scale: the nice tick values inside the\n * domain for a continuous scale, or the category labels for a band scale.\n *\n * @param scale - The scale to enumerate.\n * @param count - Requested tick count hint (ignored by band scales).\n *\n * @returns The tick values (numbers, `Date`s, or category strings).\n */\nexport function scaleTicks(scale: ChartScale, count: number): Array<number | Date | string> {\n if (isBandScale(scale)) {\n return scale.domain();\n }\n\n return (scale as ScaleLinear<number, number> | ScaleTime<number, number>).ticks(count);\n}\n\n/**\n * Returns the pixel position of a tick value: the projected position for a\n * continuous scale, or the band centre for a band scale.\n *\n * @param scale - The scale to project through.\n * @param value - The tick value to position.\n *\n * @returns The pixel position along the scale's range.\n */\nexport function tickPosition(scale: ChartScale, value: number | Date | string): number {\n if (isBandScale(scale)) {\n return (scale(value as string) ?? 0) + scale.bandwidth() / 2;\n }\n\n return (scale as ScaleLinear<number, number> | ScaleTime<number, number>)(value as number & Date);\n}\n\n/**\n * Returns a string formatter for a scale's tick values — d3's own\n * domain-appropriate `.tickFormat()` for a continuous scale (which picks a\n * sensible number/time format for the tick density), or `String` for a band\n * scale's already-textual categories.\n *\n * @param scale - The scale to format ticks for.\n * @param count - Tick-count hint passed to d3's continuous `.tickFormat()`.\n *\n * @returns A `(value) => string` formatter.\n */\nexport function tickFormatter(scale: ChartScale, count: number): (value: number | Date | string) => string {\n if (isBandScale(scale)) {\n return (value) => String(value);\n }\n\n const format = (scale as ScaleLinear<number, number> | ScaleTime<number, number>).tickFormat(count);\n\n return (value) => format(value as number & Date);\n}\n\n/**\n * Computes the `[min, max]` x-extent across a flat list of points, falling back\n * to `[0, 1]` for an empty list so a scale never receives a `NaN`/`undefined`\n * domain.\n *\n * @param points - The points to span.\n *\n * @returns The `[min, max]` x-extent.\n */\nexport function pointsXExtent(points: ChartPoint[]): [number, number] {\n const span = extent(points, (p) => p.x);\n\n return [span[0] ?? 0, span[1] ?? 1];\n}\n\n/**\n * Computes the y-domain bounds across a flat list of points. When\n * `includeZero` is set (the default) the lower bound is clamped to at most `0`\n * so a value axis starts at the baseline; the upper bound is the data maximum.\n * Falls back to `[0, 1]` for an empty list.\n *\n * @param points - The points to span.\n * @param includeZero - Whether to force the baseline `0` into the domain.\n *\n * @returns The `[lower, upper]` y-domain.\n */\nexport function pointsYBounds(points: ChartPoint[], includeZero: boolean = true): [number, number] {\n if (points.length === 0) {\n return [0, 1];\n }\n\n const dataMin = min(points, (p) => p.y) ?? 0;\n const dataMax = max(points, (p) => p.y) ?? 1;\n const lower = includeZero ? Math.min(0, dataMin) : dataMin;\n // A flat series (all-equal y) would collapse the domain to a point and make\n // `.nice()` produce a zero-height range; nudge the upper bound up by 1 so the\n // axis always has extent.\n const upper = dataMax > lower ? dataMax : lower + 1;\n\n return [lower, upper];\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from \"~/core/DOM.js\";\nimport { scaleTicks, tickPosition } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport type { MarkFactory, PlotRect } from \"~/component/chart/types.js\";\n\n/**\n * Which edge an axis is drawn on. `\"bottom\"` is the horizontal x axis under the\n * plot; `\"left\"` is the vertical y axis to its left.\n *\n * @category Components\n */\nexport type AxisOrientation = \"bottom\" | \"left\";\n\n/**\n * Length in px of each tick mark drawn outward from the axis line. Fixed rather\n * than themed: the tick is a structural cue whose length carries no design\n * meaning, and a constant keeps the margin arithmetic (which reserves this plus\n * the label extent) simple.\n */\nconst TICK_LENGTH = 6;\n\n/**\n * Gap in px between a tick mark and its label. Small, fixed breathing room so\n * the label does not touch the tick; mirrored into the reserved margin.\n */\nconst LABEL_GAP = 4;\n\n/**\n * Default number of ticks requested from a continuous scale. A hint, not a\n * guarantee — d3 rounds it to the nearest nice-number tick count. Eight reads\n * as a legible density for the plan's stated modest data sizes.\n */\nexport const DEFAULT_TICK_COUNT = 8;\n\n/**\n * Render options for one axis pass.\n *\n * @category Components\n */\nexport interface AxisRenderOptions {\n /** Requested tick count (continuous scales only). */\n tickCount: number;\n /** Tick-value formatter, typically from the scale's own `tickFormat`. */\n format: (value: number | Date | string) => string;\n /** Whether to draw gridlines spanning the plot at each tick. */\n grid: boolean;\n}\n\n/**\n * Measures the margin (px) a plot rectangle must reserve for an axis, from the\n * scale's tick labels — the max label width for a `\"left\"` axis, or the label\n * height for a `\"bottom\"` axis — plus the tick length and label gap. Measured\n * from the domain ticks (independent of the pixel range), so it can run *before*\n * the plot rectangle exists, breaking the margin↔layout feedback loop.\n *\n * @param orientation - The axis edge.\n * @param scale - The scale whose ticks are measured.\n * @param format - The tick-value formatter.\n * @param tickCount - Requested tick count hint.\n *\n * @returns The margin to reserve in px.\n */\nexport function measureAxisMargin(\n orientation: AxisOrientation,\n scale: ChartScale,\n format: (value: number | Date | string) => string,\n tickCount: number\n): number {\n const ticks = scaleTicks(scale, tickCount);\n\n if (orientation === \"left\") {\n let widest = 0;\n\n for (const value of ticks) {\n widest = Math.max(widest, DOM.source.measureText(format(value)).width);\n }\n\n return TICK_LENGTH + LABEL_GAP + Math.ceil(widest);\n }\n\n // Bottom axis: horizontal labels, so the reserved extent is one line's\n // height (the widest label height, which is font-driven and constant).\n const labelHeight = DOM.source.measureText(\"0\").height;\n\n return TICK_LENGTH + LABEL_GAP + Math.ceil(labelHeight);\n}\n\n/**\n * Draws an axis — its line, tick marks, tick labels, and optional gridlines —\n * into a mark group through the supplied {@link MarkFactory}, entirely natively\n * (no `d3-axis`, which would own a d3-selection and mutate the DOM). Colours and\n * stroke widths bind to `--ts-ui-chart-*` theme variables so a theme switch\n * re-cascades with no redraw.\n *\n * @param create - The mark factory bound to the axis group.\n * @param orientation - The axis edge.\n * @param scale - The scale to render.\n * @param plot - The plot rectangle in SVG user space.\n * @param opts - Tick count, formatter, and gridline flag.\n */\nexport function drawAxis(\n create: MarkFactory,\n orientation: AxisOrientation,\n scale: ChartScale,\n plot: PlotRect,\n opts: AxisRenderOptions\n): void {\n const axisStroke = { stroke: \"var(--ts-ui-chart-axis)\", \"stroke-width\": \"var(--ts-ui-chart-axis-width)\" };\n const gridStroke = { stroke: \"var(--ts-ui-chart-grid)\", \"stroke-width\": \"var(--ts-ui-chart-axis-width)\" };\n const labelFill = { fill: \"var(--ts-ui-chart-label)\" };\n\n const bottomEdge = plot.y + plot.height;\n const rightEdge = plot.x + plot.width;\n\n if (orientation === \"left\") {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(plot.y), x2: String(plot.x), y2: String(bottomEdge) }, style: axisStroke });\n } else {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(bottomEdge), x2: String(rightEdge), y2: String(bottomEdge) }, style: axisStroke });\n }\n\n for (const value of scaleTicks(scale, opts.tickCount)) {\n const pos = tickPosition(scale, value);\n const label = opts.format(value);\n\n if (orientation === \"left\") {\n drawLeftTick(create, plot, rightEdge, pos, label, opts.grid, gridStroke, axisStroke, labelFill);\n } else {\n drawBottomTick(create, plot, bottomEdge, pos, label, opts.grid, gridStroke, axisStroke, labelFill);\n }\n }\n}\n\n/**\n * Draws one left-axis tick: its optional gridline across the plot, the tick\n * mark, and the right-aligned, vertically-centred label.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n * @param rightEdge - The plot's right edge x coordinate.\n * @param pos - The tick's y position in SVG user space.\n * @param label - The formatted tick label.\n * @param grid - Whether to draw the gridline.\n * @param gridStroke - Gridline stroke style.\n * @param axisStroke - Tick-mark stroke style.\n * @param labelFill - Label fill style.\n */\nfunction drawLeftTick(\n create: MarkFactory,\n plot: PlotRect,\n rightEdge: number,\n pos: number,\n label: string,\n grid: boolean,\n gridStroke: Record<string, string>,\n axisStroke: Record<string, string>,\n labelFill: Record<string, string>\n): void {\n if (grid) {\n create(\"line\", { setAttr: { x1: String(plot.x), y1: String(pos), x2: String(rightEdge), y2: String(pos) }, style: gridStroke });\n }\n\n create(\"line\", { setAttr: { x1: String(plot.x - TICK_LENGTH), y1: String(pos), x2: String(plot.x), y2: String(pos) }, style: axisStroke });\n\n create(\"text\", {\n setAttr: { x: String(plot.x - TICK_LENGTH - LABEL_GAP), y: String(pos), \"text-anchor\": \"end\", \"dominant-baseline\": \"middle\" },\n style: labelFill,\n text: label,\n });\n}\n\n/**\n * Draws one bottom-axis tick: its optional gridline up the plot, the tick mark,\n * and the centred label hanging below it.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n * @param bottomEdge - The plot's bottom edge y coordinate.\n * @param pos - The tick's x position in SVG user space.\n * @param label - The formatted tick label.\n * @param grid - Whether to draw the gridline.\n * @param gridStroke - Gridline stroke style.\n * @param axisStroke - Tick-mark stroke style.\n * @param labelFill - Label fill style.\n */\nfunction drawBottomTick(\n create: MarkFactory,\n plot: PlotRect,\n bottomEdge: number,\n pos: number,\n label: string,\n grid: boolean,\n gridStroke: Record<string, string>,\n axisStroke: Record<string, string>,\n labelFill: Record<string, string>\n): void {\n if (grid) {\n create(\"line\", { setAttr: { x1: String(pos), y1: String(plot.y), x2: String(pos), y2: String(bottomEdge) }, style: gridStroke });\n }\n\n create(\"line\", { setAttr: { x1: String(pos), y1: String(bottomEdge), x2: String(pos), y2: String(bottomEdge + TICK_LENGTH) }, style: axisStroke });\n\n create(\"text\", {\n setAttr: { x: String(pos), y: String(bottomEdge + TICK_LENGTH + LABEL_GAP), \"text-anchor\": \"middle\", \"dominant-baseline\": \"hanging\" },\n style: labelFill,\n text: label,\n });\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Panel, PanelOptions } from \"~/core/Panel.js\";\nimport { Component } from \"~/core/Component.js\";\nimport { Text } from \"~/component/input/Text.js\";\nimport { HBox } from \"~/layout/HBox.js\";\nimport { VBox } from \"~/layout/VBox.js\";\nimport { Insets } from \"~/primitive/Insets.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * One legend entry: a series' name, its resolved swatch colour, and whether the\n * legend has toggled it hidden (rendered greyed).\n *\n * @category Components\n */\nexport interface ChartLegendEntry {\n /** The series' display name. */\n name: string;\n /** The resolved swatch colour (a concrete colour or a `var(--…)` binding). */\n color: string;\n /** Whether the entry is toggled off (rendered dimmed). */\n hidden?: boolean;\n}\n\n/**\n * The direction the legend arranges its entries: a vertical stack (docked to the\n * plot's right) or a horizontal row (docked above or below).\n *\n * @category Components\n */\nexport type ChartLegendOrientation = \"vertical\" | \"horizontal\";\n\n/**\n * Construction-time options for {@link ChartLegend}.\n *\n * @category Components\n */\nexport interface ChartLegendOptions extends PanelOptions {\n /** The legend entries to render. */\n entries?: ChartLegendEntry[];\n /** Arrangement direction; defaults to `\"vertical\"`. */\n orientation?: ChartLegendOrientation;\n /** Construction-time listener bag for the `\"toggle\"` event. */\n listeners?: {\n toggle?: (seriesIndex: number) => void;\n };\n}\n\n/** Custom events emitted by {@link ChartLegend}. */\ntype ChartLegendEvent = \"toggle\";\n\n/** Swatch square edge length in px — a compact colour chip beside each label. */\nconst SWATCH_SIZE = 12;\n\n/** Opacity applied to a legend row whose series is toggled hidden. */\nconst HIDDEN_OPACITY = 0.4;\n\nconst _defaultChartLegendOptions: Partial<ChartLegendOptions> = {\n backgroundColor: \"transparent\",\n};\n\n/**\n * A clickable chart legend: one row per series (colour swatch + name). A click\n * on a row emits `\"toggle\"(seriesIndex)` so the owning chart can hide/show that\n * series and repaint. Composed from existing components — an `HBox`/`VBox`\n * `Panel` of per-entry rows, each an `HBox` of a swatch `Component` and a\n * `Text` — rather than a specialised component.\n *\n * @category Components\n */\nclass ChartLegend extends Panel<ChartLegendOptions> {\n\n private _listeners: ListenerBag<ChartLegendEvent> = this.registerListenerBag(new ListenerBag<ChartLegendEvent>());\n private _rows: Component[] = [];\n private _entries: ChartLegendEntry[] = [];\n private _orientation: ChartLegendOrientation = \"vertical\";\n\n /**\n * Builds the legend and dispatches its own options from the constructor body\n * (not `applyOptions`, which runs inside the `super()` cascade before the\n * `ListenerBag` and row list exist).\n *\n * @param options - Optional construction-time options.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults; subclasses forward their `_defaultXxxOptions`\n * constant here.\n */\n constructor(options?: ChartLegendOptions, subclassDefaults?: Partial<ChartLegendOptions>) {\n super(options, { ..._defaultChartLegendOptions, ...(subclassDefaults ?? {}) });\n\n this.clearInsets();\n this.applyOrientationLayout();\n\n this.dispatchLegendOptions(options);\n\n // A row click toggles its series. Subtree listener on self (never on a\n // child's own event surface), matching the framework's delegation rule.\n Event.addSubtreeListener(this, \"click\", this.handleRowClick);\n }\n\n /**\n * Dispatches the legend-specific options through their setters once the row\n * list and listener bag exist.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchLegendOptions(options?: ChartLegendOptions): void {\n if (!options) {\n return;\n }\n\n if (options.orientation !== undefined) {\n this.setOrientation(options.orientation);\n }\n\n if (options.entries !== undefined) {\n this.setEntries(options.entries);\n }\n\n this.applyListeners(options.listeners);\n }\n\n /**\n * Sets the arrangement direction and swaps the layout manager to match\n * (`VBox` for vertical, `HBox` for horizontal), then re-lays out.\n *\n * @param orientation - The arrangement direction.\n *\n * @returns This legend, for method chaining.\n */\n setOrientation(orientation: ChartLegendOrientation): this {\n if (this._orientation === orientation) {\n return this;\n }\n\n this._orientation = orientation;\n\n this.applyOrientationLayout();\n\n return this;\n }\n\n /**\n * Returns the current arrangement direction.\n *\n * @returns The legend orientation.\n */\n getOrientation(): ChartLegendOrientation {\n return this._orientation;\n }\n\n /** Installs the layout manager matching the current orientation. */\n private applyOrientationLayout(): void {\n this.setLayoutManager(\n this._orientation === \"vertical\"\n ? new VBox({ spacing: 2, stretching: false })\n : new HBox({ spacing: 10, stretching: false })\n );\n }\n\n /**\n * Rebuilds the legend rows from `entries`: one row (swatch + name) per\n * entry, dimmed when the entry is hidden. Replaces any previous rows.\n *\n * @param entries - The entries to render.\n *\n * @returns This legend, for method chaining.\n */\n setEntries(entries: ChartLegendEntry[]): this {\n if (this.entriesEqual(entries)) {\n return this;\n }\n\n this._entries = entries.map((e) => ({ ...e }));\n\n this.disposeAllComponents();\n this._rows = [];\n\n for (const entry of this._entries) {\n const row = this.buildRow(entry);\n\n this._rows.push(row);\n this.addComponent(row);\n }\n\n return this;\n }\n\n /**\n * Returns a copy of the current legend entries.\n *\n * @returns The entries.\n */\n getEntries(): ChartLegendEntry[] {\n return this._entries.map((e) => ({ ...e }));\n }\n\n /**\n * Reports whether `candidate` renders identically to the current entries —\n * same length and, per index, equal name, colour, and effective hidden state\n * (`undefined` hidden renders the same as `false`). Lets a no-op re-apply\n * skip the teardown/rebuild that would relay a preferred-size change to the\n * owning chart and re-arm the layout flush.\n *\n * @param candidate - The entries about to be applied.\n *\n * @returns `true` when `candidate` is value-equal to the current entries.\n */\n private entriesEqual(candidate: ChartLegendEntry[]): boolean {\n if (candidate.length !== this._entries.length) {\n return false;\n }\n\n for (let i = 0; i < candidate.length; i++) {\n const a = candidate[i];\n const b = this._entries[i];\n\n if (a.name !== b.name || a.color !== b.color || (a.hidden ?? false) !== (b.hidden ?? false)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Builds one legend row: a horizontal swatch + name pair, dimmed when the\n * entry is hidden, with a pointer cursor to signal it is clickable.\n *\n * @param entry - The entry to render.\n *\n * @returns The row component.\n */\n private buildRow(entry: ChartLegendEntry): Component {\n const swatch = new Component({\n preferredSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n minSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n maxSize: { width: SWATCH_SIZE, height: SWATCH_SIZE },\n backgroundColor: entry.color,\n borderRadius: \"2px\",\n });\n\n const label = new Text(entry.name);\n\n return new Panel({\n layoutManager: new HBox({ spacing: 6, stretching: true }),\n insets: new Insets(2, 4, 2, 4),\n cursor: \"pointer\",\n opacity: entry.hidden ? HIDDEN_OPACITY : 1,\n components: [swatch, label],\n });\n }\n\n /**\n * Resolves a click to the row it landed in and emits `\"toggle\"` with that\n * row's index. Reads the event target through the source seam and matches it\n * against each row's element (never listening on a row's own surface).\n *\n * @param event - The DOM click event.\n */\n private handleRowClick = (event: MouseEvent): void => {\n if (!DOM.source.isNode(event.target)) {\n return;\n }\n\n const target = DOM.source.intern(event.target);\n\n for (let index = 0; index < this._rows.length; index++) {\n const element = this._rows[index].getElement();\n\n if (element && DOM.source.contains(element, target)) {\n this.emit(\"toggle\", index);\n\n return;\n }\n }\n };\n\n /**\n * Registers a `\"toggle\"` listener, fired with a series index when its row is\n * clicked.\n *\n * @param event - The `\"toggle\"` event.\n * @param listener - The callback invoked with the toggled series index.\n *\n * @returns This legend, for method chaining.\n */\n on(event: \"toggle\", listener: (seriesIndex: number) => void): this {\n this._listeners.add(event, listener);\n\n return this;\n }\n\n /**\n * Removes a previously registered `\"toggle\"` listener.\n *\n * @param event - The `\"toggle\"` event.\n * @param listener - The exact callback reference to remove.\n *\n * @returns This legend, for method chaining.\n */\n off(event: \"toggle\", listener: (seriesIndex: number) => void): this {\n this._listeners.remove(event, listener);\n\n return this;\n }\n\n /**\n * Fires every `\"toggle\"` listener with the toggled series index.\n *\n * @param event - The `\"toggle\"` event.\n * @param seriesIndex - The toggled series index.\n */\n protected emit(event: ChartLegendEvent, seriesIndex: number): void {\n this._listeners.fire(event, seriesIndex);\n }\n\n}\n\nconst ChartLegendCallable = callable(ChartLegend);\ntype ChartLegendCallable = ChartLegend;\nexport {\n ChartLegend as _ChartLegend,\n ChartLegendCallable as ChartLegend\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Panel, PanelOptions } from \"~/core/Panel.js\";\nimport type { StyleBag } from \"~/core/ClassStyleRules.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle, ElementPatch } from \"~/core/DOM.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { Tooltip } from \"~/overlay/Tooltip.js\";\nimport { ThemeManager } from \"~/core/Theme.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { AbstractStore, StoreEvent } from \"~/data/AbstractStore.js\";\nimport { drawAxis, measureAxisMargin, DEFAULT_TICK_COUNT } from \"~/component/chart/ChartAxis.js\";\nimport { tickFormatter } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport { ChartLegend } from \"~/component/chart/ChartLegend.js\";\nimport type {\n ChartPoint,\n ChartSeries,\n ChartSeriesModel,\n ChartSelectionEvent,\n MarkFactory,\n PlotRect,\n} from \"~/component/chart/types.js\";\n\n/** The SVG namespace URI for every mark the chart creates through the sink. */\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/** The store events a bound chart subscribes to (mirrors ComboBox's binding). */\nconst STORE_EVENTS: readonly StoreEvent[] = [\"load\", \"add\", \"remove\", \"datachange\"];\n\n/** Size of the categorical palette; series colours cycle within it. */\nconst PALETTE_SIZE = 8;\n\n/** Padding (px) reserved above the plot so the top gridline/label has headroom. */\nconst TOP_PAD = 10;\n\n/** Padding (px) reserved right of the plot so the last x label is not clipped. */\nconst RIGHT_PAD = 12;\n\n/** Gap (px) between the plot and a docked legend. */\nconst LEGEND_GAP = 8;\n\n/** Extra band (px) reserved for an axis title beyond the tick labels. */\nconst AXIS_LABEL_BAND = 18;\n\n/** Radius (px) of the selection ring drawn around a clicked point. */\nconst SELECTION_RING_RADIUS = 6;\n\n/** Where the legend docks relative to the plot. */\nexport type ChartLegendPosition = \"top\" | \"right\" | \"bottom\";\n\n/** Custom events an {@link AbstractChart} emits. */\ntype ChartEvent = \"selection\";\n\n/**\n * Construction-time listener bag for a chart's custom events. A type alias (not\n * an interface) so it carries the implicit index signature `applyListeners`\n * requires.\n *\n * @category Components\n */\nexport type ChartListeners = {\n selection?: (event: ChartSelectionEvent) => void;\n};\n\n/**\n * Construction-time options common to every chart type.\n *\n * @category Components\n */\nexport interface AbstractChartOptions extends PanelOptions {\n /** In-memory series data (mutually exclusive with the store path). */\n series?: ChartSeries[];\n /** Store whose records supply the data (with the field options below). */\n store?: AbstractStore;\n /** Record field read for each point's `x` (store path). */\n xField?: string;\n /** Record field read for each point's `y` (store path). */\n yField?: string;\n /** Record field whose distinct values split records into series (store path). */\n seriesField?: string;\n /** Whether the legend is shown; defaults to `true`. */\n showLegend?: boolean;\n /** Where the legend docks; defaults to `\"right\"`. */\n legendPosition?: ChartLegendPosition;\n /** Optional x-axis title. */\n xAxisLabel?: string;\n /** Optional y-axis title. */\n yAxisLabel?: string;\n /** Construction-time listener bag for the `\"selection\"` event. */\n listeners?: ChartListeners;\n}\n\n// A sensible default envelope: a fixed preferred size, plus a small min so\n// the Panel can shrink (it clamps only to its explicit min/max).\nconst _defaultAbstractChartOptions: Partial<AbstractChartOptions> = {\n preferredSize: { width: 400, height: 300 },\n minSize: { width: 80, height: 60 },\n};\n\n/**\n * Shared SVG-first foundation for the chart family. An `AbstractChart` is a\n * `Panel` whose root `<div>` hosts a single raw `<svg>` drawing surface (a\n * tracked child created through the DOM sink, mirroring `Glyph`); axes,\n * gridlines, and series marks are SVG children drawn into that surface, never\n * framework components. Interactive HTML chrome — the legend — stays a real\n * child component positioned in `doLayout`.\n *\n * The computational layer (scales, ticks, path generation) delegates to pure\n * d3 submodules; all rendering, layout, interaction, and theming are native.\n * Concrete subtypes fill in the scale-building, series-drawing, and\n * point-anchor hooks.\n *\n * @typeParam O - The subtype's options interface.\n *\n * @remarks Abstract, so it is deliberately **not** wrapped with `callable()` (a\n * base with abstract members cannot be constructed); the concrete `LineChart` /\n * `BarChart` subclasses carry the callable export.\n *\n * @category Components\n */\nexport abstract class AbstractChart<O extends AbstractChartOptions = AbstractChartOptions> extends Panel<O> {\n\n // Own contribution to the hierarchy-aware class tier — see\n // plans/implemented/class-hierarchy-cascade.md.\n protected static readonly ownClassStyleDefaults: StyleBag = _defaultAbstractChartOptions;\n\n private _listeners: ListenerBag<ChartEvent> = this.registerListenerBag(new ListenerBag<ChartEvent>());\n\n /** The resolved series model (points + hidden flag), rebuilt on data change. */\n protected _series: ChartSeriesModel[] = [];\n\n /** The clicked point, drawn with a selection ring; `null` when none. */\n protected _selectedPoint: { series: number; index: number } | null = null;\n\n private _boundStore: AbstractStore | null = null;\n private _xField: string = \"x\";\n private _yField: string = \"y\";\n private _seriesField: string | undefined = undefined;\n private readonly _onStoreRefresh: () => void = () => this.rebuildFromStore();\n\n private readonly _legend: ChartLegend = new ChartLegend();\n private _themeCleanup: (() => void) | null = null;\n\n // The raw SVG surface and its mark groups (created at first render, so null\n // until then). Groups paint back-to-front in creation order: axis/grid,\n // then series, then the selection overlay.\n private _svg: Handle | null = null;\n private _axisGroup: Handle | null = null;\n private _seriesGroup: Handle | null = null;\n private _overlayGroup: Handle | null = null;\n\n // Every mark created since the last repaint, with its parent group, so a\n // repaint can detach and release each one (an unreleased handle pins the\n // detached node in the registry — the Glyphs sprite-leak lesson).\n private _marks: Array<{ parent: Handle; handle: Handle }> = [];\n\n // The plot rectangle and scales from the last layout, cached so pointer\n // hit-testing (which runs outside layout, on every mousemove) can map the\n // cursor into data space without rebuilding them. Null until first layout.\n protected _plot: PlotRect | null = null;\n protected _xScale: ChartScale | null = null;\n protected _yScale: ChartScale | null = null;\n\n /**\n * Builds the chart shell: the legend child, the default size envelope, the\n * interaction listeners, and the theme subscription. Chart-specific options\n * are dispatched from the constructor body (not `applyOptions`) so the\n * `ListenerBag` and legend exist first.\n *\n * @param options - Optional construction-time options.\n * @param subclassDefaults - Optional subclass default options.\n */\n constructor(options?: O, subclassDefaults?: Partial<O>) {\n super(options, { ..._defaultAbstractChartOptions, ...(subclassDefaults ?? {}) } as Partial<O>);\n\n this.addComponent(this._legend);\n this._legend.on(\"toggle\", this.handleLegendToggle);\n\n Event.addSubtreeListener(this, \"mousemove\", this.handlePointerMove);\n Event.addSubtreeListener(this, \"mouseout\", this.handlePointerOut);\n Event.addSubtreeListener(this, \"click\", this.handlePointerClick);\n\n // Re-measure axis margins when the font changes (the label widths shift).\n this._themeCleanup = ThemeManager.onThemeChange(() => this.scheduleLayout());\n\n this.dispatchChartOptions(options);\n }\n\n /**\n * Dispatches the chart-specific options through their setters. Store and\n * in-memory series are mutually exclusive construction paths.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchChartOptions(options?: O): void {\n if (!options) {\n return;\n }\n\n if (options.store !== undefined) {\n this.setStore(options.store, options.xField ?? \"x\", options.yField ?? \"y\", options.seriesField);\n } else if (options.series !== undefined) {\n this.setSeries(options.series);\n }\n\n if (options.showLegend !== undefined) {\n this.setShowLegend(options.showLegend);\n }\n\n if (options.legendPosition !== undefined) {\n this.setLegendPosition(options.legendPosition);\n }\n\n if (options.xAxisLabel !== undefined) {\n this.setXAxisLabel(options.xAxisLabel);\n }\n\n if (options.yAxisLabel !== undefined) {\n this.setYAxisLabel(options.yAxisLabel);\n }\n\n this.applyListeners(options.listeners);\n }\n\n // ── Data ────────────────────────────────────────────────────────────────\n\n /**\n * Replaces the chart's data with an in-memory series array, resolving it\n * into the internal model (points copied, `hidden` flags preserved by name)\n * and repainting.\n *\n * @param series - The series to render.\n *\n * @returns This chart, for method chaining.\n */\n setSeries(series: ChartSeries[]): this {\n this._series = this.resolveModel(series);\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the chart's series as plain `ChartSeries` (points copied out of\n * the internal model).\n *\n * @returns The current series.\n */\n getSeries(): ChartSeries[] {\n return this._series.map((m) => ({\n name: m.name,\n data: m.points.map((p) => ({ x: p.x, y: p.y })),\n color: m.color,\n }));\n }\n\n /**\n * Binds the chart to a store, reading each point from the given fields and\n * (optionally) splitting records into series by `seriesField`. Unsubscribes\n * any previous store from all four data events before binding the next (no\n * listener accumulation), then rebuilds the model and repaints.\n *\n * @param store - The store to bind.\n * @param xField - Record field for each point's `x`.\n * @param yField - Record field for each point's `y`.\n * @param seriesField - Optional field whose values split records into series.\n *\n * @returns This chart, for method chaining.\n */\n setStore(store: AbstractStore, xField: string, yField: string, seriesField?: string): this {\n if (this._boundStore) {\n for (const event of STORE_EVENTS) {\n this._boundStore.off(event, this._onStoreRefresh);\n }\n }\n\n this._boundStore = store;\n this._xField = xField;\n this._yField = yField;\n this._seriesField = seriesField;\n\n for (const event of STORE_EVENTS) {\n store.on(event, this._onStoreRefresh);\n }\n\n this.rebuildFromStore();\n\n return this;\n }\n\n /**\n * Returns the bound store, or `null` when the chart uses in-memory series.\n *\n * @returns The bound store, or `null`.\n */\n getStore(): AbstractStore | null {\n return this._boundStore;\n }\n\n /**\n * Rebuilds the series model from the bound store's current records, grouping\n * by `seriesField` when configured, and repaints. Preserves each series'\n * hidden flag by name. An empty store yields zero series (no throw).\n */\n private rebuildFromStore(): void {\n if (!this._boundStore) {\n return;\n }\n\n this._series = this.resolveModel(this.seriesFromStore(this._boundStore));\n\n this.scheduleLayout();\n }\n\n /**\n * Reads the store's records into `ChartSeries`, splitting them into one\n * series per distinct `seriesField` value (in first-seen order) when that\n * field is configured, or a single series otherwise.\n *\n * @param store - The bound store.\n *\n * @returns The series read from the store.\n */\n private seriesFromStore(store: AbstractStore): ChartSeries[] {\n const records = store.getRecords();\n\n if (records.length === 0) {\n return [];\n }\n\n if (this._seriesField === undefined) {\n return [{\n name: this._yField,\n data: records.map((r) => ({ x: Number(r.get(this._xField)), y: Number(r.get(this._yField)) })),\n }];\n }\n\n const groups = new Map<string, ChartPoint[]>();\n\n for (const record of records) {\n const key = String(record.get(this._seriesField));\n const point: ChartPoint = { x: Number(record.get(this._xField)), y: Number(record.get(this._yField)) };\n const bucket = groups.get(key);\n\n if (bucket) {\n bucket.push(point);\n } else {\n groups.set(key, [point]);\n }\n }\n\n return Array.from(groups, ([name, data]) => ({ name, data }));\n }\n\n /**\n * Resolves a `ChartSeries` list into the internal model — points copied,\n * colour carried, and the `hidden` flag preserved from the current model by\n * series name so a data refresh does not un-hide a toggled series.\n *\n * @param series - The source series.\n *\n * @returns The resolved series model.\n */\n private resolveModel(series: ChartSeries[]): ChartSeriesModel[] {\n const prevHidden = new Map(this._series.map((m) => [m.name, m.hidden]));\n\n return series.map((s) => ({\n name: s.name,\n points: s.data.map((p) => ({ x: p.x, y: p.y })),\n color: s.color,\n hidden: prevHidden.get(s.name) ?? false,\n }));\n }\n\n // ── Chrome ──────────────────────────────────────────────────────────────\n\n /**\n * Shows or hides the legend and repaints.\n *\n * @param value - `true` to show the legend, `false` to hide it.\n *\n * @returns This chart, for method chaining.\n */\n setShowLegend(value: boolean): this {\n this._options.showLegend = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether the legend is shown (defaults to `true`).\n *\n * @returns `true` when the legend is shown.\n */\n isShowLegend(): boolean {\n return this._options.showLegend ?? true;\n }\n\n /**\n * Sets which edge the legend docks to and repaints.\n *\n * @param position - The legend edge.\n *\n * @returns This chart, for method chaining.\n */\n setLegendPosition(position: ChartLegendPosition): this {\n this._options.legendPosition = position;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the legend dock edge (defaults to `\"right\"`).\n *\n * @returns The legend position.\n */\n getLegendPosition(): ChartLegendPosition {\n return this._options.legendPosition ?? \"right\";\n }\n\n /**\n * Sets the x-axis title (reserving a margin band for it) and repaints.\n *\n * @param label - The axis title.\n *\n * @returns This chart, for method chaining.\n */\n setXAxisLabel(label: string): this {\n this._options.xAxisLabel = label;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the x-axis title, or `null` when unset.\n *\n * @returns The x-axis title, or `null`.\n */\n getXAxisLabel(): string | null {\n return this._options.xAxisLabel ?? null;\n }\n\n /**\n * Sets the y-axis title (reserving a margin band for it) and repaints.\n *\n * @param label - The axis title.\n *\n * @returns This chart, for method chaining.\n */\n setYAxisLabel(label: string): this {\n this._options.yAxisLabel = label;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the y-axis title, or `null` when unset.\n *\n * @returns The y-axis title, or `null`.\n */\n getYAxisLabel(): string | null {\n return this._options.yAxisLabel ?? null;\n }\n\n // ── Events ──────────────────────────────────────────────────────────────\n\n /**\n * Registers a `\"selection\"` listener, fired when a datum is clicked.\n *\n * @param event - The `\"selection\"` event.\n * @param listener - The callback invoked with the selection payload.\n *\n * @returns This chart, for method chaining.\n */\n on(event: \"selection\", listener: (event: ChartSelectionEvent) => void): this {\n this._listeners.add(event, listener);\n\n return this;\n }\n\n /**\n * Removes a previously registered `\"selection\"` listener.\n *\n * @param event - The `\"selection\"` event.\n * @param listener - The exact callback reference to remove.\n *\n * @returns This chart, for method chaining.\n */\n off(event: \"selection\", listener: (event: ChartSelectionEvent) => void): this {\n this._listeners.remove(event, listener);\n\n return this;\n }\n\n /**\n * Fires every `\"selection\"` listener with the payload.\n *\n * @param event - The `\"selection\"` event.\n * @param payload - The selection payload.\n */\n protected emit(event: ChartEvent, payload: ChartSelectionEvent): void {\n this._listeners.fire(event, payload);\n }\n\n // ── Rendering surface ─────────────────────────────────────────────────────\n\n /**\n * Creates the root `<div>` plus the tracked `<svg>` drawing surface and its\n * mark groups (axis, series, overlay), mirroring `Glyph.createRootElement`'s\n * raw-SVG-through-the-sink pattern.\n *\n * @returns The root element handle.\n */\n protected createRootElement(): Handle {\n const root = super.createRootElement();\n\n const svg = DOM.sink.createElementNS(SVG_NS, \"svg\");\n DOM.sink.apply(svg, { style: { position: \"absolute\", left: \"0\", top: \"0\", overflow: \"visible\" } });\n DOM.sink.appendChild(root, svg);\n this.trackHandle(svg);\n this._svg = svg;\n\n this._axisGroup = this.createGroup(svg);\n this._seriesGroup = this.createGroup(svg);\n this._overlayGroup = this.createGroup(svg);\n\n return root;\n }\n\n /**\n * Creates a tracked `<g>` group appended to the SVG surface.\n *\n * @param svg - The SVG surface handle.\n *\n * @returns The group handle.\n */\n private createGroup(svg: Handle): Handle {\n const group = DOM.sink.createElementNS(SVG_NS, \"g\");\n DOM.sink.appendChild(svg, group);\n this.trackHandle(group);\n\n return group;\n }\n\n // ── Layout ────────────────────────────────────────────────────────────────\n\n /**\n * Lays the chart out: sizes the SVG surface to the inner box, reserves the\n * legend band, measures the axis margins, computes the plot rectangle,\n * builds the final scales, and repaints. Reads only the cached inner size\n * (no live geometry), so the stale-DOM hazard does not arise.\n *\n * @returns This chart, for method chaining.\n */\n doLayout(): this {\n super.doLayout();\n\n const inner = this.getInnerSize();\n\n if (!inner || !this._svg) {\n return this;\n }\n\n const origin = this.getPerimeterSize();\n\n this.sizeSurface(inner);\n\n const plotOuter = this.reserveLegend(inner, origin);\n const plot = this.computePlot(plotOuter);\n const scales = this.buildScales(plot);\n\n this._plot = plot;\n this._xScale = scales.x;\n this._yScale = scales.y;\n\n this.repaint(plot, scales.x, scales.y);\n\n return this;\n }\n\n /**\n * Sizes and positions the SVG surface to cover the inner content box, with a\n * user-space viewBox matching so marks are drawn in inner-box pixels.\n *\n * @param inner - The inner content size.\n */\n private sizeSurface(inner: { width: number; height: number }): void {\n const origin = this.getPerimeterSize();\n\n DOM.sink.apply(this._svg!, {\n setAttr: { width: String(inner.width), height: String(inner.height), viewBox: `0 0 ${inner.width} ${inner.height}` },\n style: { position: \"absolute\", left: `${origin.left}px`, top: `${origin.top}px`, overflow: \"visible\" },\n });\n }\n\n /**\n * Reserves the legend's band on its docked edge and positions the legend\n * child there, returning the remaining rectangle for the plot. Hides the\n * legend (and reserves nothing) when it is off or there are no series.\n *\n * @param inner - The inner content size.\n * @param origin - The perimeter origin offset (inset + border + padding).\n *\n * @returns The rectangle left for the plot, in SVG user space.\n */\n private reserveLegend(inner: { width: number; height: number }, origin: { left: number; top: number }): PlotRect {\n const full: PlotRect = { x: 0, y: 0, width: inner.width, height: inner.height };\n\n if (!this.isShowLegend() || this._series.length === 0) {\n this._legend.setVisible(false);\n\n return full;\n }\n\n this._legend.setVisible(true);\n this._legend.setOrientation(this.getLegendPosition() === \"right\" ? \"vertical\" : \"horizontal\");\n this._legend.setEntries(this._series.map((m, i) => ({ name: m.name, color: this.seriesColor(i, m), hidden: m.hidden })));\n\n const pref = this._legend.getPreferredSize() ?? { width: 120, height: 60 };\n const position = this.getLegendPosition();\n\n if (position === \"right\") {\n const band = Math.min(pref.width, inner.width / 2);\n this.placeLegend(origin, inner.width - band, 0, band, inner.height);\n\n return { x: 0, y: 0, width: inner.width - band - LEGEND_GAP, height: inner.height };\n }\n\n const band = Math.min(pref.height, inner.height / 2);\n\n if (position === \"top\") {\n this.placeLegend(origin, 0, 0, inner.width, band);\n\n return { x: 0, y: band + LEGEND_GAP, width: inner.width, height: inner.height - band - LEGEND_GAP };\n }\n\n this.placeLegend(origin, 0, inner.height - band, inner.width, band);\n\n return { x: 0, y: 0, width: inner.width, height: inner.height - band - LEGEND_GAP };\n }\n\n /**\n * Positions the legend child at an inner-box rectangle, offset by the\n * perimeter origin so its coordinates align with the SVG surface.\n *\n * @param origin - The perimeter origin offset.\n * @param x - The rectangle's inner-box x.\n * @param y - The rectangle's inner-box y.\n * @param width - The rectangle width.\n * @param height - The rectangle height.\n */\n private placeLegend(origin: { left: number; top: number }, x: number, y: number, width: number, height: number): void {\n this._legend.setX(origin.left + x);\n this._legend.setY(origin.top + y);\n this._legend.setWidth(width);\n this._legend.setHeight(height);\n this._legend.doLayout();\n }\n\n /**\n * Computes the plot rectangle inside `plotOuter` by subtracting the measured\n * axis margins. Measures margins from provisional scales built against\n * `plotOuter` — the tick *values* (hence label widths) are range-independent,\n * so this one extra scale build breaks the margin↔layout feedback loop.\n *\n * @param plotOuter - The rectangle left after the legend band.\n *\n * @returns The plot rectangle for the series marks.\n */\n private computePlot(plotOuter: PlotRect): PlotRect {\n const provisional = this.buildScales(plotOuter);\n const xFormat = tickFormatter(provisional.x, DEFAULT_TICK_COUNT);\n const yFormat = tickFormatter(provisional.y, DEFAULT_TICK_COUNT);\n\n const leftMargin = measureAxisMargin(\"left\", provisional.y, yFormat, DEFAULT_TICK_COUNT)\n + (this._options.yAxisLabel ? AXIS_LABEL_BAND : 0);\n const bottomMargin = measureAxisMargin(\"bottom\", provisional.x, xFormat, DEFAULT_TICK_COUNT)\n + (this._options.xAxisLabel ? AXIS_LABEL_BAND : 0);\n\n return {\n x: plotOuter.x + leftMargin,\n y: plotOuter.y + TOP_PAD,\n width: Math.max(0, plotOuter.width - leftMargin - RIGHT_PAD),\n height: Math.max(0, plotOuter.height - bottomMargin - TOP_PAD),\n };\n }\n\n /**\n * Clears the previous marks and redraws the axes (with y-gridlines), the\n * series, and the selection ring from scratch.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n private repaint(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n this.clearMarks();\n\n const axis = this.markFactory(this._axisGroup!);\n\n drawAxis(axis, \"left\", yScale, plot, { tickCount: DEFAULT_TICK_COUNT, format: tickFormatter(yScale, DEFAULT_TICK_COUNT), grid: true });\n drawAxis(axis, \"bottom\", xScale, plot, { tickCount: DEFAULT_TICK_COUNT, format: tickFormatter(xScale, DEFAULT_TICK_COUNT), grid: false });\n\n this.drawAxisTitles(axis, plot);\n this.drawSeries(plot, xScale, yScale);\n this.drawSelection(plot, xScale, yScale);\n }\n\n /**\n * Draws the optional x/y axis titles centred on their axes.\n *\n * @param create - The mark factory bound to the axis group.\n * @param plot - The plot rectangle.\n */\n private drawAxisTitles(create: MarkFactory, plot: PlotRect): void {\n const labelFill = { fill: \"var(--ts-ui-chart-label)\" };\n\n if (this._options.xAxisLabel) {\n create(\"text\", {\n setAttr: { x: String(plot.x + plot.width / 2), y: String(plot.y + plot.height + AXIS_LABEL_BAND + TOP_PAD), \"text-anchor\": \"middle\", \"dominant-baseline\": \"hanging\" },\n style: labelFill,\n text: this._options.xAxisLabel,\n });\n }\n\n if (this._options.yAxisLabel) {\n const cx = plot.x - AXIS_LABEL_BAND * 2;\n const cy = plot.y + plot.height / 2;\n\n create(\"text\", {\n setAttr: { x: String(cx), y: String(cy), \"text-anchor\": \"middle\", \"dominant-baseline\": \"middle\", transform: `rotate(-90 ${cx} ${cy})` },\n style: labelFill,\n text: this._options.yAxisLabel,\n });\n }\n }\n\n /**\n * Draws the selection ring around the currently selected point, if any and\n * its series is visible.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n private drawSelection(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n if (!this._selectedPoint) {\n return;\n }\n\n const model = this._series[this._selectedPoint.series];\n\n if (!model || model.hidden || this._selectedPoint.index >= model.points.length) {\n return;\n }\n\n const anchor = this.pointPixel(plot, xScale, yScale, this._selectedPoint.series, this._selectedPoint.index);\n\n if (!anchor) {\n return;\n }\n\n this.createMark(this._overlayGroup!, \"circle\", {\n setAttr: { cx: String(anchor.x), cy: String(anchor.y), r: String(SELECTION_RING_RADIUS) },\n style: { fill: \"none\", stroke: \"var(--ts-ui-chart-selection)\", \"stroke-width\": \"2\" },\n });\n }\n\n // ── Mark bookkeeping ───────────────────────────────────────────────────────\n\n /**\n * Returns a {@link MarkFactory} bound to a group, so a caller (e.g. the axis\n * renderer) creates marks that flow through this chart's centralised\n * clear/release bookkeeping.\n *\n * @param group - The parent group handle.\n *\n * @returns A factory creating tracked marks in that group.\n */\n private markFactory(group: Handle): MarkFactory {\n return (tag, patch) => this.createMark(group, tag, patch);\n }\n\n /**\n * Creates one SVG mark, applies a patch, appends it to a group, and tracks\n * it for release on the next repaint.\n *\n * @param parent - The parent group handle.\n * @param tag - The SVG element tag.\n * @param patch - The patch to apply.\n *\n * @returns The created mark handle.\n */\n private createMark(parent: Handle, tag: string, patch: ElementPatch): Handle {\n const mark = DOM.sink.createElementNS(SVG_NS, tag);\n DOM.sink.apply(mark, patch);\n DOM.sink.appendChild(parent, mark);\n this._marks.push({ parent, handle: mark });\n\n return mark;\n }\n\n /**\n * Creates a series mark in the series group, for subclass `drawSeries`\n * implementations.\n *\n * @param tag - The SVG element tag.\n * @param patch - The patch to apply.\n *\n * @returns The created mark handle.\n */\n protected seriesMark(tag: string, patch: ElementPatch): Handle {\n return this.createMark(this._seriesGroup!, tag, patch);\n }\n\n /** Detaches and releases every mark created since the last repaint. */\n private clearMarks(): void {\n for (const { parent, handle } of this._marks) {\n DOM.sink.removeChild(parent, handle);\n DOM.sink.release(handle);\n }\n\n this._marks.length = 0;\n }\n\n // ── Interaction ────────────────────────────────────────────────────────────\n\n /**\n * On pointer move over a mark carrying series/index data attributes, shows a\n * tooltip for that datum; hides it when the pointer is over blank space.\n *\n * @param event - The mouse-move event.\n */\n private handlePointerMove = (event: MouseEvent): void => {\n const hit = this.resolveHit(event);\n\n if (!hit) {\n Tooltip.hide();\n\n return;\n }\n\n const model = this._series[hit.series];\n // A whole-series mark (a line path, no point index) shows the series name\n // only; an indexed mark (a point marker or bar) shows the datum.\n const text = hit.index === null\n ? model.name\n : `${model.name}: (${model.points[hit.index].x}, ${model.points[hit.index].y})`;\n\n Tooltip.show(text, event.clientX, event.clientY);\n };\n\n /**\n * Hides the tooltip when the pointer truly leaves the chart. The subtree\n * `mouseout` also fires when the pointer crosses *between* internal marks\n * (a point marker onto the line path, say); hiding then would blank the\n * tooltip at every internal boundary, so a move whose `relatedTarget` is\n * still inside the chart is ignored.\n *\n * @param event - The mouse-out event.\n */\n private handlePointerOut = (event: MouseEvent): void => {\n const related = event.relatedTarget;\n const root = this.getElement();\n\n if (root && DOM.source.isNode(related) && DOM.source.contains(root, DOM.source.intern(related))) {\n return;\n }\n\n Tooltip.hide();\n };\n\n /**\n * On a click on a mark carrying series/index data attributes, selects that\n * datum (drawing a selection ring) and emits `\"selection\"`.\n *\n * @param event - The click event.\n */\n private handlePointerClick = (event: MouseEvent): void => {\n const hit = this.resolveHit(event);\n\n // Selection needs a concrete point — a whole-series mark (line path,\n // null index) carries no datum to select.\n if (!hit || hit.index === null) {\n return;\n }\n\n this.selectPoint(hit.series, hit.index);\n };\n\n /**\n * Toggles a series' visibility from a legend click and repaints.\n *\n * @param index - The toggled series index.\n */\n private handleLegendToggle = (index: number): void => {\n const model = this._series[index];\n\n if (model) {\n model.hidden = !model.hidden;\n\n this.scheduleLayout();\n }\n };\n\n /**\n * Resolves a pointer event to the datum (or whole series) it targets, or\n * `null` for a miss. The default reads the series/index data attributes off\n * the event's target mark ({@link hitMark}); subtypes whose marks are hard\n * to land on precisely (a thin line path) override this with a geometric\n * proximity test.\n *\n * @param event - The pointer event.\n *\n * @returns The hit `{ series, index }` (`index` null for a whole-series mark), or `null`.\n */\n protected resolveHit(event: MouseEvent): { series: number; index: number | null } | null {\n return this.hitMark(event);\n }\n\n /**\n * Maps a viewport (client) coordinate to the SVG surface's user space, whose\n * viewBox matches the inner-box pixels 1:1. Returns `null` before the surface\n * exists. Used by geometric hit-testing to place the cursor in mark space.\n *\n * @param clientX - The viewport x coordinate.\n * @param clientY - The viewport y coordinate.\n *\n * @returns The point in SVG user space, or `null`.\n */\n protected clientToSurface(clientX: number, clientY: number): { x: number; y: number } | null {\n if (!this._svg) {\n return null;\n }\n\n const rect = DOM.source.getElementRect(this._svg);\n\n return { x: clientX - rect.x, y: clientY - rect.y };\n }\n\n /**\n * Reads the series/index data attributes off the event's target mark. A mark\n * carrying only `data-series` (a line path) resolves to a whole-series hit\n * (`index: null`); a mark carrying `data-index` too (a point marker or bar)\n * resolves to that datum. Returns `null` when the target is not a series\n * mark, its series is hidden, or its index is out of range — so a series with\n * no point markers (`showPoints: false`) still hovers at the series level via\n * its path.\n *\n * @param event - The pointer event.\n *\n * @returns The hit `{ series, index }` (`index` null for a whole-series mark), or `null`.\n */\n private hitMark(event: MouseEvent): { series: number; index: number | null } | null {\n if (!DOM.source.isNode(event.target)) {\n return null;\n }\n\n const target = DOM.source.intern(event.target);\n const seriesRaw = DOM.source.getDataset(target, \"series\");\n\n if (seriesRaw === undefined) {\n return null;\n }\n\n const series = Number(seriesRaw);\n const model = this._series[series];\n\n if (!model || model.hidden) {\n return null;\n }\n\n const indexRaw = DOM.source.getDataset(target, \"index\");\n\n if (indexRaw === undefined) {\n return { series, index: null };\n }\n\n const index = Number(indexRaw);\n\n if (index >= model.points.length) {\n return null;\n }\n\n return { series, index };\n }\n\n /**\n * Selects a datum, repaints with the selection ring, and emits `\"selection\"`.\n *\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n */\n protected selectPoint(series: number, index: number): void {\n this._selectedPoint = { series, index };\n\n this.scheduleLayout();\n\n const model = this._series[series];\n\n this.emit(\"selection\", { series, index, point: model.points[index], seriesName: model.name });\n }\n\n // ── Colour resolution ──────────────────────────────────────────────────────\n\n /**\n * Resolves a series' mark colour: its explicit override, or the theme's\n * categorical palette slot for its index (cycling within the palette).\n *\n * @param index - The series index.\n * @param model - The series model.\n *\n * @returns A CSS colour or `var(--ts-ui-chart-series-N)` binding.\n */\n protected seriesColor(index: number, model: ChartSeriesModel): string {\n return model.color ?? `var(--ts-ui-chart-series-${(index % PALETTE_SIZE) + 1})`;\n }\n\n // ── Subtype hooks ──────────────────────────────────────────────────────────\n\n /**\n * Builds the x and y scales for the given plot rectangle. Reads the visible\n * series to compute domains; the subtype selects the scale kinds.\n *\n * @param plot - The plot rectangle whose edges form the pixel ranges.\n *\n * @returns The x and y scales.\n */\n protected abstract buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale };\n\n /**\n * Draws the series marks into the series group (via {@link seriesMark}),\n * carrying `data-series` / `data-index` for hit-testing and binding colours\n * to the palette variables. Hidden series draw nothing.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n protected abstract drawSeries(plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void;\n\n /**\n * Returns the pixel anchor of a datum (for the selection ring) in SVG user\n * space, or `null` when it cannot be resolved.\n *\n * @param plot - The plot rectangle.\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The pixel anchor, or `null`.\n */\n protected abstract pointPixel(plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null;\n\n // ── Lifecycle ──────────────────────────────────────────────────────────────\n\n /**\n * Unbinds the store, removes the theme subscription, and hides any open\n * tooltip. Call when the chart is permanently removed.\n */\n protected destructor(): void {\n if (this._boundStore) {\n for (const event of STORE_EVENTS) {\n this._boundStore.off(event, this._onStoreRefresh);\n }\n\n this._boundStore = null;\n }\n\n if (this._themeCleanup) {\n this._themeCleanup();\n this._themeCleanup = null;\n }\n\n // Release the last repaint's marks. They deliberately bypass\n // `trackHandle` (only the <svg> and its groups are tracked, and released\n // by the destructor), and `release` is non-recursive, so without this\n // every mark stays pinned in the handle registry — the Glyphs sprite-leak\n // lesson at final teardown, not just per repaint.\n this.clearMarks();\n\n // `_legend` is registered via `addComponent`, so `super.destructor()`'s\n // child recursion below already disposes it — an explicit call here\n // would run `ChartLegend.destructor()` a second time.\n Tooltip.hide();\n\n super.destructor();\n }\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { line, curveMonotoneX, curveLinear } from \"d3-shape\";\nimport { AbstractChart, AbstractChartOptions } from \"~/component/chart/AbstractChart.js\";\nimport { linearScale, timeScale, pointsXExtent, pointsYBounds } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport { callable } from \"~/core/Callable.js\";\nimport type { ChartPoint, PlotRect } from \"~/component/chart/types.js\";\n\n/** The x-axis scale kind a line chart uses. */\nexport type LineChartScaleType = \"linear\" | \"time\";\n\n/**\n * Vertical distance (px) within which the pointer \"catches\" a line for hover.\n * A comfortable band so the thin stroke need not be hit exactly; the nearest\n * line within it wins.\n */\nconst HOVER_TOLERANCE = 16;\n\n/** Binary-search steps used to invert a curve segment's x(t) — sub-pixel at 24. */\nconst CURVE_SOLVE_STEPS = 24;\n\n/** One captured path segment as a cubic in pixel space: `[x0,y0, x1,y1, x2,y2, x3,y3]`. */\ntype CurveSegment = [number, number, number, number, number, number, number, number];\n\n/**\n * A minimal path \"context\" that records the segments d3's line generator emits.\n * Feeding this to `line().context(...)` captures the *exact* rendered curve —\n * straight (`curveLinear`) or monotone (`curveMonotoneX`) — as cubic segments in\n * pixel space, so hover hit-testing can evaluate the real curve instead of the\n * straight chord between data points (which, for a monotone curve, sits off the\n * visible line and biases the catch band to one side). Only the three calls a\n * d3 line curve makes are implemented; a straight `lineTo` is stored as a\n * degenerate cubic whose controls lie on the chord.\n */\nclass CurveTape {\n readonly segments: CurveSegment[] = [];\n private _x = 0;\n private _y = 0;\n\n moveTo(x: number, y: number): void {\n this._x = x;\n this._y = y;\n }\n\n lineTo(x: number, y: number): void {\n this.segments.push([this._x, this._y, this._x, this._y, x, y, x, y]);\n this._x = x;\n this._y = y;\n }\n\n bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.segments.push([this._x, this._y, x1, y1, x2, y2, x, y]);\n this._x = x;\n this._y = y;\n }\n\n closePath(): void {\n // Line paths are never closed; required only to satisfy the context shape.\n }\n}\n\n/** Evaluates a cubic Bézier component (one axis) at parameter `t`. */\nfunction cubicAt(a: number, b: number, c: number, d: number, t: number): number {\n const u = 1 - t;\n\n return u * u * u * a + 3 * u * u * t * b + 3 * u * t * t * c + t * t * t * d;\n}\n\n/**\n * Construction-time options for {@link LineChart}.\n *\n * @category Components\n */\nexport interface LineChartOptions extends AbstractChartOptions {\n /** Whether to draw a circle marker at each point; defaults to `true`. */\n showPoints?: boolean;\n /** Whether to smooth the line (monotone curve) vs straight segments; defaults to `false`. */\n curved?: boolean;\n /** The x-axis scale kind; defaults to `\"linear\"`. */\n xScaleType?: LineChartScaleType;\n}\n\n/**\n * A line chart: one path per series over a linear or time x axis and a linear y\n * axis, with optional point markers. The path `d` string is generated by the\n * pure `d3-shape` `line()` generator (optionally with a monotone curve) and fed\n * straight into a `setAttr({ d })` through the sink — no DOM-owning d3 code.\n *\n * @category Components\n */\nclass LineChart extends AbstractChart<LineChartOptions> {\n\n /**\n * Builds the line chart, then dispatches its own options from the\n * constructor body (after `super()` has wired the base chart).\n *\n * @param options - Optional construction-time options.\n */\n constructor(options?: LineChartOptions) {\n super(options);\n\n this.dispatchLineOptions(options);\n }\n\n /**\n * Dispatches the line-specific options through their setters.\n *\n * @param options - The construction options, or `undefined`.\n */\n private dispatchLineOptions(options?: LineChartOptions): void {\n if (!options) {\n return;\n }\n\n if (options.showPoints !== undefined) {\n this.setShowPoints(options.showPoints);\n }\n\n if (options.curved !== undefined) {\n this.setCurved(options.curved);\n }\n\n if (options.xScaleType !== undefined) {\n this.setXScaleType(options.xScaleType);\n }\n }\n\n /**\n * Sets whether point markers are drawn and repaints.\n *\n * @param value - `true` to draw circle markers at each point.\n *\n * @returns This chart, for method chaining.\n */\n setShowPoints(value: boolean): this {\n this._options.showPoints = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether point markers are drawn (defaults to `true`).\n *\n * @returns `true` when markers are drawn.\n */\n isShowPoints(): boolean {\n return this._options.showPoints ?? true;\n }\n\n /**\n * Sets whether the line is smoothed (monotone curve) and repaints.\n *\n * @param value - `true` to smooth the line.\n *\n * @returns This chart, for method chaining.\n */\n setCurved(value: boolean): this {\n this._options.curved = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether the line is smoothed (defaults to `false`).\n *\n * @returns `true` when smoothed.\n */\n isCurved(): boolean {\n return this._options.curved ?? false;\n }\n\n /**\n * Sets the x-axis scale kind and repaints.\n *\n * @param value - The scale kind.\n *\n * @returns This chart, for method chaining.\n */\n setXScaleType(value: LineChartScaleType): this {\n this._options.xScaleType = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns the x-axis scale kind (defaults to `\"linear\"`).\n *\n * @returns The scale kind.\n */\n getXScaleType(): LineChartScaleType {\n return this._options.xScaleType ?? \"linear\";\n }\n\n /**\n * Flattens the points of every visible series into one array (for domain\n * computation).\n *\n * @returns The visible points.\n */\n private visiblePoints(): ChartPoint[] {\n return this._series.filter((m) => !m.hidden).flatMap((m) => m.points);\n }\n\n /**\n * Builds a linear or time x scale and a linear y scale against the plot\n * rectangle, from the visible points' extents.\n *\n * @param plot - The plot rectangle.\n *\n * @returns The x and y scales.\n */\n protected buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale } {\n const points = this.visiblePoints();\n const [xMin, xMax] = pointsXExtent(points);\n const yBounds = pointsYBounds(points);\n const xRange: [number, number] = [plot.x, plot.x + plot.width];\n const yRange: [number, number] = [plot.y + plot.height, plot.y];\n\n const x = this.getXScaleType() === \"time\"\n ? timeScale([new Date(xMin), new Date(xMax)], xRange)\n : linearScale([xMin, xMax], xRange);\n\n return { x, y: linearScale(yBounds, yRange) };\n }\n\n /**\n * Draws one path per visible series (plus optional point markers), tagging\n * each mark with its `data-series` / `data-index` and binding its colour to\n * the palette. The path `d` comes from `d3-shape`'s `line()` generator.\n *\n * @param plot - The plot rectangle (unused; the scales carry the geometry).\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n */\n protected drawSeries(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n const project = this.projector(xScale, yScale);\n const curve = this.isCurved() ? curveMonotoneX : curveLinear;\n\n this._series.forEach((model, seriesIndex) => {\n if (model.hidden) {\n return;\n }\n\n const color = this.seriesColor(seriesIndex, model);\n const path = line<ChartPoint>().x((p) => project.x(p.x)).y((p) => project.y(p.y)).curve(curve)(model.points);\n\n // The path spans the whole series, so it carries `data-series` only\n // (no per-point `data-index`): hovering the line shows a series-level\n // tooltip, while per-point hover/selection rides on the point markers\n // below. With `showPoints: false` the line stays series-level hoverable.\n this.seriesMark(\"path\", {\n setAttr: { d: path ?? \"\", \"data-series\": String(seriesIndex) },\n style: { fill: \"none\", stroke: color, \"stroke-width\": \"var(--ts-ui-chart-line-width)\" },\n });\n\n if (this.isShowPoints()) {\n this.drawPoints(model.points, seriesIndex, color, project);\n }\n });\n }\n\n /**\n * Draws a circle marker per point, each hit-taggable via its\n * `data-series` / `data-index`.\n *\n * @param points - The series points.\n * @param seriesIndex - The series index.\n * @param color - The resolved series colour.\n * @param project - The point→pixel projectors.\n */\n private drawPoints(points: ChartPoint[], seriesIndex: number, color: string, project: { x: (v: number) => number; y: (v: number) => number }): void {\n points.forEach((point, index) => {\n this.seriesMark(\"circle\", {\n setAttr: { cx: String(project.x(point.x)), cy: String(project.y(point.y)), r: \"var(--ts-ui-chart-point-radius)\", \"data-series\": String(seriesIndex), \"data-index\": String(index) },\n style: { fill: color },\n });\n });\n }\n\n /**\n * Returns the pixel anchor of a datum for the selection ring.\n *\n * @param plot - The plot rectangle (unused).\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The pixel anchor, or `null` when out of range.\n */\n protected pointPixel(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null {\n const point = this._series[series]?.points[index];\n\n if (!point) {\n return null;\n }\n\n const project = this.projector(xScale, yScale);\n\n return { x: project.x(point.x), y: project.y(point.y) };\n }\n\n /**\n * Resolves a pointer to the vertically-nearest visible series' line at the\n * cursor's x, within {@link HOVER_TOLERANCE}. A thin line path is hard to\n * land on precisely, so instead of the base's data-attribute hit-testing\n * this interpolates each line's y at the pointer and picks the closest,\n * reporting that series' nearest point (so the tooltip shows its value and a\n * click selects it). Returns `null` before layout or when no line is near.\n *\n * @param event - The pointer event.\n *\n * @returns The nearest `{ series, index }`, or `null`.\n */\n protected resolveHit(event: MouseEvent): { series: number; index: number | null } | null {\n if (!this._plot || !this._xScale || !this._yScale) {\n return null;\n }\n\n const cursor = this.clientToSurface(event.clientX, event.clientY);\n\n if (!cursor) {\n return null;\n }\n\n const plot = this._plot;\n\n // Only inside the plot's horizontal band, and its vertical band widened\n // by the tolerance so a line at the very top/bottom edge still catches.\n if (cursor.x < plot.x || cursor.x > plot.x + plot.width\n || cursor.y < plot.y - HOVER_TOLERANCE || cursor.y > plot.y + plot.height + HOVER_TOLERANCE) {\n return null;\n }\n\n const project = this.projector(this._xScale, this._yScale);\n\n let bestSeries = -1;\n let bestDist = HOVER_TOLERANCE;\n\n this._series.forEach((model, seriesIndex) => {\n if (model.hidden || model.points.length === 0) {\n return;\n }\n\n const lineY = this.curveYAt(model.points, cursor.x, project);\n\n if (lineY === null) {\n return;\n }\n\n const dist = Math.abs(cursor.y - lineY);\n\n if (dist <= bestDist) {\n bestDist = dist;\n bestSeries = seriesIndex;\n }\n });\n\n if (bestSeries < 0) {\n return null;\n }\n\n return { series: bestSeries, index: this.nearestPointIndex(this._series[bestSeries].points, cursor.x, project) };\n }\n\n /**\n * Evaluates a series' rendered line at a pixel x, returning the curve's\n * pixel y (or `null` when the cursor is outside the series' x-extent). The\n * curve is captured exactly as drawn — via {@link CurveTape} fed to the same\n * `line()` generator {@link drawSeries} uses — so a monotone (curved) line is\n * followed faithfully rather than approximated by the straight chord, which\n * would sit off the visible line and make the catch band lopsided. Within the\n * bracketing segment (x is monotone across it for both curve kinds), a binary\n * search inverts x(t), then y(t) gives the height.\n *\n * @param points - The series points (x-ordered, as drawn).\n * @param px - The cursor's pixel x.\n * @param project - The point→pixel projectors.\n *\n * @returns The line's pixel y at `px`, or `null` when out of range.\n */\n private curveYAt(points: ChartPoint[], px: number, project: { x: (v: number) => number; y: (v: number) => number }): number | null {\n const tape = new CurveTape();\n // d3's context type is Canvas-shaped; CurveTape implements only the three\n // calls a line curve makes, so the cast bridges the structural gap.\n const generator = line<ChartPoint>()\n .x((p) => project.x(p.x))\n .y((p) => project.y(p.y))\n .curve(this.isCurved() ? curveMonotoneX : curveLinear)\n .context(tape as unknown as CanvasRenderingContext2D);\n\n generator(points);\n\n for (const [x0, y0, x1, y1, x2, y2, x3, y3] of tape.segments) {\n if (px < Math.min(x0, x3) || px > Math.max(x0, x3)) {\n continue;\n }\n\n const ascending = x3 >= x0;\n let lo = 0;\n let hi = 1;\n\n for (let step = 0; step < CURVE_SOLVE_STEPS; step++) {\n const mid = (lo + hi) / 2;\n\n if ((cubicAt(x0, x1, x2, x3, mid) <= px) === ascending) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return cubicAt(y0, y1, y2, y3, (lo + hi) / 2);\n }\n\n return null;\n }\n\n /**\n * Returns the index of the series point whose projected x is nearest the\n * cursor's pixel x — the datum a near-line hover reports.\n *\n * @param points - The series points.\n * @param px - The cursor's pixel x.\n * @param project - The point→pixel projectors.\n *\n * @returns The nearest point's index.\n */\n private nearestPointIndex(points: ChartPoint[], px: number, project: { x: (v: number) => number; y: (v: number) => number }): number {\n let best = 0;\n let bestDx = Infinity;\n\n points.forEach((point, index) => {\n const dx = Math.abs(project.x(point.x) - px);\n\n if (dx < bestDx) {\n bestDx = dx;\n best = index;\n }\n });\n\n return best;\n }\n\n /**\n * Adapts the continuous x/y scales into plain numeric projectors. The line\n * chart's x scale is always continuous (linear/time), so the band-scale arm\n * of the {@link ChartScale} union never applies here.\n *\n * @param xScale - The x scale.\n * @param yScale - The y scale.\n *\n * @returns The `x` and `y` value→pixel projectors.\n */\n private projector(xScale: ChartScale, yScale: ChartScale): { x: (v: number) => number; y: (v: number) => number } {\n return {\n x: xScale as unknown as (v: number) => number,\n y: yScale as unknown as (v: number) => number,\n };\n }\n}\n\nconst LineChartCallable = callable(LineChart);\ntype LineChartCallable = LineChart;\nexport {\n LineChart as _LineChart,\n LineChartCallable as LineChart\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractChart, AbstractChartOptions } from \"~/component/chart/AbstractChart.js\";\nimport { bandScale, linearScale, isBandScale, pointsYBounds } from \"~/component/chart/Scale.js\";\nimport type { ChartScale } from \"~/component/chart/Scale.js\";\nimport type { ScaleBand } from \"d3-scale\";\nimport { callable } from \"~/core/Callable.js\";\nimport type { ChartPoint, ChartSeriesModel, PlotRect } from \"~/component/chart/types.js\";\n\n/**\n * Construction-time options for {@link BarChart}.\n *\n * @category Components\n */\nexport interface BarChartOptions extends AbstractChartOptions {\n /**\n * Whether multiple series are drawn as side-by-side grouped bars (`true`)\n * or stacked (`false`). Defaults to grouped when more than one series is\n * present.\n */\n grouped?: boolean;\n}\n\n/** One resolved bar rectangle, tagged with the datum it represents. */\ninterface BarRect {\n seriesIndex: number;\n pointIndex: number;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * A bar chart: a discrete band x axis and a linear y axis. Multiple series are\n * drawn grouped (side by side) or stacked. Bar rectangles are hand-computed from\n * the band scale — `d3-shape` adds nothing to axis-aligned rectangles.\n *\n * @category Components\n */\nclass BarChart extends AbstractChart<BarChartOptions> {\n\n /**\n * Builds the bar chart, then dispatches its own options from the constructor\n * body.\n *\n * @param options - Optional construction-time options.\n */\n constructor(options?: BarChartOptions) {\n super(options);\n\n if (options?.grouped !== undefined) {\n this.setGrouped(options.grouped);\n }\n }\n\n /**\n * Sets whether multiple series are grouped (vs stacked) and repaints.\n *\n * @param value - `true` for grouped bars, `false` for stacked.\n *\n * @returns This chart, for method chaining.\n */\n setGrouped(value: boolean): this {\n this._options.grouped = value;\n\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether multiple series are grouped (defaults to grouped when more\n * than one series is present).\n *\n * @returns `true` when bars are grouped.\n */\n isGrouped(): boolean {\n return this._options.grouped ?? this._series.length > 1;\n }\n\n /**\n * Returns the distinct x categories across the visible series, in ascending\n * numeric order, as strings.\n *\n * @returns The ordered category labels.\n */\n private categories(): string[] {\n const values = new Set<number>();\n\n for (const model of this._series) {\n if (!model.hidden) {\n for (const point of model.points) {\n values.add(point.x);\n }\n }\n }\n\n return Array.from(values).sort((a, b) => a - b).map(String);\n }\n\n /**\n * Flattens the points of every visible series (for the y-domain).\n *\n * @returns The visible points.\n */\n private visiblePoints(): ChartPoint[] {\n return this._series.filter((m) => !m.hidden).flatMap((m) => m.points);\n }\n\n /**\n * Builds a band x scale over the categories and a linear y scale from zero\n * to the data max.\n *\n * @param plot - The plot rectangle.\n *\n * @returns The x and y scales.\n */\n protected buildScales(plot: PlotRect): { x: ChartScale; y: ChartScale } {\n const x = bandScale(this.categories(), [plot.x, plot.x + plot.width]);\n const y = linearScale(pointsYBounds(this.visiblePoints()), [plot.y + plot.height, plot.y]);\n\n return { x, y };\n }\n\n /**\n * Draws one `<rect>` per (visible series × point), grouped or stacked, each\n * tagged with `data-series` / `data-index` and coloured from the palette.\n *\n * @param plot - The plot rectangle (unused; the scales carry the geometry).\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n */\n protected drawSeries(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale): void {\n for (const bar of this.computeBars(xScale, yScale)) {\n const color = this.seriesColor(bar.seriesIndex, this._series[bar.seriesIndex]);\n\n this.seriesMark(\"rect\", {\n setAttr: { x: String(bar.x), y: String(bar.y), width: String(bar.width), height: String(bar.height), \"data-series\": String(bar.seriesIndex), \"data-index\": String(bar.pointIndex) },\n style: { fill: color },\n });\n }\n }\n\n /**\n * Computes the bar rectangles for the visible series against the scales,\n * subdividing each category band across grouped series or stacking them.\n *\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n *\n * @returns The bar rectangles.\n */\n private computeBars(xScale: ChartScale, yScale: ChartScale): BarRect[] {\n if (!isBandScale(xScale)) {\n return [];\n }\n\n const project = yScale as unknown as (v: number) => number;\n const baseline = project(0);\n const grouped = this.isGrouped();\n const visible = this._series\n .map((model, index) => ({ model, index }))\n .filter((entry) => !entry.model.hidden);\n const groupWidth = xScale.bandwidth();\n const barWidth = grouped ? groupWidth / Math.max(1, visible.length) : groupWidth;\n const stackTops = new Map<string, number>();\n const bars: BarRect[] = [];\n\n visible.forEach((entry, position) => {\n this.appendSeriesBars(bars, entry.model, entry.index, position, xScale, project, baseline, grouped, barWidth, stackTops);\n });\n\n return bars;\n }\n\n /**\n * Appends the bar rectangles for one series to `bars`.\n *\n * @param bars - The accumulating bar list.\n * @param model - The series model.\n * @param seriesIndex - The series' index in the full model.\n * @param position - The series' position among the visible series (grouped offset).\n * @param xScale - The band x scale.\n * @param project - The y value→pixel projector.\n * @param baseline - The pixel y of the zero baseline.\n * @param grouped - Whether bars are grouped (vs stacked).\n * @param barWidth - The per-bar width in px.\n * @param stackTops - Running stacked tops per category (mutated for stacking).\n */\n private appendSeriesBars(\n bars: BarRect[],\n model: ChartSeriesModel,\n seriesIndex: number,\n position: number,\n xScale: ScaleBand<string>,\n project: (v: number) => number,\n baseline: number,\n grouped: boolean,\n barWidth: number,\n stackTops: Map<string, number>\n ): void {\n model.points.forEach((point, pointIndex) => {\n const category = String(point.x);\n const bandStart = xScale(category) ?? 0;\n\n if (grouped) {\n const top = project(point.y);\n\n bars.push({ seriesIndex, pointIndex, x: bandStart + position * barWidth, y: Math.min(top, baseline), width: barWidth, height: Math.abs(baseline - top), });\n } else {\n const prev = stackTops.get(category) ?? 0;\n const cumulative = prev + point.y;\n const top = project(cumulative);\n const bottom = project(prev);\n\n bars.push({ seriesIndex, pointIndex, x: bandStart, y: Math.min(top, bottom), width: barWidth, height: Math.abs(bottom - top), });\n stackTops.set(category, cumulative);\n }\n });\n }\n\n /**\n * Returns the top-centre pixel of a datum's bar for the selection ring.\n *\n * @param plot - The plot rectangle (unused).\n * @param xScale - The band x scale.\n * @param yScale - The linear y scale.\n * @param series - The datum's series index.\n * @param index - The datum's index within its series.\n *\n * @returns The bar top-centre pixel, or `null` when not found.\n */\n protected pointPixel(_plot: PlotRect, xScale: ChartScale, yScale: ChartScale, series: number, index: number): { x: number; y: number } | null {\n const bar = this.computeBars(xScale, yScale).find((b) => b.seriesIndex === series && b.pointIndex === index);\n\n if (!bar) {\n return null;\n }\n\n return { x: bar.x + bar.width / 2, y: bar.y };\n }\n}\n\nconst BarChartCallable = callable(BarChart);\ntype BarChartCallable = BarChart;\nexport {\n BarChart as _BarChart,\n BarChartCallable as BarChart\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71],"mappings":"0WAAA,SAAA,mBAAwB,EAAG,CACzB,OAAO,SAAS,UAAW,CACzB,OAAO,CACT,CACF,CCJA,IAAM,EAAK,KAAK,GACZ,EAAM,EAAI,EACV,EAAU,KACV,EAAa,EAAM,EAEvB,SAAS,OAAO,EAAS,CACvB,KAAK,GAAK,EAAQ,GAClB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,EAAI,EAAG,EAAE,EAC3C,KAAK,GAAK,UAAU,GAAK,EAAQ,EAErC,CAEA,SAAS,YAAY,EAAQ,CAC3B,IAAI,EAAI,KAAK,MAAM,CAAM,EACzB,GAAI,EAAE,GAAK,GAAI,MAAU,MAAM,mBAAmB,GAAQ,EAC1D,GAAI,EAAI,GAAI,OAAO,OACnB,IAAM,EAAI,IAAM,EAChB,OAAO,SAAS,EAAS,CACvB,KAAK,GAAK,EAAQ,GAClB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,EAAI,EAAG,EAAE,EAC3C,KAAK,GAAK,KAAK,MAAM,UAAU,GAAK,CAAC,EAAI,EAAI,EAAQ,EAEzD,CACF,CAEA,IAAa,KAAb,KAAkB,CAChB,YAAY,EAAQ,CAClB,KAAK,IAAM,KAAK,IAChB,KAAK,IAA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