Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _on_action_details(self, msg):
params = msg['content']['data']['content']
graphics_object = None
for item in self.chart.graphics_list:
if item.uid == params['itemId']:
graphics_object = item
action_type = params['params']['actionType']
if action_type == 'onclick' or action_type == 'onkey':
self.details = GraphicsActionObject(graphics_object, params['params'])
arguments = dict(target_name='beakerx.tag.run')
comm = Comm(**arguments)
msg = {'runByTag': params['params']['tag']}
state = {'state': msg}
comm.send(data=state, buffers=[])
def _handle_msg(self, msg):
if 'content' in msg['content']['data']:
params = msg['content']['data']['content']
graphics_object = None
for item in self.chart.graphics_list:
if item.uid == params['itemId']:
graphics_object = item
self.details = GraphicsActionObject(graphics_object, params['params'])
if params['event'] == 'onclick':
self._on_click_action(msg)
elif params['event'] == 'onkey':
self._on_key_action(msg)
elif params['event'] == 'actiondetails':
self._on_action_details(msg)
def __init__(self, **kwargs):
super(Plot, self).__init__(**kwargs)
self.chart = XYChart(**kwargs)
self.model = self.chart.transform()
self.on_msg(self._handle_msg)
self.details = GraphicsActionObject(None, {})
def _handle_msg(self, msg):
params = msg['content']['data']['content']
graphics_object = None
for item in self.chart.graphics_list:
if item.uid == params['itemId']:
graphics_object = item
self.details = GraphicsActionObject(graphics_object, params['params'])
if params['event'] == 'onclick':
self._on_click_action(msg)
elif params['event'] == 'onkey':
self._on_key_action(msg)
elif params['event'] == 'actiondetails':
self._on_action_details(msg)
def _on_action_details(self, msg):
params = msg['content']['data']['content']
graphics_object = None
for item in self.chart.graphics_list:
if item.uid == params['itemId']:
graphics_object = item
action_type = params['params']['actionType']
if action_type == 'onclick' or action_type == 'onkey':
self.details = GraphicsActionObject(graphics_object, params['params'])
arguments = dict(target_name='beakerx.tag.run')
comm = Comm(**arguments)
msg = {'runByTag': params['params']['tag']}
state = {'state': msg}
comm.send(data=state, buffers=[])
def __init__(self, **kwargs):
super(Plot, self).__init__()
self.chart = XYChart(**kwargs)
self.model = self.chart.transform()
self.on_msg(self._handle_msg)
self.details = GraphicsActionObject(None, {})