def _handle_msg(self, message):
        """Handle a msg from the front-end.

        Args:
            content (dict): Content of the msg.
        """
        content = message['content']['data']['content']
        if content.get('event', '') == 'pong':
            self._graphId = content['graphId']

            # ready to recieve - pop out all of the items in the deque
            while self._clientMessages:
                _message = self._clientMessages.popleft()
                _message['graphId'] = self._graphId
                _message = json.dumps(_message)
                self._message = _message

        if content.get('event', '') in ['click', 'hover', 'zoom']:
            # De-nest the message
            if content['event'] == 'click' or content['event'] == 'hover':
                message = content['message']['points']
            elif content['event'] == 'zoom':
                message = content['message']['ranges']

            self._event_handlers[content['event']](self, message)

        if content.get('event', '') == 'getAttributes':
            self._attributes = content.get('response', {})

            # there might be a save pending, use the plotly module to save
            if self._flags['save_pending']:
                self._flags['save_pending'] = False
                url = py.plot(self._attributes, auto_open=False,
                              filename=self._filename, validate=False)
                self._new_url = url
                self._fade_to('slow', 1)
dataset/ETHPy150Open plotly/plotly.py/plotly/widgets/graph_widget.py/GraphWidget._handle_msg/original