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))
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)
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)
def shape_palettes(path): path = None if path is None else path.split(".") return accessors.getitempath(shape_palette_libraries, path) if path else None
def __getitem__(self, key): return accessors.getitempath(self._obj, key_to_path(key))
def groupby(self): return list(filter(accessors.attrgetter("bound"), [accessors.getitempath(self, path) for path in self._groupby]))