higlass 1.13.0 → 1.13.2

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.
@@ -1,5 +1,7 @@
1
1
  /* eslint-disable */
2
2
 
3
+ import type { THEME_DARK, THEME_LIGHT } from "./configs";
4
+
3
5
  export type Scale = import("d3-scale").ScaleContinuousNumeric<number, number>;
4
6
 
5
7
  export type TrackPosition = typeof import('./configs/primitives').TRACK_LOCATIONS[number];
@@ -77,3 +79,27 @@ export interface TrackObject {
77
79
  movedY(extent: number): void;
78
80
  zoomedY(yPosition: number, wheelDelta: number): void;
79
81
  }
82
+
83
+ export type Theme = typeof THEME_DARK | typeof THEME_LIGHT;
84
+
85
+ type TilesetInfoBase = {
86
+ name: string;
87
+ coordSystem: string;
88
+ min_pos: number[];
89
+ max_pos: number[];
90
+ max_zoom: number;
91
+ tile_size?: number;
92
+ max_tile_width?: number;
93
+ transforms?: { name: string, value: string }[];
94
+ }
95
+
96
+ export type LegacyTilesetInfo = TilesetInfoBase & {
97
+ max_width: number;
98
+ bins_per_dimension?: number;
99
+ }
100
+
101
+ export type ResolutionsTilesetInfo = TilesetInfoBase & {
102
+ resolutions: number[];
103
+ }
104
+
105
+ export type TilesetInfo = LegacyTilesetInfo | ResolutionsTilesetInfo;
@@ -15,3 +15,27 @@ export function isCombinedTrackConfig(trackConfig) {
15
15
  export function isWheelEvent(event) {
16
16
  return 'deltaY' in event && 'deltaMode' in event;
17
17
  }
18
+
19
+ /**
20
+ * @param {unknown} obj
21
+ * @returns {obj is {}}
22
+ */
23
+ export function isObject(obj) {
24
+ return obj !== null && typeof obj === 'object';
25
+ }
26
+
27
+ /**
28
+ * @param {import('../types').TilesetInfo | undefined} info
29
+ * @returns {info is import('../types').LegacyTilesetInfo}
30
+ */
31
+ export function isLegacyTilesetInfo(info) {
32
+ return isObject(info) && 'max_width' in info;
33
+ }
34
+
35
+ /**
36
+ * @param {import('../types').TilesetInfo | undefined} info
37
+ * @returns {info is import('../types').ResolutionsTilesetInfo}
38
+ */
39
+ export function isResolutionsTilesetInfo(info) {
40
+ return isObject(info) && 'resolutions' in info;
41
+ }
package/dist/esm.html ADDED
@@ -0,0 +1,283 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>HiGlass</title>
7
+ <style type="text/css">
8
+ #demo {
9
+ position: absolute;
10
+ left: 1rem;
11
+ top: 1rem;
12
+ bottom: 1rem;
13
+ right: 1rem;
14
+ overflow: hidden;
15
+ }
16
+ </style>
17
+ <link rel="stylesheet" href="./hglib.css">
18
+ <script type="importmap">
19
+ {
20
+ "imports": {
21
+ "react": "https://esm.sh/react@17",
22
+ "react-dom": "https://esm.sh/react-dom@17",
23
+ "pixi.js": "https://esm.sh/pixi.js@6"
24
+ }
25
+ }
26
+ </script>
27
+ <script type="module">
28
+ import * as hglib from "./higlass.mjs";
29
+ globalThis.hglib = hglib;
30
+ </script>
31
+
32
+ </head>
33
+
34
+ <body>
35
+ <div id="demo"></div>
36
+ </body>
37
+
38
+ <script type="module">
39
+ const viewConfig = {
40
+ zoomFixed: false,
41
+ views: [
42
+ {
43
+ layout: {
44
+ w: 12,
45
+ h: 7,
46
+ x: 0,
47
+ y: 0
48
+ },
49
+ uid: 'aa',
50
+ initialYDomain: [
51
+ 2534823997.9776945,
52
+ 2547598956.834603
53
+ ],
54
+ initialXDomain: [
55
+ 2521015726.4619913,
56
+ 2558682921.8435397
57
+ ],
58
+ tracks: {
59
+ left: [],
60
+ top: [
61
+ {
62
+ uid: 'genes',
63
+ tilesetUid: 'OHJakQICQD6gTD7skx4EWA',
64
+ server: 'http://higlass.io/api/v1',
65
+ type: 'horizontal-gene-annotations',
66
+ height: 48,
67
+ options: {
68
+ labelColor: 'black',
69
+ plusStrandColor: 'black',
70
+ labelPosition: 'hidden',
71
+ minusStrandColor: 'black',
72
+ fontSize: 11,
73
+ trackBorderWidth: 0,
74
+ trackBorderColor: 'black',
75
+ showMousePosition: true,
76
+ mousePositionColor: '#000000',
77
+ geneAnnotationHeight: 10,
78
+ geneLabelPosition: 'outside',
79
+ geneStrandSpacing: 4
80
+ },
81
+ },
82
+ {
83
+ uid: 'line1',
84
+ tilesetUid: 'PjIJKXGbSNCalUZO21e_HQ',
85
+ height: 20,
86
+ server: 'http://higlass.io/api/v1',
87
+ type: 'horizontal-line',
88
+ options: {
89
+ valueScaling: 'linear',
90
+ lineStrokeWidth: 2,
91
+ lineStrokeColor: '#4a35fc',
92
+ labelPosition: 'topLeft',
93
+ labelColor: 'black',
94
+ axisPositionHorizontal: 'right',
95
+ trackBorderWidth: 0,
96
+ trackBorderColor: 'black',
97
+ labelTextOpacity: 0.4,
98
+ showMousePosition: true,
99
+ mousePositionColor: '#000000',
100
+ showTooltip: false
101
+ }
102
+ },
103
+ {
104
+ uid: 'line2',
105
+ tilesetUid: 'PdAaSdibTLK34hCw7ubqKA',
106
+ height: 20,
107
+ server: 'http://higlass.io/api/v1',
108
+ type: 'horizontal-line',
109
+ options: {
110
+ valueScaling: 'linear',
111
+ lineStrokeWidth: 2,
112
+ lineStrokeColor: '#d104fa',
113
+ labelPosition: 'topLeft',
114
+ labelColor: 'black',
115
+ axisPositionHorizontal: 'right',
116
+ trackBorderWidth: 0,
117
+ trackBorderColor: 'black',
118
+ labelTextOpacity: 0.4,
119
+ showMousePosition: true,
120
+ mousePositionColor: '#000000',
121
+ showTooltip: false
122
+ },
123
+ },
124
+ {
125
+ uid: 'line3',
126
+ tilesetUid: 'e0DYtZBSTqiMLHoaimsSpg',
127
+ height: 20,
128
+ server: 'http://higlass.io/api/v1',
129
+ type: 'horizontal-line',
130
+ options: {
131
+ valueScaling: 'linear',
132
+ lineStrokeWidth: 2,
133
+ lineStrokeColor: '#ff0000',
134
+ labelPosition: 'topLeft',
135
+ labelColor: 'black',
136
+ axisPositionHorizontal: 'right',
137
+ trackBorderWidth: 0,
138
+ trackBorderColor: 'black',
139
+ labelTextOpacity: 0.4,
140
+ showMousePosition: true,
141
+ mousePositionColor: '#000000',
142
+ showTooltip: false
143
+ },
144
+ },
145
+ {
146
+ uid: 'line4',
147
+ tilesetUid: 'cE0nGyd0Q_yVYSyBUe89Ww',
148
+ height: 20,
149
+ server: 'http://higlass.io/api/v1',
150
+ type: 'horizontal-line',
151
+ options: {
152
+ valueScaling: 'linear',
153
+ lineStrokeWidth: 2,
154
+ lineStrokeColor: 'orange',
155
+ labelPosition: 'topLeft',
156
+ labelColor: 'black',
157
+ axisPositionHorizontal: 'right',
158
+ trackBorderWidth: 0,
159
+ trackBorderColor: 'black',
160
+ labelTextOpacity: 0.4,
161
+ showMousePosition: true,
162
+ mousePositionColor: '#000000',
163
+ showTooltip: false
164
+ },
165
+ },
166
+ {
167
+ uid: 'chroms',
168
+ height: 18,
169
+ chromInfoPath: '//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv',
170
+ type: 'horizontal-chromosome-labels',
171
+ options: {
172
+ color: '#777777',
173
+ stroke: '#FFFFFF',
174
+ fontSize: 11,
175
+ fontIsLeftAligned: true,
176
+ showMousePosition: true,
177
+ mousePositionColor: '#000000'
178
+ },
179
+ }
180
+ ],
181
+ right: [],
182
+ center: [
183
+ {
184
+ uid: 'center',
185
+ type: 'combined',
186
+ contents: [
187
+ {
188
+ server: 'http://higlass.io/api/v1',
189
+ tilesetUid: 'dVBREuC2SvO01uXYMUh2aQ',
190
+ type: 'heatmap',
191
+ uid: 'Yqetzqw6Qfy-hREAJhAXEA',
192
+ options: {
193
+ backgroundColor: '#eeeeee',
194
+ labelPosition: 'topLeft',
195
+ labelTextOpacity: 0.4,
196
+ colorRange: [
197
+ 'white',
198
+ 'rgba(245,166,35,1.0)',
199
+ 'rgba(208,2,27,1.0)',
200
+ 'black'
201
+ ],
202
+ maxZoom: null,
203
+ colorbarPosition: 'topRight',
204
+ trackBorderWidth: 0,
205
+ trackBorderColor: 'black',
206
+ heatmapValueScaling: 'log',
207
+ showMousePosition: true,
208
+ mousePositionColor: '#000000',
209
+ showTooltip: true,
210
+ scaleStartPercent: '0.00000',
211
+ scaleEndPercent: '1.00000',
212
+ showMousePositionGlobally: true,
213
+ },
214
+ }
215
+ ],
216
+ }
217
+ ],
218
+ bottom: [],
219
+ whole: [],
220
+ gallery: []
221
+ },
222
+ chromInfoPath: '//s3.amazonaws.com/pkerp/data/hg19/chromSizes.tsv',
223
+ genomePositionSearchBox: {
224
+ visible: true,
225
+ chromInfoServer: 'http://higlass.io/api/v1',
226
+ chromInfoId: 'hg19',
227
+ autocompleteServer: 'http://higlass.io/api/v1',
228
+ autocompleteId: 'OHJakQICQD6gTD7skx4EWA'
229
+ }
230
+ }
231
+ ],
232
+ editable: true,
233
+ viewEditable: true,
234
+ tracksEditable: true,
235
+ exportViewUrl: '/api/v1/viewconfs',
236
+ zoomLocks: {
237
+ locksByViewUid: {},
238
+ locksDict: {}
239
+ },
240
+ trackSourceServers: [
241
+ 'http://higlass.io/api/v1'
242
+ ],
243
+ locationLocks: {
244
+ locksByViewUid: {
245
+ aa: 'PkNgAl3mSIqttnSsCewngw',
246
+ ewZvJwlDSei_dbpIAkGMlg: 'PkNgAl3mSIqttnSsCewngw'
247
+ },
248
+ locksDict: {
249
+ PkNgAl3mSIqttnSsCewngw: {
250
+ aa: [
251
+ 1550000000,
252
+ 1550000000,
253
+ 3380588.876772046
254
+ ],
255
+ ewZvJwlDSei_dbpIAkGMlg: [
256
+ 1550000000.0000002,
257
+ 1549999999.9999993,
258
+ 3380588.876772046
259
+ ],
260
+ uid: 'PkNgAl3mSIqttnSsCewngw'
261
+ }
262
+ }
263
+ },
264
+ valueScaleLocks: {
265
+ locksByViewUid: {},
266
+ locksDict: {}
267
+ }
268
+ };
269
+
270
+ const hgApi = window.hgApi = hglib.viewer(
271
+ document.getElementById('demo'),
272
+ viewConfig,
273
+ { bounded: true },
274
+ );
275
+
276
+ hgApi.setBroadcastMousePositionGlobally(true);
277
+
278
+ hgApi.on('viewConfig', () => {
279
+ console.log('View Config changed');
280
+ });
281
+
282
+ </script>
283
+ </html>