higlass 1.13.6 → 2.0.1

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 (297) hide show
  1. package/app/scripts/AddTrackDialog.jsx +8 -1
  2. package/app/scripts/AddTrackPositionMenu.jsx +26 -5
  3. package/app/scripts/Annotations1dTrack.js +90 -251
  4. package/app/scripts/Annotations2dTrack.js +9 -2
  5. package/app/scripts/Autocomplete.jsx +1 -9
  6. package/app/scripts/BedLikeTrack.js +549 -441
  7. package/app/scripts/ContextMenuContainer.jsx +3 -0
  8. package/app/scripts/ContextMenuItem.jsx +13 -2
  9. package/app/scripts/FilledLine.js +349 -0
  10. package/app/scripts/GenomePositionSearchBox.jsx +178 -477
  11. package/app/scripts/HiGlassComponent.jsx +443 -349
  12. package/app/scripts/HiGlassComponentContext.js +5 -0
  13. package/app/scripts/SeriesListMenu.jsx +94 -44
  14. package/app/scripts/SeriesListSubmenuMixin.jsx +1 -0
  15. package/app/scripts/Tiled1DPixiTrack.js +0 -1
  16. package/app/scripts/TiledPixiTrack.js +72 -63
  17. package/app/scripts/TiledPlot.jsx +530 -77
  18. package/app/scripts/TrackRenderer.jsx +2 -2
  19. package/app/scripts/ViewContextMenu.jsx +50 -2
  20. package/app/scripts/ViewHeader.jsx +3 -2
  21. package/app/scripts/api.js +87 -6
  22. package/app/scripts/configs/index.js +6 -1
  23. package/app/scripts/configs/primitives.js +2 -0
  24. package/app/scripts/configs/tracks-info.js +1 -0
  25. package/app/scripts/data-fetchers/genbank-fetcher.js +9 -14
  26. package/app/scripts/data-fetchers/local-tile-fetcher.js +8 -2
  27. package/app/scripts/hglib.jsx +61 -70
  28. package/app/scripts/options-info.js +49 -11
  29. package/app/scripts/services/tile-proxy.js +0 -4
  30. package/app/scripts/services/worker.js +1 -0
  31. package/app/scripts/test-helpers/index.js +2 -1
  32. package/app/scripts/test-helpers/test-helpers.jsx +154 -66
  33. package/app/scripts/types.ts +68 -3
  34. package/app/scripts/utils/copy-text-to-clipboard.js +36 -0
  35. package/app/scripts/utils/decompress.js +33 -0
  36. package/app/scripts/utils/default-tracks.js +46 -0
  37. package/app/scripts/utils/get-default-track-for-datatype.js +2 -1
  38. package/app/scripts/utils/get-default-tracks-for-datatype.ts +46 -0
  39. package/app/scripts/utils/index.js +1 -0
  40. package/app/scripts/utils/positioned-tracks-to-all-tracks.js +55 -0
  41. package/app/scripts/utils/show-mouse-position.js +0 -16
  42. package/app/scripts/utils/visit-positioned-tracks.js +4 -1
  43. package/app/styles/AddTrackPositionMenu.module.scss +37 -0
  44. package/app/styles/HiGlass.module.scss +3 -1
  45. package/app/styles/TiledPlot.module.scss +20 -0
  46. package/dist/app/schema.json +525 -0
  47. package/dist/app/scripts/AddTrackDialog.d.ts +64 -0
  48. package/dist/app/scripts/AddTrackPositionMenu.d.ts +5 -0
  49. package/dist/app/scripts/Annotations1dTrack.d.ts +15 -0
  50. package/dist/app/scripts/Annotations2dTrack.d.ts +95 -0
  51. package/dist/app/scripts/ArrowheadDomainsTrack.d.ts +36 -0
  52. package/dist/app/scripts/Autocomplete.d.ts +102 -0
  53. package/dist/app/scripts/AxisPixi.d.ts +25 -0
  54. package/dist/app/scripts/BarTrack.d.ts +28 -0
  55. package/dist/app/scripts/BedLikeTrack.d.ts +84 -0
  56. package/dist/app/scripts/Button.d.ts +3 -0
  57. package/dist/app/scripts/CNVIntervalTrack.d.ts +12 -0
  58. package/dist/app/scripts/CenterTiledPlot.d.ts +3 -0
  59. package/dist/app/scripts/CenterTrack.d.ts +92 -0
  60. package/dist/app/scripts/Chromosome2DAnnotations.d.ts +10 -0
  61. package/dist/app/scripts/Chromosome2DLabels.d.ts +13 -0
  62. package/dist/app/scripts/ChromosomeGrid.d.ts +24 -0
  63. package/dist/app/scripts/ChromosomeInfo.d.ts +14 -0
  64. package/dist/app/scripts/CloseTrackMenu.d.ts +10 -0
  65. package/dist/app/scripts/CombinedTrack.d.ts +32 -0
  66. package/dist/app/scripts/ConfigTrackMenu.d.ts +10 -0
  67. package/dist/app/scripts/ConfigViewMenu.d.ts +34 -0
  68. package/dist/app/scripts/ConfigureSeriesMenu.d.ts +3 -0
  69. package/dist/app/scripts/ContextMenuContainer.d.ts +36 -0
  70. package/dist/app/scripts/ContextMenuItem.d.ts +34 -0
  71. package/dist/app/scripts/Cross.d.ts +3 -0
  72. package/dist/app/scripts/CrossRule.d.ts +24 -0
  73. package/dist/app/scripts/CustomTrackDialog.d.ts +17 -0
  74. package/dist/app/scripts/Dialog.d.ts +5 -0
  75. package/dist/app/scripts/DivergentBarTrack.d.ts +4 -0
  76. package/dist/app/scripts/DragListeningDiv.d.ts +32 -0
  77. package/dist/app/scripts/DraggableDiv.d.ts +63 -0
  78. package/dist/app/scripts/ExportLinkDialog.d.ts +21 -0
  79. package/dist/app/scripts/FilledLine.d.ts +5 -0
  80. package/dist/app/scripts/FixedTrack.d.ts +5 -0
  81. package/dist/app/scripts/GalleryTracks.d.ts +20 -0
  82. package/dist/app/scripts/GenomePositionSearchBox.d.ts +95 -0
  83. package/dist/app/scripts/HeatmapOptions.d.ts +30 -0
  84. package/dist/app/scripts/HeatmapTiledPixiTrack.d.ts +184 -0
  85. package/dist/app/scripts/HiGlassComponent.d.ts +762 -0
  86. package/dist/app/scripts/HiGlassComponentContext.d.ts +3 -0
  87. package/dist/app/scripts/HiGlassTrackComponent.d.ts +37 -0
  88. package/dist/app/scripts/Horizontal1dHeatmapTrack.d.ts +9 -0
  89. package/dist/app/scripts/Horizontal2DDomainsTrack.d.ts +21 -0
  90. package/dist/app/scripts/HorizontalChromosomeLabels.d.ts +47 -0
  91. package/dist/app/scripts/HorizontalGeneAnnotationsTrack.d.ts +25 -0
  92. package/dist/app/scripts/HorizontalHeatmapTrack.d.ts +12 -0
  93. package/dist/app/scripts/HorizontalItem.d.ts +3 -0
  94. package/dist/app/scripts/HorizontalLine1DPixiTrack.d.ts +23 -0
  95. package/dist/app/scripts/HorizontalMultivecTrack.d.ts +50 -0
  96. package/dist/app/scripts/HorizontalPoint1DPixiTrack.d.ts +5 -0
  97. package/dist/app/scripts/HorizontalRule.d.ts +22 -0
  98. package/dist/app/scripts/HorizontalTiled1DPixiTrack.d.ts +26 -0
  99. package/dist/app/scripts/HorizontalTiledPlot.d.ts +49 -0
  100. package/dist/app/scripts/HorizontalTrack.d.ts +6 -0
  101. package/dist/app/scripts/Id2DTiledPixiTrack.d.ts +10 -0
  102. package/dist/app/scripts/IdHorizontal1DTiledPixiTrack.d.ts +6 -0
  103. package/dist/app/scripts/IdVertical1DTiledPixiTrack.d.ts +7 -0
  104. package/dist/app/scripts/LeftAxisTrack.d.ts +9 -0
  105. package/dist/app/scripts/LeftTrackModifier.d.ts +29 -0
  106. package/dist/app/scripts/ListWrapper.d.ts +64 -0
  107. package/dist/app/scripts/MapboxTilesTrack.d.ts +9 -0
  108. package/dist/app/scripts/Modal.d.ts +5 -0
  109. package/dist/app/scripts/MoveableTrack.d.ts +18 -0
  110. package/dist/app/scripts/NestedContextMenu.d.ts +7 -0
  111. package/dist/app/scripts/OSMTileIdsTrack.d.ts +5 -0
  112. package/dist/app/scripts/OSMTilesTrack.d.ts +129 -0
  113. package/dist/app/scripts/OverlayTrack.d.ts +13 -0
  114. package/dist/app/scripts/PixiTrack.d.ts +174 -0
  115. package/dist/app/scripts/PlotTypeChooser.d.ts +25 -0
  116. package/dist/app/scripts/PopupMenu.d.ts +28 -0
  117. package/dist/app/scripts/RasterTilesTrack.d.ts +9 -0
  118. package/dist/app/scripts/RuleMixin.d.ts +2 -0
  119. package/dist/app/scripts/SVGTrack.d.ts +15 -0
  120. package/dist/app/scripts/SearchField.d.ts +13 -0
  121. package/dist/app/scripts/SeriesListItems.d.ts +2 -0
  122. package/dist/app/scripts/SeriesListMenu.d.ts +51 -0
  123. package/dist/app/scripts/SeriesListSubmenuMixin.d.ts +2 -0
  124. package/dist/app/scripts/SketchInlinePicker.d.ts +25 -0
  125. package/dist/app/scripts/SortableList.d.ts +22 -0
  126. package/dist/app/scripts/SquareMarkersTrack.d.ts +22 -0
  127. package/dist/app/scripts/Tiled1DPixiTrack.d.ts +60 -0
  128. package/dist/app/scripts/TiledPixiTrack.d.ts +369 -0
  129. package/dist/app/scripts/TiledPlot.d.ts +313 -0
  130. package/dist/app/scripts/TilesetFinder.d.ts +65 -0
  131. package/dist/app/scripts/TopAxisTrack.d.ts +9 -0
  132. package/dist/app/scripts/Track.d.ts +196 -0
  133. package/dist/app/scripts/TrackArea.d.ts +26 -0
  134. package/dist/app/scripts/TrackControl.d.ts +5 -0
  135. package/dist/app/scripts/TrackRenderer.d.ts +724 -0
  136. package/dist/app/scripts/UnknownPixiTrack.d.ts +7 -0
  137. package/dist/app/scripts/ValueIntervalTrack.d.ts +6 -0
  138. package/dist/app/scripts/VerticalItem.d.ts +3 -0
  139. package/dist/app/scripts/VerticalRule.d.ts +21 -0
  140. package/dist/app/scripts/VerticalTiled1DPixiTrack.d.ts +6 -0
  141. package/dist/app/scripts/VerticalTiledPlot.d.ts +50 -0
  142. package/dist/app/scripts/VerticalTrack.d.ts +6 -0
  143. package/dist/app/scripts/ViewConfigEditor.d.ts +53 -0
  144. package/dist/app/scripts/ViewContextMenu.d.ts +17 -0
  145. package/dist/app/scripts/ViewHeader.d.ts +75 -0
  146. package/dist/app/scripts/ViewportTracker2D.d.ts +17 -0
  147. package/dist/app/scripts/ViewportTracker2DPixi.d.ts +11 -0
  148. package/dist/app/scripts/ViewportTrackerHorizontal.d.ts +17 -0
  149. package/dist/app/scripts/ViewportTrackerVertical.d.ts +17 -0
  150. package/dist/app/scripts/api.d.ts +640 -0
  151. package/dist/app/scripts/configs/available-track-types.d.ts +2 -0
  152. package/dist/app/scripts/configs/colormaps.d.ts +2 -0
  153. package/dist/app/scripts/configs/datatype-to-track-type.d.ts +4 -0
  154. package/dist/app/scripts/configs/default-tracks-for-datatype.d.ts +38 -0
  155. package/dist/app/scripts/configs/dense-data-extrema-config.d.ts +2 -0
  156. package/dist/app/scripts/configs/globals.d.ts +5 -0
  157. package/dist/app/scripts/configs/index.d.ts +16 -0
  158. package/dist/app/scripts/configs/positions-by-datatype.d.ts +2 -0
  159. package/dist/app/scripts/configs/primitives.d.ts +20 -0
  160. package/dist/app/scripts/configs/themes.d.ts +3 -0
  161. package/dist/app/scripts/configs/tracks-info-by-type.d.ts +4 -0
  162. package/dist/app/scripts/configs/tracks-info.d.ts +24 -0
  163. package/dist/app/scripts/d3-context-menu.d.ts +2 -0
  164. package/dist/app/scripts/data-fetchers/DataFetcher.d.ts +151 -0
  165. package/dist/app/scripts/data-fetchers/genbank-fetcher.d.ts +86 -0
  166. package/dist/app/scripts/data-fetchers/index.d.ts +3 -0
  167. package/dist/app/scripts/data-fetchers/local-tile-fetcher.d.ts +47 -0
  168. package/dist/app/scripts/gosling-exports.d.ts +17 -0
  169. package/dist/app/scripts/hglib.d.ts +24 -0
  170. package/dist/app/scripts/hocs/with-modal.d.ts +19 -0
  171. package/dist/app/scripts/hocs/with-pub-sub.d.ts +22 -0
  172. package/dist/app/scripts/hocs/with-theme.d.ts +13 -0
  173. package/dist/app/scripts/icons.d.ts +161 -0
  174. package/dist/app/scripts/mixwith.d.ts +27 -0
  175. package/dist/app/scripts/options-info.d.ts +1355 -0
  176. package/dist/app/scripts/plugins/available-for-plugins.d.ts +2338 -0
  177. package/dist/app/scripts/plugins/get-data-fetcher.d.ts +2 -0
  178. package/dist/app/scripts/plugins/index.d.ts +2 -0
  179. package/dist/app/scripts/services/chrom-info.d.ts +10 -0
  180. package/dist/app/scripts/services/dom-event.d.ts +7 -0
  181. package/dist/app/scripts/services/element-resize-listener.d.ts +5 -0
  182. package/dist/app/scripts/services/index.d.ts +5 -0
  183. package/dist/app/scripts/services/tile-proxy.d.ts +180 -0
  184. package/dist/app/scripts/services/worker.d.ts +157 -0
  185. package/dist/app/scripts/symbol.d.ts +13 -0
  186. package/dist/app/scripts/test-helpers/index.d.ts +1 -0
  187. package/dist/app/scripts/test-helpers/test-helpers.d.ts +33 -0
  188. package/dist/app/scripts/track-utils.d.ts +73 -0
  189. package/dist/app/scripts/types.d.ts +199 -0
  190. package/dist/app/scripts/utils/DenseDataExtrema1D.d.ts +88 -0
  191. package/dist/app/scripts/utils/DenseDataExtrema2D.d.ts +97 -0
  192. package/dist/app/scripts/utils/LruCache.d.ts +44 -0
  193. package/dist/app/scripts/utils/abs-to-chr.d.ts +14 -0
  194. package/dist/app/scripts/utils/accessor-transposition.d.ts +14 -0
  195. package/dist/app/scripts/utils/add-arrays.d.ts +18 -0
  196. package/dist/app/scripts/utils/add-class.d.ts +8 -0
  197. package/dist/app/scripts/utils/add-event-listener-once.d.ts +11 -0
  198. package/dist/app/scripts/utils/assert.d.ts +17 -0
  199. package/dist/app/scripts/utils/background-task-scheduler.d.ts +47 -0
  200. package/dist/app/scripts/utils/base64-to-canvas.d.ts +9 -0
  201. package/dist/app/scripts/utils/chr-to-abs.d.ts +10 -0
  202. package/dist/app/scripts/utils/chrom-info-bisector.d.ts +4 -0
  203. package/dist/app/scripts/utils/clone-event.d.ts +12 -0
  204. package/dist/app/scripts/utils/color-domain-to-rgba-array.d.ts +13 -0
  205. package/dist/app/scripts/utils/color-to-hex.d.ts +9 -0
  206. package/dist/app/scripts/utils/color-to-rgba.d.ts +9 -0
  207. package/dist/app/scripts/utils/copy-text-to-clipboard.d.ts +2 -0
  208. package/dist/app/scripts/utils/data-to-genomic-loci.d.ts +11 -0
  209. package/dist/app/scripts/utils/debounce.d.ts +5 -0
  210. package/dist/app/scripts/utils/dec-to-hex-str.d.ts +8 -0
  211. package/dist/app/scripts/utils/decompress.d.ts +27 -0
  212. package/dist/app/scripts/utils/default-tracks.d.ts +3 -0
  213. package/dist/app/scripts/utils/dict-from-tuples.d.ts +11 -0
  214. package/dist/app/scripts/utils/dict-items.d.ts +18 -0
  215. package/dist/app/scripts/utils/dict-keys.d.ts +10 -0
  216. package/dist/app/scripts/utils/dict-values.d.ts +8 -0
  217. package/dist/app/scripts/utils/download.d.ts +7 -0
  218. package/dist/app/scripts/utils/expand-combined-tracks.d.ts +11 -0
  219. package/dist/app/scripts/utils/fake-pub-sub.d.ts +11 -0
  220. package/dist/app/scripts/utils/fill-in-min-widths.d.ts +44 -0
  221. package/dist/app/scripts/utils/flatten.d.ts +9 -0
  222. package/dist/app/scripts/utils/for-each.d.ts +9 -0
  223. package/dist/app/scripts/utils/forward-event.d.ts +7 -0
  224. package/dist/app/scripts/utils/genome-loci-to-pixels.d.ts +9 -0
  225. package/dist/app/scripts/utils/genomic-range-to-chromosome-chunks.d.ts +21 -0
  226. package/dist/app/scripts/utils/get-aggregation-function.d.ts +10 -0
  227. package/dist/app/scripts/utils/get-default-track-for-datatype.d.ts +21 -0
  228. package/dist/app/scripts/utils/get-default-tracks-for-datatype.d.ts +3 -0
  229. package/dist/app/scripts/utils/get-element-dim.d.ts +7 -0
  230. package/dist/app/scripts/utils/get-higlass-components.d.ts +7 -0
  231. package/dist/app/scripts/utils/get-track-by-uid.d.ts +7 -0
  232. package/dist/app/scripts/utils/get-track-conf-from-hgc.d.ts +10 -0
  233. package/dist/app/scripts/utils/get-track-obj-by-id.d.ts +2 -0
  234. package/dist/app/scripts/utils/get-track-position-by-uid.d.ts +13 -0
  235. package/dist/app/scripts/utils/get-xylofon.d.ts +2 -0
  236. package/dist/app/scripts/utils/gradient.d.ts +14 -0
  237. package/dist/app/scripts/utils/has-class.d.ts +8 -0
  238. package/dist/app/scripts/utils/has-parent.d.ts +9 -0
  239. package/dist/app/scripts/utils/hex-string-to-int.d.ts +14 -0
  240. package/dist/app/scripts/utils/index.d.ts +89 -0
  241. package/dist/app/scripts/utils/interval-tree.d.ts +109 -0
  242. package/dist/app/scripts/utils/into-the-void.d.ts +6 -0
  243. package/dist/app/scripts/utils/is-track-or-child-track.d.ts +7 -0
  244. package/dist/app/scripts/utils/is-track-range-selectable.d.ts +2 -0
  245. package/dist/app/scripts/utils/is-within.d.ts +12 -0
  246. package/dist/app/scripts/utils/lat-to-y.d.ts +9 -0
  247. package/dist/app/scripts/utils/lng-to-x.d.ts +8 -0
  248. package/dist/app/scripts/utils/load-chrom-infos.d.ts +8 -0
  249. package/dist/app/scripts/utils/map.d.ts +13 -0
  250. package/dist/app/scripts/utils/max-non-zero.d.ts +6 -0
  251. package/dist/app/scripts/utils/max.d.ts +10 -0
  252. package/dist/app/scripts/utils/min-non-zero.d.ts +6 -0
  253. package/dist/app/scripts/utils/min.d.ts +10 -0
  254. package/dist/app/scripts/utils/mod.d.ts +9 -0
  255. package/dist/app/scripts/utils/ndarray-assign.d.ts +2 -0
  256. package/dist/app/scripts/utils/ndarray-flatten.d.ts +2 -0
  257. package/dist/app/scripts/utils/ndarray-to-list.d.ts +2 -0
  258. package/dist/app/scripts/utils/numericify-version.d.ts +6 -0
  259. package/dist/app/scripts/utils/obj-vals.d.ts +8 -0
  260. package/dist/app/scripts/utils/or.d.ts +8 -0
  261. package/dist/app/scripts/utils/parse-chromsizes-rows.d.ts +34 -0
  262. package/dist/app/scripts/utils/pixi-text-to-svg.d.ts +2 -0
  263. package/dist/app/scripts/utils/positioned-tracks-to-all-tracks.d.ts +26 -0
  264. package/dist/app/scripts/utils/q.d.ts +18 -0
  265. package/dist/app/scripts/utils/rad-to-deg.d.ts +7 -0
  266. package/dist/app/scripts/utils/range-query-2d.d.ts +17 -0
  267. package/dist/app/scripts/utils/reduce.d.ts +14 -0
  268. package/dist/app/scripts/utils/rel-to-abs-chrom-pos.d.ts +10 -0
  269. package/dist/app/scripts/utils/remove-class.d.ts +7 -0
  270. package/dist/app/scripts/utils/reset-d3-brush-style.d.ts +10 -0
  271. package/dist/app/scripts/utils/rgb-to-hex.d.ts +8 -0
  272. package/dist/app/scripts/utils/scales-center-and-k.d.ts +12 -0
  273. package/dist/app/scripts/utils/scales-to-genome-loci.d.ts +3 -0
  274. package/dist/app/scripts/utils/segments-to-rows.d.ts +15 -0
  275. package/dist/app/scripts/utils/selected-items-to-cum-weights.d.ts +12 -0
  276. package/dist/app/scripts/utils/selected-items-to-size.d.ts +13 -0
  277. package/dist/app/scripts/utils/show-mouse-position.d.ts +54 -0
  278. package/dist/app/scripts/utils/some.d.ts +10 -0
  279. package/dist/app/scripts/utils/sum.d.ts +8 -0
  280. package/dist/app/scripts/utils/svg-line.d.ts +2 -0
  281. package/dist/app/scripts/utils/throttle-and-debounce.d.ts +33 -0
  282. package/dist/app/scripts/utils/tile-to-canvas.d.ts +9 -0
  283. package/dist/app/scripts/utils/timeout.d.ts +3 -0
  284. package/dist/app/scripts/utils/to-void.d.ts +3 -0
  285. package/dist/app/scripts/utils/total-track-pixel-height.d.ts +27 -0
  286. package/dist/app/scripts/utils/trim-trailing-slash.d.ts +7 -0
  287. package/dist/app/scripts/utils/type-guards.d.ts +36 -0
  288. package/dist/app/scripts/utils/value-to-color.d.ts +12 -0
  289. package/dist/app/scripts/utils/visit-positioned-tracks.d.ts +18 -0
  290. package/dist/app/scripts/utils/visit-tracks.d.ts +9 -0
  291. package/dist/esm.html +1 -3
  292. package/dist/hglib.js +65302 -79868
  293. package/dist/hglib.min.js +104 -112
  294. package/dist/higlass.mjs +64214 -78780
  295. package/dist/index.html +1 -3
  296. package/dist/package.json +134 -0
  297. package/package.json +13 -10
