`geom_hilbert_outline(closed = FALSE)` identifies endcap incorrectly
davidchall opened this issue · 0 comments
davidchall commented
Currently, the endcap ("to side") is identified as being opposite the "from side". But this means we're saying the path is traveling in a straight line, which is rarely true for a Hilbert curve. To know the true endcap, we probably need to calculate the next (or previous) square in the path.
This example demonstrates the problem. We've used closed = FALSE
, but there are lots of lines blocking the path.
library(ggip)
#> Loading required package: ggplot2
#> Loading required package: ipaddress
ggplot(iana_ipv4) +
coord_ip() +
geom_hilbert_outline(aes(ip = network, color = allocation), curve_order = 5, closed = FALSE) +
theme_ip_light()
Created on 2023-01-12 with reprex v2.0.2