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.
- package/README.md +48 -54
- package/app/globals.d.ts +1 -1
- package/app/missing-types.d.ts +4 -1
- package/app/scripts/AddTrackDialog.jsx +11 -4
- package/app/scripts/AddTrackPositionMenu.jsx +28 -7
- package/app/scripts/Annotations1dTrack.js +90 -251
- package/app/scripts/Annotations2dTrack.js +12 -7
- package/app/scripts/Autocomplete.jsx +13 -28
- package/app/scripts/AxisPixi.js +6 -10
- package/app/scripts/BarTrack.js +3 -3
- package/app/scripts/BedLikeTrack.js +556 -449
- package/app/scripts/Button.jsx +1 -1
- package/app/scripts/CNVIntervalTrack.js +1 -1
- package/app/scripts/CenterTrack.jsx +8 -7
- package/app/scripts/Chromosome2DAnnotations.js +1 -1
- package/app/scripts/Chromosome2DLabels.js +1 -1
- package/app/scripts/ChromosomeGrid.js +49 -38
- package/app/scripts/ChromosomeInfo.js +1 -1
- package/app/scripts/CombinedTrack.js +3 -1
- package/app/scripts/ConfigTrackMenu.jsx +1 -1
- package/app/scripts/ConfigViewMenu.jsx +2 -2
- package/app/scripts/ContextMenuContainer.jsx +4 -2
- package/app/scripts/ContextMenuItem.jsx +14 -2
- package/app/scripts/CrossRule.js +1 -1
- package/app/scripts/CustomTrackDialog.jsx +2 -2
- package/app/scripts/Dialog.jsx +2 -2
- package/app/scripts/DragListeningDiv.jsx +1 -1
- package/app/scripts/DraggableDiv.jsx +2 -3
- package/app/scripts/ExportLinkDialog.jsx +1 -1
- package/app/scripts/FilledLine.js +349 -0
- package/app/scripts/GalleryTracks.jsx +77 -78
- package/app/scripts/GenomePositionSearchBox.jsx +184 -482
- package/app/scripts/HeatmapOptions.jsx +4 -2
- package/app/scripts/HeatmapTiledPixiTrack.js +23 -32
- package/app/scripts/HiGlassComponent.jsx +515 -444
- package/app/scripts/HiGlassComponentContext.js +5 -0
- package/app/scripts/Horizontal1dHeatmapTrack.js +1 -1
- package/app/scripts/Horizontal2DDomainsTrack.js +1 -1
- package/app/scripts/HorizontalChromosomeLabels.js +28 -22
- package/app/scripts/HorizontalGeneAnnotationsTrack.js +1 -1
- package/app/scripts/HorizontalHeatmapTrack.js +2 -2
- package/app/scripts/HorizontalMultivecTrack.js +6 -7
- package/app/scripts/HorizontalRule.js +1 -2
- package/app/scripts/HorizontalTiled1DPixiTrack.js +4 -4
- package/app/scripts/HorizontalTiledPlot.jsx +9 -9
- package/app/scripts/LeftTrackModifier.js +4 -0
- package/app/scripts/ListWrapper.jsx +1 -2
- package/app/scripts/MapboxTilesTrack.js +1 -2
- package/app/scripts/Modal.jsx +2 -2
- package/app/scripts/MoveableTrack.jsx +10 -12
- package/app/scripts/NestedContextMenu.jsx +2 -1
- package/app/scripts/OSMTileIdsTrack.js +1 -1
- package/app/scripts/OverlayTrack.js +4 -4
- package/app/scripts/PixiTrack.js +27 -13
- package/app/scripts/PlotTypeChooser.jsx +3 -4
- package/app/scripts/SearchField.js +5 -5
- package/app/scripts/SeriesListItems.jsx +3 -4
- package/app/scripts/SeriesListMenu.jsx +95 -53
- package/app/scripts/SeriesListSubmenuMixin.jsx +2 -1
- package/app/scripts/SketchInlinePicker.jsx +2 -2
- package/app/scripts/SortableList.jsx +1 -1
- package/app/scripts/Tiled1DPixiTrack.js +4 -1
- package/app/scripts/TiledPixiTrack.js +244 -102
- package/app/scripts/TiledPlot.jsx +565 -118
- package/app/scripts/TilesetFinder.jsx +12 -4
- package/app/scripts/Track.js +1 -1
- package/app/scripts/TrackArea.jsx +4 -0
- package/app/scripts/TrackControl.jsx +2 -2
- package/app/scripts/TrackRenderer.jsx +32 -33
- package/app/scripts/ValueIntervalTrack.js +1 -1
- package/app/scripts/VerticalRule.js +2 -2
- package/app/scripts/VerticalTiledPlot.jsx +7 -7
- package/app/scripts/ViewConfigEditor.jsx +1 -1
- package/app/scripts/ViewContextMenu.jsx +53 -5
- package/app/scripts/ViewHeader.jsx +9 -9
- package/app/scripts/ViewportTracker2D.js +1 -1
- package/app/scripts/api.js +92 -12
- package/app/scripts/configs/available-track-types.js +1 -1
- package/app/scripts/configs/index.js +6 -1
- package/app/scripts/configs/positions-by-datatype.js +2 -2
- package/app/scripts/configs/primitives.js +2 -0
- package/app/scripts/configs/themes.js +0 -1
- package/app/scripts/configs/tracks-info-by-type.js +11 -8
- package/app/scripts/configs/tracks-info.js +3 -2
- package/app/scripts/d3-context-menu.js +3 -4
- package/app/scripts/data-fetchers/DataFetcher.js +35 -36
- package/app/scripts/data-fetchers/genbank-fetcher.js +13 -22
- package/app/scripts/data-fetchers/local-tile-fetcher.js +10 -8
- package/app/scripts/hglib.jsx +62 -71
- package/app/scripts/hocs/with-modal.jsx +32 -10
- package/app/scripts/hocs/with-pub-sub.js +12 -3
- package/app/scripts/hocs/with-theme.jsx +21 -14
- package/app/scripts/icons.jsx +3 -2
- package/app/scripts/mixwith.js +2 -2
- package/app/scripts/options-info.js +49 -11
- package/app/scripts/plugins/get-data-fetcher.js +2 -3
- package/app/scripts/services/chrom-info.js +32 -4
- package/app/scripts/services/element-resize-listener.js +2 -2
- package/app/scripts/services/index.js +0 -1
- package/app/scripts/services/tile-proxy.js +368 -285
- package/app/scripts/services/worker.js +31 -28
- package/app/scripts/test-helpers/index.js +2 -1
- package/app/scripts/test-helpers/test-helpers.jsx +157 -69
- package/app/scripts/types.ts +118 -47
- package/app/scripts/utils/LruCache.js +3 -2
- package/app/scripts/utils/assert.js +19 -0
- package/app/scripts/utils/background-task-scheduler.js +2 -0
- package/app/scripts/utils/color-domain-to-rgba-array.js +13 -3
- package/app/scripts/utils/copy-text-to-clipboard.js +36 -0
- package/app/scripts/utils/decompress.js +33 -0
- package/app/scripts/utils/default-tracks.js +46 -0
- package/app/scripts/utils/dict-items.js +1 -0
- package/app/scripts/utils/dict-keys.js +1 -0
- package/app/scripts/utils/dict-values.js +1 -0
- package/app/scripts/utils/expand-combined-tracks.js +11 -7
- package/app/scripts/utils/fill-in-min-widths.js +47 -21
- package/app/scripts/utils/flatten.js +0 -1
- package/app/scripts/utils/get-aggregation-function.js +1 -1
- package/app/scripts/utils/get-default-track-for-datatype.js +37 -10
- package/app/scripts/utils/get-default-tracks-for-datatype.ts +46 -0
- package/app/scripts/utils/get-higlass-components.js +27 -3
- package/app/scripts/utils/get-track-position-by-uid.js +8 -1
- package/app/scripts/utils/get-xylofon.js +12 -9
- package/app/scripts/utils/has-parent.js +5 -5
- package/app/scripts/utils/hex-string-to-int.js +1 -1
- package/app/scripts/utils/index.js +1 -0
- package/app/scripts/utils/interval-tree.js +222 -177
- package/app/scripts/utils/load-chrom-infos.js +4 -1
- package/app/scripts/utils/pixi-text-to-svg.js +5 -9
- package/app/scripts/utils/positioned-tracks-to-all-tracks.js +55 -0
- package/app/scripts/utils/range-query-2d.js +3 -3
- package/app/scripts/utils/reduce.js +12 -5
- package/app/scripts/utils/segments-to-rows.js +14 -11
- package/app/scripts/utils/svg-line.js +7 -8
- package/app/scripts/utils/type-guards.js +16 -7
- package/app/scripts/utils/visit-positioned-tracks.js +9 -4
- package/app/styles/AddTrackPositionMenu.module.scss +37 -0
- package/app/styles/HiGlass.module.scss +3 -1
- package/app/styles/d3-context-menu.css +0 -1
- package/app/styles/prism.css +1 -0
- package/dist/app/schema.json +525 -0
- package/dist/app/scripts/AddTrackDialog.d.ts +64 -0
- package/dist/app/scripts/AddTrackPositionMenu.d.ts +5 -0
- package/dist/app/scripts/Annotations1dTrack.d.ts +15 -0
- package/dist/app/scripts/Annotations2dTrack.d.ts +95 -0
- package/dist/app/scripts/ArrowheadDomainsTrack.d.ts +36 -0
- package/dist/app/scripts/Autocomplete.d.ts +102 -0
- package/dist/app/scripts/AxisPixi.d.ts +25 -0
- package/dist/app/scripts/BarTrack.d.ts +28 -0
- package/dist/app/scripts/BedLikeTrack.d.ts +84 -0
- package/dist/app/scripts/Button.d.ts +3 -0
- package/dist/app/scripts/CNVIntervalTrack.d.ts +12 -0
- package/dist/app/scripts/CenterTiledPlot.d.ts +3 -0
- package/dist/app/scripts/CenterTrack.d.ts +92 -0
- package/dist/app/scripts/Chromosome2DAnnotations.d.ts +10 -0
- package/dist/app/scripts/Chromosome2DLabels.d.ts +13 -0
- package/dist/app/scripts/ChromosomeGrid.d.ts +24 -0
- package/dist/app/scripts/ChromosomeInfo.d.ts +14 -0
- package/dist/app/scripts/CloseTrackMenu.d.ts +10 -0
- package/dist/app/scripts/CombinedTrack.d.ts +32 -0
- package/dist/app/scripts/ConfigTrackMenu.d.ts +10 -0
- package/dist/app/scripts/ConfigViewMenu.d.ts +34 -0
- package/dist/app/scripts/ConfigureSeriesMenu.d.ts +3 -0
- package/dist/app/scripts/ContextMenuContainer.d.ts +36 -0
- package/dist/app/scripts/ContextMenuItem.d.ts +34 -0
- package/dist/app/scripts/Cross.d.ts +3 -0
- package/dist/app/scripts/CrossRule.d.ts +24 -0
- package/dist/app/scripts/CustomTrackDialog.d.ts +17 -0
- package/dist/app/scripts/Dialog.d.ts +5 -0
- package/dist/app/scripts/DivergentBarTrack.d.ts +4 -0
- package/dist/app/scripts/DragListeningDiv.d.ts +32 -0
- package/dist/app/scripts/DraggableDiv.d.ts +63 -0
- package/dist/app/scripts/ExportLinkDialog.d.ts +21 -0
- package/dist/app/scripts/FilledLine.d.ts +5 -0
- package/dist/app/scripts/FixedTrack.d.ts +5 -0
- package/dist/app/scripts/GalleryTracks.d.ts +20 -0
- package/dist/app/scripts/GenomePositionSearchBox.d.ts +95 -0
- package/dist/app/scripts/HeatmapOptions.d.ts +30 -0
- package/dist/app/scripts/HeatmapTiledPixiTrack.d.ts +184 -0
- package/dist/app/scripts/HiGlassComponent.d.ts +762 -0
- package/dist/app/scripts/HiGlassComponentContext.d.ts +3 -0
- package/dist/app/scripts/HiGlassTrackComponent.d.ts +37 -0
- package/dist/app/scripts/Horizontal1dHeatmapTrack.d.ts +9 -0
- package/dist/app/scripts/Horizontal2DDomainsTrack.d.ts +21 -0
- package/dist/app/scripts/HorizontalChromosomeLabels.d.ts +47 -0
- package/dist/app/scripts/HorizontalGeneAnnotationsTrack.d.ts +25 -0
- package/dist/app/scripts/HorizontalHeatmapTrack.d.ts +12 -0
- package/dist/app/scripts/HorizontalItem.d.ts +3 -0
- package/dist/app/scripts/HorizontalLine1DPixiTrack.d.ts +23 -0
- package/dist/app/scripts/HorizontalMultivecTrack.d.ts +50 -0
- package/dist/app/scripts/HorizontalPoint1DPixiTrack.d.ts +5 -0
- package/dist/app/scripts/HorizontalRule.d.ts +22 -0
- package/dist/app/scripts/HorizontalTiled1DPixiTrack.d.ts +26 -0
- package/dist/app/scripts/HorizontalTiledPlot.d.ts +49 -0
- package/dist/app/scripts/HorizontalTrack.d.ts +6 -0
- package/dist/app/scripts/Id2DTiledPixiTrack.d.ts +10 -0
- package/dist/app/scripts/IdHorizontal1DTiledPixiTrack.d.ts +6 -0
- package/dist/app/scripts/IdVertical1DTiledPixiTrack.d.ts +7 -0
- package/dist/app/scripts/LeftAxisTrack.d.ts +9 -0
- package/dist/app/scripts/LeftTrackModifier.d.ts +29 -0
- package/dist/app/scripts/ListWrapper.d.ts +64 -0
- package/dist/app/scripts/MapboxTilesTrack.d.ts +9 -0
- package/dist/app/scripts/Modal.d.ts +5 -0
- package/dist/app/scripts/MoveableTrack.d.ts +18 -0
- package/dist/app/scripts/NestedContextMenu.d.ts +7 -0
- package/dist/app/scripts/OSMTileIdsTrack.d.ts +5 -0
- package/dist/app/scripts/OSMTilesTrack.d.ts +129 -0
- package/dist/app/scripts/OverlayTrack.d.ts +13 -0
- package/dist/app/scripts/PixiTrack.d.ts +174 -0
- package/dist/app/scripts/PlotTypeChooser.d.ts +25 -0
- package/dist/app/scripts/PopupMenu.d.ts +28 -0
- package/dist/app/scripts/RasterTilesTrack.d.ts +9 -0
- package/dist/app/scripts/RuleMixin.d.ts +2 -0
- package/dist/app/scripts/SVGTrack.d.ts +15 -0
- package/dist/app/scripts/SearchField.d.ts +13 -0
- package/dist/app/scripts/SeriesListItems.d.ts +2 -0
- package/dist/app/scripts/SeriesListMenu.d.ts +51 -0
- package/dist/app/scripts/SeriesListSubmenuMixin.d.ts +2 -0
- package/dist/app/scripts/SketchInlinePicker.d.ts +25 -0
- package/dist/app/scripts/SortableList.d.ts +22 -0
- package/dist/app/scripts/SquareMarkersTrack.d.ts +22 -0
- package/dist/app/scripts/Tiled1DPixiTrack.d.ts +60 -0
- package/dist/app/scripts/TiledPixiTrack.d.ts +369 -0
- package/dist/app/scripts/TiledPlot.d.ts +313 -0
- package/dist/app/scripts/TilesetFinder.d.ts +65 -0
- package/dist/app/scripts/TopAxisTrack.d.ts +9 -0
- package/dist/app/scripts/Track.d.ts +196 -0
- package/dist/app/scripts/TrackArea.d.ts +26 -0
- package/dist/app/scripts/TrackControl.d.ts +5 -0
- package/dist/app/scripts/TrackRenderer.d.ts +724 -0
- package/dist/app/scripts/UnknownPixiTrack.d.ts +7 -0
- package/dist/app/scripts/ValueIntervalTrack.d.ts +6 -0
- package/dist/app/scripts/VerticalItem.d.ts +3 -0
- package/dist/app/scripts/VerticalRule.d.ts +21 -0
- package/dist/app/scripts/VerticalTiled1DPixiTrack.d.ts +6 -0
- package/dist/app/scripts/VerticalTiledPlot.d.ts +50 -0
- package/dist/app/scripts/VerticalTrack.d.ts +6 -0
- package/dist/app/scripts/ViewConfigEditor.d.ts +53 -0
- package/dist/app/scripts/ViewContextMenu.d.ts +17 -0
- package/dist/app/scripts/ViewHeader.d.ts +75 -0
- package/dist/app/scripts/ViewportTracker2D.d.ts +17 -0
- package/dist/app/scripts/ViewportTracker2DPixi.d.ts +11 -0
- package/dist/app/scripts/ViewportTrackerHorizontal.d.ts +17 -0
- package/dist/app/scripts/ViewportTrackerVertical.d.ts +17 -0
- package/dist/app/scripts/api.d.ts +640 -0
- package/dist/app/scripts/configs/available-track-types.d.ts +2 -0
- package/dist/app/scripts/configs/colormaps.d.ts +2 -0
- package/dist/app/scripts/configs/datatype-to-track-type.d.ts +4 -0
- package/dist/app/scripts/configs/default-tracks-for-datatype.d.ts +38 -0
- package/dist/app/scripts/configs/dense-data-extrema-config.d.ts +2 -0
- package/dist/app/scripts/configs/globals.d.ts +5 -0
- package/dist/app/scripts/configs/index.d.ts +16 -0
- package/dist/app/scripts/configs/positions-by-datatype.d.ts +2 -0
- package/dist/app/scripts/configs/primitives.d.ts +20 -0
- package/dist/app/scripts/configs/themes.d.ts +3 -0
- package/dist/app/scripts/configs/tracks-info-by-type.d.ts +4 -0
- package/dist/app/scripts/configs/tracks-info.d.ts +24 -0
- package/dist/app/scripts/d3-context-menu.d.ts +2 -0
- package/dist/app/scripts/data-fetchers/DataFetcher.d.ts +151 -0
- package/dist/app/scripts/data-fetchers/genbank-fetcher.d.ts +86 -0
- package/dist/app/scripts/data-fetchers/index.d.ts +3 -0
- package/dist/app/scripts/data-fetchers/local-tile-fetcher.d.ts +47 -0
- package/dist/app/scripts/gosling-exports.d.ts +17 -0
- package/dist/app/scripts/hglib.d.ts +24 -0
- package/dist/app/scripts/hocs/with-modal.d.ts +19 -0
- package/dist/app/scripts/hocs/with-pub-sub.d.ts +22 -0
- package/dist/app/scripts/hocs/with-theme.d.ts +13 -0
- package/dist/app/scripts/icons.d.ts +161 -0
- package/dist/app/scripts/mixwith.d.ts +27 -0
- package/dist/app/scripts/options-info.d.ts +1355 -0
- package/dist/app/scripts/plugins/available-for-plugins.d.ts +2338 -0
- package/dist/app/scripts/plugins/get-data-fetcher.d.ts +2 -0
- package/dist/app/scripts/plugins/index.d.ts +2 -0
- package/dist/app/scripts/services/chrom-info.d.ts +10 -0
- package/dist/app/scripts/services/dom-event.d.ts +7 -0
- package/dist/app/scripts/services/element-resize-listener.d.ts +5 -0
- package/dist/app/scripts/services/index.d.ts +5 -0
- package/dist/app/scripts/services/tile-proxy.d.ts +180 -0
- package/dist/app/scripts/services/worker.d.ts +157 -0
- package/dist/app/scripts/symbol.d.ts +13 -0
- package/dist/app/scripts/test-helpers/index.d.ts +1 -0
- package/dist/app/scripts/test-helpers/test-helpers.d.ts +33 -0
- package/dist/app/scripts/track-utils.d.ts +73 -0
- package/dist/app/scripts/types.d.ts +199 -0
- package/dist/app/scripts/utils/DenseDataExtrema1D.d.ts +88 -0
- package/dist/app/scripts/utils/DenseDataExtrema2D.d.ts +97 -0
- package/dist/app/scripts/utils/LruCache.d.ts +44 -0
- package/dist/app/scripts/utils/abs-to-chr.d.ts +14 -0
- package/dist/app/scripts/utils/accessor-transposition.d.ts +14 -0
- package/dist/app/scripts/utils/add-arrays.d.ts +18 -0
- package/dist/app/scripts/utils/add-class.d.ts +8 -0
- package/dist/app/scripts/utils/add-event-listener-once.d.ts +11 -0
- package/dist/app/scripts/utils/assert.d.ts +17 -0
- package/dist/app/scripts/utils/background-task-scheduler.d.ts +47 -0
- package/dist/app/scripts/utils/base64-to-canvas.d.ts +9 -0
- package/dist/app/scripts/utils/chr-to-abs.d.ts +10 -0
- package/dist/app/scripts/utils/chrom-info-bisector.d.ts +4 -0
- package/dist/app/scripts/utils/clone-event.d.ts +12 -0
- package/dist/app/scripts/utils/color-domain-to-rgba-array.d.ts +13 -0
- package/dist/app/scripts/utils/color-to-hex.d.ts +9 -0
- package/dist/app/scripts/utils/color-to-rgba.d.ts +9 -0
- package/dist/app/scripts/utils/copy-text-to-clipboard.d.ts +2 -0
- package/dist/app/scripts/utils/data-to-genomic-loci.d.ts +11 -0
- package/dist/app/scripts/utils/debounce.d.ts +5 -0
- package/dist/app/scripts/utils/dec-to-hex-str.d.ts +8 -0
- package/dist/app/scripts/utils/decompress.d.ts +27 -0
- package/dist/app/scripts/utils/default-tracks.d.ts +3 -0
- package/dist/app/scripts/utils/dict-from-tuples.d.ts +11 -0
- package/dist/app/scripts/utils/dict-items.d.ts +18 -0
- package/dist/app/scripts/utils/dict-keys.d.ts +10 -0
- package/dist/app/scripts/utils/dict-values.d.ts +8 -0
- package/dist/app/scripts/utils/download.d.ts +7 -0
- package/dist/app/scripts/utils/expand-combined-tracks.d.ts +11 -0
- package/dist/app/scripts/utils/fake-pub-sub.d.ts +11 -0
- package/dist/app/scripts/utils/fill-in-min-widths.d.ts +44 -0
- package/dist/app/scripts/utils/flatten.d.ts +9 -0
- package/dist/app/scripts/utils/for-each.d.ts +9 -0
- package/dist/app/scripts/utils/forward-event.d.ts +7 -0
- package/dist/app/scripts/utils/genome-loci-to-pixels.d.ts +9 -0
- package/dist/app/scripts/utils/genomic-range-to-chromosome-chunks.d.ts +21 -0
- package/dist/app/scripts/utils/get-aggregation-function.d.ts +10 -0
- package/dist/app/scripts/utils/get-default-track-for-datatype.d.ts +21 -0
- package/dist/app/scripts/utils/get-default-tracks-for-datatype.d.ts +3 -0
- package/dist/app/scripts/utils/get-element-dim.d.ts +7 -0
- package/dist/app/scripts/utils/get-higlass-components.d.ts +7 -0
- package/dist/app/scripts/utils/get-track-by-uid.d.ts +7 -0
- package/dist/app/scripts/utils/get-track-conf-from-hgc.d.ts +10 -0
- package/dist/app/scripts/utils/get-track-obj-by-id.d.ts +2 -0
- package/dist/app/scripts/utils/get-track-position-by-uid.d.ts +13 -0
- package/dist/app/scripts/utils/get-xylofon.d.ts +2 -0
- package/dist/app/scripts/utils/gradient.d.ts +14 -0
- package/dist/app/scripts/utils/has-class.d.ts +8 -0
- package/dist/app/scripts/utils/has-parent.d.ts +9 -0
- package/dist/app/scripts/utils/hex-string-to-int.d.ts +14 -0
- package/dist/app/scripts/utils/index.d.ts +89 -0
- package/dist/app/scripts/utils/interval-tree.d.ts +109 -0
- package/dist/app/scripts/utils/into-the-void.d.ts +6 -0
- package/dist/app/scripts/utils/is-track-or-child-track.d.ts +7 -0
- package/dist/app/scripts/utils/is-track-range-selectable.d.ts +2 -0
- package/dist/app/scripts/utils/is-within.d.ts +12 -0
- package/dist/app/scripts/utils/lat-to-y.d.ts +9 -0
- package/dist/app/scripts/utils/lng-to-x.d.ts +8 -0
- package/dist/app/scripts/utils/load-chrom-infos.d.ts +8 -0
- package/dist/app/scripts/utils/map.d.ts +13 -0
- package/dist/app/scripts/utils/max-non-zero.d.ts +6 -0
- package/dist/app/scripts/utils/max.d.ts +10 -0
- package/dist/app/scripts/utils/min-non-zero.d.ts +6 -0
- package/dist/app/scripts/utils/min.d.ts +10 -0
- package/dist/app/scripts/utils/mod.d.ts +9 -0
- package/dist/app/scripts/utils/ndarray-assign.d.ts +2 -0
- package/dist/app/scripts/utils/ndarray-flatten.d.ts +2 -0
- package/dist/app/scripts/utils/ndarray-to-list.d.ts +2 -0
- package/dist/app/scripts/utils/numericify-version.d.ts +6 -0
- package/dist/app/scripts/utils/obj-vals.d.ts +8 -0
- package/dist/app/scripts/utils/or.d.ts +8 -0
- package/dist/app/scripts/utils/parse-chromsizes-rows.d.ts +34 -0
- package/dist/app/scripts/utils/pixi-text-to-svg.d.ts +2 -0
- package/dist/app/scripts/utils/positioned-tracks-to-all-tracks.d.ts +26 -0
- package/dist/app/scripts/utils/q.d.ts +18 -0
- package/dist/app/scripts/utils/rad-to-deg.d.ts +7 -0
- package/dist/app/scripts/utils/range-query-2d.d.ts +17 -0
- package/dist/app/scripts/utils/reduce.d.ts +14 -0
- package/dist/app/scripts/utils/rel-to-abs-chrom-pos.d.ts +10 -0
- package/dist/app/scripts/utils/remove-class.d.ts +7 -0
- package/dist/app/scripts/utils/reset-d3-brush-style.d.ts +10 -0
- package/dist/app/scripts/utils/rgb-to-hex.d.ts +8 -0
- package/dist/app/scripts/utils/scales-center-and-k.d.ts +12 -0
- package/dist/app/scripts/utils/scales-to-genome-loci.d.ts +3 -0
- package/dist/app/scripts/utils/segments-to-rows.d.ts +15 -0
- package/dist/app/scripts/utils/selected-items-to-cum-weights.d.ts +12 -0
- package/dist/app/scripts/utils/selected-items-to-size.d.ts +13 -0
- package/dist/app/scripts/utils/show-mouse-position.d.ts +54 -0
- package/dist/app/scripts/utils/some.d.ts +10 -0
- package/dist/app/scripts/utils/sum.d.ts +8 -0
- package/dist/app/scripts/utils/svg-line.d.ts +2 -0
- package/dist/app/scripts/utils/throttle-and-debounce.d.ts +33 -0
- package/dist/app/scripts/utils/tile-to-canvas.d.ts +9 -0
- package/dist/app/scripts/utils/timeout.d.ts +3 -0
- package/dist/app/scripts/utils/to-void.d.ts +3 -0
- package/dist/app/scripts/utils/total-track-pixel-height.d.ts +27 -0
- package/dist/app/scripts/utils/trim-trailing-slash.d.ts +7 -0
- package/dist/app/scripts/utils/type-guards.d.ts +36 -0
- package/dist/app/scripts/utils/value-to-color.d.ts +12 -0
- package/dist/app/scripts/utils/visit-positioned-tracks.d.ts +18 -0
- package/dist/app/scripts/utils/visit-tracks.d.ts +9 -0
- package/dist/esm.html +1 -3
- package/dist/hglib.js +86315 -100592
- package/dist/hglib.min.js +123 -131
- package/dist/higlass.mjs +88861 -103138
- package/dist/index.html +1 -3
- package/dist/package.json +134 -0
- package/package.json +25 -27
|
@@ -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,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,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,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,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,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,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,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,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,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,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
|
});
|