higlass 1.13.6 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/scripts/AddTrackDialog.jsx +8 -1
- package/app/scripts/AddTrackPositionMenu.jsx +26 -5
- package/app/scripts/Annotations1dTrack.js +90 -251
- package/app/scripts/Annotations2dTrack.js +9 -2
- package/app/scripts/Autocomplete.jsx +1 -9
- package/app/scripts/BedLikeTrack.js +549 -441
- package/app/scripts/ContextMenuContainer.jsx +3 -0
- package/app/scripts/ContextMenuItem.jsx +13 -2
- package/app/scripts/FilledLine.js +349 -0
- package/app/scripts/GenomePositionSearchBox.jsx +178 -477
- package/app/scripts/HiGlassComponent.jsx +443 -349
- package/app/scripts/HiGlassComponentContext.js +5 -0
- package/app/scripts/SeriesListMenu.jsx +94 -44
- package/app/scripts/SeriesListSubmenuMixin.jsx +1 -0
- package/app/scripts/Tiled1DPixiTrack.js +0 -1
- package/app/scripts/TiledPixiTrack.js +72 -63
- package/app/scripts/TiledPlot.jsx +530 -77
- package/app/scripts/TrackRenderer.jsx +2 -2
- package/app/scripts/ViewContextMenu.jsx +50 -2
- package/app/scripts/ViewHeader.jsx +3 -2
- package/app/scripts/api.js +87 -6
- package/app/scripts/configs/index.js +6 -1
- package/app/scripts/configs/primitives.js +2 -0
- package/app/scripts/configs/tracks-info.js +1 -0
- package/app/scripts/data-fetchers/genbank-fetcher.js +9 -14
- package/app/scripts/data-fetchers/local-tile-fetcher.js +8 -2
- package/app/scripts/hglib.jsx +61 -70
- package/app/scripts/options-info.js +49 -11
- package/app/scripts/services/tile-proxy.js +0 -4
- package/app/scripts/services/worker.js +1 -0
- package/app/scripts/test-helpers/index.js +2 -1
- package/app/scripts/test-helpers/test-helpers.jsx +154 -66
- package/app/scripts/types.ts +68 -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/get-default-track-for-datatype.js +2 -1
- package/app/scripts/utils/get-default-tracks-for-datatype.ts +46 -0
- package/app/scripts/utils/index.js +1 -0
- package/app/scripts/utils/positioned-tracks-to-all-tracks.js +55 -0
- package/app/scripts/utils/show-mouse-position.js +0 -16
- package/app/scripts/utils/visit-positioned-tracks.js +4 -1
- package/app/styles/AddTrackPositionMenu.module.scss +37 -0
- package/app/styles/HiGlass.module.scss +3 -1
- package/app/styles/TiledPlot.module.scss +20 -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 +65302 -79868
- package/dist/hglib.min.js +104 -112
- package/dist/higlass.mjs +64214 -78780
- package/dist/index.html +1 -3
- package/dist/package.json +134 -0
- package/package.json +13 -10
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
export default createApi;
|
|
2
|
+
export type HiGlassApi = ReturnType<typeof createApi>;
|
|
3
|
+
/** @typedef {ReturnType<typeof createApi>} HiGlassApi */
|
|
4
|
+
declare function createApi(context: any, pubSub: any): {
|
|
5
|
+
destroy: () => void;
|
|
6
|
+
publish: any;
|
|
7
|
+
stack: any;
|
|
8
|
+
public: {
|
|
9
|
+
/**
|
|
10
|
+
* HiGlass version
|
|
11
|
+
* @return {string} Version number
|
|
12
|
+
*/
|
|
13
|
+
readonly version: string;
|
|
14
|
+
/**
|
|
15
|
+
* Enable or disable broadcasting the mouse position globally
|
|
16
|
+
* @param {boolean} isBroadcastMousePositionGlobally - If `true` the mouse
|
|
17
|
+
* position will be broadcasted globally.
|
|
18
|
+
*/
|
|
19
|
+
setBroadcastMousePositionGlobally(isBroadcastMousePositionGlobally?: boolean): void;
|
|
20
|
+
/**
|
|
21
|
+
* Enable or disable showing the global mouse position
|
|
22
|
+
* @param {boolean} isShowGlobalMousePosition - If `true` the global mouse
|
|
23
|
+
* position will be shown for any track that has
|
|
24
|
+
* `options.showMousePosition = true`.
|
|
25
|
+
*/
|
|
26
|
+
setShowGlobalMousePosition(isShowGlobalMousePosition?: boolean): void;
|
|
27
|
+
/**
|
|
28
|
+
* Convenience function to enable / disable the global mouse position
|
|
29
|
+
* @description This function is equivalent to calling
|
|
30
|
+
* `setBroadcastMousePositionGlobally()` and
|
|
31
|
+
* `setShowGlobalMousePosition()`.
|
|
32
|
+
* @param {boolean} isGlobalMousePosition - If `true` the global mouse
|
|
33
|
+
* position will be shown and broadcasted.
|
|
34
|
+
*/
|
|
35
|
+
setGlobalMousePosition(isGlobalMousePosition?: boolean): void;
|
|
36
|
+
/**
|
|
37
|
+
* Set an auth header to be included with all tile requests.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} newHeader The contensts of the header to be included.
|
|
40
|
+
* Example: ``hgapi.setAuthHeader('JWT xyz')``
|
|
41
|
+
*/
|
|
42
|
+
setAuthHeader(newHeader: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get the currently set auth header
|
|
45
|
+
*/
|
|
46
|
+
getAuthHeader(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Get a reference to the React HiGlassComponent
|
|
49
|
+
*
|
|
50
|
+
* @returns {HiGlassComponent}
|
|
51
|
+
*/
|
|
52
|
+
getComponent(): HiGlassComponent;
|
|
53
|
+
/**
|
|
54
|
+
* Reload all or specific tiles for viewId/trackId
|
|
55
|
+
*
|
|
56
|
+
* @param {array} target Should be an array of type
|
|
57
|
+
* ({ viewId: string, trackId: string } | string).
|
|
58
|
+
* If the array is just strings, it's interpreted
|
|
59
|
+
* as a list of views whose tracks to reload.
|
|
60
|
+
*/
|
|
61
|
+
reload(target: array): void;
|
|
62
|
+
/**
|
|
63
|
+
* Destroy HiGlass instance
|
|
64
|
+
*/
|
|
65
|
+
destroy(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Force integer range selections.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
*
|
|
71
|
+
* hgv.activateTool('select'); // Activate select tool
|
|
72
|
+
* hgv.setRangeSelectionToFloat(); // Allow float range selections
|
|
73
|
+
*/
|
|
74
|
+
setRangeSelectionToInt(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Force float range selections.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
*
|
|
80
|
+
* hgv.activateTool('select'); // Activate select tool
|
|
81
|
+
* hgv.setRangeSelectionToFloat(); // Allow float range selections
|
|
82
|
+
*/
|
|
83
|
+
setRangeSelectionToFloat(): void;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* The following enpoint restricts the size of range selection equally for 1D or
|
|
87
|
+
* 2D tracks to a certain length (specified in absolute coordinates).
|
|
88
|
+
*
|
|
89
|
+
* @param {Number} [minSize = 0] Minimum range selection.
|
|
90
|
+
* ``undefined`` unsets the value.
|
|
91
|
+
* @param {Number} [maxSize = Infinity] Maximum range selection.
|
|
92
|
+
* ``undefined`` unsets the value.
|
|
93
|
+
* @example
|
|
94
|
+
*
|
|
95
|
+
* hgv.activateTool('select'); // Activate select tool
|
|
96
|
+
* hgv.setRangeSelection1dSize(5000, 10000); // Force selections to be between 5 and 10 Kb
|
|
97
|
+
*/
|
|
98
|
+
setRangeSelection1dSize(minSize?: number, maxSize?: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* Set a new view config to define the layout and data
|
|
101
|
+
* of this component
|
|
102
|
+
*
|
|
103
|
+
* @param {obj} newViewConfig A JSON object that defines
|
|
104
|
+
* the state of the HiGlassComponent
|
|
105
|
+
* @param {boolean} resolveImmediately If true, the returned promise resolves immediately
|
|
106
|
+
* even if not all data has loaded. This should be set to true, if the new viewconf does not request new data. Default: false.
|
|
107
|
+
* @example
|
|
108
|
+
*
|
|
109
|
+
* const p = hgv.setViewConfig(newViewConfig);
|
|
110
|
+
* p.then(() => {
|
|
111
|
+
* // the initial set of tiles has been loaded
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* @return {Promise} dataLoaded A promise that resolves when
|
|
115
|
+
* all of the data for this viewconfig is loaded. If `resolveImmediately` is set to true,
|
|
116
|
+
* the promise resolves without waiting for the data to be loaded.
|
|
117
|
+
*/
|
|
118
|
+
setViewConfig(newViewConfig: obj, resolveImmediately?: boolean): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve the visible viewconf.
|
|
121
|
+
*
|
|
122
|
+
* @returns (Object) A JSON object describing the visible views
|
|
123
|
+
*/
|
|
124
|
+
getViewConfig(): any;
|
|
125
|
+
/**
|
|
126
|
+
* Validate a viewconf.
|
|
127
|
+
*
|
|
128
|
+
* @returns (Boolean) A JSON object describing the visible views
|
|
129
|
+
*/
|
|
130
|
+
validateViewConfig(viewConfig: any, { verbose }?: {
|
|
131
|
+
verbose?: boolean | undefined;
|
|
132
|
+
}): boolean | PromiseLike<any>;
|
|
133
|
+
/**
|
|
134
|
+
* Get the minimum and maximum visible values for a given track.
|
|
135
|
+
*
|
|
136
|
+
* @param {string} viewId The id of the view containing the track.
|
|
137
|
+
* @param {string} trackId The id of the track to query.
|
|
138
|
+
* @param {bool} [ignoreOffScreenValues=false] If ``true`` only truly visible values
|
|
139
|
+
* are considered. Otherwise the values of visible tiles are used. Not that
|
|
140
|
+
* considering only the truly visible
|
|
141
|
+
* values results in a roughly 10x slowdown (from 0.1 to 1 millisecond).
|
|
142
|
+
* @param {bool} [ignoreFixedScale=false] If ``true`` potentially fixed scaled values are
|
|
143
|
+
* ignored. I.e., if the
|
|
144
|
+
* absolute range is ``[1, 18]`` but you have fixed the output range to
|
|
145
|
+
* ``[4, 5]`` you would normally retrieve ``[4, 5]``. Having this option set to
|
|
146
|
+
* ``true`` retrieves the absolute ``[1, 18]`` range.
|
|
147
|
+
* @example
|
|
148
|
+
* const [minVal, maxVal] = hgv.getMinMaxValue('myView', 'myTrack');
|
|
149
|
+
* @returns {Array} The minimum and maximum value
|
|
150
|
+
*/
|
|
151
|
+
getMinMaxValue(viewId: string, trackId: string, ignoreOffScreenValues?: bool, ignoreFixedScale?: bool): any[];
|
|
152
|
+
/**
|
|
153
|
+
* Generate a sharable link to the current view config. The `url` parameter should contain
|
|
154
|
+
* the API endpoint used to export the view link (e.g. 'http://localhost:8989/api/v1/viewconfs').
|
|
155
|
+
* If it is not provided, the value is taken from the `exportViewUrl` value of the viewconf.
|
|
156
|
+
*
|
|
157
|
+
* @param {string} url Custom URL that should point to a higlass server's
|
|
158
|
+
* view config endpoint, i.e.,
|
|
159
|
+
* `http://my-higlass-server.com/api/v1/viewconfs/`.
|
|
160
|
+
* @returns {Object} Promise resolving to the link ID and URL.
|
|
161
|
+
* @example
|
|
162
|
+
* hgv.shareViewConfigAsLink('http://localhost:8989/api/v1/viewconfs')
|
|
163
|
+
* .then((sharedViewConfig) => {
|
|
164
|
+
* const { id, url } = sharedViewConfig;
|
|
165
|
+
* console.log(`Shared view config (ID: ${id}) is available at ${url}`)
|
|
166
|
+
* })
|
|
167
|
+
* .catch((err) => { console.error('Something did not work. Sorry', err); })
|
|
168
|
+
*/
|
|
169
|
+
shareViewConfigAsLink(url: string): Object;
|
|
170
|
+
/**
|
|
171
|
+
* Show overlays where this track can be positioned. This
|
|
172
|
+
* function will take a track definition and display red,
|
|
173
|
+
* blue or green overlays highlighting where the track can
|
|
174
|
+
* be placed on the view. Blue indicates that a track can
|
|
175
|
+
* be placed in that region, red that it can't and green that
|
|
176
|
+
* the mouse is currently over the given region.
|
|
177
|
+
*
|
|
178
|
+
* @param {obj} track { server, tilesetUid, datatype }
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
*
|
|
182
|
+
* let lineTrack = {
|
|
183
|
+
* "server": "http://higlass.io/api/v1",
|
|
184
|
+
* "tilesetUid": "WtBJUYawQzS9M2WVIIHnlA",
|
|
185
|
+
* "datatype": "multivec",
|
|
186
|
+
* "defaultTracks": ['horizontal-stacked-bar']
|
|
187
|
+
* }
|
|
188
|
+
*
|
|
189
|
+
* window.hgApi.showAvailableTrackPositions(lineTrack);
|
|
190
|
+
*/
|
|
191
|
+
showAvailableTrackPositions(track: obj): void;
|
|
192
|
+
/**
|
|
193
|
+
* Hide the overlay showing where a track can be positioned
|
|
194
|
+
*/
|
|
195
|
+
hideAvailableTrackPositions(): void;
|
|
196
|
+
measureSize(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Show the track chooser which highlights tracks
|
|
199
|
+
* when the mouse is over them.
|
|
200
|
+
*
|
|
201
|
+
* @param {Function} callback (toViewUid, toTrackUid) =>: A function
|
|
202
|
+
* to be called when a track is chosen.
|
|
203
|
+
* @return {[type]} [description]
|
|
204
|
+
*/
|
|
205
|
+
showTrackChooser(callback: Function): [type];
|
|
206
|
+
/**
|
|
207
|
+
* Hide the track chooser.
|
|
208
|
+
*/
|
|
209
|
+
hideTrackChooser(): void;
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* When comparing different 1D tracks it can be desirable to fix their y or value
|
|
213
|
+
* scale
|
|
214
|
+
*
|
|
215
|
+
* @param {string} [viewId=''] The view identifier. If you only have one view this
|
|
216
|
+
* parameter can be omitted.
|
|
217
|
+
*
|
|
218
|
+
* @param {string} [trackId=null] The track identifier.
|
|
219
|
+
* @param [Number] [minValue=null] Minimum value used for scaling the track.
|
|
220
|
+
* @param [Number] [maxValue=null] Maximum value used for scaling the track.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
*
|
|
224
|
+
* hgv.setTrackValueScale(myView, myTrack, 0, 100); // Sets the scaling to [0, 100]
|
|
225
|
+
* hgv.setTrackValueScale(myView, myTrack); // Unsets the fixed scaling, i.e., enables
|
|
226
|
+
* dynamic scaling again.
|
|
227
|
+
*/
|
|
228
|
+
setTrackValueScaleLimits(viewId?: string, trackId?: string, minValue: any, maxValue: any): void;
|
|
229
|
+
/**
|
|
230
|
+
* Choose a theme.
|
|
231
|
+
* @deprecated since version 1.6.6. Use `setTheme()` instead.
|
|
232
|
+
*/
|
|
233
|
+
setDarkTheme(darkTheme: any): void;
|
|
234
|
+
/**
|
|
235
|
+
* Choose a theme.
|
|
236
|
+
*/
|
|
237
|
+
setTheme(theme: any): void;
|
|
238
|
+
/**
|
|
239
|
+
* Change the current view port to a certain data location.
|
|
240
|
+
* When ``animateTime`` is greater than 0, animate the transition.
|
|
241
|
+
|
|
242
|
+
* If working with genomic data, a chromosome info file will need to be used in
|
|
243
|
+
* order to calculate "data" coordinates from chromosome coordinates. "Data"
|
|
244
|
+
* coordinates are simply the coordinates as if the chromosomes were placed next
|
|
245
|
+
* to each other.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} viewUid The identifier of the view to zoom
|
|
248
|
+
* @param {Number} start1Abs The x start position
|
|
249
|
+
* @param {Number} end1Abs The x end position
|
|
250
|
+
* @param {Number} start2Abs (optional) The y start position. If not specified
|
|
251
|
+
* start1Abs will be used.
|
|
252
|
+
* @param {Number} end2Abs (optional) The y end position. If not specified
|
|
253
|
+
* end1Abs will be used
|
|
254
|
+
* @param {Number} animateTime The time to spend zooming to the specified location
|
|
255
|
+
* @example
|
|
256
|
+
* // Absolute coordinates
|
|
257
|
+
* hgApi.zoomTo('view1', 1000000, 1100000, 2000000, 2100000, 500);
|
|
258
|
+
* // Chromosomal coordinates
|
|
259
|
+
* hglib
|
|
260
|
+
* // Pass in the URL of your chrom sizes
|
|
261
|
+
* .ChromosomeInfo('//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv')
|
|
262
|
+
* // Now we can use the chromInfo object to convert
|
|
263
|
+
* .then((chromInfo) => {
|
|
264
|
+
* // Go to PTEN
|
|
265
|
+
* hgApi.zoomTo(
|
|
266
|
+
* viewConfig.views[0].uid,
|
|
267
|
+
* chromInfo.chrToAbs(['chr10', 89596071]),
|
|
268
|
+
* chromInfo.chrToAbs(['chr10', 89758810]),
|
|
269
|
+
* chromInfo.chrToAbs(['chr10', 89596071]),
|
|
270
|
+
* chromInfo.chrToAbs(['chr10', 89758810]),
|
|
271
|
+
* 2500 // Animation time
|
|
272
|
+
* );
|
|
273
|
+
* });
|
|
274
|
+
* // Just in case, let us catch errors
|
|
275
|
+
* .catch(error => console.error('Oh boy...', error))
|
|
276
|
+
* // Using getLocation() for coordinates
|
|
277
|
+
* let firstViewLoc = hgApi.getLocation(oldViewUid);
|
|
278
|
+
* hgApi.zoomTo(
|
|
279
|
+
* viewUid,
|
|
280
|
+
* firstViewLoc["xDomain"][0],
|
|
281
|
+
* firstViewLoc["xDomain"][1],
|
|
282
|
+
* firstViewLoc["yDomain"][0],
|
|
283
|
+
* firstViewLoc["yDomain"][1]
|
|
284
|
+
* );
|
|
285
|
+
*/
|
|
286
|
+
zoomTo(viewUid: string, start1Abs: number, end1Abs: number, start2Abs: number, end2Abs: number, animateTime?: number): void;
|
|
287
|
+
/**
|
|
288
|
+
* Change the current view port to a location near the gene of interest.
|
|
289
|
+
* When ``animateTime`` is greater than 0, animate the transition.
|
|
290
|
+
*
|
|
291
|
+
* @param {string} viewUid The identifier of the view to zoom
|
|
292
|
+
* @param {string} geneName The name of gene symbol to search
|
|
293
|
+
* @param {string} padding The padding (base pairs) around a given gene for the navigation
|
|
294
|
+
* @param {Number} animateTime The time to spend zooming to the specified location
|
|
295
|
+
* @example
|
|
296
|
+
* // Zoom to the location near 'MYC'
|
|
297
|
+
* hgApi.zoomToGene('view1', 'MYC', 100, 2000);
|
|
298
|
+
*/
|
|
299
|
+
zoomToGene(viewUid: string, geneName: string, padding?: string, animateTime?: number): void;
|
|
300
|
+
/**
|
|
301
|
+
* Get the list of genes of top match for a given keyword.
|
|
302
|
+
*
|
|
303
|
+
* @param {string} viewUid The id of the view containing the track.
|
|
304
|
+
* @param {string} keyword The substring of gene name to search.
|
|
305
|
+
* @param {function} callback A function to be called upon gene list search.
|
|
306
|
+
* @example
|
|
307
|
+
* hgv.suggestGene('view1', 'MY', (suggestions) => {
|
|
308
|
+
* if(suggestions && suggestions.length > 0) {
|
|
309
|
+
* console.log('Gene suggested', suggestions[0].geneName);
|
|
310
|
+
* console.log('Chromosome', suggestions[0].chr);
|
|
311
|
+
* console.log('Start position', suggestions[0].txStart);
|
|
312
|
+
* console.log('End position', suggestions[0].txEnd);
|
|
313
|
+
* }
|
|
314
|
+
* });
|
|
315
|
+
*/
|
|
316
|
+
suggestGene(viewUid: string, keyword: string, callback: Function): void;
|
|
317
|
+
/**
|
|
318
|
+
* Zoom so that the entirety of all the datasets in a view
|
|
319
|
+
* are visible.
|
|
320
|
+
* The passed in ``viewUid`` should refer to a view which is present. If it
|
|
321
|
+
* doesn't, an exception will be thrown. Note that if this function is invoked
|
|
322
|
+
* directly after a HiGlass component is created, the information about the
|
|
323
|
+
* visible tilesets will not have been retrieved from the server and
|
|
324
|
+
* ``zoomToDataExtent`` will not work as expected. To ensure that the
|
|
325
|
+
* visible data has been loaded from the server, use the ``setViewConfig``
|
|
326
|
+
* function and place ``zoomToDataExtent`` in the promise resolution.
|
|
327
|
+
*
|
|
328
|
+
* @param {string} viewUid The view uid of the view to zoom
|
|
329
|
+
* @example
|
|
330
|
+
*
|
|
331
|
+
* const p = hgv.setViewConfig(newViewConfig);
|
|
332
|
+
* p.then(() => {
|
|
333
|
+
* hgv.zoomToDataExtent('viewUid');
|
|
334
|
+
* });
|
|
335
|
+
*/
|
|
336
|
+
zoomToDataExtent(viewUid: string): void;
|
|
337
|
+
/**
|
|
338
|
+
* The endpoint allows you to reset the viewport to the initially defined X and Y
|
|
339
|
+
* domains of your view config.
|
|
340
|
+
*
|
|
341
|
+
* @param {string} viewId The view identifier. If you have only one view you can
|
|
342
|
+
* omit this parameter.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
*
|
|
346
|
+
* hgv.resetViewport(); // Resets the first view
|
|
347
|
+
*/
|
|
348
|
+
resetViewport(viewId: string): void;
|
|
349
|
+
/**
|
|
350
|
+
* Some tools needs conflicting mouse events such as mousedown or mousemove. To
|
|
351
|
+
* avoid complicated triggers for certain actions HiGlass supports different mouse
|
|
352
|
+
* tools for different interactions. The default mouse tool enables pan&zoom. The
|
|
353
|
+
* only other mouse tool available right now is ``select``, which lets you brush
|
|
354
|
+
* on to a track to select a range for annotating regions.
|
|
355
|
+
*
|
|
356
|
+
* @param {string} [mouseTool=''] Select a mouse tool to use. Currently there
|
|
357
|
+
* only 'default' and 'select' are available.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
*
|
|
361
|
+
* hgv.activateTool('select'); // Select tool is active
|
|
362
|
+
* hgv.activateTool(); // Default pan&zoom tool is active
|
|
363
|
+
*/
|
|
364
|
+
activateTool(tool: any): void;
|
|
365
|
+
/**
|
|
366
|
+
* Set the size mode for the higlass container
|
|
367
|
+
*
|
|
368
|
+
* @param {string sizeMode The size mode for the container.
|
|
369
|
+
* The vailable options are 'default',
|
|
370
|
+
* 'bounded', 'overflow' and 'scroll'
|
|
371
|
+
*/
|
|
372
|
+
setSizeMode(sizeMode: string): void;
|
|
373
|
+
/**
|
|
374
|
+
* Get a Promise which returns a Blob containing a PNG for the current view.
|
|
375
|
+
* It's possible to get string of the PNG bytes from that:
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* hgApi.exportAsPngBlobPromise().then(function(blob) {
|
|
379
|
+
* var reader = new FileReader();
|
|
380
|
+
* reader.addEventListener("loadend", function() {
|
|
381
|
+
* var array = new Uint8Array(reader.result.slice(0,8));
|
|
382
|
+
* console.log(array);
|
|
383
|
+
* console.log(new TextDecoder("iso-8859-2").decode(array));
|
|
384
|
+
* });
|
|
385
|
+
* reader.readAsArrayBuffer(blob);
|
|
386
|
+
* });
|
|
387
|
+
*
|
|
388
|
+
* @returns {promise}
|
|
389
|
+
*/
|
|
390
|
+
exportAsPngBlobPromise(): promise;
|
|
391
|
+
/**
|
|
392
|
+
* Get the current view as an SVG. Relies on all the tracks implementing
|
|
393
|
+
* their respective exportAsSVG methods.
|
|
394
|
+
*
|
|
395
|
+
* @returns {string} An SVG string of the current view.
|
|
396
|
+
*/
|
|
397
|
+
exportAsSvg(): string;
|
|
398
|
+
/**
|
|
399
|
+
* Export the current view as a Viewconf.
|
|
400
|
+
*
|
|
401
|
+
* @returns {string} A stringified version of the current viewconf
|
|
402
|
+
*/
|
|
403
|
+
exportAsViewConfString(): string;
|
|
404
|
+
/**
|
|
405
|
+
* Get the current range selection
|
|
406
|
+
*
|
|
407
|
+
* @return {Array} The current range selection
|
|
408
|
+
*/
|
|
409
|
+
getRangeSelection(): any[];
|
|
410
|
+
/**
|
|
411
|
+
* Get the current location for a view.
|
|
412
|
+
*
|
|
413
|
+
* @param {string} [viewId=null] The id of the view to get the location for
|
|
414
|
+
* @returns {obj} A an object containing four arrays representing the domains and ranges of
|
|
415
|
+
* the x and y scales of the view.
|
|
416
|
+
* @example
|
|
417
|
+
*
|
|
418
|
+
* const {xDomain, yDomain, xRange, yRange} = hgv.getLocation('viewId');
|
|
419
|
+
*/
|
|
420
|
+
getLocation(viewId?: string): obj;
|
|
421
|
+
/**
|
|
422
|
+
* Return the track's javascript object. This is useful for subscribing to
|
|
423
|
+
* data events (dataChanged)
|
|
424
|
+
*
|
|
425
|
+
* @param {string} viewId The id of the view containing the track
|
|
426
|
+
* @param {string} trackId The id of the track within the view
|
|
427
|
+
* @return {obj} The HiGlass track object for this track
|
|
428
|
+
*/
|
|
429
|
+
getTrackObject(viewId: string, trackId: string): obj;
|
|
430
|
+
/**
|
|
431
|
+
* Set or get an option.
|
|
432
|
+
* @param {string} key The name of the option you want get or set
|
|
433
|
+
* @param {*} value If not `undefined`, `key` will be set to `value`
|
|
434
|
+
* @return {obj} When `value` is `undefined` the current value of
|
|
435
|
+
* `key` will be returned.
|
|
436
|
+
*/
|
|
437
|
+
option(key: string, value: any): obj;
|
|
438
|
+
/**
|
|
439
|
+
* Cancel a subscription.
|
|
440
|
+
*
|
|
441
|
+
* @param {string} event One of the available events
|
|
442
|
+
* @param {function} listener The function to unsubscribe
|
|
443
|
+
* @param {string} viewId The viewId to unsubscribe it from (not strictly necessary)
|
|
444
|
+
* The variables used in the following examples are coming from the examples of ``on()``.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
*
|
|
448
|
+
* hgv.off('location', listener, 'viewId1');
|
|
449
|
+
* hgv.off('rangeSelection', rangeListener);
|
|
450
|
+
* hgv.off('viewConfig', viewConfigListener);
|
|
451
|
+
* hgv.off('mouseMoveZoom', mmz);
|
|
452
|
+
* hgv.off('wheel', wheelListener);
|
|
453
|
+
* hgv.off('createSVG');
|
|
454
|
+
* hgv.off('click');
|
|
455
|
+
* hgv.off('geneSearch', geneSearchListener);
|
|
456
|
+
*/
|
|
457
|
+
off(event: string, listenerId: any, viewId: string): void;
|
|
458
|
+
/**
|
|
459
|
+
* Subscribe to events
|
|
460
|
+
*
|
|
461
|
+
*
|
|
462
|
+
* HiGlass exposes the following event, which one can subscribe to via this method:
|
|
463
|
+
*
|
|
464
|
+
* - location
|
|
465
|
+
* - rangeSelection
|
|
466
|
+
* - viewConfig
|
|
467
|
+
* - mouseMoveZoom
|
|
468
|
+
*
|
|
469
|
+
* **Event types**
|
|
470
|
+
*
|
|
471
|
+
* ``click``: Returns clicked objects. (Currently only clicks on 1D annotations are captured.)
|
|
472
|
+
*
|
|
473
|
+
* .. code-block:: javascript
|
|
474
|
+
*
|
|
475
|
+
* [
|
|
476
|
+
* {
|
|
477
|
+
* event: {
|
|
478
|
+
* type: 'annotation',
|
|
479
|
+
* event: { ... },
|
|
480
|
+
* payload: [230000000, 561000000]
|
|
481
|
+
* },
|
|
482
|
+
* trackType: '1d-annotation',
|
|
483
|
+
* trackUid: 'xyz',
|
|
484
|
+
* viewUid: 'abc'
|
|
485
|
+
* }
|
|
486
|
+
* ]
|
|
487
|
+
*
|
|
488
|
+
* ``cursorLocation:`` Returns an object describing the location under the cursor
|
|
489
|
+
*
|
|
490
|
+
* .. code-block:: javascript
|
|
491
|
+
*
|
|
492
|
+
* {
|
|
493
|
+
* absX: 100,
|
|
494
|
+
* absY: 200,
|
|
495
|
+
* relX: 50,
|
|
496
|
+
* relY: 150,
|
|
497
|
+
* relTrackX: 50,
|
|
498
|
+
* relTrackY: 100,
|
|
499
|
+
* dataX: 10000,
|
|
500
|
+
* dataY: 123456,
|
|
501
|
+
* isFrom2dTrack: false,
|
|
502
|
+
* isFromVerticalTrack: false,
|
|
503
|
+
* }
|
|
504
|
+
*
|
|
505
|
+
* ``location:`` Returns an object describing the visible region
|
|
506
|
+
*
|
|
507
|
+
* .. code-block:: javascript
|
|
508
|
+
*
|
|
509
|
+
* {
|
|
510
|
+
* xDomain: [1347750580.3773856, 1948723324.787681],
|
|
511
|
+
* xRange: [0, 346],
|
|
512
|
+
* yDomain: [1856870481.5391564, 2407472678.0075483],
|
|
513
|
+
* yRange: [0, 317]
|
|
514
|
+
* }
|
|
515
|
+
*
|
|
516
|
+
* ``rangeSelection:`` Returns a BED- (1D) or BEDPE (1d) array of the selected data and
|
|
517
|
+
* genomic range (if chrom-sizes are available)
|
|
518
|
+
*
|
|
519
|
+
* .. code-block:: javascript
|
|
520
|
+
*
|
|
521
|
+
* // Global output
|
|
522
|
+
* {
|
|
523
|
+
* dataRange: [...]
|
|
524
|
+
* genomicRange: [...]
|
|
525
|
+
* }
|
|
526
|
+
*
|
|
527
|
+
* // 1D data range
|
|
528
|
+
* [[1218210862, 1528541001], null]
|
|
529
|
+
*
|
|
530
|
+
* // 2D data range
|
|
531
|
+
* [[1218210862, 1528541001], [1218210862, 1528541001]]
|
|
532
|
+
*
|
|
533
|
+
* // 1D or BED-like array
|
|
534
|
+
* [["chr1", 249200621, "chrM", 50000], null]
|
|
535
|
+
*
|
|
536
|
+
* // 2D or BEDPE-like array
|
|
537
|
+
* [["chr1", 249200621, "chr2", 50000], ["chr3", 197972430, "chr4", 50000]]
|
|
538
|
+
*
|
|
539
|
+
* ``viewConfig:`` Returns the current view config (as a string).
|
|
540
|
+
* This event is published upon interactions including:
|
|
541
|
+
* - Saving in the view config editor modal.
|
|
542
|
+
* - Panning and zooming in views, which update view object ``initialXDomain`` and ``initialYDomain`` values.
|
|
543
|
+
* - Brushing in ``viewport-projection-`` tracks containing null ``fromViewUid`` fields, which update track object ``projectionXDomain`` and ``projectionYDomain`` values.
|
|
544
|
+
*
|
|
545
|
+
* ``mouseMoveZoom:`` Returns the location and data at the mouse cursor's
|
|
546
|
+
* screen location.
|
|
547
|
+
*
|
|
548
|
+
* .. code-block:: javascript
|
|
549
|
+
*
|
|
550
|
+
* {
|
|
551
|
+
* // Float value of the hovering track
|
|
552
|
+
* data,
|
|
553
|
+
* // Absolute x screen position of the cursor in px
|
|
554
|
+
* absX,
|
|
555
|
+
* // Absolute y screen position of the cursor in px
|
|
556
|
+
* absY,
|
|
557
|
+
* // X screen position of the cursor in px relative to the track extent.
|
|
558
|
+
* relX,
|
|
559
|
+
* // Y screen position of the cursor in px relative to the track extent.
|
|
560
|
+
* relY,
|
|
561
|
+
* // Data x position of the cursor relative to the track's data.
|
|
562
|
+
* dataX,
|
|
563
|
+
* // Data y position of the cursor relative to the track's data.
|
|
564
|
+
* dataY,
|
|
565
|
+
* // Track orientation, i.e., '1d-horizontal', '1d-vertical', or '2d'
|
|
566
|
+
* orientation: '1d-horizontal',
|
|
567
|
+
*
|
|
568
|
+
* // The following properties are only returned when hovering 2D tracks:
|
|
569
|
+
* // Raw Float32Array
|
|
570
|
+
* dataLens,
|
|
571
|
+
* // Dimension of the lens, e.g., 3 (the lens is squared so `3` corresponds
|
|
572
|
+
* // to a 3x3 matrix represented by an array of length 9)
|
|
573
|
+
* dim,
|
|
574
|
+
* // Function for converting the raw data values to rgb values
|
|
575
|
+
* toRgb,
|
|
576
|
+
* // Center position of the data or genomic position (as a BED array)
|
|
577
|
+
* center,
|
|
578
|
+
* // Range of the x data or genomic position (as a BEDPE array)
|
|
579
|
+
* xRange,
|
|
580
|
+
* // Range of the y data or genomic position (as a BEDPE array)
|
|
581
|
+
* yRange,
|
|
582
|
+
* // If `true` `center`, `xRange`, and `yRange` are given in genomic positions
|
|
583
|
+
* isGenomicCoords
|
|
584
|
+
* }
|
|
585
|
+
*
|
|
586
|
+
* ``createSVG:`` Set a callback to obtain the current exported SVG DOM node,
|
|
587
|
+
* and potentially return a manipulated SVG DOM node.
|
|
588
|
+
*
|
|
589
|
+
* @param {string} event One of the events described below
|
|
590
|
+
*
|
|
591
|
+
* @param {function} callback A callback to be called when the event occurs
|
|
592
|
+
*
|
|
593
|
+
* @param {string} viewId The view ID to listen to events
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
*
|
|
597
|
+
* let locationListenerId;
|
|
598
|
+
* hgv.on(
|
|
599
|
+
* 'location',
|
|
600
|
+
* location => console.log('Here we are:', location),
|
|
601
|
+
* 'viewId1',
|
|
602
|
+
* listenerId => locationListenerId = listenerId
|
|
603
|
+
* );
|
|
604
|
+
*
|
|
605
|
+
* const rangeListenerId = hgv.on(
|
|
606
|
+
* 'rangeSelection',
|
|
607
|
+
* range => console.log('Selected', range)
|
|
608
|
+
* );
|
|
609
|
+
*
|
|
610
|
+
* const viewConfigListenerId = hgv.on(
|
|
611
|
+
* 'viewConfig',
|
|
612
|
+
* range => console.log('Selected', range)
|
|
613
|
+
* );
|
|
614
|
+
*
|
|
615
|
+
* const mmz = event => console.log('Moved', event);
|
|
616
|
+
* hgv.on('mouseMoveZoom', mmz);
|
|
617
|
+
*
|
|
618
|
+
* const wheelListener = event => console.log('Wheel', event);
|
|
619
|
+
* hgv.on('wheel', wheelListener);
|
|
620
|
+
*
|
|
621
|
+
* hgv.on('createSVG', (svg) => {
|
|
622
|
+
* const circle = document.createElement('circle');
|
|
623
|
+
* circle.setAttribute('cx', 100);
|
|
624
|
+
* circle.setAttribute('cy', 100);
|
|
625
|
+
* circle.setAttribute('r', 50);
|
|
626
|
+
* circle.setAttribute('fill', 'green');
|
|
627
|
+
* svg.appendChild(circle);
|
|
628
|
+
* return svg;
|
|
629
|
+
* });
|
|
630
|
+
*
|
|
631
|
+
* const geneSearchListener = event => {
|
|
632
|
+
* console.log('Gene searched', event.geneSymbol);
|
|
633
|
+
* console.log('Range of the gene', event.range);
|
|
634
|
+
* console.log('Center of the gene', event.centerX);
|
|
635
|
+
* }
|
|
636
|
+
* hgv.on('geneSearch', geneSearchListener);
|
|
637
|
+
*/
|
|
638
|
+
on(event: string, callback: Function, viewId: string, callbackId: any): any;
|
|
639
|
+
};
|
|
640
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const DEFAULT_TRACKS_FOR_DATATYPE: {
|
|
2
|
+
readonly chromsizes: {
|
|
3
|
+
readonly center: "2d-chromosome-grid";
|
|
4
|
+
readonly top: "chromosome-labels";
|
|
5
|
+
readonly left: "chromosome-labels";
|
|
6
|
+
readonly bottom: "chromosome-labels";
|
|
7
|
+
readonly right: "chromosome-labels";
|
|
8
|
+
};
|
|
9
|
+
readonly matrix: {
|
|
10
|
+
readonly center: "heatmap";
|
|
11
|
+
readonly top: "linear-heatmap";
|
|
12
|
+
readonly left: "linear-heatmap";
|
|
13
|
+
readonly right: "linear-heatmap";
|
|
14
|
+
readonly bottom: "linear-heatmap";
|
|
15
|
+
};
|
|
16
|
+
readonly vector: {
|
|
17
|
+
readonly top: "bar";
|
|
18
|
+
readonly bottom: "bar";
|
|
19
|
+
readonly left: "bar";
|
|
20
|
+
readonly right: "bar";
|
|
21
|
+
};
|
|
22
|
+
readonly 'geo-json': {
|
|
23
|
+
readonly center: "geo-json";
|
|
24
|
+
};
|
|
25
|
+
readonly 'gene-annotation': {
|
|
26
|
+
readonly top: "gene-annotations";
|
|
27
|
+
readonly bottom: "gene-annotations";
|
|
28
|
+
readonly left: "gene-annotations";
|
|
29
|
+
readonly right: "gene-annotations";
|
|
30
|
+
};
|
|
31
|
+
readonly bedlike: {
|
|
32
|
+
readonly top: "bedlike";
|
|
33
|
+
readonly bottom: "bedlike";
|
|
34
|
+
readonly left: "vertical-bedlike";
|
|
35
|
+
readonly right: "vertical-bedlike";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default DEFAULT_TRACKS_FOR_DATATYPE;
|