Skip to content

Commit 3cbc340

Browse files
committed
update hover api
1 parent 8e1a602 commit 3cbc340

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

plotly/widgets/graph_widget.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,15 @@ def relayout(self, layout):
135135
}
136136
self._handle_outgoing_message(message)
137137

138-
def hover(self, hover_obj, subplot=None):
138+
def hover(self, *hover_objs):
139+
# TODO: key check
140+
if len(hover_objs) == 1:
141+
hover_objs = hover_objs[0]
142+
139143
message = {
140-
'task': 'hover', 'selection': hover_obj, 'graphId': self._graphId
144+
'task': 'hover', 'selection': hover_objs, 'graphId': self._graphId
141145
}
142-
if subplot is not None:
143-
message['subplot'] = subplot
146+
144147
self._handle_outgoing_message(message)
145148

146149
def add_traces(self, traces, new_indices=None):
@@ -149,9 +152,10 @@ def add_traces(self, traces, new_indices=None):
149152
150153
If `new_indices` isn't specified, they are simply appended.
151154
152-
:param (list[dict]) traces: The list of trace dicts
153-
:param (list[int]|None|optional) new_indices: The final indices the
154-
added traces should occupy.
155+
Args:
156+
traces (dict or list of dicts, or class of plotly.graph_obj): trace
157+
new_indices (list[int]|None), optional: The final indices the
158+
added traces should occupy in the graph.
155159
156160
"""
157161
message = {

0 commit comments

Comments
 (0)