Skip to content

Latest commit

Β 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Heatman πŸ”₯

build Coverage Status

Version License

Docker crates.io Homebrew

Heatmap generator for visualizing data in a matrix format.

πŸ“£ Features

  • Generate heatmaps from csv files,
  • Support for assistant lines to enhance readability,
  • Customizable pixel size for cells,
  • Specify the order of data to be plotted, and
  • Output images in PNG format.

πŸƒ CLI installation & Usage

βš“οΈ Installation

🍺 Homebrew

You can install the CLI tool using Homebrew:

brew install tamada/tap/heatman

Basic Usage

The heatman CLI tool converts csv files into heatmap images. The csv file should contain the row and column header and each cell should be a number between 0 and 1. The output image will be saved as heatman.png by default. The example csv files are available on the testdata directory.

heatman testdata/sample.csv

The resultant image is as follows:

heatman.png

Other usage examples are available in the CLI interface documentation.

🐳 Docker available

You can also use heatman via Docker without installing it on your system:

docker run --rm -it -v $PWD:/app ghcr.io/tamada/heatman:latest /app/testdata/sample.csv

The details of the Docker image are available in the Containerfile.

πŸ‘Ÿ Library usage

To use heatman in your Rust project, add it to your Cargo.toml:

[dependencies]
heatman = "0.1.0" # Check for the latest version

Example 1: Basic heatmap generation

use heatman::{Heatmap, Data, DataLoader};
use image::{ImageBuffer, Rgba};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let data = DataLoader::load("testdata/sample.csv")
        .expect("Failed to load data from CSV");
    let cells: Data<Rgba<u8>> = data.into();
    let context = Heatmap::new(cells, 10);
    let image: ImageBuffer<Rgba<u8>, Vec<u8>> = context.into();
    image.save("output.png")
        .expect("Failed to save heatmap image");
    Ok(())
}

This code is available in the examples/generate_heatmap_from_csv.rs file.

ℹ️ About

πŸ§‘β€πŸ’Ό Authors πŸ‘©β€πŸ’Ό

πŸ“œ License

License

This project is licensed under the MIT License. See the LICENSE file for details.

πŸŽƒ Logo

heatman logo

About

Heatmap generator.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages