From f697debc28d0cc59069a370f174a8084d526aa23 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 23 Sep 2022 11:09:23 -0400 Subject: [PATCH] chore: bump itk-vtk-viewer version --- itkwidgets/viewer.py | 7 ++++--- itkwidgets/viewer_config.py | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 itkwidgets/viewer_config.py diff --git a/itkwidgets/viewer.py b/itkwidgets/viewer.py index d240a14f..a660c8e0 100644 --- a/itkwidgets/viewer.py +++ b/itkwidgets/viewer.py @@ -12,6 +12,7 @@ from ._method_types import deferred_methods from .integrations import _detect_render_type, _get_viewer_image, _get_viewer_point_sets from .render_types import RenderType +from .viewer_config import ITK_VIEWER_SRC, PYDATA_SPHINX_HREF, MUI_HREF __all__ = [ "Viewer", @@ -56,14 +57,14 @@ async def run(self, ctx): if ui == "pydata-sphinx": config = { "uiMachineOptions": { - "href": "https://cdn.jsdelivr.net/npm/itk-viewer-bootstrap-ui@0.11.0/dist/bootstrapUIMachineOptions.js.es.js", + "href": PYDATA_SPHINX_HREF, "export": "default", } } elif ui == "mui": config = { "uiMachineOptions": { - "href": "https://cdn.jsdelivr.net/npm/itk-viewer-material-ui@0.3.0/dist/materialUIMachineOptions.js.es.js", + "href": MUI_HREF, "export": "default", } } @@ -93,7 +94,7 @@ async def run(self, ctx): itk_viewer = await api.createWindow( name=f"itkwidgets viewer {_viewer_count}", type="itk-vtk-viewer", - src="https://bafybeicvblbtdzu7u6fdawt3muzd5t436xtbpu7cwdas3p3rcsjktxousq.on.fleek.co/", + src=ITK_VIEWER_SRC, fullscreen=True, data=self.init_data, # config should be a python data dictionary and can't be a string e.g. 'pydata-sphinx', diff --git a/itkwidgets/viewer_config.py b/itkwidgets/viewer_config.py new file mode 100644 index 00000000..57009654 --- /dev/null +++ b/itkwidgets/viewer_config.py @@ -0,0 +1,5 @@ +ITK_VIEWER_SRC = ( + "https://bafybeidzxfofr6cwqq6oxsbfwjpfufrf5nuxt56s42kqr6qsjphv5hfpce.on.fleek.co/" +) +PYDATA_SPHINX_HREF = "https://cdn.jsdelivr.net/npm/itk-viewer-bootstrap-ui@0.11.2/dist/bootstrapUIMachineOptions.js.es.js" +MUI_HREF = "https://cdn.jsdelivr.net/npm/itk-viewer-material-ui@0.3.0/dist/materialUIMachineOptions.js.es.js"