<.> Encodable
Getting startedWhy use Encodable?
Gallery
Guides
Encodable API
Submodule API
@encodable/colorInstallExample usage@encodable/dimension@encodable/format@encodable/registry
Contributing guidelinesAbout

@encodable/color

Version David (path)

Utilities for managing color schemes and color scales. Built on top of D3.

Install

npm install @encodable/color global-box

Example usage

import { getColorSchemeRegistry } from '@encodable/color';
/* Get color schemes by name */
getColorSchemeRegistry().get(schemeName);
// Get categorical scheme
getColorSchemeRegistry().categorical.get(schemeName);
// Get sequential scheme
getColorSchemeRegistry().sequential.get(schemeName);
// Get diverging scheme
getColorSchemeRegistry().diverging.get(schemeName);
// Register color scheme
getColorSchemeRegistry().register({
type: 'categorical',
id: 'my-scheme',
colors: [...],
});

The library also includes all schemes from d3-scale-chromatic by default.