Answers for "'FigureWidget' object has no attribute 'on_selection'"

0

'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])
Posted by: Guest on November-30-2020

Code answers related to "'FigureWidget' object has no attribute 'on_selection'"

Python Answers by Framework

Browse Popular Code Answers by Language