higlass 1.13.5 → 2.0.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 (392) hide show
  1. package/README.md +48 -54
  2. package/app/globals.d.ts +1 -1
  3. package/app/missing-types.d.ts +4 -1
  4. package/app/scripts/AddTrackDialog.jsx +11 -4
  5. package/app/scripts/AddTrackPositionMenu.jsx +28 -7
  6. package/app/scripts/Annotations1dTrack.js +90 -251
  7. package/app/scripts/Annotations2dTrack.js +12 -7
  8. package/app/scripts/Autocomplete.jsx +13 -28
  9. package/app/scripts/AxisPixi.js +6 -10
  10. package/app/scripts/BarTrack.js +3 -3
  11. package/app/scripts/BedLikeTrack.js +556 -449
  12. package/app/scripts/Button.jsx +1 -1
  13. package/app/scripts/CNVIntervalTrack.js +1 -1
  14. package/app/scripts/CenterTrack.jsx +8 -7
  15. package/app/scripts/Chromosome2DAnnotations.js +1 -1
  16. package/app/scripts/Chromosome2DLabels.js +1 -1
  17. package/app/scripts/ChromosomeGrid.js +49 -38
  18. package/app/scripts/ChromosomeInfo.js +1 -1
  19. package/app/scripts/CombinedTrack.js +3 -1
  20. package/app/scripts/ConfigTrackMenu.jsx +1 -1
  21. package/app/scripts/ConfigViewMenu.jsx +2 -2
  22. package/app/scripts/ContextMenuContainer.jsx +4 -2
  23. package/app/scripts/ContextMenuItem.jsx +14 -2
  24. package/app/scripts/CrossRule.js +1 -1
  25. package/app/scripts/CustomTrackDialog.jsx +2 -2
  26. package/app/scripts/Dialog.jsx +2 -2
  27. package/app/scripts/DragListeningDiv.jsx +1 -1
  28. package/app/scripts/DraggableDiv.jsx +2 -3
  29. package/app/scripts/ExportLinkDialog.jsx +1 -1
  30. package/app/scripts/FilledLine.js +349 -0
  31. package/app/scripts/GalleryTracks.jsx +77 -78
  32. package/app/scripts/GenomePositionSearchBox.jsx +184 -482
  33. package/app/scripts/HeatmapOptions.jsx +4 -2
  34. package/app/scripts/HeatmapTiledPixiTrack.js +23 -32
  35. package/app/scripts/HiGlassComponent.jsx +515 -444
  36. package/app/scripts/HiGlassComponentContext.js +5 -0
  37. package/app/scripts/Horizontal1dHeatmapTrack.js +1 -1
  38. package/app/scripts/Horizontal2DDomainsTrack.js +1 -1
  39. package/app/scripts/HorizontalChromosomeLabels.js +28 -22
  40. package/app/scripts/HorizontalGeneAnnotationsTrack.js +1 -1
  41. package/app/scripts/HorizontalHeatmapTrack.js +2 -2
  42. package/app/scripts/HorizontalMultivecTrack.js +6 -7
  43. package/app/scripts/HorizontalRule.js +1 -2
  44. package/app/scripts/HorizontalTiled1DPixiTrack.js +4 -4
  45. package/app/scripts/HorizontalTiledPlot.jsx +9 -9
  46. package/app/scripts/LeftTrackModifier.js +4 -0
  47. package/app/scripts/ListWrapper.jsx +1 -2
  48. package/app/scripts/MapboxTilesTrack.js +1 -2
  49. package/app/scripts/Modal.jsx +2 -2
  50. package/app/scripts/MoveableTrack.jsx +10 -12
  51. package/app/scripts/NestedContextMenu.jsx +2 -1
  52. package/app/scripts/OSMTileIdsTrack.js +1 -1
  53. package/app/scripts/OverlayTrack.js +4 -4
  54. package/app/scripts/PixiTrack.js +27 -13
  55. package/app/scripts/PlotTypeChooser.jsx +3 -4
  56. package/app/scripts/SearchField.js +5 -5
  57. package/app/scripts/SeriesListItems.jsx +3 -4
  58. package/app/scripts/SeriesListMenu.jsx +95 -53
  59. package/app/scripts/SeriesListSubmenuMixin.jsx +2 -1
  60. package/app/scripts/SketchInlinePicker.jsx +2 -2
  61. package/app/scripts/SortableList.jsx +1 -1
  62. package/app/scripts/Tiled1DPixiTrack.js +4 -1
  63. package/app/scripts/TiledPixiTrack.js +244 -102
  64. package/app/scripts/TiledPlot.jsx +565 -118
  65. package/app/scripts/TilesetFinder.jsx +12 -4
  66. package/app/scripts/Track.js +1 -1
  67. package/app/scripts/TrackArea.jsx +4 -0
  68. package/app/scripts/TrackControl.jsx +2 -2
  69. package/app/scripts/TrackRenderer.jsx +32 -33
  70. package/app/scripts/ValueIntervalTrack.js +1 -1
  71. package/app/scripts/VerticalRule.js +2 -2
  72. package/app/scripts/VerticalTiledPlot.jsx +7 -7
  73. package/app/scripts/ViewConfigEditor.jsx +1 -1
  74. package/app/scripts/ViewContextMenu.jsx +53 -5
  75. package/app/scripts/ViewHeader.jsx +9 -9
  76. package/app/scripts/ViewportTracker2D.js +1 -1
  77. package/app/scripts/api.js +92 -12
  78. package/app/scripts/configs/available-track-types.js +1 -1
  79. package/app/scripts/configs/index.js +6 -1
  80. package/app/scripts/configs/positions-by-datatype.js +2 -2
  81. package/app/scripts/configs/primitives.js +2 -0
  82. package/app/scripts/configs/themes.js +0 -1
  83. package/app/scripts/configs/tracks-info-by-type.js +11 -8
  84. package/app/scripts/configs/tracks-info.js +3 -2
  85. package/app/scripts/d3-context-menu.js +3 -4
  86. package/app/scripts/data-fetchers/DataFetcher.js +35 -36
  87. package/app/scripts/data-fetchers/genbank-fetcher.js +13 -22
  88. package/app/scripts/data-fetchers/local-tile-fetcher.js +10 -8
  89. package/app/scripts/hglib.jsx +62 -71
  90. package/app/scripts/hocs/with-modal.jsx +32 -10
  91. package/app/scripts/hocs/with-pub-sub.js +12 -3
  92. package/app/scripts/hocs/with-theme.jsx +21 -14
  93. package/app/scripts/icons.jsx +3 -2
  94. package/app/scripts/mixwith.js +2 -2
  95. package/app/scripts/options-info.js +49 -11
  96. package/app/scripts/plugins/get-data-fetcher.js +2 -3
  97. package/app/scripts/services/chrom-info.js +32 -4
  98. package/app/scripts/services/element-resize-listener.js +2 -2
  99. package/app/scripts/services/index.js +0 -1
  100. package/app/scripts/services/tile-proxy.js +368 -285
  101. package/app/scripts/services/worker.js +31 -28
  102. package/app/scripts/test-helpers/index.js +2 -1
  103. package/app/scripts/test-helpers/test-helpers.jsx +157 -69
  104. package/app/scripts/types.ts +118 -47
  105. package/app/scripts/utils/LruCache.js +3 -2
  106. package/app/scripts/utils/assert.js +19 -0
  107. package/app/scripts/utils/background-task-scheduler.js +2 -0
  108. package/app/scripts/utils/color-domain-to-rgba-array.js +13 -3
  109. package/app/scripts/utils/copy-text-to-clipboard.js +36 -0
  110. package/app/scripts/utils/decompress.js +33 -0
  111. package/app/scripts/utils/default-tracks.js +46 -0
  112. package/app/scripts/utils/dict-items.js +1 -0
  113. package/app/scripts/utils/dict-keys.js +1 -0
  114. package/app/scripts/utils/dict-values.js +1 -0
  115. package/app/scripts/utils/expand-combined-tracks.js +11 -7
  116. package/app/scripts/utils/fill-in-min-widths.js +47 -21
  117. package/app/scripts/utils/flatten.js +0 -1
  118. package/app/scripts/utils/get-aggregation-function.js +1 -1
  119. package/app/scripts/utils/get-default-track-for-datatype.js +37 -10
  120. package/app/scripts/utils/get-default-tracks-for-datatype.ts +46 -0
  121. package/app/scripts/utils/get-higlass-components.js +27 -3
  122. package/app/scripts/utils/get-track-position-by-uid.js +8 -1
  123. package/app/scripts/utils/get-xylofon.js +12 -9
  124. package/app/scripts/utils/has-parent.js +5 -5
  125. package/app/scripts/utils/hex-string-to-int.js +1 -1
  126. package/app/scripts/utils/index.js +1 -0
  127. package/app/scripts/utils/interval-tree.js +222 -177
  128. package/app/scripts/utils/load-chrom-infos.js +4 -1
  129. package/app/scripts/utils/pixi-text-to-svg.js +5 -9
  130. package/app/scripts/utils/positioned-tracks-to-all-tracks.js +55 -0
  131. package/app/scripts/utils/range-query-2d.js +3 -3
  132. package/app/scripts/utils/reduce.js +12 -5
  133. package/app/scripts/utils/segments-to-rows.js +14 -11
  134. package/app/scripts/utils/svg-line.js +7 -8
  135. package/app/scripts/utils/type-guards.js +16 -7
  136. package/app/scripts/utils/visit-positioned-tracks.js +9 -4
  137. package/app/styles/AddTrackPositionMenu.module.scss +37 -0
  138. package/app/styles/HiGlass.module.scss +3 -1
  139. package/app/styles/d3-context-menu.css +0 -1
  140. package/app/styles/prism.css +1 -0
  141. package/dist/app/schema.json +525 -0
  142. package/dist/app/scripts/AddTrackDialog.d.ts +64 -0
  143. package/dist/app/scripts/AddTrackPositionMenu.d.ts +5 -0
  144. package/dist/app/scripts/Annotations1dTrack.d.ts +15 -0
  145. package/dist/app/scripts/Annotations2dTrack.d.ts +95 -0
  146. package/dist/app/scripts/ArrowheadDomainsTrack.d.ts +36 -0
  147. package/dist/app/scripts/Autocomplete.d.ts +102 -0
  148. package/dist/app/scripts/AxisPixi.d.ts +25 -0
  149. package/dist/app/scripts/BarTrack.d.ts +28 -0
  150. package/dist/app/scripts/BedLikeTrack.d.ts +84 -0
  151. package/dist/app/scripts/Button.d.ts +3 -0
  152. package/dist/app/scripts/CNVIntervalTrack.d.ts +12 -0
  153. package/dist/app/scripts/CenterTiledPlot.d.ts +3 -0
  154. package/dist/app/scripts/CenterTrack.d.ts +92 -0
  155. package/dist/app/scripts/Chromosome2DAnnotations.d.ts +10 -0
  156. package/dist/app/scripts/Chromosome2DLabels.d.ts +13 -0
  157. package/dist/app/scripts/ChromosomeGrid.d.ts +24 -0
  158. package/dist/app/scripts/ChromosomeInfo.d.ts +14 -0
  159. package/dist/app/scripts/CloseTrackMenu.d.ts +10 -0
  160. package/dist/app/scripts/CombinedTrack.d.ts +32 -0
  161. package/dist/app/scripts/ConfigTrackMenu.d.ts +10 -0
  162. package/dist/app/scripts/ConfigViewMenu.d.ts +34 -0
  163. package/dist/app/scripts/ConfigureSeriesMenu.d.ts +3 -0
  164. package/dist/app/scripts/ContextMenuContainer.d.ts +36 -0
  165. package/dist/app/scripts/ContextMenuItem.d.ts +34 -0
  166. package/dist/app/scripts/Cross.d.ts +3 -0
  167. package/dist/app/scripts/CrossRule.d.ts +24 -0
  168. package/dist/app/scripts/CustomTrackDialog.d.ts +17 -0
  169. package/dist/app/scripts/Dialog.d.ts +5 -0
  170. package/dist/app/scripts/DivergentBarTrack.d.ts +4 -0
  171. package/dist/app/scripts/DragListeningDiv.d.ts +32 -0
  172. package/dist/app/scripts/DraggableDiv.d.ts +63 -0
  173. package/dist/app/scripts/ExportLinkDialog.d.ts +21 -0
  174. package/dist/app/scripts/FilledLine.d.ts +5 -0
  175. package/dist/app/scripts/FixedTrack.d.ts +5 -0
  176. package/dist/app/scripts/GalleryTracks.d.ts +20 -0
  177. package/dist/app/scripts/GenomePositionSearchBox.d.ts +95 -0
  178. package/dist/app/scripts/HeatmapOptions.d.ts +30 -0
  179. package/dist/app/scripts/HeatmapTiledPixiTrack.d.ts +184 -0
  180. package/dist/app/scripts/HiGlassComponent.d.ts +762 -0
  181. package/dist/app/scripts/HiGlassComponentContext.d.ts +3 -0
  182. package/dist/app/scripts/HiGlassTrackComponent.d.ts +37 -0
  183. package/dist/app/scripts/Horizontal1dHeatmapTrack.d.ts +9 -0
  184. package/dist/app/scripts/Horizontal2DDomainsTrack.d.ts +21 -0
  185. package/dist/app/scripts/HorizontalChromosomeLabels.d.ts +47 -0
  186. package/dist/app/scripts/HorizontalGeneAnnotationsTrack.d.ts +25 -0
  187. package/dist/app/scripts/HorizontalHeatmapTrack.d.ts +12 -0
  188. package/dist/app/scripts/HorizontalItem.d.ts +3 -0
  189. package/dist/app/scripts/HorizontalLine1DPixiTrack.d.ts +23 -0
  190. package/dist/app/scripts/HorizontalMultivecTrack.d.ts +50 -0
  191. package/dist/app/scripts/HorizontalPoint1DPixiTrack.d.ts +5 -0
  192. package/dist/app/scripts/HorizontalRule.d.ts +22 -0
  193. package/dist/app/scripts/HorizontalTiled1DPixiTrack.d.ts +26 -0
  194. package/dist/app/scripts/HorizontalTiledPlot.d.ts +49 -0
  195. package/dist/app/scripts/HorizontalTrack.d.ts +6 -0
  196. package/dist/app/scripts/Id2DTiledPixiTrack.d.ts +10 -0
  197. package/dist/app/scripts/IdHorizontal1DTiledPixiTrack.d.ts +6 -0
  198. package/dist/app/scripts/IdVertical1DTiledPixiTrack.d.ts +7 -0
  199. package/dist/app/scripts/LeftAxisTrack.d.ts +9 -0
  200. package/dist/app/scripts/LeftTrackModifier.d.ts +29 -0
  201. package/dist/app/scripts/ListWrapper.d.ts +64 -0
  202. package/dist/app/scripts/MapboxTilesTrack.d.ts +9 -0
  203. package/dist/app/scripts/Modal.d.ts +5 -0
  204. package/dist/app/scripts/MoveableTrack.d.ts +18 -0
  205. package/dist/app/scripts/NestedContextMenu.d.ts +7 -0
  206. package/dist/app/scripts/OSMTileIdsTrack.d.ts +5 -0
  207. package/dist/app/scripts/OSMTilesTrack.d.ts +129 -0
  208. package/dist/app/scripts/OverlayTrack.d.ts +13 -0
  209. package/dist/app/scripts/PixiTrack.d.ts +174 -0
  210. package/dist/app/scripts/PlotTypeChooser.d.ts +25 -0
  211. package/dist/app/scripts/PopupMenu.d.ts +28 -0
  212. package/dist/app/scripts/RasterTilesTrack.d.ts +9 -0
  213. package/dist/app/scripts/RuleMixin.d.ts +2 -0
  214. package/dist/app/scripts/SVGTrack.d.ts +15 -0
  215. package/dist/app/scripts/SearchField.d.ts +13 -0
  216. package/dist/app/scripts/SeriesListItems.d.ts +2 -0
  217. package/dist/app/scripts/SeriesListMenu.d.ts +51 -0
  218. package/dist/app/scripts/SeriesListSubmenuMixin.d.ts +2 -0
  219. package/dist/app/scripts/SketchInlinePicker.d.ts +25 -0
  220. package/dist/app/scripts/SortableList.d.ts +22 -0
  221. package/dist/app/scripts/SquareMarkersTrack.d.ts +22 -0
  222. package/dist/app/scripts/Tiled1DPixiTrack.d.ts +60 -0
  223. package/dist/app/scripts/TiledPixiTrack.d.ts +369 -0
  224. package/dist/app/scripts/TiledPlot.d.ts +313 -0
  225. package/dist/app/scripts/TilesetFinder.d.ts +65 -0
  226. package/dist/app/scripts/TopAxisTrack.d.ts +9 -0
  227. package/dist/app/scripts/Track.d.ts +196 -0
  228. package/dist/app/scripts/TrackArea.d.ts +26 -0
  229. package/dist/app/scripts/TrackControl.d.ts +5 -0
  230. package/dist/app/scripts/TrackRenderer.d.ts +724 -0
  231. package/dist/app/scripts/UnknownPixiTrack.d.ts +7 -0
  232. package/dist/app/scripts/ValueIntervalTrack.d.ts +6 -0
  233. package/dist/app/scripts/VerticalItem.d.ts +3 -0
  234. package/dist/app/scripts/VerticalRule.d.ts +21 -0
  235. package/dist/app/scripts/VerticalTiled1DPixiTrack.d.ts +6 -0
  236. package/dist/app/scripts/VerticalTiledPlot.d.ts +50 -0
  237. package/dist/app/scripts/VerticalTrack.d.ts +6 -0
  238. package/dist/app/scripts/ViewConfigEditor.d.ts +53 -0
  239. package/dist/app/scripts/ViewContextMenu.d.ts +17 -0
  240. package/dist/app/scripts/ViewHeader.d.ts +75 -0
  241. package/dist/app/scripts/ViewportTracker2D.d.ts +17 -0
  242. package/dist/app/scripts/ViewportTracker2DPixi.d.ts +11 -0
  243. package/dist/app/scripts/ViewportTrackerHorizontal.d.ts +17 -0
  244. package/dist/app/scripts/ViewportTrackerVertical.d.ts +17 -0
  245. package/dist/app/scripts/api.d.ts +640 -0
  246. package/dist/app/scripts/configs/available-track-types.d.ts +2 -0
  247. package/dist/app/scripts/configs/colormaps.d.ts +2 -0
  248. package/dist/app/scripts/configs/datatype-to-track-type.d.ts +4 -0
  249. package/dist/app/scripts/configs/default-tracks-for-datatype.d.ts +38 -0
  250. package/dist/app/scripts/configs/dense-data-extrema-config.d.ts +2 -0
  251. package/dist/app/scripts/configs/globals.d.ts +5 -0
  252. package/dist/app/scripts/configs/index.d.ts +16 -0
  253. package/dist/app/scripts/configs/positions-by-datatype.d.ts +2 -0
  254. package/dist/app/scripts/configs/primitives.d.ts +20 -0
  255. package/dist/app/scripts/configs/themes.d.ts +3 -0
  256. package/dist/app/scripts/configs/tracks-info-by-type.d.ts +4 -0
  257. package/dist/app/scripts/configs/tracks-info.d.ts +24 -0
  258. package/dist/app/scripts/d3-context-menu.d.ts +2 -0
  259. package/dist/app/scripts/data-fetchers/DataFetcher.d.ts +151 -0
  260. package/dist/app/scripts/data-fetchers/genbank-fetcher.d.ts +86 -0
  261. package/dist/app/scripts/data-fetchers/index.d.ts +3 -0
  262. package/dist/app/scripts/data-fetchers/local-tile-fetcher.d.ts +47 -0
  263. package/dist/app/scripts/gosling-exports.d.ts +17 -0
  264. package/dist/app/scripts/hglib.d.ts +24 -0
  265. package/dist/app/scripts/hocs/with-modal.d.ts +19 -0
  266. package/dist/app/scripts/hocs/with-pub-sub.d.ts +22 -0
  267. package/dist/app/scripts/hocs/with-theme.d.ts +13 -0
  268. package/dist/app/scripts/icons.d.ts +161 -0
  269. package/dist/app/scripts/mixwith.d.ts +27 -0
  270. package/dist/app/scripts/options-info.d.ts +1355 -0
  271. package/dist/app/scripts/plugins/available-for-plugins.d.ts +2338 -0
  272. package/dist/app/scripts/plugins/get-data-fetcher.d.ts +2 -0
  273. package/dist/app/scripts/plugins/index.d.ts +2 -0
  274. package/dist/app/scripts/services/chrom-info.d.ts +10 -0
  275. package/dist/app/scripts/services/dom-event.d.ts +7 -0
  276. package/dist/app/scripts/services/element-resize-listener.d.ts +5 -0
  277. package/dist/app/scripts/services/index.d.ts +5 -0
  278. package/dist/app/scripts/services/tile-proxy.d.ts +180 -0
  279. package/dist/app/scripts/services/worker.d.ts +157 -0
  280. package/dist/app/scripts/symbol.d.ts +13 -0
  281. package/dist/app/scripts/test-helpers/index.d.ts +1 -0
  282. package/dist/app/scripts/test-helpers/test-helpers.d.ts +33 -0
  283. package/dist/app/scripts/track-utils.d.ts +73 -0
  284. package/dist/app/scripts/types.d.ts +199 -0
  285. package/dist/app/scripts/utils/DenseDataExtrema1D.d.ts +88 -0
  286. package/dist/app/scripts/utils/DenseDataExtrema2D.d.ts +97 -0
  287. package/dist/app/scripts/utils/LruCache.d.ts +44 -0
  288. package/dist/app/scripts/utils/abs-to-chr.d.ts +14 -0
  289. package/dist/app/scripts/utils/accessor-transposition.d.ts +14 -0
  290. package/dist/app/scripts/utils/add-arrays.d.ts +18 -0
  291. package/dist/app/scripts/utils/add-class.d.ts +8 -0
  292. package/dist/app/scripts/utils/add-event-listener-once.d.ts +11 -0
  293. package/dist/app/scripts/utils/assert.d.ts +17 -0
  294. package/dist/app/scripts/utils/background-task-scheduler.d.ts +47 -0
  295. package/dist/app/scripts/utils/base64-to-canvas.d.ts +9 -0
  296. package/dist/app/scripts/utils/chr-to-abs.d.ts +10 -0
  297. package/dist/app/scripts/utils/chrom-info-bisector.d.ts +4 -0
  298. package/dist/app/scripts/utils/clone-event.d.ts +12 -0
  299. package/dist/app/scripts/utils/color-domain-to-rgba-array.d.ts +13 -0
  300. package/dist/app/scripts/utils/color-to-hex.d.ts +9 -0
  301. package/dist/app/scripts/utils/color-to-rgba.d.ts +9 -0
  302. package/dist/app/scripts/utils/copy-text-to-clipboard.d.ts +2 -0
  303. package/dist/app/scripts/utils/data-to-genomic-loci.d.ts +11 -0
  304. package/dist/app/scripts/utils/debounce.d.ts +5 -0
  305. package/dist/app/scripts/utils/dec-to-hex-str.d.ts +8 -0
  306. package/dist/app/scripts/utils/decompress.d.ts +27 -0
  307. package/dist/app/scripts/utils/default-tracks.d.ts +3 -0
  308. package/dist/app/scripts/utils/dict-from-tuples.d.ts +11 -0
  309. package/dist/app/scripts/utils/dict-items.d.ts +18 -0
  310. package/dist/app/scripts/utils/dict-keys.d.ts +10 -0
  311. package/dist/app/scripts/utils/dict-values.d.ts +8 -0
  312. package/dist/app/scripts/utils/download.d.ts +7 -0
  313. package/dist/app/scripts/utils/expand-combined-tracks.d.ts +11 -0
  314. package/dist/app/scripts/utils/fake-pub-sub.d.ts +11 -0
  315. package/dist/app/scripts/utils/fill-in-min-widths.d.ts +44 -0
  316. package/dist/app/scripts/utils/flatten.d.ts +9 -0
  317. package/dist/app/scripts/utils/for-each.d.ts +9 -0
  318. package/dist/app/scripts/utils/forward-event.d.ts +7 -0
  319. package/dist/app/scripts/utils/genome-loci-to-pixels.d.ts +9 -0
  320. package/dist/app/scripts/utils/genomic-range-to-chromosome-chunks.d.ts +21 -0
  321. package/dist/app/scripts/utils/get-aggregation-function.d.ts +10 -0
  322. package/dist/app/scripts/utils/get-default-track-for-datatype.d.ts +21 -0
  323. package/dist/app/scripts/utils/get-default-tracks-for-datatype.d.ts +3 -0
  324. package/dist/app/scripts/utils/get-element-dim.d.ts +7 -0
  325. package/dist/app/scripts/utils/get-higlass-components.d.ts +7 -0
  326. package/dist/app/scripts/utils/get-track-by-uid.d.ts +7 -0
  327. package/dist/app/scripts/utils/get-track-conf-from-hgc.d.ts +10 -0
  328. package/dist/app/scripts/utils/get-track-obj-by-id.d.ts +2 -0
  329. package/dist/app/scripts/utils/get-track-position-by-uid.d.ts +13 -0
  330. package/dist/app/scripts/utils/get-xylofon.d.ts +2 -0
  331. package/dist/app/scripts/utils/gradient.d.ts +14 -0
  332. package/dist/app/scripts/utils/has-class.d.ts +8 -0
  333. package/dist/app/scripts/utils/has-parent.d.ts +9 -0
  334. package/dist/app/scripts/utils/hex-string-to-int.d.ts +14 -0
  335. package/dist/app/scripts/utils/index.d.ts +89 -0
  336. package/dist/app/scripts/utils/interval-tree.d.ts +109 -0
  337. package/dist/app/scripts/utils/into-the-void.d.ts +6 -0
  338. package/dist/app/scripts/utils/is-track-or-child-track.d.ts +7 -0
  339. package/dist/app/scripts/utils/is-track-range-selectable.d.ts +2 -0
  340. package/dist/app/scripts/utils/is-within.d.ts +12 -0
  341. package/dist/app/scripts/utils/lat-to-y.d.ts +9 -0
  342. package/dist/app/scripts/utils/lng-to-x.d.ts +8 -0
  343. package/dist/app/scripts/utils/load-chrom-infos.d.ts +8 -0
  344. package/dist/app/scripts/utils/map.d.ts +13 -0
  345. package/dist/app/scripts/utils/max-non-zero.d.ts +6 -0
  346. package/dist/app/scripts/utils/max.d.ts +10 -0
  347. package/dist/app/scripts/utils/min-non-zero.d.ts +6 -0
  348. package/dist/app/scripts/utils/min.d.ts +10 -0
  349. package/dist/app/scripts/utils/mod.d.ts +9 -0
  350. package/dist/app/scripts/utils/ndarray-assign.d.ts +2 -0
  351. package/dist/app/scripts/utils/ndarray-flatten.d.ts +2 -0
  352. package/dist/app/scripts/utils/ndarray-to-list.d.ts +2 -0
  353. package/dist/app/scripts/utils/numericify-version.d.ts +6 -0
  354. package/dist/app/scripts/utils/obj-vals.d.ts +8 -0
  355. package/dist/app/scripts/utils/or.d.ts +8 -0
  356. package/dist/app/scripts/utils/parse-chromsizes-rows.d.ts +34 -0
  357. package/dist/app/scripts/utils/pixi-text-to-svg.d.ts +2 -0
  358. package/dist/app/scripts/utils/positioned-tracks-to-all-tracks.d.ts +26 -0
  359. package/dist/app/scripts/utils/q.d.ts +18 -0
  360. package/dist/app/scripts/utils/rad-to-deg.d.ts +7 -0
  361. package/dist/app/scripts/utils/range-query-2d.d.ts +17 -0
  362. package/dist/app/scripts/utils/reduce.d.ts +14 -0
  363. package/dist/app/scripts/utils/rel-to-abs-chrom-pos.d.ts +10 -0
  364. package/dist/app/scripts/utils/remove-class.d.ts +7 -0
  365. package/dist/app/scripts/utils/reset-d3-brush-style.d.ts +10 -0
  366. package/dist/app/scripts/utils/rgb-to-hex.d.ts +8 -0
  367. package/dist/app/scripts/utils/scales-center-and-k.d.ts +12 -0
  368. package/dist/app/scripts/utils/scales-to-genome-loci.d.ts +3 -0
  369. package/dist/app/scripts/utils/segments-to-rows.d.ts +15 -0
  370. package/dist/app/scripts/utils/selected-items-to-cum-weights.d.ts +12 -0
  371. package/dist/app/scripts/utils/selected-items-to-size.d.ts +13 -0
  372. package/dist/app/scripts/utils/show-mouse-position.d.ts +54 -0
  373. package/dist/app/scripts/utils/some.d.ts +10 -0
  374. package/dist/app/scripts/utils/sum.d.ts +8 -0
  375. package/dist/app/scripts/utils/svg-line.d.ts +2 -0
  376. package/dist/app/scripts/utils/throttle-and-debounce.d.ts +33 -0
  377. package/dist/app/scripts/utils/tile-to-canvas.d.ts +9 -0
  378. package/dist/app/scripts/utils/timeout.d.ts +3 -0
  379. package/dist/app/scripts/utils/to-void.d.ts +3 -0
  380. package/dist/app/scripts/utils/total-track-pixel-height.d.ts +27 -0
  381. package/dist/app/scripts/utils/trim-trailing-slash.d.ts +7 -0
  382. package/dist/app/scripts/utils/type-guards.d.ts +36 -0
  383. package/dist/app/scripts/utils/value-to-color.d.ts +12 -0
  384. package/dist/app/scripts/utils/visit-positioned-tracks.d.ts +18 -0
  385. package/dist/app/scripts/utils/visit-tracks.d.ts +9 -0
  386. package/dist/esm.html +1 -3
  387. package/dist/hglib.js +86315 -100592
  388. package/dist/hglib.min.js +123 -131
  389. package/dist/higlass.mjs +88861 -103138
  390. package/dist/index.html +1 -3
  391. package/dist/package.json +134 -0
  392. package/package.json +25 -27
