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

removing old add_legend in shiny app #209

Open
todd-james opened this issue Dec 6, 2022 · 3 comments
Open

removing old add_legend in shiny app #209

todd-james opened this issue Dec 6, 2022 · 3 comments

Comments

@todd-james
Copy link

Hi @crazycapivara,

I was wondering whether you would be able to help me with a few issues I am facing when implementing deckgl in a shiny application. I have detailed the issues on a couple of stackoverflow posts here and here, which also contain working examples of the issues.

The primary difficulty I am facing is the persistent of old legends on outputs of deckglOutput, where changing/updating add_legend parameters to include new variables that are representative of the new data that are being displayed just add an additional legend that clutters the plot view, as opposed to replacing the old legend.

This is also an issue when I have multiple deckglOutput with different data, where the legend are plot on the incorrect output.

Any guidance or assistance resolving these issues would be greatly appreciated!

Thanks, James

@crazycapivara
Copy link
Owner

Hi @todd-james, unfortunately you are right, there is no function yet to remove a legend, so you would need to pass some javascript to do so.

@todd-james
Copy link
Author

Hi @crazycapivara,

Thank you for the clarification! Unfortunately I haven't got any experience with javascript. Please may you send some sample code that can be implemented in R or point me in the direction of how I might attempt this myself. Thanks.

@sbmkvp
Copy link

sbmkvp commented Apr 25, 2023

you can add script as a tag in the ui.r

tags$head(tags$script(" Your JS Code "))
or
tags$head(HTML("<script type='text/javascript'> Your JS Code </script>"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants