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/README.md
CHANGED
|
@@ -7,20 +7,31 @@
|
|
|
7
7
|
|
|
8
8
|
### Introduction
|
|
9
9
|
|
|
10
|
-
HiGlass is a web-based viewer for datasets too large to view at once.
|
|
11
|
-
|
|
12
|
-
for navigation across genomic loci and resolutions. It
|
|
13
|
-
genomic (e.g., Hi-C, ChIP-seq, or bed
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
HiGlass is a web-based viewer for datasets too large to view at once. It
|
|
11
|
+
features synchronized navigation of multiple views as well as continuous
|
|
12
|
+
zooming and panning for navigation across genomic loci and resolutions. It
|
|
13
|
+
supports visual comparison of genomic (e.g., Hi-C, ChIP-seq, or bed
|
|
14
|
+
annotations) and other data (e.g., geographic maps, gigapixel images, or
|
|
15
|
+
abstract 1D and 2D sequential data) from different experimental conditions and
|
|
16
|
+
can be used to efficiently identify salient outcomes of experimental
|
|
17
|
+
perturbations, generate new hypotheses, and share the results with the
|
|
18
|
+
community.
|
|
19
|
+
|
|
20
|
+
A live instance can be found at [https://higlass.io](https://higlass.io). A
|
|
21
|
+
[Docker container](https://github.com/higlass/higlass-docker) is available for
|
|
22
|
+
running an instance locally, although we recommend using the
|
|
23
|
+
[higlass-manage](https://github.com/pkerpedjiev/higlass-manage) package to
|
|
24
|
+
start, stop and configure local instances.
|
|
25
|
+
|
|
26
|
+
For documentation about how to use and install HiGlass, please visit
|
|
27
|
+
[https://docs.higlass.io](https://docs.higlass.io).
|
|
20
28
|
|
|
21
29
|
### Citation
|
|
22
30
|
|
|
23
|
-
Kerpedjiev, P., Abdennur, N., Lekschas, F., McCallum, C., Dinkla, K., Strobelt,
|
|
31
|
+
Kerpedjiev, P., Abdennur, N., Lekschas, F., McCallum, C., Dinkla, K., Strobelt,
|
|
32
|
+
H., ... & Gehlenborg, N. *HiGlass: Web-based Visual Exploration and Analysis of
|
|
33
|
+
Genome Interaction Maps.* Genome Biology (2018): 19:125.
|
|
34
|
+
https://doi.org/10.1186/s13059-018-1486-1
|
|
24
35
|
|
|
25
36
|
### Example
|
|
26
37
|
|
|
@@ -34,7 +45,7 @@ To run higlass from its source code simply run the following:
|
|
|
34
45
|
|
|
35
46
|
```
|
|
36
47
|
npm clean-install // use --legacy-peer-deps if you get peer dependency errors
|
|
37
|
-
npm
|
|
48
|
+
npm start
|
|
38
49
|
```
|
|
39
50
|
|
|
40
51
|
This starts a server in development mode at http://localhost:5173/.
|
|
@@ -44,26 +55,16 @@ This starts a server in development mode at http://localhost:5173/.
|
|
|
44
55
|
> Once started, a list of the examples can be found at [http://localhost:8080/examples.html](http://localhost:8080/examples.html).
|
|
45
56
|
> Template viewconfs located at `/docs/examples/viewconfs` can viewed directly at urls such as [http://localhost:8080/apis/svg.html?/viewconfs/overlay-tracks.json](http://localhost:8080/apis/svg.html?/viewconfs/overlay-tracks.json).
|
|
46
57
|
|
|
47
|
-
|
|
48
58
|
### Tests
|
|
49
59
|
|
|
50
|
-
The tests for the React components and API functions are located in the `test`
|
|
51
|
-
Tests are run with [`
|
|
60
|
+
The tests for the React components and API functions are located in the `test`
|
|
61
|
+
directory. Tests are run with [`vitest`](https://vitest.dev/).
|
|
52
62
|
|
|
53
63
|
Useful commands:
|
|
54
64
|
|
|
55
|
-
- Run all tests: `npm test`
|
|
56
|
-
- Run all tests in interactive "watch" mode: `npm test -- --watch`
|
|
57
|
-
- Run a specific test or "glob" of tests: `npm test -- test/APITests.js [--watch]`
|
|
58
|
-
- Manually run individual tests in an open browser window: `npm test -- --manual`
|
|
59
|
-
|
|
60
|
-
**Troubleshooting:**
|
|
61
|
-
|
|
62
|
-
- If the installation fails due to `sharp` > `node-gyp` try installing the node packages using `python2`:
|
|
65
|
+
- Run all tests in the browser: `npm test -- --browser.headless=false`
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
npm ci --python=/usr/bin/python2 && rm -rf node_modules/node-sass && npm ci
|
|
66
|
-
```
|
|
67
|
+
See the [contributing guide](./CONTRIBUTING.md) to learn more.
|
|
67
68
|
|
|
68
69
|
### API
|
|
69
70
|
|
|
@@ -71,34 +72,27 @@ HiGlass provides an API for controlling the component from with JavaScript. Belo
|
|
|
71
72
|
|
|
72
73
|
```html
|
|
73
74
|
<!DOCTYPE html>
|
|
74
|
-
<head>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<script>
|
|
96
|
-
const hgApi = window.hglib.viewer(
|
|
97
|
-
document.body,
|
|
98
|
-
'https://higlass.io/api/v1/viewconfs/?d=default',
|
|
99
|
-
{ bounded: true },
|
|
100
|
-
);
|
|
101
|
-
</script>
|
|
75
|
+
<head>
|
|
76
|
+
<meta charset="utf-8">
|
|
77
|
+
<title>Minimal Working Example · HiGlass</title>
|
|
78
|
+
<style type="text/css">
|
|
79
|
+
html, body {
|
|
80
|
+
width: 100vw;
|
|
81
|
+
height: 100vh;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
85
|
+
</head>
|
|
86
|
+
<body></body>
|
|
87
|
+
<script type="module">
|
|
88
|
+
import * as hglib from "https://esm.sh/higlass@1.13";
|
|
89
|
+
|
|
90
|
+
const api = hglib.viewer(
|
|
91
|
+
document.body,
|
|
92
|
+
'https://higlass.io/api/v1/viewconfs/?d=default',
|
|
93
|
+
{ bounded: true },
|
|
94
|
+
);
|
|
95
|
+
</script>
|
|
102
96
|
</html>
|
|
103
97
|
```
|
|
104
98
|
|
package/app/globals.d.ts
CHANGED
package/app/missing-types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
// https://www.npmjs.com/package/pub-sub-es
|
|
3
2
|
declare module 'pub-sub-es' {
|
|
3
|
+
// biome-ignore lint/suspicious/noExplicitAny: Inherited API
|
|
4
4
|
type EventMap = { [name: string]: any };
|
|
5
5
|
export type Subscription = {
|
|
6
6
|
event: string;
|
|
7
|
+
// biome-ignore lint/suspicious/noExplicitAny: Inherited API
|
|
7
8
|
handler: (news: any) => void;
|
|
8
9
|
};
|
|
9
10
|
type PublishOptions = {
|
|
@@ -11,7 +12,9 @@ declare module 'pub-sub-es' {
|
|
|
11
12
|
isNoGlobalBroadCast?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export type PubSub = {
|
|
15
|
+
// biome-ignore lint/suspicious/noExplicitAny: Inherited API
|
|
14
16
|
publish(event: string, news?: any, options?: PublishOptions): void;
|
|
17
|
+
// biome-ignore lint/suspicious/noExplicitAny: Inherited API
|
|
15
18
|
subscribe(event: string, handler: (news: any) => void): Subscription;
|
|
16
19
|
unsubscribe(subscription: Subscription): void;
|
|
17
20
|
clear(): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import Dialog from './Dialog';
|
|
6
|
-
import TilesetFinder from './TilesetFinder';
|
|
7
6
|
import PlotTypeChooser from './PlotTypeChooser';
|
|
7
|
+
import TilesetFinder from './TilesetFinder';
|
|
8
8
|
|
|
9
9
|
// Configs
|
|
10
10
|
import { AVAILABLE_TRACK_TYPES } from './configs';
|
|
@@ -15,7 +15,7 @@ import { getDefaultTrackForDatatype } from './utils';
|
|
|
15
15
|
// Styles
|
|
16
16
|
import '../styles/AddTrackDialog.module.scss';
|
|
17
17
|
|
|
18
|
-
class AddTrackDialog extends React.Component {
|
|
18
|
+
export class AddTrackDialog extends React.Component {
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
|
|
@@ -67,6 +67,7 @@ class AddTrackDialog extends React.Component {
|
|
|
67
67
|
this.props.onTracksChosen(
|
|
68
68
|
this.state.selectedTilesets,
|
|
69
69
|
this.props.position,
|
|
70
|
+
this.props.extent,
|
|
70
71
|
this.props.host,
|
|
71
72
|
);
|
|
72
73
|
}
|
|
@@ -86,6 +87,7 @@ class AddTrackDialog extends React.Component {
|
|
|
86
87
|
this.props.onTracksChosen(
|
|
87
88
|
this.state.selectedTilesets,
|
|
88
89
|
this.props.position,
|
|
90
|
+
this.props.extent,
|
|
89
91
|
this.props.host,
|
|
90
92
|
);
|
|
91
93
|
}
|
|
@@ -172,7 +174,11 @@ class AddTrackDialog extends React.Component {
|
|
|
172
174
|
datatype={this.props.datatype}
|
|
173
175
|
onDoubleClick={this.handleTilesetPickerDoubleClick.bind(this)}
|
|
174
176
|
onTracksChosen={(value) =>
|
|
175
|
-
this.props.onTracksChosen(
|
|
177
|
+
this.props.onTracksChosen(
|
|
178
|
+
value,
|
|
179
|
+
this.props.position,
|
|
180
|
+
this.props.extent,
|
|
181
|
+
)
|
|
176
182
|
}
|
|
177
183
|
orientation={orientation}
|
|
178
184
|
selectedTilesetChanged={this.selectedTilesetsChanged.bind(this)}
|
|
@@ -223,6 +229,7 @@ AddTrackDialog.defaultProps = {
|
|
|
223
229
|
|
|
224
230
|
AddTrackDialog.propTypes = {
|
|
225
231
|
datatype: PropTypes.string,
|
|
232
|
+
extent: PropTypes.string,
|
|
226
233
|
host: PropTypes.string,
|
|
227
234
|
onCancel: PropTypes.func.isRequired,
|
|
228
235
|
onTracksChosen: PropTypes.func.isRequired,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
import withTheme from './hocs/with-theme';
|
|
7
6
|
import { THEME_DARK } from './configs';
|
|
7
|
+
import withTheme from './hocs/with-theme';
|
|
8
8
|
|
|
9
9
|
import classes from '../styles/AddTrackPositionMenu.module.scss';
|
|
10
10
|
|
|
@@ -42,11 +42,32 @@ function AddTrackPositionMenu(props) {
|
|
|
42
42
|
>
|
|
43
43
|
left
|
|
44
44
|
</td>
|
|
45
|
-
<td
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
<td className={classes['add-track-position-middle-middle']}>
|
|
46
|
+
<span
|
|
47
|
+
onClick={() => props.onTrackPositionChosen('center')}
|
|
48
|
+
className={classes['add-track-position-middle-middle-full']}
|
|
49
|
+
data-testid="add-track-center"
|
|
50
|
+
>
|
|
51
|
+
center
|
|
52
|
+
</span>
|
|
53
|
+
<span
|
|
54
|
+
onClick={() =>
|
|
55
|
+
props.onTrackPositionChosen('center', 'upper-right')
|
|
56
|
+
}
|
|
57
|
+
className={
|
|
58
|
+
classes['add-track-position-middle-middle-upper-right']
|
|
59
|
+
}
|
|
60
|
+
data-testid="add-track-upper-right"
|
|
61
|
+
/>
|
|
62
|
+
<span
|
|
63
|
+
onClick={() =>
|
|
64
|
+
props.onTrackPositionChosen('center', 'lower-left')
|
|
65
|
+
}
|
|
66
|
+
className={
|
|
67
|
+
classes['add-track-position-middle-middle-lower-left']
|
|
68
|
+
}
|
|
69
|
+
data-testid="add-track-lower-left"
|
|
70
|
+
/>
|
|
50
71
|
</td>
|
|
51
72
|
<td
|
|
52
73
|
className={classes['add-track-position-middle-right']}
|
|
@@ -1,271 +1,110 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import polygonArea from 'area-polygon';
|
|
3
|
+
import classifyPoint from 'robust-point-in-polygon';
|
|
4
|
+
|
|
5
|
+
import BedLikeTrack, { polyToPoly } from './BedLikeTrack';
|
|
6
|
+
|
|
7
|
+
/** Find out which rects are under a point.
|
|
8
|
+
*
|
|
9
|
+
* @param {track} The track object
|
|
10
|
+
* @param {x} x position to check (relative to track)
|
|
11
|
+
* @param {y} y position to check (relative to track)
|
|
12
|
+
* @return {[]} An array of drawnRects that are under that point
|
|
13
|
+
*/
|
|
14
|
+
export const rectsAtPoint = (track, x, y) => {
|
|
15
|
+
const drawnRects = Object.values(track.drawnRects);
|
|
16
|
+
const point = [x, y];
|
|
17
|
+
const payloads = [];
|
|
18
|
+
const g = track.rectGraphics;
|
|
19
|
+
|
|
20
|
+
for (const drawnRect of drawnRects) {
|
|
21
|
+
// copy the rect because polyToPoly is destructive
|
|
22
|
+
const rect = drawnRect[0].slice(0);
|
|
23
|
+
|
|
24
|
+
const poly = polyToPoly(
|
|
25
|
+
rect,
|
|
26
|
+
g.scale.x,
|
|
27
|
+
g.position.x,
|
|
28
|
+
g.scale.y,
|
|
29
|
+
g.position.y,
|
|
30
|
+
);
|
|
31
|
+
const area = polygonArea(poly);
|
|
32
|
+
|
|
33
|
+
if (classifyPoint(poly, point) === -1) {
|
|
34
|
+
const payload = drawnRect[1];
|
|
35
|
+
payload.area = area;
|
|
36
|
+
|
|
37
|
+
payloads.push(payload);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
4
40
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// click events with out current setup. Since most UIs treat long clicks as
|
|
8
|
-
// either something special or a cancelation we follow best practices and
|
|
9
|
-
// implement a threshold on the delay as well.
|
|
10
|
-
import { GLOBALS, MAX_CLICK_DELAY } from './configs';
|
|
41
|
+
return payloads;
|
|
42
|
+
};
|
|
11
43
|
|
|
12
|
-
class Annotations1dTrack extends
|
|
44
|
+
class Annotations1dTrack extends BedLikeTrack {
|
|
13
45
|
constructor(context, options, isVertical) {
|
|
14
46
|
super(context, options);
|
|
15
|
-
|
|
16
|
-
this.pubSub = context.pubSub;
|
|
17
|
-
this.options = options;
|
|
18
|
-
this.isVertical = isVertical;
|
|
19
|
-
|
|
20
|
-
this.rects = {};
|
|
21
|
-
|
|
22
|
-
this.defaultColor = color('red');
|
|
23
47
|
}
|
|
24
48
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
? color(this.options.fill)
|
|
34
|
-
: this.defaultColor;
|
|
35
|
-
|
|
36
|
-
const globalFillOpacity =
|
|
37
|
-
typeof this.options.fillOpacity !== 'undefined'
|
|
38
|
-
? +this.options.fillOpacity
|
|
39
|
-
: 0.2;
|
|
40
|
-
|
|
41
|
-
const globalStroke =
|
|
42
|
-
typeof this.options.stroke !== 'undefined'
|
|
43
|
-
? color(this.options.stroke)
|
|
44
|
-
: this.defaultColor;
|
|
45
|
-
|
|
46
|
-
const globalStrokeWidth =
|
|
47
|
-
typeof this.options.strokeWidth !== 'undefined'
|
|
48
|
-
? +this.options.strokeWidth
|
|
49
|
-
: 1;
|
|
50
|
-
|
|
51
|
-
const globalStrokeOpacity =
|
|
52
|
-
typeof this.options.strokeOpacity !== 'undefined'
|
|
53
|
-
? +this.options.strokeOpacity
|
|
54
|
-
: 0;
|
|
55
|
-
|
|
56
|
-
let strokePos;
|
|
57
|
-
if (this.options.strokePos && this.options.strokePos.length) {
|
|
58
|
-
strokePos = Array.isArray(this.options.strokePos)
|
|
59
|
-
? this.options.strokePos
|
|
60
|
-
: [this.options.strokePos];
|
|
49
|
+
rerender(options, force) {
|
|
50
|
+
if (options && options.projectUid !== this.options.projectUid) {
|
|
51
|
+
// we're filtering by a new project id so we have to
|
|
52
|
+
// re-fetch the tiles
|
|
53
|
+
this.options = options;
|
|
54
|
+
this.fetchedTiles = {};
|
|
55
|
+
this.refreshTiles();
|
|
56
|
+
return;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
super.
|
|
64
|
-
|
|
65
|
-
graphics.clear();
|
|
66
|
-
|
|
67
|
-
// The time stamp is used to keep track which rectangles have been drawn per
|
|
68
|
-
// draw call. Each rectangle previously drawn that is not visible anymore
|
|
69
|
-
// (i.e., is not drawn in the current draw call) will be removed at the end
|
|
70
|
-
// by checking against the time stamp.
|
|
71
|
-
const timeStamp = performance.now();
|
|
72
|
-
|
|
73
|
-
// Regions have to follow the following form:
|
|
74
|
-
// start, end, fill, stroke, fillOpacity, strokeOpcaity, min-size
|
|
75
|
-
// If `color-line` is not given, `color-fill` is used
|
|
76
|
-
this.options.regions.forEach((region) => {
|
|
77
|
-
const id = `${region[0]}-${region[1]}`;
|
|
78
|
-
|
|
79
|
-
if (!this.rects[id]) {
|
|
80
|
-
this.rects[id] = { graphics: new GLOBALS.PIXI.Graphics() };
|
|
81
|
-
graphics.addChild(this.rects[id].graphics);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
this.rects[id].timeStamp = timeStamp;
|
|
85
|
-
|
|
86
|
-
const fill = color(region[2]) || globalFill;
|
|
87
|
-
let stroke = color(region[3]) || globalStroke;
|
|
88
|
-
|
|
89
|
-
if (!stroke) {
|
|
90
|
-
stroke = fill;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const fillHex = GLOBALS.PIXI.utils.rgb2hex([
|
|
94
|
-
fill.r / 255.0,
|
|
95
|
-
fill.g / 255.0,
|
|
96
|
-
fill.b / 255.0,
|
|
97
|
-
]);
|
|
98
|
-
const strokeHex = GLOBALS.PIXI.utils.rgb2hex([
|
|
99
|
-
stroke.r / 255.0,
|
|
100
|
-
stroke.g / 255.0,
|
|
101
|
-
stroke.b / 255.0,
|
|
102
|
-
]);
|
|
103
|
-
|
|
104
|
-
if (strokePos) {
|
|
105
|
-
graphics.lineStyle(1, strokeHex, 0);
|
|
106
|
-
graphics.beginFill(strokeHex, +region[5] || globalStrokeOpacity);
|
|
107
|
-
} else {
|
|
108
|
-
graphics.lineStyle(
|
|
109
|
-
globalStrokeWidth,
|
|
110
|
-
strokeHex,
|
|
111
|
-
+region[5] || globalStrokeOpacity,
|
|
112
|
-
);
|
|
113
|
-
graphics.beginFill(fillHex, +region[4] || globalFillOpacity);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const scale = this.isVertical ? this._yScale : this._xScale;
|
|
117
|
-
|
|
118
|
-
let start = scale(+region[0]);
|
|
119
|
-
const end = scale(+region[1]);
|
|
120
|
-
|
|
121
|
-
let width = end - start;
|
|
122
|
-
|
|
123
|
-
const minRectWidth =
|
|
124
|
-
typeof region[6] !== 'undefined' ? region[6] : globalMinRectWidth;
|
|
125
|
-
|
|
126
|
-
if (width < minRectWidth) {
|
|
127
|
-
// this region is too small to draw so center it on the location
|
|
128
|
-
// where it would be drawn
|
|
129
|
-
start = (start + end) / 2 - minRectWidth / 2;
|
|
130
|
-
width = minRectWidth;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (strokePos) {
|
|
134
|
-
graphics.lineStyle(1, strokeHex, 0);
|
|
135
|
-
graphics.beginFill(strokeHex, +region[5] || globalStrokeOpacity);
|
|
136
|
-
|
|
137
|
-
strokePos.forEach((pos) => {
|
|
138
|
-
if (pos === 'top' || pos === 'around') {
|
|
139
|
-
if (this.isVertical) {
|
|
140
|
-
graphics.drawRect(0, start, globalStrokeWidth, width);
|
|
141
|
-
} else {
|
|
142
|
-
graphics.drawRect(start, 0, width, globalStrokeWidth);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (pos === 'right' || pos === 'around') {
|
|
147
|
-
if (this.isVertical) {
|
|
148
|
-
graphics.drawRect(
|
|
149
|
-
0,
|
|
150
|
-
start,
|
|
151
|
-
this.dimensions[0],
|
|
152
|
-
globalStrokeWidth,
|
|
153
|
-
);
|
|
154
|
-
} else {
|
|
155
|
-
graphics.drawRect(
|
|
156
|
-
start,
|
|
157
|
-
0,
|
|
158
|
-
globalStrokeWidth,
|
|
159
|
-
this.dimensions[1],
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (pos === 'bottom' || pos === 'around') {
|
|
165
|
-
if (this.isVertical) {
|
|
166
|
-
graphics.drawRect(
|
|
167
|
-
this.dimensions[0] - globalStrokeWidth,
|
|
168
|
-
start,
|
|
169
|
-
globalStrokeWidth,
|
|
170
|
-
width,
|
|
171
|
-
);
|
|
172
|
-
} else {
|
|
173
|
-
graphics.drawRect(
|
|
174
|
-
start,
|
|
175
|
-
this.dimensions[1] - globalStrokeWidth,
|
|
176
|
-
width,
|
|
177
|
-
globalStrokeWidth,
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (pos === 'left' || pos === 'around') {
|
|
183
|
-
if (this.isVertical) {
|
|
184
|
-
graphics.drawRect(
|
|
185
|
-
0,
|
|
186
|
-
start + width - globalStrokeWidth,
|
|
187
|
-
this.dimensions[0],
|
|
188
|
-
globalStrokeWidth,
|
|
189
|
-
);
|
|
190
|
-
} else {
|
|
191
|
-
graphics.drawRect(
|
|
192
|
-
start + width - globalStrokeWidth,
|
|
193
|
-
0,
|
|
194
|
-
globalStrokeWidth,
|
|
195
|
-
this.dimensions[1],
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
} else {
|
|
201
|
-
graphics.lineStyle(
|
|
202
|
-
globalStrokeWidth,
|
|
203
|
-
strokeHex,
|
|
204
|
-
+region[5] || globalStrokeOpacity,
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Make annotation clickable
|
|
209
|
-
this.rects[id].graphics.clear();
|
|
210
|
-
this.rects[id].graphics.interactive = true;
|
|
211
|
-
this.rects[id].graphics.buttonMode = true;
|
|
212
|
-
|
|
213
|
-
graphics.beginFill(fillHex, +region[4] || globalFillOpacity);
|
|
214
|
-
if (this.isVertical) {
|
|
215
|
-
graphics.drawRect(0, start, this.dimensions[0], width);
|
|
216
|
-
this.rects[id].graphics.hitArea = new GLOBALS.PIXI.Rectangle(
|
|
217
|
-
0,
|
|
218
|
-
start,
|
|
219
|
-
this.dimensions[0],
|
|
220
|
-
width,
|
|
221
|
-
);
|
|
222
|
-
} else {
|
|
223
|
-
graphics.drawRect(start, 0, width, this.dimensions[1]);
|
|
224
|
-
this.rects[id].graphics.hitArea = new GLOBALS.PIXI.Rectangle(
|
|
225
|
-
start,
|
|
226
|
-
0,
|
|
227
|
-
width,
|
|
228
|
-
this.dimensions[1],
|
|
229
|
-
);
|
|
230
|
-
}
|
|
59
|
+
super.rerender(options, force);
|
|
60
|
+
}
|
|
231
61
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
62
|
+
/*
|
|
63
|
+
* The local tile identifier
|
|
64
|
+
*/
|
|
65
|
+
tileToLocalId(tile) {
|
|
66
|
+
// tile contains [zoomLevel, xPos, yPos]
|
|
67
|
+
return this.tileToRemoteId(tile);
|
|
68
|
+
}
|
|
235
69
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
});
|
|
70
|
+
/**
|
|
71
|
+
* The tile identifier used on the server
|
|
72
|
+
*/
|
|
73
|
+
tileToRemoteId(tile) {
|
|
74
|
+
// tile contains [zoomLevel, xPos, yPos]
|
|
75
|
+
let tileId = `${tile.join('.')}`;
|
|
76
|
+
|
|
77
|
+
if (this.options.projectUid) {
|
|
78
|
+
// include the projectUid in the options
|
|
79
|
+
// (resgen feature)
|
|
80
|
+
tileId = `${tileId}.ui=${this.options.projectUid}`;
|
|
81
|
+
}
|
|
249
82
|
|
|
250
|
-
|
|
251
|
-
// time stamp stored above.
|
|
252
|
-
Object.values(this.rects)
|
|
253
|
-
.filter((rect) => rect.timeStamp !== timeStamp)
|
|
254
|
-
.forEach((rect) => graphics.removeChild(rect.graphics));
|
|
83
|
+
return tileId;
|
|
255
84
|
}
|
|
256
85
|
|
|
257
|
-
|
|
258
|
-
|
|
86
|
+
/**
|
|
87
|
+
* @param {x} x position of the evt relative to the track
|
|
88
|
+
* @param {y} y position of the evt relative to the track
|
|
89
|
+
*/
|
|
90
|
+
click(x, y) {
|
|
91
|
+
const rects = rectsAtPoint(this, x, y);
|
|
92
|
+
|
|
93
|
+
if (!rects.length) {
|
|
94
|
+
this.selectRect(null);
|
|
95
|
+
} else {
|
|
96
|
+
this.selectRect(rects[0].value.uid);
|
|
97
|
+
}
|
|
259
98
|
|
|
260
|
-
|
|
261
|
-
|
|
99
|
+
return {
|
|
100
|
+
type: '1d-annotations',
|
|
101
|
+
event: null,
|
|
102
|
+
payload: rects,
|
|
103
|
+
};
|
|
262
104
|
}
|
|
263
105
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
this.yScale(newYScale);
|
|
267
|
-
|
|
268
|
-
this.draw();
|
|
106
|
+
render() {
|
|
107
|
+
super.render();
|
|
269
108
|
}
|
|
270
109
|
}
|
|
271
110
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
|
|
2
3
|
import createPubSub from 'pub-sub-es';
|
|
3
4
|
|
|
4
5
|
import TiledPixiTrack from './TiledPixiTrack';
|
|
@@ -41,13 +42,11 @@ class Annotations2dTrack extends TiledPixiTrack {
|
|
|
41
42
|
/* --------------------------- Getter / Setter ---------------------------- */
|
|
42
43
|
|
|
43
44
|
get minX() {
|
|
44
|
-
return this.tilesetInfo
|
|
45
|
-
? this.tilesetInfo.min_pos[0]
|
|
46
|
-
: 0;
|
|
45
|
+
return this.tilesetInfo?.min_pos ? this.tilesetInfo.min_pos[0] : 0;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
get maxX() {
|
|
50
|
-
return this.tilesetInfo
|
|
49
|
+
return this.tilesetInfo?.max_pos
|
|
51
50
|
? this.tilesetInfo.max_pos[0]
|
|
52
51
|
: this.tilesetInfo.max_width || this.tilesetInfo.max_size;
|
|
53
52
|
}
|
|
@@ -420,7 +419,10 @@ class Annotations2dTrack extends TiledPixiTrack {
|
|
|
420
419
|
prevUid = this.selectedAnno.uid;
|
|
421
420
|
}
|
|
422
421
|
|
|
423
|
-
this.selectedAnno = {
|
|
422
|
+
this.selectedAnno = {
|
|
423
|
+
graphics,
|
|
424
|
+
uid,
|
|
425
|
+
};
|
|
424
426
|
this.focus(graphics, viewPos, uid);
|
|
425
427
|
|
|
426
428
|
if (this.options.onSelect && !silent) {
|
|
@@ -468,8 +470,11 @@ class Annotations2dTrack extends TiledPixiTrack {
|
|
|
468
470
|
track.appendChild(output);
|
|
469
471
|
|
|
470
472
|
this.visibleAndFetchedTiles()
|
|
471
|
-
.filter((tile) => tile.tileData
|
|
472
|
-
.map((tile) => ({
|
|
473
|
+
.filter((tile) => tile.tileData?.length)
|
|
474
|
+
.map((tile) => ({
|
|
475
|
+
graphics: tile.graphics,
|
|
476
|
+
td: tile.tileData,
|
|
477
|
+
}))
|
|
473
478
|
.forEach(({ td, graphics }) => {
|
|
474
479
|
const gTile = document.createElement('g');
|
|
475
480
|
|