Skip to content

Commit

Permalink
Change default annotation type to string (#4172)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jan 8, 2020
1 parent 7743d57 commit 7017524
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions holoviews/annotators.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ def _process_element(self, element=None):
validate.append(col)
continue
init = self.annotations[col]() if isinstance(self.annotations, dict) else ''
element = element.add_dimension(col, 0, init, True)
element = element.add_dimension(col, len(element.vdims), init, True)
for col in self.vertex_annotations:
if col in element:
continue
elif isinstance(self.vertex_annotations, dict):
init = self.vertex_annotations[col]()
else:
init = ''
element = element.add_dimension(col, 0, init, True)
element = element.add_dimension(col, len(element.vdims), init, True)

# Validate annotations
poly_data = {c: element.dimension_values(c, expanded=False)
Expand Down Expand Up @@ -449,7 +449,7 @@ def _process_element(self, object):
for col in self.annotations:
if col in object:
continue
init = self.annotations[col]() if isinstance(self.annotations, dict) else None
init = self.annotations[col]() if isinstance(self.annotations, dict) else ''
object = object.add_dimension(col, len(object.vdims), init, True)

# Add options
Expand Down

0 comments on commit 7017524

Please sign in to comment.