vitessce 3.7.6__py3-none-any.whl → 3.7.7__py3-none-any.whl
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.
- vitessce/widget.py +86 -8
- {vitessce-3.7.6.dist-info → vitessce-3.7.7.dist-info}/METADATA +1 -1
- {vitessce-3.7.6.dist-info → vitessce-3.7.7.dist-info}/RECORD +5 -5
- {vitessce-3.7.6.dist-info → vitessce-3.7.7.dist-info}/WHEEL +0 -0
- {vitessce-3.7.6.dist-info → vitessce-3.7.7.dist-info}/licenses/LICENSE +0 -0
vitessce/widget.py
CHANGED
|
@@ -155,7 +155,19 @@ def get_uid_str(uid):
|
|
|
155
155
|
|
|
156
156
|
# lang: js
|
|
157
157
|
ESM = """
|
|
158
|
-
|
|
158
|
+
let importWithMap;
|
|
159
|
+
try {
|
|
160
|
+
importWithMap = (await import('https://unpkg.com/dynamic-importmap@0.1.0')).importWithMap;
|
|
161
|
+
} catch(e) {
|
|
162
|
+
console.warn("Import of dynamic-importmap failed, trying fallback.");
|
|
163
|
+
importWithMap = (await import('https://cdn.vitessce.io/dynamic-importmap@0.1.0/dist/index.js')).importWithMap;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const successfulImportMap = {
|
|
167
|
+
imports: {
|
|
168
|
+
|
|
169
|
+
},
|
|
170
|
+
};
|
|
159
171
|
const importMap = {
|
|
160
172
|
imports: {
|
|
161
173
|
"react": "https://esm.sh/react@18.2.0?dev",
|
|
@@ -163,9 +175,64 @@ const importMap = {
|
|
|
163
175
|
"react-dom/client": "https://esm.sh/react-dom@18.2.0/client?dev",
|
|
164
176
|
},
|
|
165
177
|
};
|
|
178
|
+
const fallbackImportMap = {
|
|
179
|
+
imports: {
|
|
180
|
+
"react": "https://cdn.vitessce.io/react@18.2.0/index.js",
|
|
181
|
+
"react-dom": "https://cdn.vitessce.io/react-dom@18.2.0/index.js",
|
|
182
|
+
"react-dom/client": "https://cdn.vitessce.io/react-dom@18.2.0/es2022/client.mjs",
|
|
183
|
+
// Replaced with version-specific URL below.
|
|
184
|
+
"vitessce": "https://cdn.vitessce.io/vitessce@3.8.5/dist/index.min.js",
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
/*
|
|
188
|
+
const fallbackDevImportMap = {
|
|
189
|
+
imports: {
|
|
190
|
+
"react": "https://cdn.vitessce.io/react@18.2.0/index_dev.js",
|
|
191
|
+
"react-dom": "https://cdn.vitessce.io/react-dom@18.2.0/index_dev.js",
|
|
192
|
+
"react-dom/client": "https://cdn.vitessce.io/react-dom@18.2.0/es2022/client.development.mjs",
|
|
193
|
+
// Replaced with version-specific URL below.
|
|
194
|
+
"vitessce": "https://cdn.vitessce.io/@vitessce/dev@3.8.5/dist/index.js",
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
async function importWithMapAndFallback(moduleName, importMap, fallbackMap) {
|
|
200
|
+
let result = null;
|
|
201
|
+
if (!fallbackMap) {
|
|
202
|
+
// fallbackMap is null, user may have provided custom JS URL.
|
|
203
|
+
result = await importWithMap(moduleName, {
|
|
204
|
+
imports: {
|
|
205
|
+
...importMap.imports,
|
|
206
|
+
...successfulImportMap.imports,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
successfulImportMap.imports[moduleName] = importMap.imports[moduleName];
|
|
210
|
+
} else {
|
|
211
|
+
try {
|
|
212
|
+
result = await importWithMap(moduleName, {
|
|
213
|
+
imports: {
|
|
214
|
+
...importMap.imports,
|
|
215
|
+
...successfulImportMap.imports,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
successfulImportMap.imports[moduleName] = importMap.imports[moduleName];
|
|
219
|
+
} catch (e) {
|
|
220
|
+
console.warn(`Importing ${moduleName} failed with importMap`, importMap, "trying fallback", fallbackMap, successfulImportMap);
|
|
221
|
+
result = await importWithMap(moduleName, {
|
|
222
|
+
imports: {
|
|
223
|
+
...fallbackMap.imports,
|
|
224
|
+
...successfulImportMap.imports,
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
successfulImportMap.imports[moduleName] = fallbackMap.imports[moduleName];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
232
|
+
|
|
166
233
|
|
|
167
|
-
const React = await
|
|
168
|
-
const { createRoot } = await
|
|
234
|
+
const React = await importWithMapAndFallback("react", importMap, fallbackImportMap);
|
|
235
|
+
const { createRoot } = await importWithMapAndFallback("react-dom/client", importMap, fallbackImportMap);
|
|
169
236
|
|
|
170
237
|
const e = React.createElement;
|
|
171
238
|
|
|
@@ -268,10 +335,21 @@ async function render(view) {
|
|
|
268
335
|
|
|
269
336
|
const pkgName = (jsDevMode ? "@vitessce/dev" : "vitessce");
|
|
270
337
|
|
|
271
|
-
|
|
338
|
+
const hasCustomJsUrl = customJsUrl.length > 0;
|
|
339
|
+
|
|
340
|
+
importMap.imports["vitessce"] = (hasCustomJsUrl
|
|
272
341
|
? customJsUrl
|
|
273
342
|
: `https://unpkg.com/${pkgName}@${jsPackageVersion}`
|
|
274
343
|
);
|
|
344
|
+
let fallbackImportMapToUse = null;
|
|
345
|
+
if (!hasCustomJsUrl) {
|
|
346
|
+
fallbackImportMapToUse = fallbackImportMap;
|
|
347
|
+
if (jsDevMode) {
|
|
348
|
+
fallbackImportMapToUse.imports["vitessce"] = `https://cdn.vitessce.io/vitessce@${jsPackageVersion}/dist/index.min.js`;
|
|
349
|
+
} else {
|
|
350
|
+
fallbackImportMapToUse.imports["vitessce"] = `https://cdn.vitessce.io/@vitessce/dev@${jsPackageVersion}/dist/index.js`;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
275
353
|
|
|
276
354
|
const {
|
|
277
355
|
Vitessce,
|
|
@@ -292,7 +370,7 @@ async function render(view) {
|
|
|
292
370
|
useComplexCoordinationSecondary,
|
|
293
371
|
useCoordinationScopes,
|
|
294
372
|
useCoordinationScopesBy,
|
|
295
|
-
} = await
|
|
373
|
+
} = await importWithMapAndFallback("vitessce", importMap, fallbackImportMapToUse);
|
|
296
374
|
|
|
297
375
|
let pluginViewTypes = [];
|
|
298
376
|
let pluginCoordinationTypes = [];
|
|
@@ -651,7 +729,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
651
729
|
|
|
652
730
|
next_port = DEFAULT_PORT
|
|
653
731
|
|
|
654
|
-
js_package_version = Unicode('3.8.
|
|
732
|
+
js_package_version = Unicode('3.8.5').tag(sync=True)
|
|
655
733
|
js_dev_mode = Bool(False).tag(sync=True)
|
|
656
734
|
custom_js_url = Unicode('').tag(sync=True)
|
|
657
735
|
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
@@ -664,7 +742,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
664
742
|
|
|
665
743
|
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
|
|
666
744
|
|
|
667
|
-
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.
|
|
745
|
+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.5', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, prefer_local=True, invoke_timeout=300000, invoke_batched=True, page_mode=False, page_esm=None, prevent_scroll=True, server_host=None):
|
|
668
746
|
"""
|
|
669
747
|
Construct a new Vitessce widget. Not intended to be instantiated directly; instead, use ``VitessceConfig.widget``.
|
|
670
748
|
|
|
@@ -798,7 +876,7 @@ class VitessceWidget(anywidget.AnyWidget):
|
|
|
798
876
|
# Launch Vitessce using plain HTML representation (no ipywidgets)
|
|
799
877
|
|
|
800
878
|
|
|
801
|
-
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.8.
|
|
879
|
+
def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.8.5', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None, server_host=None):
|
|
802
880
|
from IPython.display import display, HTML
|
|
803
881
|
uid_str = "vitessce" + get_uid_str(uid)
|
|
804
882
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vitessce
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.7
|
|
4
4
|
Summary: Jupyter widget facilitating interactive visualization of spatial single-cell data with Vitessce
|
|
5
5
|
Project-URL: repository, https://github.com/vitessce/vitessce-python
|
|
6
6
|
Author-email: Mark Keller <mark_keller@hms.harvard.edu>
|
|
@@ -8,7 +8,7 @@ vitessce/repr.py,sha256=qMmefmZ3E-3sRVxeI5q1DTZnfuwbXKiA85eyqk5MCT4,2287
|
|
|
8
8
|
vitessce/responses.py,sha256=Z6Wo4AXN-RyzmxMPhSuhpIsHTItHM4GyIgMLGoVEYcU,339
|
|
9
9
|
vitessce/routes.py,sha256=U8T-L-3QCD_tAbPF8LsUlSMhPWNbyzbLNUnxP9Z9s9o,2140
|
|
10
10
|
vitessce/utils.py,sha256=obzjj65qsagu60_yuhGc-0jmHO-BW0Y-bDs0FgrBqLY,981
|
|
11
|
-
vitessce/widget.py,sha256=
|
|
11
|
+
vitessce/widget.py,sha256=ndgKqwNLrgYnXnA5pGCu2mgQe0_vF1ZMedWuHDYqPpo,39260
|
|
12
12
|
vitessce/wrappers.py,sha256=WdOQ9w4ElGZH_nKrZAfyrtHxW3iVDzIQ1eqBPlrucj0,76993
|
|
13
13
|
vitessce/data_utils/__init__.py,sha256=3mWi1lMjoj4_dNbhMOvyE-HEJu0qpMzcmkhfz_5T6n8,361
|
|
14
14
|
vitessce/data_utils/anndata.py,sha256=iLa5-bRezHgBzL_XCHO7w0pc0RQ4urzZbDsqJbBYeCk,10668
|
|
@@ -18,7 +18,7 @@ vitessce/data_utils/ome.py,sha256=te1X933QTRfCm8N5uVXZREShtxDdAEggZZKKEoJdlhU,55
|
|
|
18
18
|
vitessce/widget_plugins/__init__.py,sha256=lto2GXnc7KwjIoT-jvzyRYLj0XTJG3uxoX45Hc9EcWA,82
|
|
19
19
|
vitessce/widget_plugins/demo_plugin.py,sha256=14S7nOxdlKSxIHw9DUcNCN83NE_U1EMPy2D4k0FDues,1797
|
|
20
20
|
vitessce/widget_plugins/spatial_query.py,sha256=CYxvmMT1Je_jguikPROQxlegkPgIIzemKGbZSJfZMyI,12314
|
|
21
|
-
vitessce-3.7.
|
|
22
|
-
vitessce-3.7.
|
|
23
|
-
vitessce-3.7.
|
|
24
|
-
vitessce-3.7.
|
|
21
|
+
vitessce-3.7.7.dist-info/METADATA,sha256=iXdHIIrXmQc6KTomDoFxfYRq20FRbN43WYOp46QZ1gY,9826
|
|
22
|
+
vitessce-3.7.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
vitessce-3.7.7.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
|
|
24
|
+
vitessce-3.7.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|