diff --git a/js/css/brillouin.css b/js/css/brillouin.css index 6a4c701..0520782 100644 --- a/js/css/brillouin.css +++ b/js/css/brillouin.css @@ -1,5 +1,5 @@ .BZ-widget { - width: 100%; + width: 450px; height: 450px; align-items: center; } diff --git a/js/lib/example.js b/js/lib/example.js index e96eaa9..6a13d9d 100644 --- a/js/lib/example.js +++ b/js/lib/example.js @@ -58,8 +58,12 @@ var BrillouinZoneView = widgets.DOMWidgetView.extend({ this.model.on('change:path_vectors', this.vectors_changed, this); this.model.on('change:update_structure', this.reloadBZ, this); - this.el.innerHTML = '
' - + '
'; + this.width = this.model.get('width'); + this.height = this.model.get('height'); + + this.el.innerHTML = '
'; var jsondata = this.model.get('jsondata'); var faceColor = this.model.get('face_color'); diff --git a/widget_bzvisualizer/_version.py b/widget_bzvisualizer/_version.py index 36cdc75..a1fa517 100644 --- a/widget_bzvisualizer/_version.py +++ b/widget_bzvisualizer/_version.py @@ -1,5 +1,5 @@ # Module version -version_info = (0, 1, 0, 'alpha', 3) +version_info = (0, 1, 0, 'alpha', 4) # Module version stage suffix map _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''} diff --git a/widget_bzvisualizer/example.py b/widget_bzvisualizer/example.py index ce46548..59a6706 100644 --- a/widget_bzvisualizer/example.py +++ b/widget_bzvisualizer/example.py @@ -52,7 +52,11 @@ class BZVisualizer(widgets.DOMWidget): # Singal to update the structure update_structure = Int().tag(sync=True) - def __init__(self, cell, positions, numbers, face_color=True): + # Set the width and height of the widget + width = Unicode('450px').tag(sync=True) + height = Unicode('450px').tag(sync=True) + + def __init__(self, cell, positions, numbers, face_color=True, width='450px', height='450px'): if type(cell) == np.ndarray: cell = cell.tolist() @@ -62,7 +66,7 @@ def __init__(self, cell, positions, numbers, face_color=True): if type(numbers) == np.ndarray: numbers = numbers.tolist() - super().__init__(cell = cell, positions=positions, numbers=numbers, face_color=face_color) + super().__init__(cell = cell, positions=positions, numbers=numbers, face_color=face_color, width=width, height=height) system = (np.array(cell), np.array(positions), np.array(numbers)) res = seekpath.getpaths.get_path(system, with_time_reversal=False)