GithubHelp home page GithubHelp logo

newmana / chroma-elm Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 3.68 MB

A native Elm version of the chroma.js library with various enhancements.

Home Page: https://package.elm-lang.org/packages/newmana/chroma-elm/latest

License: Apache License 2.0

Elm 99.02% JavaScript 0.95% HTML 0.02%

chroma-elm's Introduction

chroma-elm

A native version of Chroma.js that allows you to:

  • use W3C X11 color names,
  • cluster data points using algorithms: CkMeans, equal, head/tail, Jenks, logarithmic or quantile,
  • create color scales,
  • use different color spaces such as CMYK, HSLA, LAB, LCH and RGB,
  • modify colors using interpolate, set/get alpha, lighten/darken, saturate/desaturate,
  • compare colors using WCAG contrast,
  • use existing color maps such as Brewer, cmocean, Material, Cividis, Turbo, Sinebow, Parula, Virdis, Plasma, Magma and Inferno.

There is an example site showing how to use the library.

Changelog

Development

  • yarn install
  • yarn run make
  • yarn run test
  • yarn run review
  • yarn run full (test && review)

Test Coverage

Coverage Report

Benchmarks

  • yarn run benchmarks

101 Data Points, Limits on an Apple M1, Chrome 96.0:

| Algorithm     | Runs/Second   |
| ------------- | ------------- |
| CkMeans       | 846           |
| Equal         | 48,311        |
| HeadTail      | 32,197        |
| Jenks         | 108           |
| Logarithmic   | 48,017        |
| Quantile      | 40,905        |

Documentation

  • yarn run local-doc

Publish to GitHub

  • yarn run doc

Links

Elm

Color Maps

Thanks

Many thanks to Indicatrix for supporting this project.

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.