Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter3d.on_click doesn't receive InputDeviceState object #4687

Open
ruoyu0088 opened this issue Jul 23, 2024 · 0 comments
Open

Scatter3d.on_click doesn't receive InputDeviceState object #4687

ruoyu0088 opened this issue Jul 23, 2024 · 0 comments
Labels
bug something broken P3 not needed for current cycle

Comments

@ruoyu0088
Copy link

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
@gvwilson gvwilson assigned gvwilson and unassigned gvwilson Jul 26, 2024
@gvwilson gvwilson added P3 not needed for current cycle bug something broken labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

2 participants