vitessce 3.5.7__py3-none-any.whl → 3.5.9__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 CHANGED
@@ -163,7 +163,12 @@ const React = await importWithMap("react", importMap);
163
163
  const { createRoot } = await importWithMap("react-dom/client", importMap);
164
164
 
165
165
  const e = React.createElement;
166
+
167
+ function isAbsoluteUrl(s) {
168
+ return s.startsWith('http://') || s.startsWith('https://');
169
+ }
166
170
  const WORKSPACES_URL_KEYWORD = 'https://workspaces-pt';
171
+ const OPTIONS_URL_KEYS = ['offsetsUrl', 'refSpecUrl'];
167
172
  const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
168
173
  // The jupyter server may be running through a proxy,
169
174
  // which means that the client needs to prepend the part of the URL before /proxy/8000 such as
@@ -196,13 +201,25 @@ function prependBaseUrl(config, proxy, hasHostName) {
196
201
  ...config,
197
202
  datasets: config.datasets.map(d => ({
198
203
  ...d,
199
- files: d.files.map(f => ({
200
- ...f,
201
- url: (!(f.url.startsWith('http://') || f.url.startsWith('https://'))
202
- ? `${origin}${baseUrl}${f.url}`
203
- : f.url
204
- ),
205
- })),
204
+ files: d.files.map(f => {
205
+ const updatedFileDef = { ...f };
206
+ if (!isAbsoluteUrl(f.url)) {
207
+ // Update the main file URL if necessary.
208
+ updatedFileDef.url = `${origin}${baseUrl}${f.url}`;
209
+ }
210
+ if (f.options) {
211
+ // Update any urls within the options object
212
+ const updatedOptions = { ...f.options };
213
+ OPTIONS_URL_KEYS.forEach(key => {
214
+ const optionValue = updatedOptions[key];
215
+ if (optionValue && !isAbsoluteUrl(optionValue)) {
216
+ updatedOptions[key] = `${origin}${baseUrl}${optionValue}`;
217
+ }
218
+ });
219
+ updatedFileDef.options = updatedOptions;
220
+ }
221
+ return updatedFileDef;
222
+ }),
206
223
  })),
207
224
  };
208
225
  }
@@ -578,7 +595,7 @@ class VitessceWidget(anywidget.AnyWidget):
578
595
 
579
596
  next_port = DEFAULT_PORT
580
597
 
581
- js_package_version = Unicode('3.5.11').tag(sync=True)
598
+ js_package_version = Unicode('3.5.12').tag(sync=True)
582
599
  js_dev_mode = Bool(False).tag(sync=True)
583
600
  custom_js_url = Unicode('').tag(sync=True)
584
601
  plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
@@ -589,7 +606,7 @@ class VitessceWidget(anywidget.AnyWidget):
589
606
 
590
607
  store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
591
608
 
592
- def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.5.11', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, prefer_local=True, invoke_timeout=300000, page_mode=False, page_esm=None):
609
+ def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.5.12', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, prefer_local=True, invoke_timeout=300000, page_mode=False, page_esm=None):
593
610
  """
594
611
  Construct a new Vitessce widget.
595
612
 
@@ -723,7 +740,7 @@ class VitessceWidget(anywidget.AnyWidget):
723
740
  # Launch Vitessce using plain HTML representation (no ipywidgets)
724
741
 
725
742
 
726
- def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.5.11', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
743
+ def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.5.12', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None):
727
744
  from IPython.display import display, HTML
728
745
  uid_str = "vitessce" + get_uid_str(uid)
729
746
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vitessce
3
- Version: 3.5.7
3
+ Version: 3.5.9
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>
@@ -102,7 +102,7 @@ Python API and Jupyter widget facilitating interactive visualization of spatial
102
102
 
103
103
  To install with pip:
104
104
 
105
- $ pip install vitessce[all]
105
+ $ pip install 'vitessce[all]'
106
106
 
107
107
  ## Getting started
108
108
 
@@ -7,7 +7,7 @@ vitessce/file_def_utils.py,sha256=RM9Hj1uwPY-Y37JLOHiKA_acGY40p8C9WsDk8iVjDz8,66
7
7
  vitessce/repr.py,sha256=qMmefmZ3E-3sRVxeI5q1DTZnfuwbXKiA85eyqk5MCT4,2287
8
8
  vitessce/routes.py,sha256=U8T-L-3QCD_tAbPF8LsUlSMhPWNbyzbLNUnxP9Z9s9o,2140
9
9
  vitessce/utils.py,sha256=obzjj65qsagu60_yuhGc-0jmHO-BW0Y-bDs0FgrBqLY,981
10
- vitessce/widget.py,sha256=1E1PGs656B7AGLdE6qAGlJ63zcH7aBFi1bOS0sMkYks,31623
10
+ vitessce/widget.py,sha256=-8zK7h3AeFU8VWncuPWR2vAA8StHWYNjbrwVm5ld03w,32418
11
11
  vitessce/wrappers.py,sha256=kVqXFcpbuIb8MtZQSB4F7k32JM8bwCgMBrOkcAAhmvc,74676
12
12
  vitessce/data_utils/__init__.py,sha256=3mWi1lMjoj4_dNbhMOvyE-HEJu0qpMzcmkhfz_5T6n8,361
13
13
  vitessce/data_utils/anndata.py,sha256=iLa5-bRezHgBzL_XCHO7w0pc0RQ4urzZbDsqJbBYeCk,10668
@@ -17,7 +17,7 @@ vitessce/data_utils/ome.py,sha256=aK-iGNgjUmUMsWgdZhW78VrtMBKMW_jIQDYnsupq6BE,54
17
17
  vitessce/widget_plugins/__init__.py,sha256=lto2GXnc7KwjIoT-jvzyRYLj0XTJG3uxoX45Hc9EcWA,82
18
18
  vitessce/widget_plugins/demo_plugin.py,sha256=14S7nOxdlKSxIHw9DUcNCN83NE_U1EMPy2D4k0FDues,1797
19
19
  vitessce/widget_plugins/spatial_query.py,sha256=CYxvmMT1Je_jguikPROQxlegkPgIIzemKGbZSJfZMyI,12314
20
- vitessce-3.5.7.dist-info/METADATA,sha256=EbK58qfEkCzquClPc-XIIvNBcgUhQgarf-qEaX0THW4,9556
21
- vitessce-3.5.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- vitessce-3.5.7.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
23
- vitessce-3.5.7.dist-info/RECORD,,
20
+ vitessce-3.5.9.dist-info/METADATA,sha256=g_LIqo1wtjJamdEcoUuyv7di45t_X0MhleRnSianTTQ,9558
21
+ vitessce-3.5.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ vitessce-3.5.9.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
23
+ vitessce-3.5.9.dist-info/RECORD,,