Open
Description
Here is the code:
import plotly.graph_objects as go
import numpy as np
import ipywidgets
np.random.seed(1)
scatter_1 = go.Scatter3d(x=np.random.rand(100), y=np.random.rand(100), z=np.random.rand(100), mode='markers', marker={"size":2},)
f = go.FigureWidget()
f.add_trace(scatter_1)
o = ipywidgets.Output()
@o.capture(clear_output=True)
def callback(trace, points, selector):
print(points)
print(selector)
f.data[0].on_click(callback)
ipywidgets.HBox([f, o])
click on any point, and the output is as following, the selector argument is None:
Points(point_inds=[69],
xs=[0.5865550405019929],
ys=[0.5688514370864813],
trace_name='trace 0',
trace_index=0)
None