heatman 0.1.1

Creating heatmap image from given CSV file
Documentation

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