Skip to content

Commit 50e9ab5

Browse files
committed
Updated url for options object
1 parent 1ecdb39 commit 50e9ab5

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Python API and Jupyter widget facilitating interactive visualization of spatial
1414

1515
To install with pip:
1616

17-
$ pip install vitessce[all]
17+
$ pip install 'vitessce[all]'
1818

1919
## Getting started
2020

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "vitessce"
7-
version = "3.5.7"
7+
version = "3.5.8"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]

src/vitessce/widget.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,26 @@ def get_uid_str(uid):
196196
...config,
197197
datasets: config.datasets.map(d => ({
198198
...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-
})),
199+
files: d.files.map(f => {
200+
// Update the main file URL
201+
const updatedUrl = f.url.startsWith('http://') || f.url.startsWith('https://')
202+
? f.url
203+
: `${origin}${baseUrl}${f.url}`;
204+
// Update any urls within the options object
205+
const updatedOptions = { ...f.options };
206+
['offsetsUrl', 'refSpecUrl'].forEach(key => {
207+
if (updatedOptions.hasOwnProperty(key)) {
208+
if (!updatedOptions[key].startsWith('http://') && !updatedOptions[key].startsWith('https://')) {
209+
updatedOptions[key] = `${origin}${baseUrl}${updatedOptions[key]}`;
210+
}
211+
}
212+
});
213+
return {
214+
...f,
215+
url: updatedUrl,
216+
options: updatedOptions,
217+
};
218+
}),
206219
})),
207220
};
208221
}

0 commit comments

Comments
 (0)