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 being visual attractive.
- This library does not require any additional installation of javascript, or downloads or setting paths to your systems environments. You just need python and pip install this library. There are two main functions to create a heatmap and there are some differences between the two. Read below for more details. Have fun!
This library is since 18-01-2023 fully implemented in D3Blocks.
pip install d3blocks
# Import
from d3blocks import D3Blocks
# Initialize
d3 = D3Blocks()
# Load example data
df = d3.import_example('stormofswords')
df = d3.vec2adjmat(df['source'], df['target'], weight=df['weight'], symmetric=True)
# Plot
d3.heatmap(df)
Functionalities
d3heatmap.matrix
- Allows none symetric adjacency matrices.
- Colormap can be changed.
- No clustering.
- round-ish elements.
d3heatmap.heatmap
- Allows Clustering.
- Colormap is fixed.
- Advanced cluster coloring. Clusters are colored and within each cluster the color is incremental based on the value.
- Adjacency matrix must be symetric.
Star the D3Blocks repo if you like it! ⭐️
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 heatmap
# Initialize
d3 = heatmap()
Example 1: plot using the heatmap function
from d3heatmap import heatmap
# Initialize
d3 = heatmap()
# Load example data
df = d3.import_example()
# Create heatmap
paths = results = d3.heatmap(df)
Klik on the figure for the interactive example.
Example 2: plot using the matrix function
from d3heatmap import heatmap
# Initialize
d3 = heatmap()
# Load example data
df = d3.import_example(size=(6,20))
# Create matrix heatmap
paths = d3.matrix(df)
Example 3: plot using the matrix function
from d3heatmap import heatmap
# Initialize
d3 = heatmap()
# 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:
from d3heatmap import heatmap
# Initialize
d3 = heatmap()
# 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.
from d3heatmap import heatmap
# Initialize
d3 = heatmap()
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. See right column for citation information.
References
Maintainer
Metadata
Release files for d3heatmap 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| d3heatmap-1.0.0.tar.gz | 4.6 kB | Without provenance | Details for d3heatmap-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| d3heatmap-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for d3heatmap-1.0.0-py3-none-any.whl |
Total release size: 9.5 kB
Release files / d3heatmap-1.0.0.tar.gz
| Download URL | d3heatmap-1.0.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e1b1e0072a1652d45c7eae0fc9eea66e184cf1aaa9db5671c6b912a4bed8387
|
|
BLAKE2b-256 checksum How to use checksums |
70f781fc61a804ddd585ef24dbcb60870efabf0d2e5bed1a0d3590e6e4d33ae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / d3heatmap-1.0.0-py3-none-any.whl
| Download URL | d3heatmap-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ed4614ecd4a12c035d50e37447d9f7500008f5bbb05ad0d9e6d8c0d70edda52
|
|
BLAKE2b-256 checksum How to use checksums |
4887ea985bc3acd2539f337f154dfec80b65a0bc07e8f9b1e81afc025828d5a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for d3heatmap 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.