-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
Description
The source code is here r-tmap/tmap.cartogram#1, but I'd like to add this to the core tmap functionality.
But the question is: where and how should the user specify a transition, and how is it processed internally?
Using the tmap.cartogram
package, this is the single cartogram:
library(tmap)
library(tmap.cartogram)
Africa = World[World$continent == "Africa", ]
tm_shape(Africa, crs = "+proj=eck4") +
tm_cartogram(size = "pop_est")
Where?
- As a new map variable called "frame", which can either be a data variable, or a number indicating the number of frames.
- In the
tm_opt_x
options list.
How?
- Number of frame should be specified
- The transition mode, linear, cubic-in-out, and (what are the other options?)
Internals:
- Use it as a facet-dimension. Just like tmap animations are usually made
- Alternatively, we can see it as a separate thing, and extend the geometry: instead of one feature per tmapID, we could have a list of features, one for each time stamp. This is probably much harder to implement.