Skip to content

Commit 0187578

Browse files
committed
add camera
1 parent 484c66d commit 0187578

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

zndraw/viewer.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,21 @@ class DashApp:
4747
def update_layout(self):
4848
"""Create a clean layout for the figure."""
4949
self.fig.update_layout(showlegend=False)
50+
51+
# Default parameters which are used when `layout.scene.camera` is not provided
52+
camera = {
53+
"up": {"x": 0, "y": 0, "z": 1},
54+
"center": {"x": 0, "y": 0, "z": 0},
55+
"eye": {"x": 0.75, "y": 0.75, "z": 0.75},
56+
}
57+
5058
self.fig.update_layout(
5159
scene=dict(
5260
xaxis=dict(visible=False),
5361
yaxis=dict(visible=False),
5462
zaxis=dict(visible=False),
55-
)
63+
),
64+
scene_camera=camera,
5665
)
5766

5867
def plot_atoms(self):

0 commit comments

Comments
 (0)