Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.colors = {}
self.view._remote_call('setSize', target='Widget',
args=['%dpx' % (xsize,), '%dpx' % (ysize,)])
self.view.add_unitcell()
self.view.add_spacefill()
self.view.remove_ball_and_stick()
self.view.camera = 'orthographic'
self.view.parameters = { "clipDist": 0 }
self.view.center()
self.asel = Dropdown(options=['All'] +
list(set(self.struct.get_chemical_symbols())),
value='All', description='Show')
self.csel = Dropdown(options=nglview.color.COLOR_SCHEMES,
value='element', description='Color scheme')
self.rad = FloatSlider(value=0.5, min=0.0, max=1.5, step=0.01,
description='Ball size')
self.asel.observe(self._select_atom)
self.csel.observe(self._update_repr)
self.rad.observe(self._update_repr)
self.view.update_spacefill(radiusType='covalent',
radiusScale=0.5,
color_scheme=self.csel.value,
color_scale='rainbow')
wdg = [self.asel, self.csel, self.rad]
if self.frm: