Heatmap generator for visualizing data in a matrix format.
- 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.
You can install the CLI tool using Homebrew:
brew install tamada/tap/heatmanThe 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.csvThe resultant image is as follows:
Other usage examples are available in the CLI interface documentation.
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.csvThe details of the Docker image are available in the Containerfile.
To use heatman in your Rust project, add it to your Cargo.toml:
[dependencies]
heatman = "0.1.0" # Check for the latest versionuse 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.
This project is licensed under the MIT License. See the LICENSE file for details.