contribution-grid
A Rust crate for generating customizable, GitHub-style contribution heatmap graphs as images.
This crate provides a builder interface to create contribution heatmaps, similar to those found on GitHub user profiles. It supports custom date ranges, colors, and dimensions, outputting the result as an image.
Usage
Add this to your project:
Example
use ;
use NaiveDate;
use HashMap;
Mapping Strategies
The library supports different ways to map contribution counts to colors:
LinearStrategy: Maps counts linearly based on the maximum count in the dataset.LogarithmicStrategy: Emphasizes differences at lower values.ThresholdStrategy: Uses fixed user-defined thresholds.
use ;
// Use fixed thresholds: 0, 1-4, 5-9, 10-19, 20+
let palette = github;
Themes
The library comes with several built-in themes:
GitHub (Default)

GitHub Old

Blue

Red

Custom Examples
Custom Dimensions (Small Boxes):

You can also customize dimensions and colors via the Palette struct.
Custom Neon Theme:

License
This project is licensed under the MIT License.