-
Notifications
You must be signed in to change notification settings - Fork 122
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
In interactive mode, id
doesn't show in v4
#851
Comments
This is discussed earlier, but great to bring it up again because this is not settled yet. #749: suggestion to disable hovering by default Current status: each layer has four related arguments:
What do you think? Suggestions more than welcome. NLD_muni |>
tm_shape() +
tm_polygons(
hover = "name",
popup.vars = c("code", "name", "population")
) To do's: layer selection collapse (default) and fix bbox focus I've made the legend background deliberately solid, for two reasons: to make it consistent with plot mode, and to make sure that what is shown in the legend (symbols) are exactly the same as the features in the map they represent. However, in some cases I also prefer a bit transparency. What are your thoughts on this @Nowosad ? |
|
I would agree that hovering and id should not be enabled by default. However, if id is supplied, hocering could be enabled, and also having the bold title on top of the popup |
What do you think of the different variations: The difficulty is the fact that we often want to specify a few things at once (e.g. hovering label, popup title, and layer reference id), but in some cases we explicitly want to separate things (e.g. country name for labeling and iso a3 code for reference ids). |
good idea! # defaults
id = "" # not shown by default
popup.title = id # id by default
hover = FALSE # by default if id is not supplied what do you think? In v3 layer id was via |
@mtennekes have you consider having just one argument that accepts a function (e.g., |
So bringing this together we have: tm_shape(World) +
tm_polygons(fill = "economy",
id = "iso_a3",
popup = tm_popup(title = "name", vars = c("economy", "income_grp")),
hover = FALSE) Defaults:
|
Just in case people forgot, there's |
Am I correct in assuming that |
@tim-salabim yep -- it is still an idea |
Done So now each (vector) layer (so
Hover is Let me know it all works as expected. @tim-salabim Thanks for this suggestion! The current implementation of the popups is direct migration from tmap3, and is quite basic, so no css support etc. We can upgrade with using It has low-priority, so for now I'm closing this issue. Please reopen if there are still bugs. |
Adding support for a pop-up title shouldn't be hard to implement. I'll look into it at some stage, but also for me, this has low priority. |
A small follow-up: From a user perspective I find it annoying that the popups only show the visual variables (and all variables when no visual variables are used). In most use cases, I'd like to show all variables in the popups. So this means that Also, I finally thought about tm_shape(World) +
tm_polygons(fill = "HPI",
popup = tm_popup(
title = c("Name" = "name"),
vars = c("Happy Planet Ind." = "HPI", "Population" = "pop_est")) This should be low-hanging fruit to implement. To be flexible and minimal, we can still accept TRUE, FALSE and variable names to popup. Let me know what you think |
I am comfortable with that! |
Hi @mtennekes ,
I started looking into transitioning to v4 in my previous code. I think I ran into a bug.
id
hovering.id
as bold on top of the popup eitherv4 : nothing when hovering and no title on top of the popup
v3.3-4 : id showing when hovering + shows as bold on top of the popup
Thanks
other issues
Does not focus on China
v4 doesn`t respect borders = NULL
In v3
In v4, currently, has borders, size is not passed correctly.
I also like that the legend background in view was a bit transparent, could this be added back?
The text was updated successfully, but these errors were encountered: