Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@types/d3-interpolate

Package Overview
Dependencies
1
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/d3-interpolate

TypeScript definitions for D3JS d3-interpolate module


Version published
Weekly downloads
3.5M
increased by0.32%
Maintainers
1
Install size
51.7 kB
Created
Weekly downloads
 

Package description

What is @types/d3-interpolate?

@types/d3-interpolate provides TypeScript definitions for the d3-interpolate module, which is part of the D3.js library. This module is used for interpolating between two values, which is useful for animations, transitions, and data visualizations.

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

Number Interpolation

This feature allows you to interpolate between two numbers. The example code demonstrates how to interpolate between 0 and 100, returning 50 when the interpolation factor is 0.5.

const d3 = require('d3-interpolate');
const interpolateNumber = d3.interpolateNumber(0, 100);
console.log(interpolateNumber(0.5)); // 50

Color Interpolation

This feature allows you to interpolate between two colors. The example code demonstrates how to interpolate between 'red' and 'blue', returning 'rgb(128, 0, 128)' when the interpolation factor is 0.5.

const d3 = require('d3-interpolate');
const interpolateColor = d3.interpolateRgb("red", "blue");
console.log(interpolateColor(0.5)); // rgb(128, 0, 128)

String Interpolation

This feature allows you to interpolate between two strings. The example code demonstrates how to interpolate between '0%' and '100%', returning '50%' when the interpolation factor is 0.5.

const d3 = require('d3-interpolate');
const interpolateString = d3.interpolateString("0%", "100%");
console.log(interpolateString(0.5)); // '50%'

Array Interpolation

This feature allows you to interpolate between two arrays. The example code demonstrates how to interpolate between [0, 1] and [10, 20], returning [5, 10.5] when the interpolation factor is 0.5.

const d3 = require('d3-interpolate');
const interpolateArray = d3.interpolateArray([0, 1], [10, 20]);
console.log(interpolateArray(0.5)); // [5, 10.5]

Object Interpolation

This feature allows you to interpolate between two objects. The example code demonstrates how to interpolate between {a: 0, b: 1} and {a: 10, b: 20}, returning {a: 5, b: 10.5} when the interpolation factor is 0.5.

const d3 = require('d3-interpolate');
const interpolateObject = d3.interpolateObject({a: 0, b: 1}, {a: 10, b: 20});
console.log(interpolateObject(0.5)); // {a: 5, b: 10.5}

Other packages similar to @types/d3-interpolate

Readme

Source

Installation

npm install --save @types/d3-interpolate

Summary

This package contains type definitions for D3JS d3-interpolate module (https://github.com/d3/d3-interpolate/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate.

Additional Details

  • Last updated: Fri, 22 Sep 2023 20:29:40 GMT
  • Dependencies: @types/d3-color
  • Global values: none

Credits

These definitions were written by Tom Wanzek, Alex Ford, Boris Yankov, denisname, and Nathan Bierema.

FAQs

Last updated on 22 Sep 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc