Giter Site home page Giter Site logo

colormap's People

Contributors

archmoj avatar bpostlethwaite avatar dependabot[bot] avatar dy avatar etpinard avatar matissjanis avatar sisp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colormap's Issues

3.0 API

@bpostlethwaite I am thinking about redesigning the API so that it looks like:

var colormap = require('colormap')

var jet = colormap('jet') //or cmap(options)
var colors = jet(72) //generate number of shades

That would allow for easier to remember API, less options and higher performance.
Also I am thinking on reducing the size, as it is addressed in #13. Due to clone dependency we include Buffer polyfill, which adds 70kb of completely useless code here.

What do you think about such major change?

Among other improvements, it is possible to optionally enable smoothstep, for enhanced color interpolation (as it is done in glsl-colormap).

Where can I get the .js ?

I merely want to use this to generate a colormap with 10 divisions using the "Jet" palette.

But this isn't javascript, this is some node BS with requirements that I cannot find seperately !

I want one .js file containing what this git repo is supposed to be doing - how do I get that ?

'#aNaNaN' colors returned with small (but acceptable) nshades

> colormap({colormap: 'YIGnBu', nshades: 12})
[ '#081d58',
  '#253494',
  '#aNaNaN',
  '#225ea8',
  '#1d91c0',
  '#aNaNaN',
  '#41b6c4',
  '#7fcdbb',
  '#aNaNaN',
  '#c7e9b4',
  '#edf8d9',
  '#aNaNaN' ]

The minimum number of colors should be updated or the code altered to allow fewer shades โ€” it is stated that the minimum for YIGnBu is 9.

Thanks.

Reduce library size

colormap is great but including arraytools and clone make the library quite large (total to ~200k not minified using webpack. Minified along with rollup would be smaller).

I created color-map which create the color range same as your inner loop without dependency.

It is (1k minified, was 10k not minified using webpack). Do you want to use it inside your library?

Duplicate keys for cool

Originally reported in plotly/plotly.js#5457

Which "cool" is the cool?

"cool":[{"index":0,"rgb":[0,255,255]},{"index":1,"rgb":[255,0,255]}],

Or
"cool": [{"index":0,"rgb":[125,0,179]},{"index":0.13,"rgb":[116,0,218]},{"index":0.25,"rgb":[98,74,237]},{"index":0.38,"rgb":[68,146,231]},{"index":0.5,"rgb":[0,204,197]},{"index":0.63,"rgb":[0,247,146]},{"index":0.75,"rgb":[0,255,88]},{"index":0.88,"rgb":[40,255,8]},{"index":1,"rgb":[147,255,0]}],

Alpha values are reused for color maps with the same name

The alpha value used the first time when generating a color map is reused when generating more maps with the same name, even if they specify different values. E.g.:

var blueRed = colormap({
    colormap: "bluered",
    format: "rgba",
    alpha: [0, 1]
});

var blueRed2 = colormap({
    colormap: "bluered",
    format: "rgba",
    alpha: [0, 0.5]
});

console.log(blueRed[blueRed.length - 1]); // [ 255, 0, 0, 1 ]
console.log(blueRed2[blueRed2.length - 1]); // Also [ 255, 0, 0, 1 ] but should be [ 255, 0, 0, 0.5 ]

Colorspace clarification

Hello, I've been using the colormap library in the three.js 3D renderer.

Starting with version 152, three.js applies an automatic gamma encoding on colors.

With this automatic encoding, the same scene using the viridis color ramp renders differently:

Before:
image

After:
image

My understanding is that now three.js applies gamma encoding (i.e converts from sRGB to linear) on the colormap colors because it expects them to be in the sRGB color space. Obviously this is not the case.

Does it mean that colors generated by colormap are already in linear space ?

pointing to custom colourScales

Hi there, sorry for this if it is obvious or simple, i am a total beginner. How do I point this module to find the custom colorScales.js without editing the module as rebuilding loosing custom edits?

YlOrRd & YlGnBu colormap typo?

Hello,
I have been using this library for colormapping geospatial data in OpenLayers - with an option for the user to choose between any of the colormaps available.

In the reference image, there are colormaps 'YlOrRd' and 'YlGnBu' , which I had removed because using this string for retrieving a colormap had thrown an error that the colormap did not exist.

Looking at colorScale.js , it looks like these are actually stored as 'yiorrd' and 'yignbu' - is the 'l' actually supposed to be an 'i'? 'RdBu' is also capitalized in the image and lowercase in the code.

Either this is a typo on the implementation end, or a typo on the reference image. With no user reference other than the image for the names to use for colormaps, this had me confused.

Could you please either update the naming in the code or in the image? Thank you.

Duplicate colors

Certain Palettes generate duplicate values.
e.g. Temperature, jet etc.

Use example with browserify

Hey there
I just found your colormap repo here and I want to use it to display color tints depending on some data input. Not sure if I'm getting the right thing here, but I guess so.

Well, anyway, I just wanted to ask, if there is a way to use colormap without browserify. What does it actually require?
Can I also load the important stuff manually?

Thanks for your answer.

cheers

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.