Skip to content

Commit

Permalink
Merge branch 'main' into feature/integrate-with-structuremanager-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Mar 4, 2024
2 parents 24ff530 + 43d39f7 commit f1acf57
Show file tree
Hide file tree
Showing 7 changed files with 567 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx_rtd_theme==1.2.2
nbsphinx==0.9.2
sphinx_rtd_theme==2.0.0
nbsphinx==0.9.3
ipython
ase
18 changes: 18 additions & 0 deletions docs/source/camera.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
===================
Camera
===================

Setting
=============

One can set the direction and zoom of the camera:

.. code-block:: python
viewer.cameraSetting = {"direction": [0, 5, 1], "zoom": 2}
Camera Type
=============

For the moment, only orthographic camera is supported.
2 changes: 1 addition & 1 deletion docs/source/color.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Supported style are:


Color by attribute
----------------
----------------------
Coloring based on the attribute of the atoms. The attribute can be: charge, magmom, or any other attribute in the structure.

Here we show how to color the atoms by their forces.
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ A widget to visualize and interact with atomistic structures in Jupyter Notebook
mesh_primitive
search_operator
selection
camera
gallery


Expand Down
26 changes: 25 additions & 1 deletion docs/source/quick_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,36 @@
"<img src=_static/images/example_color_by_force.png width=300px />\n"
]
},
{
"cell_type": "markdown",
"id": "69f8b8f3",
"metadata": {},
"source": [
"### Camera setting\n",
"\n",
"One can set the direction and zoom of the camera:\n",
"\n",
"```python\n",
"viewer.cameraSetting = {\"direction\": [0, 5, 1], \"zoom\": 2}\n",
"```\n"
]
},
{
"cell_type": "markdown",
"id": "ede9f9c6",
"metadata": {},
"source": [
"### Download image"
"### Export image\n",
"\n",
"Save image to a path by:\n",
"\n",
"```python\n",
"viewer.save_image(\"/homg/xing/filename.png\")\n",
"```\n",
"\n",
"\n",
"\n",
"Trigger the download panel by:"
]
},
{
Expand Down
Loading

0 comments on commit f1acf57

Please sign in to comment.