geom_hilbert_outline {ggip} | R Documentation |
Hilbert curve outline
Description
Computes and draws the outline of the Hilbert curve used to map IP data to the Cartesian plane. By superimposing this outline on top of a ggip plot, it guides the eye to regions that are close in IP address space.
Usage
geom_hilbert_outline(
mapping = NULL,
data = NULL,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Aesthetics
geom_curve_outline()
understands the following aesthetics:
-
ip
: Anip_network
column. By default, the entire Hilbert curve is shown. -
curve_order
: How nested is the curve? (default:3
). -
closed
: Should the curve outline have closed ends? (default:FALSE
). -
alpha
-
colour
-
linetype
-
linewidth
Computed variables
- x, y
The start coordinates for the segment
- xend, yend
The end coordinates for the segment
Examples
p <- ggplot() + coord_ip() + theme_ip_light()
# default shows curve across entire canvas
p + geom_hilbert_outline()
# only show subnetwork
p + geom_hilbert_outline(ip = ip_network("128.0.0.0/2"))
# increased nesting
p + geom_hilbert_outline(curve_order = 4)
# show multiple networks
df <- data.frame(
ip = ip_network(c("0.0.0.0/2", "128.0.0.0/4")),
curve_order = c(4, 5),
closed = c(FALSE, TRUE)
)
p + geom_hilbert_outline(
aes(ip = ip, curve_order = curve_order, closed = closed),
data = df
)