Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Nov 22, 2024
1 parent 592c5d1 commit e06c452
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 71 deletions.
2 changes: 1 addition & 1 deletion nglview/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def download_image(self,
kwargs=params)

def _handle_request_frame(self):
frame = self.frame
frame = self.frame + 1
if frame > self.max_frame:
frame = 0
elif frame < 0:
Expand Down
121 changes: 103 additions & 18 deletions notebooks/render_image.ipynb

Large diffs are not rendered by default.

57 changes: 5 additions & 52 deletions notebooks/trajectory_player.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c6665ccdb72143e5b28a95bf828ae552",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"_ColormakerRegistry()"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3cd409d052ba465fbf57d1c93bfee878",
"model_id": "990b22023ae14df1a9cfac55daeae32c",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -42,44 +28,11 @@
"view = nv.show_pytraj(traj)\n",
"view"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"view._ngl_serialize = True"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3cd409d052ba465fbf57d1c93bfee878",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget(frame=37, max_frame=37, n_components=1)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"view"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -93,7 +46,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.14"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down Expand Up @@ -10476,5 +10429,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit e06c452

Please sign in to comment.