@@ -0,0 +1,2 @@
1
+ export default getDataFetcher;
2
+ declare const getDataFetcher: (dataConfig: any, pubSub: any, pluginDataFetchers: any, availableForPlugins?: any) => any;
@@ -0,0 +1,2 @@
1
+ export { default as getDataFetcher } from "./get-data-fetcher";
2
+ export { default as AVAILABLE_FOR_PLUGINS } from "./available-for-plugins";
@@ -0,0 +1,10 @@
1
+ export default api;
2
+ declare namespace api {
3
+ export { get };
4
+ }
5
+ /**
6
+ * @param {string} url
7
+ * @returns {Promise<ParsedChromsizes | null>}
8
+ */
9
+ declare function get(url: string): Promise<ParsedChromsizes | null>;
10
+ import type { ParsedChromsizes } from '../utils/parse-chromsizes-rows';
@@ -0,0 +1,7 @@
1
+ export default domEvent;
2
+ /**
3
+ * Public API.
4
+ *
5
+ * @type {object}
6
+ */
7
+ declare const domEvent: object;
@@ -0,0 +1,5 @@
1
+ export default ElementResizeListener;
2
+ declare namespace ElementResizeListener {
3
+ export { listen };
4
+ }
5
+ declare function listen(): void;
@@ -0,0 +1,5 @@
1
+ export { default as chromInfo } from "./chrom-info";
2
+ export { default as createDomEvent } from "./dom-event";
3
+ export { default as ElementResizeListener } from "./element-resize-listener";
4
+ export { tileResponseToData } from "./worker";
5
+ export { default as tileProxy, requestsInFlight, setTileProxyAuthHeader, getTileProxyAuthHeader, authHeader } from "./tile-proxy";
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Merges an array of request objects by combining requests
3
+ * that share the same `id`, reducing the total number of requests.
4
+ *
5
+ * If multiple requests have the same `id`, their `tileIds` arrays are merged
6
+ * into a single request entry in the output array.
7
+ *
8
+ * @example
9
+ * ```js
10
+ * const requests = [
11
+ * { id: "A", tileIds: ["1", "2"] },
12
+ * { id: "B", tileIds: ["3"] },
13
+ * { id: "A", tileids: ["4", "5"] },
14
+ * ];
15
+ *
16
+ * const bundled = bundleRequests(requests);
17
+ * console.log(bundled);
18
+ * // [
19
+ * // { id: "A", tileIds: ["1", "2", "4", "5"] },
20
+ * // { id: "B", tileIds: ["3"] },
21
+ * // ]
22
+ * ```
23
+ *
24
+ * @template {{ id: string, tileIds: ReadonlyArray<string> }} T
25
+ * @param {Array<T>} requests - The list of requests to bundle
26
+ * @returns {Array<T>} - A new array with merged requests
27
+ */
28
+ export function bundleRequestsById<T extends {
29
+ id: string;
30
+ tileIds: ReadonlyArray<string>;
31
+ }>(requests: Array<T>): Array<T>;
32
+ /**
33
+ * Groups request objects by `server`, merging their `tileIds` and structuring tileset-related
34
+ * data into `body`.
35
+ *
36
+ * **Note:** The first request for each `server` sets the `options` for all grouped requests.
37
+ * Each tileset in `body` also inherits these `options`. A tileset is only added to `body`
38
+ * if the request includes `options`.
39
+ *
40
+ * Trevor (2025-02-20): This follows the original "server bundling" logic. It’s unclear if `body` is
41
+ * actually used in practice. Omitting requests without `options` might be an unintended
42
+ * behavior, but we're maintaining it for now.
43
+ *
44
+ * @example
45
+ * ```js
46
+ * const requests = [
47
+ * { server: "A", tileIds: ["tileset1.1", "tileset2.2"], options: { foo: "bar" } },
48
+ * { server: "B", tileIds: ["tileset3.3"], options: { baz: "qux" } },
49
+ * { server: "A", tileIds: ["tileset1.4"] },
50
+ * ];
51
+ *
52
+ * const bundled = bundleRequestsByServer(requests);
53
+ * console.log(bundled);
54
+ * // [
55
+ * // {
56
+ * // server: "A",
57
+ * // tileIds: ["tileset1.1", "tileset2.2", "tileset1.4"],
58
+ * // options: { foo: "bar" },
59
+ * // body: [
60
+ * // { tilesetUid: "tileset1", tileIds: ["1"], options: { foo: "bar" } },
61
+ * // { tilesetUid: "tileset2", tileIds: ["2"], options: { foo: "bar" } }
62
+ * // ]
63
+ * // },
64
+ * // {
65
+ * // server: "B",
66
+ * // tileIds: ["tileset3.3"],
67
+ * // options: { baz: "qux" },
68
+ * // body: [
69
+ * // { tilesetUid: "tileset3", tileIds: ["3"], options: { baz: "qux" } }
70
+ * // ]
71
+ * // }
72
+ * // ]
73
+ * ```
74
+ *
75
+ * @template {{ tileIds: ReadonlyArray<string>, server: string, options?: Record<string, any> }} T
76
+ * @param {Array<T>} requests - The list of requests to bundle
77
+ * @returns {Array<T & { body: ReadonlyArray<ServerTilesetBody> }> }>} - A new array with merged requests per server
78
+ */
79
+ export function bundleRequestsByServer<T extends {
80
+ tileIds: ReadonlyArray<string>;
81
+ server: string;
82
+ options?: Record<string, any>;
83
+ }>(requests: Array<T>): Array<T & {
84
+ body: ReadonlyArray<{
85
+ tilesetUid: string;
86
+ tileIds: Array<string>;
87
+ options: Record<string, any>;
88
+ }>;
89
+ }>;
90
+ /**
91
+ * Calculate the element within this tile containing the given
92
+ * position.
93
+ *
94
+ * Returns the tile position and position within the tile for
95
+ * the given element.
96
+ *
97
+ * @param {TilesetInfo} tilesetInfo - The information about this tileset
98
+ * @param {number} maxDim - The maximum width of the dataset (only used for tilesets without resolutions)
99
+ * @param {number} dataStartPos - The position where the data begins
100
+ * @param {number} zoomLevel - The (integer) current zoomLevel
101
+ * @param {number} position -The position (in absolute coordinates) to caculate the tile and position in tile for
102
+ *
103
+ * @returns {Array<number>}
104
+ */
105
+ export function calculateTileAndPosInTile(tilesetInfo: TilesetInfo, maxDim: number, dataStartPos: number, zoomLevel: number, position: number): Array<number>;
106
+ /** @type {number} */
107
+ export let requestsInFlight: number;
108
+ /** @type {string | null} */
109
+ export let authHeader: string | null;
110
+ export function setTileProxyAuthHeader(newHeader: string): void;
111
+ export function getTileProxyAuthHeader(): string | null;
112
+ /**
113
+ * Retrieve a set of tiles from the server.
114
+ *
115
+ * @type {(request: TilesRequest, pubSub: PubSub) => Promise<Record<string, TileData>>}
116
+ */
117
+ export const fetchTilesDebounced: (request: TilesRequest, pubSub: PubSub) => Promise<Record<string, TileData>>;
118
+ export function calculateZoomLevelFromResolutions(resolutions: Array<string>, scale: Scale): number;
119
+ export function calculateResolution(tilesetInfo: TilesetInfo, zoomLevel: number): number;
120
+ export function calculateZoomLevel(scale: Scale, minX: number, maxX: number, binsPerTile: number): number;
121
+ export function calculateTiles(zoomLevel: number, scale: Scale, minX: number, _maxX: number, maxZoom: number, maxDim: number): Array<number>;
122
+ export function calculateTileWidth(tilesetInfo: TilesetInfo, zoomLevel: number, binsPerTile: number): number;
123
+ export function calculateTilesFromResolution(resolution: number, scale: Scale, minX: number, maxX: number, pixelsPerTile?: number | undefined): number[];
124
+ export function tileDataToPixData(tile: {
125
+ mirrored?: boolean;
126
+ isMirrored?: boolean;
127
+ tileData: {
128
+ dense: Float32Array;
129
+ tilePos: readonly [a: number, b?: number];
130
+ shape: readonly [number, number];
131
+ };
132
+ }, valueScaleType: "log" | "linear", valueScaleDomain: [min: number, max: number], pseudocount: number, colorScale: ReadonlyArray<readonly [r: number, g: number, b: number, a: number]>, finished: (x: null | {
133
+ pixData: Uint8ClampedArray;
134
+ }) => void, ignoreUpperRight: boolean | undefined, ignoreLowerLeft: boolean | undefined, zeroValueColor: [r: number, g: number, b: number, a: number], selectedRowsOptions: Partial<SelectedRowsOptions>): void;
135
+ export function trackInfo(server: string, tilesetUid: string, doneCb: (info: Record<string, TilesetInfo>) => void, errorCb: (error: string) => void, pubSub: import("pub-sub-es").PubSub): void;
136
+ export default api;
137
+ export type WithResolvers<T, U> = {
138
+ value: T;
139
+ resolve: (value: U) => void;
140
+ reject: (err: unknown) => void;
141
+ };
142
+ export type TileData = CompletedTileData<TileResponse>;
143
+ import type { TilesetInfo } from '../types';
144
+ import type { TilesRequest } from '../types';
145
+ import type { PubSub } from 'pub-sub-es';
146
+ import type { Scale } from '../types';
147
+ import type { SelectedRowsOptions } from './worker';
148
+ declare namespace api {
149
+ export { calculateResolution };
150
+ export { calculateTileAndPosInTile };
151
+ export { calculateTiles };
152
+ export { calculateTilesFromResolution };
153
+ export { calculateTileWidth };
154
+ export { calculateZoomLevel };
155
+ export { calculateZoomLevelFromResolutions };
156
+ export { fetchTilesDebounced };
157
+ export { json };
158
+ export { text };
159
+ export { tileDataToPixData };
160
+ export { trackInfo };
161
+ }
162
+ import type { TileResponse } from './worker';
163
+ import type { CompletedTileData } from './worker';
164
+ /**
165
+ * Send a JSON request and mark it so that we can tell how many are in flight
166
+ *
167
+ * @template T
168
+ * @param {string} url
169
+ * @param {(err: Error | undefined, value: T | undefined) => void} callback
170
+ * @param {import("pub-sub-es").PubSub} pubSub
171
+ */
172
+ declare function json<T>(url: string, callback: (err: Error | undefined, value: T | undefined) => void, pubSub: import("pub-sub-es").PubSub): Promise<T>;
173
+ /**
174
+ * Send a text request and mark it so that we can tell how many are in flight
175
+ *
176
+ * @param {string | URL} url
177
+ * @param {(err: Error | undefined, value: string | undefined) => void} callback
178
+ * @param {import("pub-sub-es").PubSub} pubSub
179
+ */
180
+ declare function text(url: string | URL, callback: (err: Error | undefined, value: string | undefined) => void, pubSub: import("pub-sub-es").PubSub): Promise<string>;
@@ -0,0 +1,157 @@
1
+ /**
2
+ * @typedef SelectedRowsOptions
3
+ * @property {Array<number | Array<number>>} selectedRows - Row indices, for ordering and filtering rows. Used by the HorizontalMultivecTrack.
4
+ * @property {'mean' | 'sum' | 'variance' | 'deviation'} selectedRowsAggregationMode - The aggregation function to use ("mean", "sum", etc).
5
+ * @property {boolean} selectedRowsAggregationWithRelativeHeight - Whether the height of row groups should be relative to the size of the group.
6
+ * @property {'client' | 'server'} selectedRowsAggregationMethod - Where will the aggregation be performed? Possible values: "client", "server".
7
+ */
8
+ /**
9
+ * This function takes in tile data and other rendering parameters,
10
+ * and generates an array of pixel data that can be passed to a canvas
11
+ * (and subsequently passed to a PIXI sprite).
12
+ *
13
+ * @param {number} size - `data` parameter length. Often set to a tile's `tile.tileData.dense.length` value.
14
+ * @param {Array<number> | Float32Array} data - The tile data array.
15
+ * @param {'log' | 'linear'} valueScaleType 'log' or 'linear'.
16
+ * @param {[number, number]} valueScaleDomain
17
+ * @param {number} pseudocount - The pseudocount is generally the minimum non-zero value and is
18
+ * used so that our log scaling doesn't lead to NaN values.
19
+ * @param {ReadonlyArray<readonly [r: number, g: number, b: number, a: number]>} colorScale
20
+ * @param {boolean} ignoreUpperRight
21
+ * @param {boolean} ignoreLowerLeft
22
+ * @param {readonly [numRows: number, numCols: number] | null} shape - Array `[numRows, numCols]`, used when iterating over a subset of rows,
23
+ * when one needs to know the width of each column.
24
+ * @param {[r: number, g: number, b: number, a: number] | null} zeroValueColor - The color to use for rendering zero data values, [r, g, b, a].
25
+ * @param {Partial<SelectedRowsOptions> | null} selectedRowsOptions - Rendering options when using a `selectRows` track option.
26
+ *
27
+ * @returns {Uint8ClampedArray} A flattened array of pixel values.
28
+ */
29
+ export function workerSetPix(size: number, data: Array<number> | Float32Array, valueScaleType: "log" | "linear", valueScaleDomain: [number, number], pseudocount: number, colorScale: ReadonlyArray<readonly [r: number, g: number, b: number, a: number]>, ignoreUpperRight?: boolean, ignoreLowerLeft?: boolean, shape?: readonly [numRows: number, numCols: number] | null, zeroValueColor?: [r: number, g: number, b: number, a: number] | null, selectedRowsOptions?: Partial<SelectedRowsOptions> | null): Uint8ClampedArray;
30
+ /**
31
+ * @typedef TileData<Server>
32
+ * @property {string} server
33
+ * @property {string} tileId
34
+ * @property {number} zoomLevel
35
+ * @property {[number] | [number, number]} tilePos
36
+ * @property {string} tilesetUid
37
+ */
38
+ /**
39
+ * @typedef DenseTileData
40
+ * @property {string} server
41
+ * @property {string} tileId
42
+ * @property {number} zoomLevel
43
+ * @property {[number] | [number, number]} tilePos
44
+ * @property {string} tilesetUid
45
+ * @property {Float32Array} dense
46
+ * @property {string} dtype
47
+ * @property {DenseDataExtrema1D | DenseDataExtrema2D} denseDataExtrema
48
+ * @property {number} minNonZero
49
+ * @property {number} maxNonZero
50
+ */
51
+ /**
52
+ * @template T
53
+ * @typedef {Omit<T, keyof DenseTileData> & (TileData | DenseTileData)} CompletedTileData
54
+ */
55
+ /**
56
+ * @typedef TileResponse
57
+ * @property {string} [dense] - a base64 encoded string
58
+ * @property {string} [tilePositionId] - The position of the tile
59
+ */
60
+ /**
61
+ * Convert a response from the tile server to data that can be used by higlass.
62
+ *
63
+ * WARNING: Mutates the data object.
64
+ *
65
+ * @template {TileResponse} T
66
+ * @param {Record<string, T>} inputData
67
+ * @param {string} server
68
+ * @param {ReadonlyArray<string>} theseTileIds
69
+ *
70
+ * @returns {Record<string, CompletedTileData<T>>}
71
+ *
72
+ * Trevor: This function is littered with ts-expect-error comments because
73
+ * the type of mutation happening to the input object is very tricky to type.
74
+ * The type signature of the function tries to adequately describe the mutation,
75
+ * to outside users.
76
+ */
77
+ export function tileResponseToData<T extends TileResponse>(inputData: Record<string, T>, server: string, theseTileIds: ReadonlyArray<string>): Record<string, CompletedTileData<T>>;
78
+ /**
79
+ * Fetch tiles from the server.
80
+ *
81
+ * @template {TileResponse} T
82
+ *
83
+ * @param {Object} request
84
+ * @param {string} request.server
85
+ * @param {ReadonlyArray<string>} request.tileIds
86
+ * @param {ReadonlyArray<{ tilesetUid: string, tileIds: Array<string>, options?: Record<string, unknown> }>} request.body
87
+ * @param {Object} options
88
+ * @param {string | null} [options.authHeader]
89
+ * @param {import("pub-sub-es").PubSub} [options.pubSub]
90
+ * @param {string} options.sessionId
91
+ */
92
+ export function workerFetchTiles<T extends TileResponse>(request: {
93
+ server: string;
94
+ tileIds: ReadonlyArray<string>;
95
+ body: ReadonlyArray<{
96
+ tilesetUid: string;
97
+ tileIds: Array<string>;
98
+ options?: Record<string, unknown>;
99
+ }>;
100
+ }, options: {
101
+ authHeader?: string | null | undefined;
102
+ pubSub?: import("pub-sub-es").PubSub | undefined;
103
+ sessionId: string;
104
+ }): Promise<void | Record<string, CompletedTileData<TileResponse>>>;
105
+ export type SelectedRowsOptions = {
106
+ /**
107
+ * - Row indices, for ordering and filtering rows. Used by the HorizontalMultivecTrack.
108
+ */
109
+ selectedRows: Array<number | Array<number>>;
110
+ /**
111
+ * - The aggregation function to use ("mean", "sum", etc).
112
+ */
113
+ selectedRowsAggregationMode: "mean" | "sum" | "variance" | "deviation";
114
+ /**
115
+ * - Whether the height of row groups should be relative to the size of the group.
116
+ */
117
+ selectedRowsAggregationWithRelativeHeight: boolean;
118
+ /**
119
+ * - Where will the aggregation be performed? Possible values: "client", "server".
120
+ */
121
+ selectedRowsAggregationMethod: "client" | "server";
122
+ };
123
+ /**
124
+ * <Server>
125
+ */
126
+ export type TileData = {
127
+ server: string;
128
+ tileId: string;
129
+ zoomLevel: number;
130
+ tilePos: [number] | [number, number];
131
+ tilesetUid: string;
132
+ };
133
+ export type DenseTileData = {
134
+ server: string;
135
+ tileId: string;
136
+ zoomLevel: number;
137
+ tilePos: [number] | [number, number];
138
+ tilesetUid: string;
139
+ dense: Float32Array;
140
+ dtype: string;
141
+ denseDataExtrema: DenseDataExtrema1D | DenseDataExtrema2D;
142
+ minNonZero: number;
143
+ maxNonZero: number;
144
+ };
145
+ export type CompletedTileData<T> = Omit<T, keyof DenseTileData> & (TileData | DenseTileData);
146
+ export type TileResponse = {
147
+ /**
148
+ * - a base64 encoded string
149
+ */
150
+ dense?: string | undefined;
151
+ /**
152
+ * - The position of the tile
153
+ */
154
+ tilePositionId?: string | undefined;
155
+ };
156
+ import DenseDataExtrema1D from '../utils/DenseDataExtrema1D';
157
+ import DenseDataExtrema2D from '../utils/DenseDataExtrema2D';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Create a path-based symbol icon
3
+ *
4
+ * @method createSymbolIcon
5
+ * @author Fritz Lekschas
6
+ * @date 2016-10-09
7
+ * @param {Object} el D3 selected base element to where the symbols
8
+ * should be appended to.
9
+ * @param {String} id ID of the icon to be created.
10
+ * @param {Array} paths Array of path strings.
11
+ * @param {String} viewBox View box string.
12
+ */
13
+ export default function createSymbolIcon(el: Object, id: string, paths: any[], viewBox: string): void;
@@ -0,0 +1 @@
1
+ export { changeOptions, waitForJsonComplete, waitForTilesLoaded, waitForTransitionsFinished, waitForScalesStabilized, waitForComponentReady, mountHGComponent, mountHGComponentAsync, removeHGComponent } from "./test-helpers";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @param {HTMLDivElement | null} prevDiv
3
+ * @param {import("enzyme").ReactWrapper<{}, {}, HiGlassComponent> | null} prevHgc
4
+ * @param {Record<string, unknown>} viewConf
5
+ * @param {{ style?: string, bounded?: boolean, extendedDelay?: boolean }} [options]
6
+ * @returns {Promise<[HTMLDivElement, { instance: () => HiGlassComponent }]>}
7
+ */
8
+ export function mountHGComponentAsync(prevDiv: HTMLDivElement | null, prevHgc: import("enzyme").ReactWrapper<{}, {}, HiGlassComponent> | null, viewConf: Record<string, unknown>, options?: {
9
+ style?: string;
10
+ bounded?: boolean;
11
+ extendedDelay?: boolean;
12
+ }): Promise<[HTMLDivElement, {
13
+ instance: () => HiGlassComponent;
14
+ }]>;
15
+ export function changeOptions(hgc: import("enzyme").ReactWrapper<{}, {}, HiGlassComponent>, viewUid: string, trackUid: string, options: Record<string, unknown>): void;
16
+ export function areTransitionsActive(hgc: HiGlassComponent): boolean;
17
+ export function waitForTransitionsFinished(hgc: HiGlassComponent, callback: () => void): void;
18
+ export function waitForJsonComplete(finished: () => void): void;
19
+ export function isWaitingOnTiles(hgc: HiGlassComponent): boolean;
20
+ export function waitForTilesLoaded(hgc: HiGlassComponent, tilesLoadedCallback: (value?: unknown) => void): void;
21
+ export function mountHGComponent(prevDiv: HTMLDivElement | null, prevHgc: import("enzyme").ReactWrapper<{}, {}, HiGlassComponent> | null, viewConf: Record<string, unknown>, done: (value?: unknown) => void, options?: {
22
+ style?: string;
23
+ bounded?: boolean;
24
+ extendedDelay?: boolean;
25
+ }): readonly [HTMLDivElement, import("enzyme").ReactWrapper<{}, {}, HiGlassComponent>];
26
+ export function waitForScalesStabilized(hgc: HiGlassComponent, viewUid: string, options: {
27
+ initialWait?: number | undefined;
28
+ timeInterval?: number | undefined;
29
+ maxTime?: number | undefined;
30
+ }): Promise<void>;
31
+ export function waitForComponentReady(div: HTMLElement): Promise<void>;
32
+ export function removeHGComponent(div: HTMLDivElement): void;
33
+ import HiGlassComponent from '../HiGlassComponent';
@@ -0,0 +1,73 @@
1
+ export default trackUtils;
2
+ declare namespace trackUtils {
3
+ export { calculate1DVisibleTiles };
4
+ export { calculate1DZoomLevel };
5
+ export { drawAxis };
6
+ export { movedY };
7
+ export { getTilePosAndDimensions };
8
+ export { stretchRects };
9
+ export { zoomedY };
10
+ }
11
+ /**
12
+ * Calculate which tiles should be visible given a track's
13
+ * scale.
14
+ *
15
+ * @param {object} tilesetInfo The track's tileset info, containing either the `resolutions`
16
+ * list or min_pos and max_pos arrays
17
+ * @param {function} scale The track's D3 scale function.
18
+ * @return {array} A list of visible tiles (e.g. [[1,0],[1,1]])
19
+ */
20
+ declare function calculate1DVisibleTiles(tilesetInfo: object, scale: Function): array;
21
+ /**
22
+ * Calculate the current zoom level for a 1D track
23
+ *
24
+ * @param {object} tilesetInfo The tileset info for the track. Should contain
25
+ * min_pos and max_pos arrays, each of which has one
26
+ * value which stores the minimum and maximum data
27
+ * positions respectively.
28
+ * @param {function} xScale The current D3 scale function for the track.
29
+ * @param {number} maxZoom The maximum zoom level allowed by the track.
30
+ * @return {number} The current zoom level of the track.
31
+ */
32
+ declare function calculate1DZoomLevel(tilesetInfo: object, xScale: Function, maxZoom: number): number;
33
+ /**
34
+ * Draw an axis on a track. Where on the track the axis will be drawn
35
+ * is taken from the track's options.
36
+ *
37
+ * @param {PixiTrack} track The track to decorate with an axis.
38
+ * @param {d3.scale} valueScale The scale that the axis should draw.
39
+ */
40
+ declare function drawAxis(track: PixiTrack, valueScale: d3.scale): void;
41
+ /**
42
+ * A track is being dragged along it's value scale axis.
43
+ *
44
+ * @param {object} Track The track instance being dragged.
45
+ * @param {number} dY The change in y position.
46
+ */
47
+ declare function movedY(track: any, dY: number): void;
48
+ /**
49
+ * Get the tile's position in its coordinate system.
50
+ *
51
+ * See Tiled1DPIXITrack.js
52
+ */
53
+ declare function getTilePosAndDimensions(tilesetInfo: any, tileId: any): {
54
+ tileX: any;
55
+ tileWidth: number;
56
+ };
57
+ /** When zooming, we want to do fast scaling rather than re-rendering
58
+ * but if we do this too much, shapes (particularly arrowheads) get
59
+ * distorted. This function keeps track of how stretched the track is
60
+ * and redraws it if it becomes too distorted (tileK < 0.5 or tileK > 2) */
61
+ declare function stretchRects(track: any, graphicsAccessors: any): void;
62
+ /**
63
+ * A track has received an event telling it to zoom along its
64
+ * vertical axis. Update the transform describing the position
65
+ * of its graphics.
66
+ *
67
+ * @param {number} yPos The position the zoom event took place
68
+ * @param {number} kMultiplier How much the zoom level should be adjusted by
69
+ * @param {d3.transform} transform The track's current graphics transform.
70
+ * @param {number} height The height of the track
71
+ * @return {d3.transform} The track's new graphics transform.
72
+ */
73
+ declare function zoomedY(yPos: number, kMultiplier: number, transform: d3.transform, height: number): d3.transform;