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

Adding the setting button tab #6

Open
rhs94 opened this issue Aug 24, 2024 · 5 comments
Open

Adding the setting button tab #6

rhs94 opened this issue Aug 24, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@rhs94
Copy link

rhs94 commented Aug 24, 2024

Hi

Is there a way to add the setting button to the htmlwidget (created/coded in RStudio) that are in the web version, as this one?
https://www.flowmap.blue/1ndHiKo8z2B99ZQpToSfoIhI0RCbUsPZhqwNT0-U-TMk?v=14.163209%2C1.373237%2C1.65%2C0%2C0&a=0&as=1&b=1&bo=100&c=1&ca=1&d=1&fe=1&lt=1&lfm=ALL&col=Mint&f=60

@rhs94
Copy link
Author

rhs94 commented Aug 30, 2024

@ilyabo and @e-kotov I really wish that you could add the setting tab and also add where you can change the map style as this on: https://app.flowmap.city/public/1681e562-8d37-4dcf-b088-8a6ab41884b9

I really hope that you will answer on whether this is something you will consider to implement in the package cause I really waited for this for a long time! :)

@e-kotov e-kotov added the enhancement New feature or request label Aug 30, 2024
@e-kotov
Copy link
Collaborator

e-kotov commented Aug 30, 2024

@rhs94 I believe this fork actually has the map style argument. You can try it https://github.com/JohMast/flowmapblue.R

@rhs94
Copy link
Author

rhs94 commented Dec 27, 2024

@rhs94 I believe this fork actually has the map style argument. You can try it https://github.com/JohMast/flowmapblue.R

Hi @e-kotov, I tried with this code:

if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("JohMast/flowmapblue.R")
library(flowmapblue)

flowmapblue <- function(
locations, flows,
mapboxAccessToken = NULL,
mapboxMapStyle = NULL,
clustering = TRUE,
animation = FALSE,
darkMode = FALSE
) {

x <- list(
locations = locations,
flows = flows,
mapboxAccessToken = mapboxAccessToken,
mapboxMapStyle = mapboxMapStyle,
clustering = clustering,
animation = animation,
darkMode = darkMode
)

htmlwidgets::createWidget(
name = 'flowmapblue',
x,
width = NULL,
height = NULL,
package = 'flowmapblue',
sizingPolicy = sizingPolicy(
padding = 0,
browser.padding = 0
)
)
}

mapboxAccessToken <- 'pk.mytokenhere'
mapboxMapStyle <- 'mapbox://styles/mapbox/navigation-day-v1'

(flowmap <- flowmapblue(
locations,
flows,
mapboxAccessToken = mapboxAccessToken,
mapboxMapStyle = mapboxMapStyle,
darkMode = FALSE,
clustering = TRUE,
animation = FALSE
))

But the map does not change. Can you help me? I also tried to "make my own" map style and make it public and use the url instead but it doesn't work. What I wanted to use was actually mapbox://styles/mapbox/navigation-day-v1 from https://docs.mapbox.com/api/maps/styles/

@e-kotov
Copy link
Collaborator

e-kotov commented Jan 6, 2025

@rhs94 I did not test this fork https://github.com/JohMast/flowmapblue.R myself. If if does not work, then very probably the version of the flowmapblue TypeScript widget shipped with the package does not actually support changing the mapbox style url. Also, I would suggest to ask the fork author @JohMast rather than here, as he would know better if it should work, and if so, why it does not work.

@JohMast
Copy link

JohMast commented Jan 7, 2025

Hi all!
Yes, I agree with your assessment @e-kotov. That fork was was just a naive attempt to see if i could change the mapstyle by passing it as an argument, but it did not have the intended result and I did not pursue it further. I wrote the flowmapper functions which suffice for my applications, but for interactive visualisations I would love to see different mapstyles in the flowmapblue as well. I am not sure how much work that would be to implement, though.

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

No branches or pull requests

3 participants