Skip to content

Commit

Permalink
add demo GIF file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dou Du committed Jun 16, 2024
1 parent 2dc5074 commit 2e0cddd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
Binary file added example/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 56 additions & 9 deletions example/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n",
"env: ANYWIDGET_HMR=1\n"
]
}
],
"source": [
"# This cell (autoloading & hot module replacement) is only needed for development!\n",
"%load_ext autoreload\n",
Expand All @@ -14,9 +24,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "067c689334a14910a7f11d529b60f922",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"BZVisualizer(disable_interact_overlay=True, height='800px', seekpath_data={'faces_data': {'triangles_vertices'…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from widget_bzvisualizer import BZVisualizer\n",
"\n",
Expand All @@ -32,7 +57,7 @@
"\n",
"bz = BZVisualizer(\n",
" cell, rel_coords, atom_numbers,\n",
" width=\"100%\", height=\"400px\",\n",
" width=\"100%\", height=\"800px\",\n",
" show_axes=True,\n",
" show_bvectors=True,\n",
" show_pathpoints=True,\n",
Expand All @@ -43,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -57,9 +82,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2acda8bf7ef946388c889d763521417b",
"version_major": 2,
"version_minor": 1
},
"text/plain": [
"BZVisualizer(height='800px', seekpath_data={'faces_data': {'triangles_vertices': [[-1.1089190599406602, -2.220…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Load info with ASE\n",
"# NOTE: (ASE is not included as a direct dependency, needs to be installed separately)\n",
Expand All @@ -71,10 +111,17 @@
" return struct.cell, struct.get_scaled_positions(), struct.numbers\n",
"\n",
"cell, rel_coords, atom_numbers = load_cell_info_ase(\"./mc3d-10016.cif\")\n",
"bz2 = BZVisualizer(cell, rel_coords, atom_numbers)\n",
"bz2 = BZVisualizer(cell, rel_coords, atom_numbers, width=\"100%\", height=\"800px\")\n",
"display(bz2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 2e0cddd

Please sign in to comment.