GithubHelp home page GithubHelp logo

gerhobbelt / rainbowvis-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anomal/rainbowvis-js

0.0 1.0 0.0 26 KB

A JavaScript library for colour data visualization. Easily map numbers to a smooth-transitioning colour legend.

License: Eclipse Public License 1.0

HTML 38.35% JavaScript 61.65%

rainbowvis-js's Introduction

RainbowVis-JS

A JavaScript library for colour data visualization. Easily map numbers to a smooth-transitioning colour legend.

The Rainbow class by default maps the range 0 to 100 (inclusive) to the colours of the rainbow (i.e., a gradient transitioning from red to yellow to lime to blue).

See example.html

var rainbow = new Rainbow(); creates new instance of Rainbow. By default, the number range is from 0 to 100, and the spectrum is a rainbow.

rainbow.colourAt(number); returns the hex colour corresponding to the number. If number is out of range, it returns the appropriate hex colour corresponding to either the minNumber or maxNumber.

rainbow.setSpectrum(colour1, colour2 [,colourN]); sets the spectrum of the Rainbow object. By default, the spectrum is a rainbow. You must have a minimum of two colours, but you can specify more than two colours. Colours can be in the form 'red', 'ff0000', or '#ff0000'. For example, rainbow.setSpectrum('red', 'yellow', 'white'); makes the "Rainbow" a colour gradient from red to yellow to white.

rainbow.setNumberRange(minNumber, maxNumber); sets the number range of the Rainbow object. By default, it is 0 to 100.

CommonJS

Installation

npm install rainbowvis.js

Usage

var Rainbow = require('rainbowvis.js');
var myRainbow = new Rainbow();

Related Links

rainbowvis-js's People

Contributors

anomal avatar explodingcabbage avatar gagan-bansal avatar kachkaev 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.