-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
plotly_click not working after version 1.31.2 #2272
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
Comments
Yes, this still happens with 1.33.0. The graph is a bar chart. |
OK, I'm going to need a bit more information than that - generally as far as I can tell bar charts do still support |
Alex, taking the code out and put it into codepen will require some significant time. It has dependencies to react and specific data and currently it is not so easy to isolate the code (I agree this is not ideal). Is there something quick I can investigate on my end to get to the root cause quicker? |
If it's purely a plotly.js issue, it should be possible to recreate it from the plot's // get the graph DOM element (if you only have one Plotly plot on the page)
var gd = document.querySelector('.js-plotly-plot')
// get the data and layout - this is basically equivalent to:
// JSON.stringify({data: gd.data, layout: gd.layout})
console.log(Plotly.Plots.graphJson(gd))
// if you gave the plot a custom config parameter, we may need that too
console.log(JSON.stringify(gd._context))
// you can copy both of those into a codepen and remake the identical plot
var fig = {"data": [...], "layout": {...}}
var config = {"staticPlot": false, ...}
Plotly.newPlot(gd, fig.data, fig.layout, config)
gd.on('plotly_click', function(e) { console.log('click', e) }); If the problem still shows up, then great! I can take a look at it. If not, this is also useful, it shows that there's something interfering at the application level. |
Ok, this codepen shows the issue I don't see the console log when I click a bar. |
Thanks @step42 - this is indeed #2265 ( You can load old versions from the CDN like: |
Thanks. That fixed it! |
Hi,
the code below used to work with version <= 1.31.2. Now with the version 1.32 the plotly_click is no longer called. Any ideas why?
Thanks
Step
The text was updated successfully, but these errors were encountered: