View source: R/geom-hilbert-outline.R
geom_hilbert_outline | R Documentation |
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.
geom_hilbert_outline(
mapping = NULL,
data = NULL,
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
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 |
geom_curve_outline()
understands the following aesthetics:
ip
: An ip_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
The start coordinates for the segment
The end coordinates for the segment
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.