diff --git a/example/demo.gif b/example/demo.gif new file mode 100644 index 0000000..ef6070e Binary files /dev/null and b/example/demo.gif differ diff --git a/example/example.ipynb b/example/example.ipynb index 0dbd3d5..85d989f 100644 --- a/example/example.ipynb +++ b/example/example.ipynb @@ -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", @@ -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", @@ -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", @@ -43,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -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", @@ -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,