Derived classes must override the following methods:
def save_offset(self): ''' Called when the object is picked for dragging; should save the reference position of the artist. ''' def update_offset(self, dx, dy): ''' Called during the dragging; (*dx*, *dy*) is the pixel offset from the point where the mouse drag started. '''
Optionally, you may override the following method:
def finalize_offset(self): '''Called when the mouse is released.'''
In the current implementation of .DraggableLegend
and DraggableAnnotation
, :None:None:`update_offset`
places the artists in display coordinates, and :None:None:`finalize_offset`
recalculates their position in axes coordinate and set a relevant attribute.
Helper base class for a draggable artist (legend, offsetbox).
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them