Skip to main content

d3heatmap

Python PyPI Version License Github Forks GitHub Open Issues Project Status DOI Downloads Downloads Sphinx Medium

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!

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 this 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 d3heatmap as d3

Example 1: plot using the heatmap function

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

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. See right column for citation information.

References

Maintainer

  • Erdogan Taskesen, github: erdogant
  • This work is created and maintained in my free time. If you wish to buy me a Coffee for this work, it is very appreciated.
  • Contributions are welcome.
  • Star it if you like it!

Release files for d3heatmap 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for d3heatmap 0.2.3
File Size Uploaded
d3heatmap-0.2.3.tar.gz 238.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for d3heatmap 0.2.3
File Interpreter ABI Platform
d3heatmap-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 479.5 kB

Release files / d3heatmap-0.2.3.tar.gz

Download URL d3heatmap-0.2.3.tar.gz
Size 238.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d5e1b1840120afec7ebf0df4e121a1caac5ae26669ddefa8a9eaa6181e036c8
BLAKE2b-256 checksum
How to use checksums
6c8b39ef44a5f637916680596fa073103f3ebd29647059417b9fb49f0b080da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / d3heatmap-0.2.3-py3-none-any.whl

Download URL d3heatmap-0.2.3-py3-none-any.whl
Size 240.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2911f3d53d6b7f43dadf80404b2f6c30f600081c47023c5885c42495f32f5892
BLAKE2b-256 checksum
How to use checksums
3d53270b468abb6a4b1c1d46c1458c4566d090d999e8c045042aebbdfea94df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page