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

Add flowmapblue to quarto chunk #14

Open
RobWiederstein opened this issue Oct 27, 2024 · 3 comments
Open

Add flowmapblue to quarto chunk #14

RobWiederstein opened this issue Oct 27, 2024 · 3 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@RobWiederstein
Copy link

I've got a quarto website where I'm trying to add the flowmapblue plot:

#| eval: TRUE
mapboxAccessToken <- Sys.getenv("MAPBOX")
flowmapblue(locations, flows, mapboxAccessToken,
            clustering = TRUE, darkMode = TRUE, animation = FALSE) -> flowmap 
flowmap

When the website renders, the plot is outside of the code block and the CSS on the page gets changed. I've tried to use it with function widgetframe::framewidget() but no luck. Any general ideas would be helpful. I'm confident it can be done, because I saw it on Professor Moraga's post: https://www.paulamoraga.com/blog/2020-07-11-mobility.html.

Many thanks and love the package! It works great from the console.

@e-kotov
Copy link
Collaborator

e-kotov commented Oct 27, 2024

Hi @RobWiederstein , I've recently noticed this problem too. I solved it with:

htmlwidgets::saveWidget(flowmap, "flowmap.html")
library(shiny)
shiny::tags$iframe(src = "flowmap_widget.html", width = "100%", height = "600px")

So basically you have to dump the map into an html file and then paste it back as an iframe, sort of.

This is a workaround...

@RobWiederstein
Copy link
Author

Perfect! Worked great and thanks so much!

@e-kotov e-kotov added bug Something isn't working documentation Improvements or additions to documentation labels Oct 27, 2024
@e-kotov
Copy link
Collaborator

e-kotov commented Oct 27, 2024

Perhaps this should be addressed as a bug, as this is not normal behaviour for an htmlwidget, or at least we should reflect this in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants