···
self.elements.extend(iterable)
def insert(self, i, element):
136
+
'''Inserts a top-level element at the given array index.'''
self.elements.insert(i, element)
def remove(self, element):
139
+
'''Removes a top-level element (except those with a z-index).'''
self.elements.remove(element)
142
+
'''Clears all drawing elements, with or without a z-index, but keeps
143
+
defs-type elements added with `append_def()`.
146
+
self.ordered_elements.clear()
def index(self, *args, **kwargs):
148
+
'''Finds the array-index of a top-level element (except those with a
return self.elements.index(*args, **kwargs)
def count(self, element):
153
+
'''Counts the number of top-level elements (except those with a z-index
return self.elements.count(element)
158
+
'''Reverses the order of all elements (except those with a z-index).'''
def draw_def(self, obj, **kwargs):
if not hasattr(obj, 'write_svg_element'):
···
id_map = defaultdict(id_gen)
252
-
prev_set = set((id(defn) for defn in self.other_defs))
dup = id(obj) in prev_set
258
-
prev_list.append(obj)
for element in self.other_defs:
if hasattr(element, 'write_svg_element'):