Data Visualization for IP Addresses and Networks

A 'ggplot2' extension that enables visualization of IP (Internet Protocol) addresses and networks. The address space is mapped onto the Cartesian coordinate system using a space-filling curve. Offers full support for both IPv4 and IPv6 (Internet Protocol versions 4 and 6) address spaces.


ggip

Lifecycle:experimental CRANstatus R buildstatus Coveragestatus

ggip is a {ggplot2} extension for visualizing IP addresses and networks stored in {ipaddress} vectors.

Here are some of the key features:

  • IP data mapped to 2D plane by a unified coordinate system
  • Compatible with existing ggplot2 layers
  • Custom IP-specific layers for common use cases
  • Full support for both IPv4 and IPv6 address spaces

Installation

You can install the released version of ggip from CRAN with:

install.packages("ggip")

Or you can install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("davidchall/ggip")

Usage

Plotting with {ggip} follows most of the conventions set by {ggplot2}. A major difference is that coord_ip() is required to map IP data to the 2D grid (addresses to points and networks to rectangles). Learn more in vignette("ggip").

Here’s a quick showcase of what’s possible:

library(tidyverse)
library(ggfittext)
library(ggip)

ggplot(ip_data) +
  stat_summary_address(aes(ip = address)) +
  geom_hilbert_outline(color = "grey80") +
  geom_fit_text(
    aes(
      xmin = network$xmin, xmax = network$xmax,
      ymin = network$ymin, ymax = network$ymax,
      label = label
    ),
    data = iana_ipv4 %>% filter(allocation == "Reserved"),
    color = "#fdc086", grow = TRUE
  ) +
  scale_fill_viridis_c(name = NULL, trans = "log2", na.value = "black") +
  coord_ip(pixel_prefix = 20) +
  theme_ip_dark()
#> Warning: Transformation introduced infinite values in discrete y-axis

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ggip")

0.3.2 by David Hall, 4 years ago


https://davidchall.github.io/ggip/, https://github.com/davidchall/ggip


Report a bug at https://github.com/davidchall/ggip/issues


Browse source code at https://github.com/cran/ggip


Authors: David Hall [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, dplyr, Rcpp, rlang, tidyr, vctrs

Depends on ggplot2, ipaddress

Suggests knitr, rmarkdown, testthat

Linking to ipaddress, Rcpp


See at CRAN