pickο
- class eomaps._cb_container.cb_pick_container(picker_name='default', picker=None, *args, **kwargs)ο
Callbacks that select the nearest datapoint if you click on the map. (you must plot a dataset with m.plot_map() first!)
The event will search for the closest data-point and execute the callback with the properties (e.g. position , ID, value) of the selected point.
Note
To speed up identification of points for very large datasets, the search is limited to points located inside a βsearch rectangleβ. The side-length of this rectangle is determined in the plot-crs and can be set via m.cb.pick.set_props(search_radius=β¦).
The default is to use a side-length of 50 times the dataset-radius.
- attach : accessor for callbacks.
Executing the functions will attach the associated callback to the map!
- get : accessor for return-objects
A container to provide easy-access to the return-values of the callbacks.
- remove : remove prviously added callbacks from the map
- forward_events : forward events to connected maps-objects
- share_events : share events between connected maps-objects (e.g. forward both ways)
- set_sticky_modifiers : define keypress-modifiers that remain active after release
- set_props : set the picking behaviour (e.g. number of points, search radius, etc.)
- set_props(n=None, consecutive_pick=None, pick_relative_to_closest=None, search_radius=None)ο
Set the picker-properties (number of picked points, max. search radius, etc.) (Only provided arguments will be updated!)
- Parameters
n (int, optional) β The number of nearest neighbours to pick at each pick-event. The default is 1.
consecutive_pick (bool, optional) β
If True, pick-callbacks will be executed consecutively for each picked datapoint.
if False, pick-callbacks will get lists of all picked values as input-arguments
The default is False.
pick_relative_to_closest (bool, optional) β
ONLY relevant if n > 1.
If True: pick (n) nearest neighbours based on the center of the closest identified datapoint
If False: pick (n) nearest neighbours based on the click-position
The default is True.
search_radius (int, float, str or None optional) β
Set the radius of the area that is used to limit the number of pixels when searching for nearest-neighbours.
- if int or float:
The radius of the circle in units of the plot_crs
- if `str:
A multiplication-factor for the estimated pixel-radius. (e.g. a circle with (r=search_radius * m.shape.radius) is used if possible and else np.inf is used.
The default is β50β (e.g. 50 times the pixel-radius).