Skip to content

Commit

Permalink
FIX: ipywidgets 7.4 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Aug 8, 2018
1 parent 4d88822 commit 47a2369
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nglview/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
import json
import numpy as np
from IPython.display import display
from ipywidgets import Box, DOMWidget, widget_image
from ipywidgets import Box, DOMWidget
try:
# ipywidgets >= 7.4
from ipywidgets import Image
except ImportError:
from ipywidgets.widget_image import Image

import ipywidgets.embed
from traitlets import (Unicode, Bool, Dict, List, Int, Integer, observe,
CaselessStrEnum)
Expand Down Expand Up @@ -150,7 +156,7 @@ def __init__(self,
self._gui = None
self._init_gui = kwargs.pop('gui', False)
self._theme = kwargs.pop('theme', 'default')
self._widget_image = widget_image.Image()
self._widget_image = Image()
self._widget_image.width = 900.
self._image_array = []
# do not use _displayed_callbacks since there is another Widget._display_callbacks
Expand Down

0 comments on commit 47a2369

Please sign in to comment.