vitessce 3.5.6__py3-none-any.whl → 3.5.8__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
- const WORKSPACES_URL_KEYWORD = 'https://workspaces-pt'
166
+
167
+ function isAbsoluteUrl(s) {
168
+ return s.startsWith('http://') || s.startsWith('https://');
169
+ }
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,10 +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: `${origin}${baseUrl}${f.url}`,
202
- })),
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
+ }),
203
223
  })),
204
224
  };
205
225
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vitessce
3
- Version: 3.5.6
3
+ Version: 3.5.8
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=XngfJKODnUwvNJ8qM1nC10fvdZPzpj6MsG2duPaCnj0,31490
10
+ vitessce/widget.py,sha256=WvdbASZf6hxn2kkPJ_nnA5S3M_ToyYtPldDxsc67c1Y,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.6.dist-info/METADATA,sha256=GYRIA202oFik97MbgKsYZDgpXqo9CbxExdvrx3CRycs,9556
21
- vitessce-3.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- vitessce-3.5.6.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
23
- vitessce-3.5.6.dist-info/RECORD,,
20
+ vitessce-3.5.8.dist-info/METADATA,sha256=KUNlB-SMYWCe4hcRNzWk_Gl9k2JeiBkOaOGMcjWHf3k,9558
21
+ vitessce-3.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ vitessce-3.5.8.dist-info/licenses/LICENSE,sha256=sNNpI0PQ57AW8_XnTAjU5Yw8YBA_DRNkVHrHYpCIhRU,1067
23
+ vitessce-3.5.8.dist-info/RECORD,,