Socket
Socket
Sign inDemoInstall

@types/d3-scale-chromatic

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-scale-chromatic

TypeScript definitions for d3-scale-chromatic


Version published
Maintainers
1
Created

What is @types/d3-scale-chromatic?

@types/d3-scale-chromatic provides TypeScript type definitions for the d3-scale-chromatic library, which is part of the D3.js ecosystem. This library offers a variety of color scales that can be used for data visualization, including both continuous and discrete color schemes.

What are @types/d3-scale-chromatic's main functionalities?

Continuous Color Scales

Continuous color scales interpolate colors smoothly across a range. The example uses the Viridis color scale to get a color at the midpoint.

const d3 = require('d3-scale-chromatic');
const scale = d3.interpolateViridis(0.5); // Returns a color in the middle of the Viridis scale

Discrete Color Scales

Discrete color scales provide a set of distinct colors. The example uses the Category10 scheme to get an array of 10 categorical colors.

const d3 = require('d3-scale-chromatic');
const colors = d3.schemeCategory10; // Returns an array of 10 categorical colors

Diverging Color Scales

Diverging color scales are useful for data that has a meaningful midpoint. The example uses the Red-Yellow-Blue scale to get a color at the midpoint.

const d3 = require('d3-scale-chromatic');
const scale = d3.interpolateRdYlBu(0.5); // Returns a color in the middle of the Red-Yellow-Blue diverging scale

Sequential Color Scales

Sequential color scales are used for data that progresses from low to high. The example uses the Blues scale to get a color at the midpoint.

const d3 = require('d3-scale-chromatic');
const scale = d3.interpolateBlues(0.5); // Returns a color in the middle of the Blues sequential scale

Other packages similar to @types/d3-scale-chromatic

FAQs

Package last updated on 21 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc