GithubHelp home page GithubHelp logo

jingxuanlim / color2d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dominikjaeckle/color2d

0.0 1.0 0.0 1.09 MB

JS 2D colormap to color encode scatterplots

Home Page: http://dominikjaeckle.com/projects/color2d/

License: Apache License 2.0

JavaScript 100.00%

color2d's Introduction

bg img

Color2D - 2D Colormaps Javascript Plugin

This plugin allows you to encode two-dimensional information with color based on a 2D colormap. Examples include scatterplots of multivariate projections or the visual representation of Self-Organizing Maps.

A demo is available here.

This plugin is based on the work of Steiger et al.

Explorative Analysis of 2D Color Maps
Steiger, M., Bernard, J., Mittelstädt, S., Hutter, M., Keim, D., Thum, S., Kohlhammer, J.
Proceedings of WSCG (23), 151-160, Eurographics Assciation, Vaclav Skala - Union Agency, 2015

Usage

Integrate the color2D.js file:

<script src="color2D.js"></script>

Set the Colormap and assign the colors in a callback function:

Color2D.setColormap(Color2D.colormaps.BREMM, function() { 
    var rgb = Color2D.getColor(x, y);
});

The following colormaps are supported:

Color2D.colormaps.BREMM; 
Color2D.colormaps.SCHUMANN; 
Color2D.colormaps.STEIGER; 
Color2D.colormaps.TEULING2; 
Color2D.colormaps.ZIEGLER;

You may also define your own 2D colormap. All you need is a .png file and set its dimensions.

Color2D.colormaps.NEW_COLORMAP = "$path_to_png$.png";
Color2D.dimensions = {width: 512, height: 512};

Per default, Color2D expects your data to be feature scaled within the range [0,1]. However, you can also change the range according to your data:

Color2D.ranges = {x: [0,1], y: [0,1]};

Example

Following, the colormap of Bremm et al. is applied to a random 2D scatterplot. From left to right: (1) 2D colormap, (2) random scatterplot, (3) color encoded scatterplot: example

color2d's People

Contributors

dominikjaeckle 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.