Giter Site home page Giter Site logo

sdsmart / d3-jnd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from connorgr/d3-jnd

0.0 2.0 0.0 29 KB

A d3 implementation for just noticeable difference calculations

Home Page: http://gramaz.io/d3-jnd/

License: BSD 3-Clause "New" or "Revised" License

HTML 61.03% JavaScript 38.97%

d3-jnd's Introduction

d3-jnd

To access the latest version of d3-jnd, grab it on unpkg. Note that d3-jnd depends on d3-color.

This module extends D3 to support color just-noticeable difference (JND) research by Maureen Stone, Danielle Albers Szafir, and Vidya Setlur (link).

@inproceedings{stone-2014-emc,
  title={An engineering model for color difference as a function of size},
  author={Stone, Maureen and Szafir, Danielle Albers and Setlur, Vidya},
  booktitle={Color and Imaging Conference},
  volume={2014},
  number={2014},
  pages={253--258},
  year={2014},
  organization={Society for Imaging Science and Technology}
}

d3-jnd has two functions: d3.noticeablyDifferent() and d3.jndInterval. Both take size and percent arguments, which alter how conservative JND estimations are.

Note that the recommendations that are provided by this library are predicted JND intervals, and should be treated as guidelines rather than absolute truth. See the d3-jnd website for more information about how to manipulate d3-jnd function arguments appropriately.

var c1 = d3.lab('black'),
    c2 = d3.rgb('white'),
    legible = d3.noticeablyDifferent(c1, c2); // true

var intervals = d3.jndInterval(0.5, 0.3);

var strictlyLegible = d3.noticeablyDifferent(c1, c2, 0.95, 0.1);

Installation

After downloading the repo, run npm install, which will install any dependencies. You can optionally install from npm opposed to cloning directly from GitHub. Make sure to load d3-cam02 after d3-color.

Dependencies: d3-color

API Reference

# d3.noticeablyDifferent(color, color[, percent, size]) <>

A function that returns true/false based on whether the two provided colors are noticeably different. Percent controls the percent of audience that will likely see a difference between the two colors quickly and easily. Size refers to the estimated visual angle of color area (smaller areas are harder to discriminate).

# d3.jndInterval(percent, size) <>

As d3.noticeablyDifferent except it returns the intervals along L*, a*, and b* channels of CIELAB that produce differences equal to "1 JND".

d3-jnd's People

Contributors

domoritz avatar sdsmart avatar

Watchers

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