grapa.shared.string_manipulations.TextHandler
- class grapa.shared.string_manipulations.TextHandler
Bases:
objecttext are draw onto plot as Annotations
- __init__()
Methods
add(graph, text, textxy[, textargs])Adds a text to be annotated in the plot, handling the not-so-nice internal implementation text, textxy, textargs: as single elements, or as lists (1 item per annotation)
check_valid(graph)validates
remove(graph[, by_id])By default, removes the last text annotation in the list (pop)
- classmethod add(graph, text, textxy, textargs=None)
Adds a text to be annotated in the plot, handling the not-so-nice internal implementation text, textxy, textargs: as single elements, or as lists (1 item per annotation)
- classmethod check_valid(graph) → Tuple[List[str], List, List[Dict]]
validates
- classmethod remove(graph, by_id=-1)
By default, removes the last text annotation in the list (pop)
- Parameters:
graph – the Graph object to act on
by_id – index of the annotation to remove
- Returns:
a dict with initial text values, prior to removal (use case: restore)