-
Notifications
You must be signed in to change notification settings - Fork 35
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
A few questions regarding ModeBar functions #38
Comments
Hi @Tomer-Tsaban this is not currently readily configurable with iheatmapr, unfortunately. However, there is a hacky back-door approach you can use to get this effect: # q is the heatmap object created above
# first convert it to an htmlwidgets object proper (this is normally done during the print process)
q_widget <- to_widget(q)
# Edit the htmlwidget object itself
q_widget$x$config$modeBarButtonsToRemove <- list(
'sendDataToCloud',
'toImage',
'autoScale2d',
'resetScale2d',
'hoverClosestCartesian',
'hoverCompareCartesian'
)
# you should be able to display the heatmap using q_widget similarly to how you would q. Having a |
Re the 2nd question -- I don't know. I am not aware of a way to do that. |
Hi Alicia, thanks for your answer! I tried to implement what you suggested (exactly your code) and for some reason I get this error: are you familiar with this? |
Try |
Hi, thanks for your quick responses! I tried again and figured out that the problem is with shiny package. anyhow, when trying the to_widget function in a non-shiny context, it works smoothly. ui<-fluidPage( server<-function(session,input,output){
} shinyApp(ui,server) |
Thanks for additional details... the issue is that renderIheatmap will call 'to_widget' but with the above approach that has already been done. As another temporary workaround, you could define renderIheatmap2 <- function(expr, env = parent.frame(), quoted = FALSE) {
if (!quoted) { expr <- substitute(expr) } # force quoted
htmlwidgets::shinyRenderWidget(expr, iheatmaprOutput, env, quoted = TRUE)
} and use that instead of renderIheatmap (basically an edit of that function that removes the call to 'to_widget') Will be much better to add ability to edit config directly to the package, but in meantime hope that unblocks whatever app you are working on. |
This works beautifully! |
@AliciaSchep May I had a question to your suggestion ? I succesfully removed logo using the strategy you suggested:
But the 'svg' output does not seem to work. Thank you. |
Another vote for allowing a custom config. This issue is currently unresolvable (even with the hacky way) in shiny apps because of #71 which was mentioned by @Tomer-Tsaban |
NiuBi! |
Hi Alicia,
I recently came across iheatmapr package and it is great! very useful and straight forward.
however, I have some questions regarding the functionality of the ModeBar (the bar of plotly designed options, of snapshot, zoom etc).
https://stackoverflow.com/questions/37437808/how-to-custom-or-display-modebar-in-plotly
this doesn't seem to work when I try it in iheatmap r, e.g. like this -
I get this error
Error in config(., displaylogo = FALSE, modeBarButtonsToRemove = list("sendDataToCloud", : could not find function "config"
Thanks alot!
The text was updated successfully, but these errors were encountered: