Python package to create interactive heatmap based on d3js.
Project description
d3heatmap
d3heatmap
is a Python package to create interactive heatmaps based on d3js.- The aim of d3heatmap is to create interactive heatmaps that can be used stand-alone and visual attractive.
- This library does not require you any additional installation, downloads or setting paths to your systems environments. You just need python and this library. All other is taken care off. There are two main functions to create a heatmap
matrix
andheatmap
and there are some differences between the two.
d3heatmap.matrix
- Allows none symetric adjacency matrices.
- Colormap can be changed.
- No clustering.
- round-ish elements.
d3heatmap.heatmap
- Allows Clustering.
- Colormap is fixed.
- Adjacency matrix must be symetric.
Installation
- Install
d3heatmap
from PyPI (recommended). d3heatmap is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows. - It is distributed under the MIT license.
Installation
pip install d3heatmap
- Alternatively, install d3heatmap from the GitHub source:
git clone https://github.com/erdogant/d3heatmap.git
cd d3heatmap
pip install -U .
Import d3heatmap
from d3heatmap import d3heatmap as d3
Example 1: plot using the heatmap function
df = d3.import_example()
# Create heatmap
paths = results = d3.heatmap(df)
Example 2: plot using the matrix function
df = d3.import_example(size=(6,20))
# Create heatmap
paths = d3.matrix(df)
Example 3: plot using the matrix function
# The dataframe contains more columns then rows. Adjust the size and color differently.
df = d3.import_example(size=(6,20))
# Create heatmap
paths = d3.matrix(df, fontsize=10, title='Hooray!', description='d3 matrix is created using https://github.com/erdogant/d3heatmap.', path='c:/temp/example/d3_matrix.html', width=600, height=300, cmap='interpolateGreens', vmin=1)
Example 4: Matrix with parameters changed:
# The dataframe contains more columns then rows. Adjust the size and color differently.
df = d3.import_example(size=(6,20))
# Create heatmap
paths = d3.matrix(df, fontsize=10, title='Hooray!', description='d3 matrix is created using https://github.com/erdogant/d3heatmap.', path='c:/temp/example/d3_matrix.html', width=600, height=300, cmap='interpolateGreens', vmin=1)
Example 4: Comparison heatmap vs matrix:
There are quit some differences between the heatmap
vs matrix
functionality.
df = d3.import_example()
results = d3.heatmap(df, title='d3heatmap with the heatmap function.', path='heatmap.html')
results = d3.matrix(df, title='d3heatmap with the matrix function.', cmap='interpolatePRGn', path='matrix.html', width=700, height=700)
Citation
Please cite d3heatmap in your publications if this is useful for your research. Here is an example BibTeX entry:
@misc{erdogant2020d3heatmap,
title={d3heatmap},
author={Erdogan Taskesen},
year={2019},
howpublished={\url{https://github.com/erdogant/d3heatmap}},
}
References
Maintainer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
d3heatmap-0.1.2.tar.gz
(9.7 kB
view hashes)
Built Distribution
d3heatmap-0.1.2-py3-none-any.whl
(12.1 kB
view hashes)
Close
Hashes for d3heatmap-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b10ee160b98c9b6d7ef00172e8c78399a23ec83b64670afdf8cc82d4e9e776d6 |
|
MD5 | d140e10be7e73daec60616aebafea5a4 |
|
BLAKE2b-256 | 30e7c6f7538d306e1b40e4284583f63d95ea1c7fddfc4b4ec72126796050dbc6 |