Example #1
0
 def update_visualisation(self):
     if not (ctrl.document and ctrl.forest):
         return
     data = ctrl.forest.vis_data
     if data and 'name' in data:
         index = list(VISUALIZATIONS.keys()).index(data['name'])
         self.selector.setCurrentIndex(index)
Example #2
0
    def watch_alerted(self, obj, signal, field_name, value):
        """ Receives alerts from signals that this object has chosen to listen. These signals
         are declared in 'self.watchlist'.

         This method will try to sort out the received signals and act accordingly.

        :param obj: the object causing the alarm
        :param signal: identifier for type of the alarm
        :param field_name: name of the field of the object causing the alarm
        :param value: value given to the field
        :return:
        """
        if signal == 'visualization':
            if value and 'name' in value:
                index = list(VISUALIZATIONS.keys()).index(value['name'])
                self.selector.setCurrentIndex(index)
Example #3
0
    def watch_alerted(self, obj, signal, field_name, value):
        """ Receives alerts from signals that this object has chosen to listen. These signals
         are declared in 'self.watchlist'.

         This method will try to sort out the received signals and act accordingly.

        :param obj: the object causing the alarm
        :param signal: identifier for type of the alarm
        :param field_name: name of the field of the object causing the alarm
        :param value: value given to the field
        :return:
        """
        if signal == 'visualization':
            if value and 'name' in value:
                index = list(VISUALIZATIONS.keys()).index(value['name'])
                self.selector.setCurrentIndex(index)
Example #4
0
 def build_visualizations(key, d, widget):
     choices = list(VISUALIZATIONS.keys())
     return Selector(key, widget, choices), False
Example #5
0
 def build_visualizations(self, key, d):
     choices = list(VISUALIZATIONS.keys())
     return Selector(key, self, choices), False
Example #6
0
 def build_visualizations(key, d, widget):
     choices = list(VISUALIZATIONS.keys())
     return Selector(key, widget, choices), False