Beispiel #1
0
 def unbind(self, mark, key):
     key = key_to_path(key)
     property = accessors.getitempath(mark, key)
     if property is not None:
         property.unbind()
         self.binding_changed(mark)
     else:
         logger.warn('Unknown property "{}".'.format(key))
Beispiel #2
0
 def group_by(self, mark, key):
     key = key_to_path(key)
     property = accessors.getitempath(mark, key)
     if property is not None:
         property.grouping = GroupState.next(property.grouping)
         if property.grouping == 0:
             mark._groupby.remove(key)
         if property.grouping == 1:
             mark._groupby.append(key)
         self.binding_changed(mark)
Beispiel #3
0
 def sort_by(self, mark, key):
     key = key_to_path(key)
     property = accessors.getitempath(mark, key)
     if property is not None:
         property.sorting = SortState.next(property.sorting)
         if property.sorting == 0:
             mark._sortby.remove(key)
         if property.sorting == 1:
             mark._sortby.append(key)
         self.binding_changed(mark)
Beispiel #4
0
def shape_palettes(path):
    path = None if path is None else path.split(".")
    return accessors.getitempath(shape_palette_libraries, path) if path else None
Beispiel #5
0
 def __getitem__(self, key):
     return accessors.getitempath(self._obj, key_to_path(key))
Beispiel #6
0
 def groupby(self):
     return list(filter(accessors.attrgetter("bound"), [accessors.getitempath(self, path) for path in self._groupby]))