diff --git a/pyproject.toml b/pyproject.toml index e69bf79..527a4fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "vitessce" -version = "3.5.0" +version = "3.5.1" authors = [ { name="Mark Keller", email="mark_keller@hms.harvard.edu" }, ] diff --git a/src/vitessce/widget.py b/src/vitessce/widget.py index 4b34473..ed3b777 100644 --- a/src/vitessce/widget.py +++ b/src/vitessce/widget.py @@ -244,6 +244,15 @@ def get_uid_str(uid): signal: AbortSignal.timeout(invokeTimeout), }); if (!data.success) return undefined; + + if (key.includes("spatialdata_attrs") && key.endsWith("0") && !ArrayBuffer.isView(buffers[0].buffer)) { + // For some reason, the Zarrita.js UnicodeStringArray does not seem to work with + // ArrayBuffers (throws a TypeError), so here we convert to Uint8Array if needed. + // This error is occurring specifically for the arr.getChunk call within the AnnDataSource._loadString function. + // TODO: figure out a more long-term solution. + return new Uint8Array(buffers[0].buffer); + } + return buffers[0].buffer; }, } @@ -454,7 +463,7 @@ class VitessceWidget(anywidget.AnyWidget): next_port = DEFAULT_PORT - js_package_version = Unicode('3.4.14').tag(sync=True) + js_package_version = Unicode('3.5.4').tag(sync=True) js_dev_mode = Bool(False).tag(sync=True) custom_js_url = Unicode('').tag(sync=True) plugin_esm = List(trait=Unicode(''), default_value=[]).tag(sync=True) @@ -463,7 +472,7 @@ class VitessceWidget(anywidget.AnyWidget): store_urls = List(trait=Unicode(''), default_value=[]).tag(sync=True) - def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.4.14', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, invoke_timeout=30000): + def __init__(self, config, height=600, theme='auto', uid=None, port=None, proxy=False, js_package_version='3.5.4', js_dev_mode=False, custom_js_url='', plugins=None, remount_on_uid_change=True, invoke_timeout=30000): """ Construct a new Vitessce widget. @@ -576,7 +585,7 @@ def _plugin_command(self, params, buffers): # Launch Vitessce using plain HTML representation (no ipywidgets) -def ipython_display(config, height=600, theme='auto', base_url=None, host_name=None, uid=None, port=None, proxy=False, js_package_version='3.4.14', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True): +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.4', js_dev_mode=False, custom_js_url='', plugin_esm=DEFAULT_PLUGIN_ESM, remount_on_uid_change=True): from IPython.display import display, HTML uid_str = "vitessce" + get_uid_str(uid)