'FigureWidget' object has no attribute 'on_selection' code example
Example: 'FigureWidget' object has no attribute 'on_selection'
import plotly.graph_objs as go
from ipywidgets import Output, VBox
fig = go.FigureWidget()
fig.add_pie(values=[1, 2, 3])
pie = fig.data[0]
out = Output()
@out.capture(clear_output=True)
def handle_click(trace, points, state):
print(points.point_inds)
pie.on_click(handle_click)
VBox([fig, out])