You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed that when there is more than 1 heatmaply in Rshiny, plotly::event_data would collect clicks for both, making differentiating between plot 1 and plot 2 very difficult.
Plotly does have an input variable called source. I make a fork of this repo and added this input variable to the Heatmaply code. Interestingly, it was easiest to overwrite the (default) source by the input source. Just pushing it to the regular heatmap object before px or py are added through the layout() function would not lead to the desired result.
Sorry, I have not done a PR before so might need a bit of guidance here.
As described in the plot_ly fuction description (https://rdrr.io/cran/plotly/src/R/plotly.R) the 'source' variable helps identify the right plot in the event_data() to retrieve events to a specific plot, as there can be more than one.
In the forked repo, all I did was overwrite the source string after the heatmap, dendogram have been added together. I tried doing it on only the heatmap, but doing so I could not capture the event correctly.
alanocallaghan
changed the title
Pull request: Added source as an input variable for Rshiny differentiation.
Added source as an input variable for Rshiny differentiation.
Sep 7, 2023
We noticed that when there is more than 1 heatmaply in Rshiny, plotly::event_data would collect clicks for both, making differentiating between plot 1 and plot 2 very difficult.
Plotly does have an input variable called source. I make a fork of this repo and added this input variable to the Heatmaply code. Interestingly, it was easiest to overwrite the (default) source by the input source. Just pushing it to the regular heatmap object before px or py are added through the layout() function would not lead to the desired result.
https://github.com/PatrickvanZalm/heatmaply
I tested it with the following code:
If it looks good on your end, I can initiate the pull request.
The text was updated successfully, but these errors were encountered: