Skip to content

Commit 92ace00

Browse files
authored
Bump js version (#485)
* Bump js version * Support featureLabels and obsEmbedding in SpatialDataWrapper * Update test
1 parent 8831236 commit 92ace00

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

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.7.8"
7+
version = "3.7.9"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]

src/vitessce/widget.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def get_uid_str(uid):
181181
"react-dom": "https://cdn.vitessce.io/[email protected]/index.js",
182182
"react-dom/client": "https://cdn.vitessce.io/[email protected]/es2022/client.mjs",
183183
// Replaced with version-specific URL below.
184-
"vitessce": "https://cdn.vitessce.io/vitessce@3.8.5/dist/index.min.js",
184+
"vitessce": "https://cdn.vitessce.io/vitessce@VERSION/dist/index.min.js",
185185
},
186186
};
187187
/*
@@ -191,7 +191,7 @@ def get_uid_str(uid):
191191
"react-dom": "https://cdn.vitessce.io/[email protected]/index_dev.js",
192192
"react-dom/client": "https://cdn.vitessce.io/[email protected]/es2022/client.development.mjs",
193193
// Replaced with version-specific URL below.
194-
"vitessce": "https://cdn.vitessce.io/@vitessce/dev@3.8.5/dist/index.js",
194+
"vitessce": "https://cdn.vitessce.io/@vitessce/dev@VERSION/dist/index.js",
195195
},
196196
};
197197
*/
@@ -729,7 +729,7 @@ class VitessceWidget(anywidget.AnyWidget):
729729

730730
next_port = DEFAULT_PORT
731731

732-
js_package_version = Unicode('3.8.5').tag(sync=True)
732+
js_package_version = Unicode('3.8.8').tag(sync=True)
733733
js_dev_mode = Bool(False).tag(sync=True)
734734
custom_js_url = Unicode('').tag(sync=True)
735735
plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True)
@@ -742,7 +742,7 @@ class VitessceWidget(anywidget.AnyWidget):
742742

743743
store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True)
744744

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):
745+
def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.8.8', 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):
746746
"""
747747
Construct a new Vitessce widget. Not intended to be instantiated directly; instead, use ``VitessceConfig.widget``.
748748
@@ -876,7 +876,7 @@ def _plugin_command(self, params, buffers):
876876
# Launch Vitessce using plain HTML representation (no ipywidgets)
877877

878878

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):
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.8', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, page_mode=False, page_esm=None, server_host=None):
880880
from IPython.display import display, HTML
881881
uid_str = "vitessce" + get_uid_str(uid)
882882

src/vitessce/wrappers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,10 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14321432
:type obs_segmentations_path: Optional[str]
14331433
:param obs_points_path: Path to a points element, by default None
14341434
:type obs_points_path: Optional[str]
1435+
:param str feature_labels_path: Path to a table var column containing feature labels (e.g., alternate gene symbols), instead of the default index column of the `var` dataframe.
1436+
:param list[str] obs_embedding_paths: Column names like `['obsm/X_umap', 'obsm/X_pca']` for showing scatterplots
1437+
:param list[str] obs_embedding_names: Overriding names like `['UMAP', 'PCA']` for displaying above scatterplots
1438+
:param list[str] obs_embedding_dims: Dimensions along which to get data for the scatterplot, like `[[0, 1], [4, 5]]` where `[0, 1]` is just the normal x and y but `[4, 5]` could be comparing the third and fourth principal components, for example.
14351439
"""
14361440
raise_error_if_zero_or_more_than_one([
14371441
sdata_path,
@@ -1551,6 +1555,7 @@ def generator(base_url):
15511555
options = gen_sdata_obs_segmentations_schema(options, self._obs_segmentations_path, self._table_path, self._coordinate_system)
15521556
options = gen_sdata_obs_points_schema(options, self._obs_points_path, self._table_path, self._coordinate_system)
15531557
options = gen_feature_labels_schema(self._feature_labels, options)
1558+
options = gen_obs_embedding_schema(options, self._mappings_obsm, self._mappings_obsm_names, self._mappings_obsm_dims)
15541559
if len(options.keys()) > 0:
15551560
obj_file_def = {
15561561
"fileType": ft.SPATIALDATA_ZARR_ZIP.value if self.is_zip else ft.SPATIALDATA_ZARR.value,

tests/test_wrappers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ def test_spatial_data_with_base_dir(self):
481481
'obsSets': [{'name': 'Cell Type', 'path': 'obs/CellType'}],
482482
'tablePath': 'tables/table'
483483
},
484-
'image': {'path': 'images/picture'}
484+
'image': {'path': 'images/picture'},
485+
'obsEmbedding': [
486+
{'dims': [0, 1], 'embeddingType': 'UMAP', 'path': 'obsm/X_umap'},
487+
],
485488
}})
486489

487490
def test_spatial_data_with_base_dir_2(self):

0 commit comments

Comments
 (0)