link¶
- LineStack.link(event_type, target, feature, new_data, callback=None, bidirectional=False)¶
Link this graphic to another graphic upon an
event_type
to change thefeature
of atarget
graphic.- Parameters:
event_type (str) â can be a pygfx event (âkey_downâ, âkey_upâ,âpointer_downâ, âpointer_moveâ, âpointer_upâ, âpointer_enterâ, âpointer_leaveâ, âclickâ, âdouble_clickâ, âwheelâ, âcloseâ, âresizeâ) or appropriate feature event (ex. colors, data, etc.) associated with the graphic (can use
graphic_instance.feature_events
to get a tuple of the valid feature events for the graphic)target (Any) â graphic to be linked to
feature (str) â feature (ex. colors, data, etc.) of the target graphic that will change following the event
new_data (Any) â appropriate data that will be changed in the feature of the target graphic after the event occurs
callback (callable, optional) â user-specified callable that will handle event, the callable must take the following four arguments | ââsourceââ - this graphic instance | ââtargetââ - the graphic to be changed following the event | ââeventââ - the ââpygfx eventââ or ââfeature eventââ that occurs | âânew_dataââ - the appropriate data of the ââtargetââ that will be changed
bidirectional (bool, default False) â
if True, the target graphic is also linked back to this graphic instance using the same arguments
For example: .. code-block::python
- Return type:
None