Draw a map of the GRiwrm object
This simple example of code plot the GRiwrm nodes on a map:
data(Severn)
sf_Severn <- sf::st_as_sf(Severn$BasinsInfo, coords = c("gauge_lon", "gauge_lat"),
crs = sf::st_crs(4326))
tmap_mode("view")
tm_shape(sf_Severn) +
tm_symbols(size = 0.5,
popup.vars = c("Nom" = "gauge_name", "Surf (km²)" = "area",
"Aval" = "downstream_id",
"Distance" = "distance_downstream")) +
tm_text(text = "gauge_id", size = 1, auto.placement = TRUE) +
tm_basemap("Esri.WorldTopoMap")
We can imagine to complete the function plot.GRiwrm
with an argument map
: NA
for the mermaid diagram, and as for the function tmap_mode
, "plot" for a fixed plot, "view" for an interactive view.
We can try to be consistant with the design of the mermaid diagram by using the same colours for the different type of nodes and to draw arrows between nodes.