@@ -0,0 +1,8 @@
1
+ export default loadChromInfos;
2
+ /**
3
+ * @param {Record<string, { chromInfoPath: string }>} views
4
+ * @returns {void}
5
+ */
6
+ declare function loadChromInfos(views: Record<string, {
7
+ chromInfoPath: string;
8
+ }>): void;
@@ -0,0 +1,13 @@
1
+ export default map;
2
+ /**
3
+ * Exposed map function. You can do cool stuff with that!
4
+ *
5
+ * @description
6
+ * The pure map function is more powerful because it can be used on data types
7
+ * other than Array too.
8
+ *
9
+ * @template T, B
10
+ * @param {(item: T, idx?: number) => B} f - Mapping function.
11
+ * @return {(x: Array<T>) => Array<B>} Mapped array.
12
+ */
13
+ declare function map<T, B>(f: (item: T, idx?: number) => B): (x: Array<T>) => Array<B>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Calculate the maximum non-zero value in the data
3
+ * @param {ArrayLike<number>} data - An array of values
4
+ * @returns {number} The maximum non-zero value in the array
5
+ */
6
+ export default function maxNonZero(data: ArrayLike<number>): number;
@@ -0,0 +1,10 @@
1
+ export default max;
2
+ /**
3
+ * Fast version of `Math.max`. Based on
4
+ * https://jsperf.com/math-min-max-vs-ternary-vs-if/24 `Math.max` is not
5
+ * very fast
6
+ * @param {number} a - Value A
7
+ * @param {number} b - Value B
8
+ * @return {number} If `true` A is greater than B.
9
+ */
10
+ declare function max(a: number, b: number): number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Calculate the minimum non-zero value in the data
3
+ * @param {ArrayLike<number>} data - An array of values
4
+ * @returns {number} The minimum non-zero value in the array
5
+ */
6
+ export default function minNonZero(data: ArrayLike<number>): number;
@@ -0,0 +1,10 @@
1
+ export default min;
2
+ /**
3
+ * Fast version of `Math.min`. Based on
4
+ * https://jsperf.com/math-min-max-vs-ternary-vs-if/24 `Math.max` is not
5
+ * very fast
6
+ * @param {number} a - Value A
7
+ * @param {number} b - Value B
8
+ * @return {number} If `true` A is smaller than B.
9
+ */
10
+ declare function min(a: number, b: number): number;
@@ -0,0 +1,9 @@
1
+ export default mod;
2
+ /**
3
+ * Non-negative modulo function. E.g., `mod(-1, 5) === 4` while `-1 % 5 === -1`.
4
+ *
5
+ * @param {number} n - Dividend (integer)
6
+ * @param {number} m - Divisor (integer)
7
+ * @return {number} Remainder (integer)
8
+ */
9
+ declare function mod(n: number, m: number): number;
@@ -0,0 +1,2 @@
1
+ export default ndarrayAssign;
2
+ declare function ndarrayAssign(target: any, source: any): void;
@@ -0,0 +1,2 @@
1
+ export default ndarrayFlatten;
2
+ declare function ndarrayFlatten(arr: any): any;
@@ -0,0 +1,2 @@
1
+ export default ndarrayToList;
2
+ declare function ndarrayToList(arr: any): any[];
@@ -0,0 +1,6 @@
1
+ export default numericifyVersion;
2
+ /**
3
+ * @param {string} version
4
+ * @returns {number}
5
+ */
6
+ declare function numericifyVersion(version: string): number;
@@ -0,0 +1,8 @@
1
+ export default objVals;
2
+ /**
3
+ * Convert an object into array which entries are the prop values of the object
4
+ *
5
+ * @param {Object} obj - Object to be arrayified
6
+ * @return {Array} Array of the object.
7
+ */
8
+ declare function objVals(obj: Object): any[];
@@ -0,0 +1,8 @@
1
+ export default or;
2
+ /**
3
+ * Logical or operator for convenience.
4
+ * @param {boolean} a - Value A
5
+ * @param {boolean} b - Value B
6
+ * @return {boolean} If `true` one of the two or both values are truthy.
7
+ */
8
+ declare function or(a: boolean, b: boolean): boolean;
@@ -0,0 +1,34 @@
1
+ export default parseChromsizesRows;
2
+ export type ChromsizeRow = [string, number];
3
+ export type CumulativeChromsizeEntry = {
4
+ id: number;
5
+ chr: string;
6
+ pos: number;
7
+ };
8
+ export type ParsedChromsizes = {
9
+ cumPositions: CumulativeChromsizeEntry[];
10
+ chrPositions: Record<string, CumulativeChromsizeEntry>;
11
+ totalLength: number;
12
+ chromLengths: Record<string, number>;
13
+ };
14
+ /** @typedef {[string, number]} ChromsizeRow */
15
+ /**
16
+ * @typedef CumulativeChromsizeEntry
17
+ * @property {number} id
18
+ * @property {string} chr
19
+ * @property {number} pos
20
+ */
21
+ /**
22
+ * @typedef ParsedChromsizes
23
+ * @property {CumulativeChromsizeEntry[]} cumPositions
24
+ * @property {Record<string, CumulativeChromsizeEntry>} chrPositions
25
+ * @property {number} totalLength
26
+ * @property {Record<string, number>} chromLengths
27
+ */
28
+ /**
29
+ * Parse an array of chromsizes, for example that result from reading rows of a chromsizes CSV file.
30
+ *
31
+ * @param {ArrayLike<ChromsizeRow>} data - Array of [chrName, chrLen] "tuples".
32
+ * @returns {ParsedChromsizes}
33
+ */
34
+ declare function parseChromsizesRows(data: ArrayLike<ChromsizeRow>): ParsedChromsizes;
@@ -0,0 +1,2 @@
1
+ export function pixiTextToSvg(pixiText: import("pixi.js").Text): HTMLElement;
2
+ export default pixiTextToSvg;
@@ -0,0 +1,26 @@
1
+ export default positionedTracksToAllTracks;
2
+ /**
3
+ * Convert the position indexed list of tracks.
4
+ *
5
+ * If `includeCombinedContents` is `true`, tracks inside
6
+ * `combined.contents` will also be included in the output.
7
+ *
8
+ * @template {{ type: string } | { type: 'combined', contents: Array<T> }} T
9
+ *
10
+ * @param {PositionedTracks<T>} positionedTracks
11
+ * @param {{ includeCombinedContents?: boolean }} options
12
+ * @returns {Array<T & { position: TrackPosition }>}
13
+ *
14
+ */
15
+ declare function positionedTracksToAllTracks<T extends {
16
+ type: string;
17
+ } | {
18
+ type: "combined";
19
+ contents: Array<T>;
20
+ }>(positionedTracks: PositionedTracks<T>, { includeCombinedContents }?: {
21
+ includeCombinedContents?: boolean;
22
+ }): Array<T & {
23
+ position: TrackPosition;
24
+ }>;
25
+ import type { PositionedTracks } from './visit-positioned-tracks';
26
+ import type { TrackPosition } from '../types';
@@ -0,0 +1,18 @@
1
+ export default q;
2
+ /**
3
+ * Object query language using dot-notation.
4
+ *
5
+ * @description In order to query an object dynamically do:
6
+ * ```
7
+ * const myFancyObj = { my: { fancy: { property: 'Sweet!' } } };
8
+ * const myNotSoFancyObj = { noSoFancy: 'buh!' };
9
+ *
10
+ * const myFancyQuery = q('my.fancy.property');
11
+ *
12
+ * console.log(myFancyQuery(myFancyObj)) ==> 'Sweet!'
13
+ * console.log(myFancyQuery(myNotSoFancyObj)) ==> undefined
14
+ * ```
15
+ * @param {string} queryStr - dot-notation query string
16
+ * @return {unknown}
17
+ */
18
+ declare function q(queryStr: string): unknown;
@@ -0,0 +1,7 @@
1
+ export default radToDeg;
2
+ /**
3
+ * Convert radiance to degree
4
+ * @param {number} rad - Radiance
5
+ * @return {number} Degree
6
+ */
7
+ declare function radToDeg(rad: number): number;
@@ -0,0 +1,17 @@
1
+ export default rangeQuery2d;
2
+ /**
3
+ * Perform a 2D query on a 1D array
4
+ *
5
+ * @param {Array} src Data source array.
6
+ * @param {Integer} xDimSrc X dimension of `src`.
7
+ * @param {Integer} xDimOut X dimension of `outList`.
8
+ * @param {Array} xRange X range array, e.g., `[start, end]`.
9
+ * @param {Array} yRange Y range array, e.g., `[start, end]`.
10
+ * @param {Integer} xOff X offset in regards to `outList`.
11
+ * @param {Integer} yOff Y offset in regards to `outList`.
12
+ * @param {Boolean} mirrored If `true` mirror query.
13
+ * @param {Array} outList Typed array to be set in place.
14
+ * 1D representation of a 2D array (e.g. ass = new Uint8ClampedArray(10);)
15
+ * @return {Array} Sub array.
16
+ */
17
+ declare function rangeQuery2d(src: any[], xDimSrc: Integer, xDimOut: Integer, xRange: any[], yRange: any[], mirrored: boolean, xOff: Integer, yOff: Integer, outList: any[]): any[];
@@ -0,0 +1,14 @@
1
+ export default reduce;
2
+ /**
3
+ * Pure functional reducer. Can be used for currying stuff.
4
+ *
5
+ * @see {@link ./flatten.js}
6
+ *
7
+ * @template T
8
+ * @template U
9
+ *
10
+ * @param {(previousValue: U, currentValue: T, currentIndex: number, array: Array<T>) => U} callbackfn
11
+ * @param {U} initialValue
12
+ * @return {(x: Array<T>) => U} Curried function that accepts an array to be reduced.
13
+ */
14
+ declare function reduce<T, U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: Array<T>) => U, initialValue: U): (x: Array<T>) => U;
@@ -0,0 +1,10 @@
1
+ export default relToAbsChromPos;
2
+ /**
3
+ * @template {string} Name
4
+ * @param {Name} chrom
5
+ * @param {number} x
6
+ * @param {number} y
7
+ * @param {import('../types').ChromInfo<Name>} chromInfo
8
+ * @returns {[number, number]}
9
+ */
10
+ declare function relToAbsChromPos<Name extends string>(chrom: Name, x: number, y: number, chromInfo: import("../types").ChromInfo<Name>): [number, number];
@@ -0,0 +1,7 @@
1
+ export default removeClass;
2
+ /**
3
+ * Remove a class from an HTML or SVG element.
4
+ * @param {Element} el - HTML or SVG element.
5
+ * @param {string} className Class name to be removed.
6
+ */
7
+ declare function removeClass(el: Element, className: string): void;
@@ -0,0 +1,10 @@
1
+ export default resetD3BrushStyle;
2
+ export type BaseType = import("d3-selection").BaseType;
3
+ /** @typedef {import('d3-selection').BaseType} BaseType */
4
+ /**
5
+ * Unsets the automatically set brush style of D3.
6
+ * @template {import('d3-selection').Selection<BaseType, unknown, BaseType, unknown>} Sel
7
+ * @param {Sel} el - Element which is brushed on.
8
+ * @param {string} className New class name to be set.
9
+ */
10
+ declare function resetD3BrushStyle<Sel extends import("d3-selection").Selection<BaseType, unknown, BaseType, unknown>>(el: Sel, className: string): void;
@@ -0,0 +1,8 @@
1
+ export default rgbToHex;
2
+ /**
3
+ * @param {number} r
4
+ * @param {number} g
5
+ * @param {number} b
6
+ * @returns {string}
7
+ */
8
+ declare function rgbToHex(r: number, g: number, b: number): string;
@@ -0,0 +1,12 @@
1
+ export default scalesCenterAndK;
2
+ /**
3
+ * Calculate the center of the scale as well as its scale
4
+ * factor
5
+ *
6
+ * Assumes the two scales have the same k
7
+ *
8
+ * @param {import('../types').Scale} xScale - A d3 scale.
9
+ * @param {import('../types').Scale} yScale - A d3 scale.
10
+ * @return {[xCenter: number, yCenter: number, k: number]}
11
+ */
12
+ declare function scalesCenterAndK(xScale: import("../types").Scale, yScale: import("../types").Scale): [xCenter: number, yCenter: number, k: number];
@@ -0,0 +1,3 @@
1
+ export function scalesToGenomeLoci(xScale: import("../types").Scale, yScale: import("../types").Scale, chromInfo: import("../types").ChromInfo): [...GenomicLoci, ...GenomicLoci] | undefined;
2
+ export default scalesToGenomeLoci;
3
+ export type GenomicLoci = import("./data-to-genomic-loci").GenomicLoci;
@@ -0,0 +1,15 @@
1
+ export default segmentsToRows;
2
+ export type Segment = {
3
+ from: number;
4
+ to: number;
5
+ };
6
+ /** @typedef {{ from:number, to: number }} Segment */
7
+ /**
8
+ * Partition a list of segments into an array of rows containing the segments.
9
+ *
10
+ * WARNING: Sorts the `segments` array input _inplace_.
11
+ *
12
+ * @param {Array<Segment>} segments An array of segments (e.g. [{from: 10, to: 20}, {from: 18, to: 30}])
13
+ * @return: {Array<Array<Segment>>} non-overlapping rows of segments
14
+ */
15
+ declare function segmentsToRows(segments: Array<Segment>): Segment[][];
@@ -0,0 +1,12 @@
1
+ export default selectedItemsToCumWeights;
2
+ /**
3
+ * Compute the cumulative normalized weights associated with a
4
+ * potentially 2d array of selected item indices.
5
+ *
6
+ * @param {Array<unknown>} selectedItems - The 1d or 2d array of items or groups of items.
7
+ * @param {boolean} withRelativeSize - Does a group of indices count as 1 unit size or is its size relative to the group size?
8
+ * @returns {Float64Array} The array of cumulative weights, one for each item.
9
+ *
10
+ * Sums to 1 before the cumulative sum step (i.e. the final array element will be 1).
11
+ */
12
+ declare function selectedItemsToCumWeights(selectedItems: Array<unknown>, withRelativeSize: boolean): Float64Array;
@@ -0,0 +1,13 @@
1
+ export default selectedItemsToSize;
2
+ /**
3
+ * Compute the size associated with a potentially 2d array of selected item indices.
4
+ * For example, this can be used to compute the total height of a `horizontal-multivec` track
5
+ * where rows are selected individually or in aggregation groups.
6
+ *
7
+ * @param {Array<unknown>} selectedItems The 1d or 2d array of items or groups of items.
8
+ * @param {boolean} withRelativeSize Does a group of indices count as 1 unit size
9
+ * or is its size relative to the group size?
10
+ * @returns {number} The computed size value.
11
+ * Between 0 and the total number of items in the (flattened) input array.
12
+ */
13
+ declare function selectedItemsToSize(selectedItems: Array<unknown>, withRelativeSize: boolean): number;
@@ -0,0 +1,54 @@
1
+ export default setupShowMousePosition;
2
+ export type MouseTrackOptions = {
3
+ /**
4
+ * - Color of the mouse position.
5
+ */
6
+ mousePositionColor?: string | undefined;
7
+ /**
8
+ * - Alpha of the mouse position.
9
+ */
10
+ mousePositionAlpha?: number | undefined;
11
+ };
12
+ export type ClassContext = {
13
+ pForeground?: import("pixi.js").Container | undefined;
14
+ pMasked?: import("pixi.js").Container | undefined;
15
+ pMain?: import("pixi.js").Container | undefined;
16
+ xScale: () => import("../types").Scale;
17
+ yScale: () => import("../types").Scale;
18
+ getPosition: () => [number, number];
19
+ getDimensions: () => [number, number];
20
+ pubSub: import("pub-sub-es").PubSub;
21
+ pubSubs: Array<import("pub-sub-es").Subscription>;
22
+ getProp: (prop: "flipText") => () => boolean;
23
+ options: {};
24
+ };
25
+ /**
26
+ * @typedef ClassContext
27
+ * @property {import('pixi.js').Container=} pForeground
28
+ * @property {import('pixi.js').Container=} pMasked
29
+ * @property {import('pixi.js').Container=} pMain
30
+ * @property {() => import('../types').Scale} xScale
31
+ * @property {() => import('../types').Scale} yScale
32
+ * @property {() => [number, number]} getPosition
33
+ * @property {() => [number, number]} getDimensions
34
+ * @property {import('pub-sub-es').PubSub} pubSub
35
+ * @property {Array<import('pub-sub-es').Subscription>} pubSubs
36
+ * @property {(prop: 'flipText') => () => boolean} getProp
37
+ * @property {{}} options
38
+ */
39
+ /**
40
+ * Public API for showing the mouse location.
41
+ *
42
+ * @description
43
+ * This is just a convenience wrapper to avoid code duplication.
44
+ * `showMousePosition` is the actual function and could be called from within
45
+ * each class as well.
46
+ *
47
+ * @param {ClassContext} context - Class context, i.e., `this`.
48
+ * @param {Boolean} is2d - If `true` both dimensions of the mouse location
49
+ * should be shown. E.g., on a central track.
50
+ * @param {Boolean} isGlobal - If `true` local and global events will trigger
51
+ * the mouse position drawing.
52
+ * @return {Function} - Method to remove graphics showing the mouse location.
53
+ */
54
+ declare function setupShowMousePosition(context: ClassContext, is2d?: boolean, isGlobal?: boolean): Function;
@@ -0,0 +1,10 @@
1
+ export default some;
2
+ /**
3
+ * Functional version of `Array.forEach`. More flexible and applicable to
4
+ * other array-like data types like `NodeList`.
5
+ *
6
+ * @template T
7
+ * @param {(item: T, i: number) => boolean} f - Modifier function applied on every item of the array.
8
+ * @return {(arr: Array<T>) => boolean} Modified array-like variable.
9
+ */
10
+ declare function some<T>(f: (item: T, i: number) => boolean): (arr: Array<T>) => boolean;
@@ -0,0 +1,8 @@
1
+ export default sum;
2
+ /**
3
+ * Convenience function for a reducer to sum up a numerical array.
4
+ * @param {number} a - Value A
5
+ * @param {number} b - Value B
6
+ * @return {number} Sum of A + B
7
+ */
8
+ declare function sum(a: number, b: number): number;
@@ -0,0 +1,2 @@
1
+ export function svgLine(x1: number, y1: number, x2: number, y2: number, strokeWidth: number, strokeColor: string): HTMLElement;
2
+ export default svgLine;
@@ -0,0 +1,33 @@
1
+ export default throttleAndDebounce;
2
+ /**
3
+ * Throttle and debounce a function call
4
+ *
5
+ * Throttling a function call means that the function is called at most every
6
+ * `interval` milliseconds no matter how frequently you trigger a call.
7
+ * Debouncing a function call means that the function is called the earliest
8
+ * after `finalWait` milliseconds wait time where the function was not called.
9
+ * Combining the two ensures that the function is called at most every
10
+ * `interval` milliseconds and is ensured to be called with the very latest
11
+ * arguments after after `finalWait` milliseconds wait time at the end.
12
+ *
13
+ * The following imaginary scenario describes the behavior:
14
+ *
15
+ * MS | interval=2 and finalWait=2
16
+ * 01. y(f, 2, 2)(args_01) => f(args_01) call
17
+ * 02. y(f, 2, 2)(args_02) => throttled call
18
+ * 03. y(f, 2, 2)(args_03) => f(args_03) call
19
+ * 04. y(f, 2, 2)(args_04) => throttled call
20
+ * 05. y(f, 2, 2)(args_05) => f(args_05) call
21
+ * 06. y(f, 2, 2)(args_06) => throttled call
22
+ * 07. y(f, 2, 2)(args_07) => f(args_03) call
23
+ * 08. y(f, 2, 2)(args_08) => throttled call
24
+ * 09. nothing
25
+ * 10. y(f, 2, 2)(args_10) => f(args_10) call from debouncing
26
+ *
27
+ * @template {any[]} Args
28
+ * @param {(...args: Args) => void} func - Function to be throttled and debounced
29
+ * @param {number} interval - Throttle intevals in milliseconds
30
+ * @param {number} finalWait - Debounce wait time in milliseconds
31
+ * @return {(request: unknown, ...args: Args) => void} - Throttled and debounced function
32
+ */
33
+ declare function throttleAndDebounce<Args extends any[]>(func: (...args: Args) => void, interval: number, finalWait: number): (request: unknown, ...args: Args) => void;
@@ -0,0 +1,9 @@
1
+ export default tileToCanvas;
2
+ /**
3
+ * Convert a 1D numerical array into a canvas image
4
+ * @param {Uint8ClampedArray} pixData - 1D data array
5
+ * @param {number} w - Width
6
+ * @param {number} h - Height
7
+ * @return {object} Canvas object
8
+ */
9
+ declare function tileToCanvas(pixData: Uint8ClampedArray, w?: number, h?: number): object;
@@ -0,0 +1,3 @@
1
+ export default timeout;
2
+ /** @param {number} ms */
3
+ declare function timeout(ms: number): Promise<any>;
@@ -0,0 +1,3 @@
1
+ export default toVoid;
2
+ /** @type {(...args: any[]) => void} */
3
+ declare const toVoid: (...args: any[]) => void;
@@ -0,0 +1,27 @@
1
+ export default totalTrackPixelHeight;
2
+ export type Tracks = {
3
+ top?: {
4
+ height: number;
5
+ }[] | undefined;
6
+ center?: {
7
+ height: number;
8
+ }[] | undefined;
9
+ bottom?: {
10
+ height: number;
11
+ }[] | undefined;
12
+ };
13
+ /**
14
+ * @typedef Tracks
15
+ * @prop {{ height: number }[]=} top
16
+ * @prop {{ height: number }[]=} center
17
+ * @prop {{ height: number }[]=} bottom
18
+ */
19
+ /**
20
+ * Calculate the total height of the horizontal and center tracks in pixels
21
+ *
22
+ * @param {{ tracks?: Tracks }} view - A typical view configuration containing a list of tracks
23
+ * @returns {number} - The total height of the top, center and bottom tracks
24
+ */
25
+ declare function totalTrackPixelHeight(view: {
26
+ tracks?: Tracks;
27
+ }): number;
@@ -0,0 +1,7 @@
1
+ export default trimTrailingSlash;
2
+ /**
3
+ * Trim trailing slash of an URL.
4
+ * @param {string} url - URL to be trimmed.
5
+ * @return {string} Trimmed URL.
6
+ */
7
+ declare function trimTrailingSlash(url: string): string;
@@ -0,0 +1,36 @@
1
+ /** @import * as t from '../types' */
2
+ /**
3
+ * @param {t.TrackConfig} trackConfig
4
+ * @return {trackConfig is t.CombinedTrackConfig}
5
+ */
6
+ export function isCombinedTrackConfig(trackConfig: t.TrackConfig): trackConfig is t.CombinedTrackConfig;
7
+ /**
8
+ * @param {Event} event
9
+ * @returns {event is WheelEvent}
10
+ */
11
+ export function isWheelEvent(event: Event): event is WheelEvent;
12
+ /**
13
+ * @param {unknown} obj
14
+ * @returns {obj is {}}
15
+ */
16
+ export function isObject(obj: unknown): obj is {};
17
+ /**
18
+ * @param {t.TilesetInfo | undefined} info
19
+ * @returns {info is t.LegacyTilesetInfo}
20
+ */
21
+ export function isLegacyTilesetInfo(info: t.TilesetInfo | undefined): info is t.LegacyTilesetInfo;
22
+ /**
23
+ * @param {t.TilesetInfo | undefined | { error: string }} info
24
+ * @returns {info is t.ResolutionsTilesetInfo}
25
+ */
26
+ export function isResolutionsTilesetInfo(info: t.TilesetInfo | undefined | {
27
+ error: string;
28
+ }): info is t.ResolutionsTilesetInfo;
29
+ /**
30
+ * @param {t.TilesetInfo | undefined | { error: string }} info
31
+ * @returns {info is t.TilesetInfo}
32
+ */
33
+ export function isTilesetInfo(info: t.TilesetInfo | undefined | {
34
+ error: string;
35
+ }): info is t.TilesetInfo;
36
+ import type * as t from '../types';
@@ -0,0 +1,12 @@
1
+ export default valueToColor;
2
+ /**
3
+ * Factory function for a value to RGB color converter
4
+ *
5
+ * @template T
6
+ * @param {(value: number) => number} valueScale - Value scaling function.
7
+ * @param {Array<T>} colorScale - Color scale array.
8
+ * @param {number} pseudoCounts - Pseudo counts used as a pseudocount to prevent taking the log of 0.
9
+ * @param {number} eps - Epsilon.
10
+ * @return {(value: number) => T} RGB color array.
11
+ */
12
+ declare function valueToColor<T>(valueScale: (value: number) => number, colorScale: Array<T>, pseudoCounts?: number, eps?: number): (value: number) => T;
@@ -0,0 +1,18 @@
1
+ export default visitPositionedTracks;
2
+ export type PositionedTracks<T = TrackConfig> = { [Key in TrackPosition]?: Array<T>; };
3
+ /** @import { TrackConfig, TrackPosition, TrackVisitor } from '../types' */
4
+ /**
5
+ * @template [T=TrackConfig]
6
+ * @typedef {{ [Key in TrackPosition]?: Array<T> }} PositionedTracks
7
+ */
8
+ /**
9
+ * Track visitor for positioned tracks, i.e., tracks with a position.
10
+ *
11
+ * @param {PositionedTracks} positionedTracks - List of all positioned tracks from the view definition.
12
+ * @param {TrackVisitor} visitor - Callback function receiving individual tracks.
13
+ * @param {boolean} inclCombinedTracks - If `true` recursively visit combined tracks.
14
+ */
15
+ declare function visitPositionedTracks(positionedTracks: PositionedTracks, visitor: TrackVisitor, inclCombinedTracks?: boolean): TrackConfig[];
16
+ import type { TrackConfig } from '../types';
17
+ import type { TrackPosition } from '../types';
18
+ import type { TrackVisitor } from '../types';
@@ -0,0 +1,9 @@
1
+ export default visitTracks;
2
+ /**
3
+ * Track visitor to run code on individual tracks.
4
+ * @param {import('../types').TrackConfig[]} tracks - List of all tracks from the view definition.
5
+ * @param {import('../types').TrackVisitor} visit - Callback function receiving individual tracks.
6
+ * @param {boolean} includeCombinedTracks - If `true` recursively visit combined tracks.
7
+ * @param {import('../types').TrackPosition | null} position - Can be used to limit the tracks to be visit to a certain position.
8
+ */
9
+ declare function visitTracks(tracks: import("../types").TrackConfig[], visit: import("../types").TrackVisitor, includeCombinedTracks?: boolean, position?: import("../types").TrackPosition | null): void;
package/dist/esm.html CHANGED
@@ -266,14 +266,12 @@
266
266
  }
267
267
  };
268
268
 
269
- const hgApi = window.hgApi = hglib.viewer(
269
+ const hgApi = window.hgApi = await hglib.viewer(
270
270
  document.getElementById('demo'),
271
271
  viewConfig,
272
272
  { bounded: true },
273
273
  );
274
274
 
275
- hgApi.setBroadcastMousePositionGlobally(true);
276
-
277
275
  hgApi.on('viewConfig', () => {
278
276
  console.log('View Config changed');
279
277
  });