11import collections
22import re
3- import typing as typ
43import warnings
54from contextlib import contextmanager
65from copy import deepcopy , copy
76from pprint import PrettyPrinter
8- from typing import Dict , Tuple , Union , Callable , List
97
10- from plotly .optional_imports import get_module
8+ from .optional_imports import get_module
119
12- import plotly . offline as pyo
10+ from . import offline as pyo
1311from _plotly_utils .basevalidators import (
1412 CompoundValidator , CompoundArrayValidator , BaseDataValidator ,
1513 BaseValidator )
16- from plotly import animation
17- from plotly .callbacks import (Points , BoxSelector , LassoSelector ,
14+ from . import animation
15+ from .callbacks import (Points , BoxSelector , LassoSelector ,
1816 InputDeviceState )
19- from plotly .utils import ElidedPrettyPrinter
20- from plotly .validators import (DataValidator , LayoutValidator , FramesValidator )
17+ from .utils import ElidedPrettyPrinter
18+ from .validators import (DataValidator , LayoutValidator , FramesValidator )
19+
2120
2221# Optional imports
2322# ----------------
@@ -2260,7 +2259,7 @@ def plotly_name(self):
22602259 return self ._plotly_name
22612260
22622261 @property
2263- def _parent_path_str (self ) -> str :
2262+ def _parent_path_str (self ):
22642263 """
22652264 dot-separated path string to this object's parent.
22662265
@@ -2283,7 +2282,7 @@ def _parent_path_str(self) -> str:
22832282 raise NotImplementedError
22842283
22852284 @property
2286- def _prop_descriptions (self ) -> str :
2285+ def _prop_descriptions (self ):
22872286 """
22882287 Formatted string containing all of this obejcts child properties
22892288 and their descriptions
@@ -3162,7 +3161,7 @@ def _dispatch_change_callbacks(self, changed_paths):
31623161 for callback in callbacks :
31633162 callback (self , * callback_args )
31643163
3165- def on_change (self , callback , * args , append = False ):
3164+ def on_change (self , callback , append = False , * args ):
31663165 """
31673166 Register callback function to be called when certain properties or
31683167 subproperties of this object are modified.
@@ -3297,7 +3296,7 @@ class BaseLayoutHierarchyType(BasePlotlyType):
32973296 """
32983297
32993298 @property
3300- def _parent_path_str (self ) -> str :
3299+ def _parent_path_str (self ):
33013300 pass
33023301
33033302 def __init__ (self , plotly_name , ** kwargs ):
@@ -3603,7 +3602,7 @@ def __init__(self, plotly_name, **kwargs):
36033602 # ---
36043603 # All trace types must have a top-level UID
36053604 @property
3606- def uid (self ) -> str :
3605+ def uid (self ):
36073606 raise NotImplementedError
36083607
36093608 @uid .setter
@@ -3613,9 +3612,9 @@ def uid(self, val):
36133612 # Hover
36143613 # -----
36153614 def on_hover (self ,
3616- callback : typ .Callable [
3617- ['BaseTraceType' , Points , InputDeviceState ], None ],
3615+ callback ,
36183616 append = False ):
3617+ # typ.Callable[['BaseTraceType', Points, InputDeviceState], None]
36193618 """
36203619 Register function to be called when the user hovers over one or more
36213620 points in this trace
@@ -3650,7 +3649,7 @@ def on_hover(self,
36503649 if callback :
36513650 self ._hover_callbacks .append (callback )
36523651
3653- def _dispatch_on_hover (self , points : Points , state : InputDeviceState ):
3652+ def _dispatch_on_hover (self , points , state ):
36543653 """
36553654 Dispatch points and device state all all hover callbacks
36563655 """
@@ -3660,8 +3659,7 @@ def _dispatch_on_hover(self, points: Points, state: InputDeviceState):
36603659 # Unhover
36613660 # -------
36623661 def on_unhover (self ,
3663- callback : typ .Callable [
3664- ['BaseTraceType' , Points , InputDeviceState ], None ],
3662+ callback ,
36653663 append = False ):
36663664 """
36673665 Register function to be called when the user unhovers away from one
@@ -3697,7 +3695,7 @@ def on_unhover(self,
36973695 if callback :
36983696 self ._unhover_callbacks .append (callback )
36993697
3700- def _dispatch_on_unhover (self , points : Points , state : InputDeviceState ):
3698+ def _dispatch_on_unhover (self , points , state ):
37013699 """
37023700 Dispatch points and device state all all hover callbacks
37033701 """
@@ -3707,8 +3705,7 @@ def _dispatch_on_unhover(self, points: Points, state: InputDeviceState):
37073705 # Click
37083706 # -----
37093707 def on_click (self ,
3710- callback : typ .Callable [
3711- ['BaseTraceType' , Points , InputDeviceState ], None ],
3708+ callback ,
37123709 append = False ):
37133710 """
37143711 Register function to be called when the user clicks on one or more
@@ -3743,7 +3740,7 @@ def on_click(self,
37433740 if callback :
37443741 self ._click_callbacks .append (callback )
37453742
3746- def _dispatch_on_click (self , points : Points , state : InputDeviceState ):
3743+ def _dispatch_on_click (self , points , state ):
37473744 """
37483745 Dispatch points and device state all all hover callbacks
37493746 """
@@ -3754,9 +3751,7 @@ def _dispatch_on_click(self, points: Points, state: InputDeviceState):
37543751 # ------
37553752 def on_selection (
37563753 self ,
3757- callback : typ .Callable [[
3758- 'BaseTraceType' , Points , typ .Union [BoxSelector , LassoSelector ]
3759- ], None ],
3754+ callback ,
37603755 append = False ):
37613756 """
37623757 Register function to be called when the user selects one or more
@@ -3793,8 +3788,8 @@ def on_selection(
37933788 self ._select_callbacks .append (callback )
37943789
37953790 def _dispatch_on_selection (self ,
3796- points : Points ,
3797- selector : typ . Union [ BoxSelector , LassoSelector ] ):
3791+ points ,
3792+ selector ):
37983793 """
37993794 Dispatch points and selector info to selection callbacks
38003795 """
0 commit comments