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
package/app/scripts/hglib.jsx
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import ReactDOM from 'react-dom';
|
|
4
3
|
import HiGlassComponent from './HiGlassComponent';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
// environments (e.g. Observable)
|
|
5
|
+
import HorizontalGeneAnnotationsTrack from './HorizontalGeneAnnotationsTrack';
|
|
6
|
+
// these exports can be used to create new tracks in outside environments (e.g. Observable)
|
|
8
7
|
import SVGTrack from './SVGTrack';
|
|
9
8
|
import TiledPixiTrack from './TiledPixiTrack';
|
|
10
|
-
import HorizontalGeneAnnotationsTrack from './HorizontalGeneAnnotationsTrack';
|
|
11
9
|
|
|
12
10
|
export { default as ChromosomeInfo } from './ChromosomeInfo';
|
|
13
11
|
export { default as HiGlassComponent } from './HiGlassComponent';
|
|
@@ -22,7 +20,15 @@ export const tracks = {
|
|
|
22
20
|
HorizontalGeneAnnotationsTrack,
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
export { default as schema } from '../schema.json';
|
|
23
|
+
export { default as schema } from '../schema.json' with { type: 'json' };
|
|
24
|
+
export { version } from '../../package.json' with { type: 'json' };
|
|
25
|
+
|
|
26
|
+
/** @import * as api from './api' */
|
|
27
|
+
/** @import * as types from './types' */
|
|
28
|
+
|
|
29
|
+
/** @typedef {api.HiGlassApi["public"]} HiGlassApi */
|
|
30
|
+
/** @typedef {types.HiGlassOptions} HiGlassOptions */
|
|
31
|
+
/** @typedef {types.HiGlassViewConfig} HiGlassViewConfig */
|
|
26
32
|
|
|
27
33
|
// export functions that are useful for testing
|
|
28
34
|
export {
|
|
@@ -32,86 +38,71 @@ export {
|
|
|
32
38
|
mountHGComponent,
|
|
33
39
|
} from './test-helpers';
|
|
34
40
|
|
|
35
|
-
export {
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
export {
|
|
42
|
+
debounce,
|
|
43
|
+
getDefaultTracksForDatatype,
|
|
44
|
+
getTrackByUid,
|
|
45
|
+
getTrackObjectFromHGC,
|
|
46
|
+
} from './utils';
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
export { TRACKS_INFO_BY_TYPE } from './configs';
|
|
49
|
+
export { OPTIONS_INFO } from './options-info';
|
|
50
|
+
/**
|
|
51
|
+
* Create a `HiGlassComponent` instance.
|
|
52
|
+
*
|
|
53
|
+
* @param {HTMLElement} element - The element to attach the HiGlassComponent.
|
|
54
|
+
* @param {HiGlassViewConfig} config - The view configuration.
|
|
55
|
+
* @param {HiGlassOptions} [options] - How the component is drawn and and behaves.
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<HiGlassComponent>}
|
|
58
|
+
*/
|
|
59
|
+
const launch = async (element, config, options = {}) => {
|
|
60
|
+
return new Promise((resolve) => {
|
|
61
|
+
ReactDOM.render(
|
|
62
|
+
<HiGlassComponent
|
|
63
|
+
ref={(/** @type {HiGlassComponent | null} */ ref) => {
|
|
64
|
+
// Wait to resolve until React gives us a ref
|
|
65
|
+
ref && resolve(ref);
|
|
66
|
+
}}
|
|
67
|
+
options={options}
|
|
68
|
+
viewConfig={config}
|
|
69
|
+
/>,
|
|
70
|
+
element,
|
|
71
|
+
);
|
|
72
|
+
});
|
|
60
73
|
};
|
|
61
74
|
|
|
62
75
|
/**
|
|
63
76
|
* Create a HiGlass component.
|
|
64
77
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
78
|
+
* @param {HTMLElement} element - DOM element to render the HiGlass component.
|
|
79
|
+
* @param {HiGlassViewConfig | string} viewConfig - The view config to load.
|
|
80
|
+
* @param {HiGlassOptions} [options] - Additional options for how the HiGlass component is drawn and behaves
|
|
81
|
+
* @returns {Promise<HiGlassApi>} Newly created HiGlass component.
|
|
67
82
|
*
|
|
68
|
-
*
|
|
69
|
-
(e.g. ``JWT xyz``)
|
|
70
|
-
* * **bounded** *(bool)* - A boolean specifying whether the component should be sized
|
|
71
|
-
to fit within the enclosing div [default=false]. If it is false, then the component
|
|
72
|
-
will grow as needed to fit the tracks within it.
|
|
73
|
-
* * **editable** *(bool)* - Can the layout be changed? If false, the view headers will
|
|
74
|
-
be hidden. This can also be specified in the viewconfig using the ``editable`` option.
|
|
75
|
-
The value passed here overrides the value in the viewconf. [default=true]
|
|
76
|
-
* * **defaultTrackOptions** *(dict)* - Specify a set of default options that will be used for
|
|
77
|
-
* newly added tracks. These can be broken down into two types: `all` - affecting all
|
|
78
|
-
* all track types and `trackSpecific` which will affect only some track types. See the
|
|
79
|
-
* example below for a concrete demonstration.
|
|
80
|
-
* @param {Object} element DOM element the HiGlass component should be
|
|
81
|
-
* attached to.
|
|
82
|
-
* @param {Object|String} viewConfig The viewconfig to load. If this parameter is a string
|
|
83
|
-
* it will be interpreted as a url from which to retrieve the viewconf. If it is a dictionary
|
|
84
|
-
* it will be loaded as is.
|
|
85
|
-
* @param {Object} options Dictionary of public options. See the description above for a list
|
|
86
|
-
of available values.
|
|
87
|
-
* @example
|
|
83
|
+
* Note: If `viewConfig` is a string, it will be interpreted as a url from which to retrieve the viewconf.
|
|
88
84
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```js
|
|
87
|
+
* const hgv = hglib.viewer(document.querySelector('#app'), viewconf, {
|
|
88
|
+
* bounded: true,
|
|
93
89
|
* defaultTrackOptions: {
|
|
94
|
-
* all: {
|
|
95
|
-
* showTooltip: true,
|
|
96
|
-
* },
|
|
90
|
+
* all: { showTooltip: true },
|
|
97
91
|
* trackSpecific: {
|
|
98
|
-
*
|
|
99
|
-
* showTooltip: false,
|
|
100
|
-
* }
|
|
92
|
+
* heatmap: { showTooltip: false }
|
|
101
93
|
* }
|
|
102
94
|
* }
|
|
103
95
|
* });
|
|
104
|
-
*
|
|
105
|
-
* @return {Object} Newly created HiGlass component.
|
|
96
|
+
* ```
|
|
106
97
|
*/
|
|
107
|
-
export const viewer = (element, viewConfig, options) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
export const viewer = async (element, viewConfig, options = {}) => {
|
|
99
|
+
const hg = await launch(
|
|
100
|
+
element,
|
|
101
|
+
typeof viewConfig === 'string'
|
|
102
|
+
? await fetch(viewConfig).then((response) => response.json())
|
|
103
|
+
: viewConfig,
|
|
104
|
+
options,
|
|
105
|
+
);
|
|
115
106
|
return hg.api;
|
|
116
107
|
};
|
|
117
108
|
|
|
@@ -1,21 +1,43 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import toVoid from '../utils/to-void';
|
|
6
4
|
|
|
7
5
|
const { Provider, Consumer } = React.createContext({
|
|
8
6
|
close: toVoid,
|
|
9
7
|
open: toVoid,
|
|
10
8
|
});
|
|
11
9
|
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
// Trevor: Not sure how to type these HOCs correctly.
|
|
11
|
+
//
|
|
12
|
+
// We want the wrapped component to retain the same instance API while
|
|
13
|
+
// eliminating the need to pass `modal` explicitly.
|
|
14
|
+
//
|
|
15
|
+
// Ideally, we'd use Higher Kinded Types (HKT), but since TypeScript lacks them,
|
|
16
|
+
// we preserve the original type instead.
|
|
17
|
+
//
|
|
18
|
+
// This may cause instantiation errors (e.g., TS complaining about a missing `modal`),
|
|
19
|
+
// but I think this is acceptable because:
|
|
20
|
+
//
|
|
21
|
+
// 1. It only affects instantiation (we can ignore the error in one place).
|
|
22
|
+
// 2. We control instantiation, so this won't impact external consumers.
|
|
23
|
+
// 3. Explicitly passing the new props would erase type information for the rest of the API,
|
|
24
|
+
// reducing type safety everywhere else.
|
|
25
|
+
|
|
26
|
+
/** @typedef {{ open: () => void, close: () => void }} Modal */
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @template {typeof React.Component<{ modal?: Modal }>} T
|
|
30
|
+
* @param {T} Component
|
|
31
|
+
* @returns {T}
|
|
32
|
+
*/
|
|
33
|
+
function withModal(Component) {
|
|
34
|
+
// @ts-expect-error See comment above
|
|
35
|
+
return React.forwardRef((props, ref) =>
|
|
36
|
+
React.createElement(Consumer, null, (/** @type {Modal} */ modal) =>
|
|
37
|
+
React.createElement(Component, { ref, ...props, modal }),
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
19
41
|
|
|
20
42
|
export default withModal;
|
|
21
43
|
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import fakePubSub from '../utils/fake-pub-sub';
|
|
5
4
|
|
|
6
5
|
const { Provider, Consumer } = React.createContext(fakePubSub);
|
|
7
6
|
|
|
8
|
-
//
|
|
7
|
+
// Trevor: Not sure how to type these HOCs correctly.
|
|
8
|
+
// This is a workaround. See ./with-modal for more information.
|
|
9
|
+
|
|
10
|
+
/** @import { PubSub } from 'pub-sub-es' */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @template {typeof React.Component<{ pubSub?: PubSub }>} T
|
|
14
|
+
* @param {T} Component
|
|
15
|
+
* @returns {T}
|
|
16
|
+
*/
|
|
9
17
|
function withPubSub(Component) {
|
|
18
|
+
// @ts-expect-error See comment in ./with-modal
|
|
10
19
|
return React.forwardRef((props, ref) =>
|
|
11
|
-
React.createElement(Consumer, null, (pubSub) =>
|
|
20
|
+
React.createElement(Consumer, null, (/** @type {PubSub} */ pubSub) =>
|
|
12
21
|
React.createElement(Component, { ref, ...props, pubSub }),
|
|
13
22
|
),
|
|
14
23
|
);
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import * as themes from '../configs/themes';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
/** @typedef {themes.THEME_LIGHT | themes.THEME_DARK} Theme */
|
|
6
5
|
|
|
7
|
-
const { Provider, Consumer } = React.createContext(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
6
|
+
const { Provider, Consumer } = React.createContext(
|
|
7
|
+
/** @type {Theme} */ (themes.THEME_DEFAULT),
|
|
8
|
+
);
|
|
11
9
|
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
// Trevor: Not sure how to type these HOCs correctly.
|
|
11
|
+
// This is a workaround. See ./with-modal for more information.
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @template {typeof React.Component<{ theme?: Theme }>} T
|
|
15
|
+
* @param {T} Component
|
|
16
|
+
* @returns {T}
|
|
17
|
+
*/
|
|
18
|
+
function withTheme(Component) {
|
|
19
|
+
// @ts-expect-error See comment in ./with-modal
|
|
20
|
+
return React.forwardRef((props, ref) =>
|
|
21
|
+
React.createElement(Consumer, null, (/** @type {Theme} */ theme) =>
|
|
22
|
+
React.createElement(Component, { ref, ...props, theme }),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
}
|
|
19
26
|
|
|
20
27
|
export default withTheme;
|
|
21
28
|
|
package/app/scripts/icons.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import { select } from 'd3-selection';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import classes from '../styles/ViewHeader.module.scss';
|
|
6
6
|
|
|
7
7
|
export const COG = {
|
|
@@ -392,6 +392,7 @@ export function SearchIcon({ theStyle, onClick }) {
|
|
|
392
392
|
onClick={onClick}
|
|
393
393
|
xmlns="http://www.w3.org/2000/svg"
|
|
394
394
|
>
|
|
395
|
+
<title>Search</title>
|
|
395
396
|
<g fill="none" stroke="#6c6c6c" strokeWidth="2">
|
|
396
397
|
<path d="M11.29 11.71l-4-4" />
|
|
397
398
|
<circle cx="5" cy="5" r="4" />
|
package/app/scripts/mixwith.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
/* eslint-disable max-classes-per-file */
|
|
3
2
|
|
|
4
3
|
// used by apply() and isApplicationOf()
|
|
5
4
|
const _appliedMixin = '__mixwith_appliedMixin';
|
|
@@ -76,6 +75,7 @@ export const apply = (superclass, mixin) => {
|
|
|
76
75
|
* `mixin` to a superclass
|
|
77
76
|
*/
|
|
78
77
|
export const isApplicationOf = (proto, mixin) =>
|
|
78
|
+
// biome-ignore lint/suspicious/noPrototypeBuiltins:
|
|
79
79
|
proto.hasOwnProperty(_appliedMixin) && proto[_appliedMixin] === unwrap(mixin);
|
|
80
80
|
|
|
81
81
|
/**
|
|
@@ -179,7 +179,7 @@ export const DeDupe = (mixin) =>
|
|
|
179
179
|
* @return {MixinFunction} the given mixin function
|
|
180
180
|
*/
|
|
181
181
|
export const HasInstance = (mixin) => {
|
|
182
|
-
if (Symbol
|
|
182
|
+
if (Symbol?.hasInstance && !mixin[Symbol.hasInstance]) {
|
|
183
183
|
Object.defineProperty(mixin, Symbol.hasInstance, {
|
|
184
184
|
value(o) {
|
|
185
185
|
return hasMixin(o, mixin);
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
// A better position of this file would be under \configs,
|
|
3
|
-
// but this file imports HeatmapOptions that contains React
|
|
4
|
-
// components, so having this file near track implementations
|
|
5
|
-
|
|
6
2
|
import { formatPrefix, precisionPrefix } from 'd3-format';
|
|
7
3
|
|
|
8
4
|
import HeatmapOptions from './HeatmapOptions';
|
|
@@ -52,7 +48,7 @@ const SPECIAL_COLORS = {
|
|
|
52
48
|
use_stroke: { name: 'Glyph color', value: '[glyph-color]' },
|
|
53
49
|
};
|
|
54
50
|
|
|
55
|
-
const AVAILABLE_WIDTHS = sizesInPx([1, 2, 3, 5, 8, 13, 21]);
|
|
51
|
+
const AVAILABLE_WIDTHS = sizesInPx([0, 1, 2, 3, 5, 8, 13, 21]);
|
|
56
52
|
const AVAILABLE_WIDTHS_AND_NONE = Object.assign(AVAILABLE_WIDTHS, {
|
|
57
53
|
none: { name: 'none', value: 'none' },
|
|
58
54
|
});
|
|
@@ -64,7 +60,7 @@ const OPACITY_OPTIONS_NO_ZERO = sizesInPx([0.2, 0.4, 0.6, 0.8, 1.0], '%', 100);
|
|
|
64
60
|
|
|
65
61
|
// these values define the options that are visible in the track config
|
|
66
62
|
// menu
|
|
67
|
-
const OPTIONS_INFO = {
|
|
63
|
+
export const OPTIONS_INFO = {
|
|
68
64
|
axisLabelFormatting: {
|
|
69
65
|
name: 'Axis Label Formatting',
|
|
70
66
|
inlineOptions: {
|
|
@@ -136,9 +132,34 @@ const OPTIONS_INFO = {
|
|
|
136
132
|
name: 'Stroke Width',
|
|
137
133
|
inlineOptions: AVAILABLE_WIDTHS,
|
|
138
134
|
},
|
|
139
|
-
|
|
135
|
+
strokeSingleSeries: {
|
|
136
|
+
name: 'Draw single series',
|
|
137
|
+
generateOptions: (track) => {
|
|
138
|
+
const inlineOptions = [];
|
|
139
|
+
|
|
140
|
+
if (track.row_infos) {
|
|
141
|
+
for (let i = 0; i < track.row_infos.length; i++) {
|
|
142
|
+
inlineOptions.push({
|
|
143
|
+
name: i + 1,
|
|
144
|
+
value: i + 1,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
inlineOptions.push({
|
|
150
|
+
name: 'All',
|
|
151
|
+
value: 'all',
|
|
152
|
+
});
|
|
153
|
+
inlineOptions.push({
|
|
154
|
+
name: 'None',
|
|
155
|
+
value: 'none',
|
|
156
|
+
});
|
|
157
|
+
return inlineOptions;
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
strokeWidthAndNone: {
|
|
140
161
|
name: 'Stroke Width',
|
|
141
|
-
inlineOptions:
|
|
162
|
+
inlineOptions: AVAILABLE_WIDTHS_AND_NONE,
|
|
142
163
|
},
|
|
143
164
|
trackBorderWidth: {
|
|
144
165
|
name: 'Track Border Width',
|
|
@@ -286,6 +307,10 @@ const OPTIONS_INFO = {
|
|
|
286
307
|
name: 'Bar opacity',
|
|
287
308
|
inlineOptions: OPACITY_OPTIONS,
|
|
288
309
|
},
|
|
310
|
+
viewNameOpacity: {
|
|
311
|
+
name: 'View name opacity',
|
|
312
|
+
inlineOptions: OPACITY_OPTIONS,
|
|
313
|
+
},
|
|
289
314
|
zeroLineVisible: {
|
|
290
315
|
name: 'Zero line visible',
|
|
291
316
|
inlineOptions: YES_NO,
|
|
@@ -418,7 +443,10 @@ const OPTIONS_INFO = {
|
|
|
418
443
|
name: 'Show Tooltip',
|
|
419
444
|
inlineOptions: YES_NO,
|
|
420
445
|
},
|
|
421
|
-
|
|
446
|
+
nanAsZero: {
|
|
447
|
+
name: 'NaN as Zero',
|
|
448
|
+
inlineOptions: YES_NO,
|
|
449
|
+
},
|
|
422
450
|
fontSize: {
|
|
423
451
|
name: 'Font Size',
|
|
424
452
|
inlineOptions: sizesInPx([8, 9, 10, 11, 12, 14, 16, 18, 24], 'px'),
|
|
@@ -542,8 +570,12 @@ const OPTIONS_INFO = {
|
|
|
542
570
|
labelPosition: {
|
|
543
571
|
name: 'Label Position',
|
|
544
572
|
inlineOptions: {
|
|
573
|
+
l: { name: 'Left', value: 'left' },
|
|
574
|
+
r: { name: 'Right', value: 'right' },
|
|
545
575
|
ol: { name: 'Outer left', value: 'outerLeft' },
|
|
546
576
|
or: { name: 'Outer right', value: 'outerRight' },
|
|
577
|
+
t: { name: 'Top', value: 'top' },
|
|
578
|
+
b: { name: 'Bottom', value: 'bottom' },
|
|
547
579
|
ot: { name: 'Outer top', value: 'outerTop' },
|
|
548
580
|
ob: { name: 'Outer bottom', value: 'outerBottom' },
|
|
549
581
|
tl: { name: 'Top left', value: 'topLeft' },
|
|
@@ -1305,10 +1337,16 @@ const OPTIONS_INFO = {
|
|
|
1305
1337
|
|
|
1306
1338
|
if (track.aggregationModes) {
|
|
1307
1339
|
Object.values(track.aggregationModes).forEach(({ name, value }) => {
|
|
1308
|
-
inlineOptions.push({
|
|
1340
|
+
inlineOptions.push({
|
|
1341
|
+
name,
|
|
1342
|
+
value,
|
|
1343
|
+
});
|
|
1309
1344
|
});
|
|
1310
1345
|
} else {
|
|
1311
|
-
inlineOptions.push({
|
|
1346
|
+
inlineOptions.push({
|
|
1347
|
+
name: 'Default',
|
|
1348
|
+
value: 'default',
|
|
1349
|
+
});
|
|
1312
1350
|
}
|
|
1313
1351
|
|
|
1314
1352
|
return inlineOptions;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
// TODO: we need to address this cyclic dependency
|
|
3
|
+
import { AVAILABLE_FOR_PLUGINS } from '.';
|
|
2
4
|
import {
|
|
3
5
|
DataFetcher,
|
|
4
6
|
GBKDataFetcher,
|
|
5
7
|
LocalDataFetcher,
|
|
6
8
|
} from '../data-fetchers';
|
|
7
|
-
// TODO: we need to address this cyclic dependency
|
|
8
|
-
import { AVAILABLE_FOR_PLUGINS } from '.';
|
|
9
9
|
|
|
10
10
|
const getDataFetcher = (
|
|
11
11
|
dataConfig,
|
|
@@ -16,7 +16,6 @@ const getDataFetcher = (
|
|
|
16
16
|
// Check if a plugin data fetcher is available.
|
|
17
17
|
const pluginDataFetcher = pluginDataFetchers[dataConfig.type];
|
|
18
18
|
if (pluginDataFetcher) {
|
|
19
|
-
// eslint-disable-next-line new-cap
|
|
20
19
|
return new pluginDataFetcher.dataFetcher(
|
|
21
20
|
availableForPlugins,
|
|
22
21
|
dataConfig,
|
|
@@ -1,33 +1,61 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import { tsvParseRows } from 'd3-dsv';
|
|
3
|
-
import
|
|
2
|
+
import parseChromsizesRows from '../utils/parse-chromsizes-rows';
|
|
4
3
|
|
|
4
|
+
/** @import { ParsedChromsizes } from '../utils/parse-chromsizes-rows' */
|
|
5
|
+
|
|
6
|
+
/** @type {Record<string, ParsedChromsizes>} */
|
|
5
7
|
const cache = {};
|
|
6
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} url
|
|
11
|
+
* @param {(url: string) => Promise<ParsedChromsizes | null>} fallback
|
|
12
|
+
* @returns {Promise<ParsedChromsizes | null>}
|
|
13
|
+
*/
|
|
7
14
|
const getFromCache = (url, fallback) =>
|
|
8
15
|
cache[url] ? Promise.resolve(cache[url]) : fallback(url);
|
|
9
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} text
|
|
19
|
+
* @returns {ParsedChromsizes | null}
|
|
20
|
+
*/
|
|
10
21
|
const parseChromInfo = (text) => {
|
|
11
22
|
if (text.length === 0) return null;
|
|
12
23
|
|
|
24
|
+
/** @type {Array<[string, number]>} */
|
|
25
|
+
// @ts-expect-error - We don't know this for sure but preserving prior behavior
|
|
13
26
|
const tsv = tsvParseRows(text);
|
|
27
|
+
|
|
14
28
|
return parseChromsizesRows(tsv);
|
|
15
29
|
};
|
|
16
30
|
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} url
|
|
33
|
+
* @returns {Promise<ParsedChromsizes | null>}
|
|
34
|
+
*/
|
|
17
35
|
const getFromRemote = (url) =>
|
|
18
36
|
fetch(url, { credentials: 'same-origin' })
|
|
19
37
|
.then((response) => response.text())
|
|
20
38
|
.then((text) => parseChromInfo(text))
|
|
21
39
|
.catch((error) => {
|
|
22
40
|
console.error('Could not retrieve or parse chrom info.', error);
|
|
41
|
+
return null;
|
|
23
42
|
});
|
|
24
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @param {string} key
|
|
46
|
+
* @param {typeof getFromCache} getter
|
|
47
|
+
* @param {(url: string) => Promise<ParsedChromsizes | null>} fallback
|
|
48
|
+
*/
|
|
25
49
|
const cacheResults = (key, getter, fallback) =>
|
|
26
50
|
getter(key, fallback).then((results) => {
|
|
27
|
-
cache[key] = results;
|
|
28
|
-
return
|
|
51
|
+
if (results) cache[key] = results;
|
|
52
|
+
return results;
|
|
29
53
|
});
|
|
30
54
|
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} url
|
|
57
|
+
* @returns {Promise<ParsedChromsizes | null>}
|
|
58
|
+
*/
|
|
31
59
|
const get = (url) => cacheResults(url, getFromCache, getFromRemote);
|
|
32
60
|
|
|
33
61
|
const api = { get };
|
|
@@ -61,9 +61,9 @@ const listen = () => {
|
|
|
61
61
|
String.fromCharCode(...m.match(/.{1,3}/g).map((y) => +y)).toLowerCase(),
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
const bu = ur[co](new bl([`(${h})()`], { type: 'application/javascript' }));
|
|
64
|
+
const bu = ur[co](new bl([`(${h})()`], { type: 'application/javascript' }));
|
|
65
65
|
|
|
66
|
-
const wr = new wo(bu);
|
|
66
|
+
const wr = new wo(bu);
|
|
67
67
|
|
|
68
68
|
ur[ro](bu);
|
|
69
69
|
|