diff --git a/aiidalab_widgets_base/structures.py b/aiidalab_widgets_base/structures.py index c3f4ecea8..ff3fc42c8 100644 --- a/aiidalab_widgets_base/structures.py +++ b/aiidalab_widgets_base/structures.py @@ -187,11 +187,11 @@ def _structure_editors(self, editors): ) if editor.has_trait("selection"): tl.link((editor, "selection"), (self.viewer, "selection")) - if editor.has_trait("camera_orientation"): - tl.dlink( - (self.viewer._viewer, "_camera_orientation"), - (editor, "camera_orientation"), - ) + # if editor.has_trait("camera_orientation"): + # tl.dlink( + # (self.viewer._viewer, "_camera_orientation"), + # (editor, "camera_orientation"), + # ) return editors_tab return None @@ -337,7 +337,6 @@ def _structure_changed(self, change=None): This function enables/disables `btn_store` widget if structure is provided/set to None. Also, the function sets `structure_node` trait to the selected node type. """ - if not self.structure_set_by_undo: self.history.append(change["new"]) diff --git a/notebooks/structures.ipynb b/notebooks/structures.ipynb index 1b172b0c1..e74899b8c 100644 --- a/notebooks/structures.ipynb +++ b/notebooks/structures.ipynb @@ -37,7 +37,26 @@ "metadata": {}, "outputs": [], "source": [ - "import aiidalab_widgets_base as awb" + "import aiidalab_widgets_base as awb\n", + "import weas_widget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "guiConfig={\"enabled\": True,\n", + " \"components\": {\"atomsControl\": True,\n", + " \"colorControl\": True,\n", + " \"buttons\": True,},\n", + " \"buttons\": {\"fullscreen\": True,\n", + " \"download\": True,\n", + " \"measurement\": True,\n", + " }\n", + " }\n", + "viewer = weas_widget.WeasWidget(guiConfig=guiConfig)" ] }, { @@ -63,6 +82,7 @@ " awb.BasicStructureEditor(title=\"Basic Editor\"),\n", " awb.BasicCellEditor(title=\"Basic Cell Editor\"),\n", " ],\n", + " viewer=viewer,\n", ")\n", "# widget = StructureUploadWidget()\n", "# Enforce node format to be CifData:\n", @@ -72,6 +92,15 @@ "# widget = StructureManagerWidget(importers = [(\"From computer\", StructureUploadWidget())], storable=False)\n", "display(widget)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "viewer" + ] } ], "metadata": { diff --git a/setup.cfg b/setup.cfg index fb72f8d5e..adfa928c8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,6 +36,7 @@ install_requires = nglview~=3.0 spglib>=1.14,<3 vapory~=0.1.2 + weas-widget python_requires = >=3.9 include_package_data = True zip_safe = False