https://davidchall.github.io/ggip/
Data visualization for IP addresses and networks
https://davidchall.github.io/ggip/
cyber data-visualization ggplot-extension ggplot2 hilbert-curve ip-address ipv4 ipv6 r space-filling-curves
Last synced: 3 months ago
JSON representation
Data visualization for IP addresses and networks
- Host: GitHub
- URL: https://davidchall.github.io/ggip/
- Owner: davidchall
- License: other
- Created: 2020-08-13T00:15:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-04T05:28:54.000Z (almost 3 years ago)
- Last Synced: 2025-10-22T05:44:11.813Z (4 months ago)
- Topics: cyber, data-visualization, ggplot-extension, ggplot2, hilbert-curve, ip-address, ipv4, ipv6, r, space-filling-curves
- Language: R
- Homepage: https://davidchall.github.io/ggip
- Size: 10.5 MB
- Stars: 26
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ggplot2 - ggip
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://CRAN.R-project.org/package=ggip)
[](https://github.com/davidchall/ggip/actions)
[](https://app.codecov.io/gh/davidchall/ggip?branch=master)
ggip is a [{ggplot2}](https://ggplot2.tidyverse.org) extension for visualizing IP addresses and networks stored in [{ipaddress}](https://davidchall.github.io/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](https://CRAN.R-project.org) with:
``` r
install.packages("ggip")
```
Or you can install the development version from GitHub:
``` r
# install.packages("remotes")
remotes::install_github("davidchall/ggip")
```
## Usage
Plotting with {ggip} follows most of the conventions set by [{ggplot2}](https://ggplot2.tidyverse.org).
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:
```{r ipv4-heatmap, fig.width=11.2, fig.height=10.3}
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()
```
