plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Plotly on_click Function not working on Google Colab

Open kaansen97 opened this issue 4 years ago • 1 comments

Hello I'm trying to display the figure of this code in google colab and jupyter notebook , it's figuring the plot but when I try to click each point it's not working, it should be turning a green circle, I think the problem is on_click function but i couldn't resolute that problem can anyone help me?

` import plotly.graph_objects as go

import numpy as np np.random.seed(1)

x = np.random.rand(100) y = np.random.rand(100)

f = go.FigureWidget([go.Scatter(x=x, y=y, mode='markers')])

scatter = f.data[0] colors = ['#a3a7e4'] * 100 scatter.marker.color = colors scatter.marker.size = [10] * 100 f.layout.hovermode = 'closest'

create our callback function

def update_point(trace, points, selector): c = list(scatter.marker.color) s = list(scatter.marker.size) for i in points.point_inds: c[i] = '#bae2be' s[i] = 20 with f.batch_update(): scatter.marker.color = c scatter.marker.size = s

scatter.on_click(update_point)

f `

kaansen97 avatar Apr 02 '22 09:04 kaansen97

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

gvwilson avatar Jul 03 '24 17:07 gvwilson