Code Monkey home page Code Monkey logo

d3heatmap's Introduction

d3heatmap

Python PyPI Version License Coffee Github Forks GitHub Open Issues Project Status Downloads Downloads Open In Colab BuyMeCoffee

  • 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!

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.

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)

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!

d3heatmap's People

Contributors

erdogant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.