GithubHelp home page GithubHelp logo

pyheatmap's Introduction

pyheatmap

Python library, provides various utilities for rendering heat maps.

Install dependencies and execute run.sh to see the result.

Input data format of all tools is the same "x,y[,weight]":

0.1,0.3,3.0
0.5,0.6,6.0
0.12,0.74       # weight defaults to 1.0
...
  • mapcoords.py

    Receives file or stream of points and normalizes points coordinates given their bounding rectangle. Output points X,Y coordinates fall in range [0, 1].

    Usage example:

    python pyheatmap/mapcoords.py \
       --area=46,57,180,191 \
       resources/positions.csv > my_points_normalized.csv
  • heataccum.py

    Receives file or stream of points and outputs accumulated values. It uses grid space partitioning and collapses points within specified threshold into single point, accumulating the weights. This allows to feed it very large set of points and receive an accumulated summary that can be used for final rendering. It also normalizes the 'weight' component of the input points, the point in grid with biggest weight will have weight of 1.0.

    Usage example:

    python pyheatmap/heataccum.py \
       --grid=100,100 \
       my_points_normalized.csv > heat.csv
  • heatmap.py

    Renders heat map points on top of the background image. Input is points in format "x,y,weight":

    0.1,0.3,1.0
     0.5,0.6,1.0
     ...

    Weight parameter is optional (defaults to 1.0). Coordinates expected to be normalized in image space and fall into [0, 1] range.

    Usage example:

    python pyheatmap/heatmap.py \
       --palette=resources/palette.png \
       --bg=resources/usa.jpg \
       --dot=35 \
       --opacity=0.8 \
       resources/heat.csv

And of course you can pipe everything together (check run.sh for example)!

Dependencies

  • Python 2.7.x
  • PIL (make sure to install with libjpeg support etc.)

pyheatmap's People

Contributors

sergiimk avatar

Watchers

 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.