@@ -3647,14 +3647,13 @@ def uid(self, val):
3647
3647
def on_hover (self ,
3648
3648
callback ,
3649
3649
append = False ):
3650
- # typ.Callable[['BaseTraceType', Points, InputDeviceState], None]
3651
3650
"""
3652
3651
Register function to be called when the user hovers over one or more
3653
3652
points in this trace
3654
3653
3655
3654
Note: Callbacks will only be triggered when the trace belongs to a
3656
3655
instance of plotly.graph_objs.FigureWidget and it is displayed in an
3657
- ipywidget context. Callbacks will not be triggered when on figures
3656
+ ipywidget context. Callbacks will not be triggered on figures
3658
3657
that are displayed using plot/iplot.
3659
3658
3660
3659
Parameters
@@ -3675,6 +3674,21 @@ def on_hover(self,
3675
3674
Returns
3676
3675
-------
3677
3676
None
3677
+
3678
+ Examples
3679
+ --------
3680
+ >>> from plotly.callbacks import Points, InputDeviceState
3681
+ >>> points, state = Points(), InputDeviceState()
3682
+
3683
+ >>> def hover_fn(trace, points, state):
3684
+ ... inds = points.point_inds
3685
+ ... # Do something
3686
+
3687
+ >>> trace.on_hover(hover_fn)
3688
+
3689
+ Note: The creation of the `points` and `state` objects is optional,
3690
+ it's simply a convenience to help the text editor perform completion
3691
+ on the arguments inside `hover_fn`
3678
3692
"""
3679
3693
if not append :
3680
3694
del self ._hover_callbacks [:]
@@ -3700,7 +3714,7 @@ def on_unhover(self,
3700
3714
3701
3715
Note: Callbacks will only be triggered when the trace belongs to a
3702
3716
instance of plotly.graph_objs.FigureWidget and it is displayed in an
3703
- ipywidget context. Callbacks will not be triggered when on figures
3717
+ ipywidget context. Callbacks will not be triggered on figures
3704
3718
that are displayed using plot/iplot.
3705
3719
3706
3720
Parameters
@@ -3721,6 +3735,21 @@ def on_unhover(self,
3721
3735
Returns
3722
3736
-------
3723
3737
None
3738
+
3739
+ Examples
3740
+ --------
3741
+ >>> from plotly.callbacks import Points, InputDeviceState
3742
+ >>> points, state = Points(), InputDeviceState()
3743
+
3744
+ >>> def unhover_fn(trace, points, state):
3745
+ ... inds = points.point_inds
3746
+ ... # Do something
3747
+
3748
+ >>> trace.on_unhover(unhover_fn)
3749
+
3750
+ Note: The creation of the `points` and `state` objects is optional,
3751
+ it's simply a convenience to help the text editor perform completion
3752
+ on the arguments inside `unhover_fn`
3724
3753
"""
3725
3754
if not append :
3726
3755
del self ._unhover_callbacks [:]
@@ -3746,7 +3775,7 @@ def on_click(self,
3746
3775
3747
3776
Note: Callbacks will only be triggered when the trace belongs to a
3748
3777
instance of plotly.graph_objs.FigureWidget and it is displayed in an
3749
- ipywidget context. Callbacks will not be triggered when on figures
3778
+ ipywidget context. Callbacks will not be triggered on figures
3750
3779
that are displayed using plot/iplot.
3751
3780
3752
3781
Parameters
@@ -3767,6 +3796,21 @@ def on_click(self,
3767
3796
Returns
3768
3797
-------
3769
3798
None
3799
+
3800
+ Examples
3801
+ --------
3802
+ >>> from plotly.callbacks import Points, InputDeviceState
3803
+ >>> points, state = Points(), InputDeviceState()
3804
+
3805
+ >>> def click_fn(trace, points, state):
3806
+ ... inds = points.point_inds
3807
+ ... # Do something
3808
+
3809
+ >>> trace.on_click(click_fn)
3810
+
3811
+ Note: The creation of the `points` and `state` objects is optional,
3812
+ it's simply a convenience to help the text editor perform completion
3813
+ on the arguments inside `click_fn`
3770
3814
"""
3771
3815
if not append :
3772
3816
del self ._click_callbacks [:]
@@ -3792,7 +3836,7 @@ def on_selection(
3792
3836
3793
3837
Note: Callbacks will only be triggered when the trace belongs to a
3794
3838
instance of plotly.graph_objs.FigureWidget and it is displayed in an
3795
- ipywidget context. Callbacks will not be triggered when on figures
3839
+ ipywidget context. Callbacks will not be triggered on figures
3796
3840
that are displayed using plot/iplot.
3797
3841
3798
3842
Parameters
0 commit comments