Full Stack Ecoinformatics

gghoneycomb

Source R ggplot2

An open-source R package extending ggplot2 to create honeycomb-style hexagonal waffle charts for proportional data visualization. Originally developed to visualize plant species abundance in honey using eDNA, the package combines domain-driven design with graph-based layout algorithms.

Role
Creator & Lead Developer
Context
Developed while serving as Software Engineer at Jonah Ventures
Status
Open Source

Domain-Driven Data Visualization for Proportional Data

gghoneycomb is an open-source R package extending ggplot2 to create honeycomb-style hexagonal waffle charts for visualizing proportional data. The package was developed while working with environmental DNA (eDNA) data at Jonah Ventures, where I needed a visually compelling and clear way to communicate the relative abundance of plant species detected in honey samples.

Example gghoneycomb visualization


The Problem

Pie charts are the traditional tool for representing part-to-whole relationships, but they are notoriously difficult to interpret accurately. Human perception struggles to compare angles and areas, making small differences between categories hard to distinguish.

In the context of pollen composition in honey, researchers needed a visualization that preserved the intuitive “part-to-whole” relationship while improving clarity and interpretability.


The Approach

The design drew inspiration from the domain itself: bees do not make pies — they build honeycombs.

gghoneycomb represents each category as a contiguous region of hexagonal cells. The number of cells allocated to each category is proportional to its value, creating a visually intuitive representation that supports rapid comparison while maintaining structural coherence.

The visual metaphor reinforces the ecological context while remaining statistically rigorous.


Technical Implementation

The package combines proportional allocation with graph-based hex-grid layout algorithms:

  • Proportional cell allocation using largest-remainder rounding
  • Region-growing algorithms that ensure each category forms a single contiguous cluster
  • Breadth-first search (BFS) for adjacency and connectivity guarantees
  • Fallback carving strategies to ensure valid layouts when initial region growth fails
  • Odd-q offset hex coordinates for adjacency computations and reproducibility through seed

The result is a layout algorithm that balances proportional accuracy, visual coherence, and algorithmic determinism.


Outcome

gghoneycomb provides ecologists and data scientists with a distinctive alternative to pie charts for proportional data visualization. By combining domain-aware design with rigorous graph algorithms, the package demonstrates how scientific context can inform both aesthetics and implementation.

The project highlights an approach that extends beyond visualization: building tools that respect both the data and the domain from which it originates.

Have a Similar Challenge?

If you're developing or modernizing software and data systems for ecological or scientific work, let's connect. We'll begin with a focused conversation about your goals, technical constraints, and how to build infrastructure that supports long-term impact.

Discuss a Similar Project