Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/d3-transition

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-transition

TypeScript definitions for D3JS d3-transition module

  • 3.0.4
  • ts4.3
  • ts4.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
decreased by-0.51%
Maintainers
1
Weekly downloads
 
Created

What is @types/d3-transition?

The @types/d3-transition package provides TypeScript type definitions for the d3-transition module, which is part of the D3.js library. This module is used to create and manage smooth transitions for data visualizations, allowing for animated changes to the DOM elements.

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

Creating a Transition

This feature allows you to create a transition for a selected DOM element. In this example, a circle's 'cx' attribute is animated from 50 to 200 over a duration of 2000 milliseconds.

import * as d3 from 'd3';

const svg = d3.select('svg');
const circle = svg.append('circle')
  .attr('cx', 50)
  .attr('cy', 50)
  .attr('r', 40);

circle.transition()
  .duration(2000)
  .attr('cx', 200);

Chaining Transitions

This feature allows you to chain multiple transitions together. In this example, the circle's 'cx' attribute is animated first, followed by the 'cy' attribute.

import * as d3 from 'd3';

const svg = d3.select('svg');
const circle = svg.append('circle')
  .attr('cx', 50)
  .attr('cy', 50)
  .attr('r', 40);

circle.transition()
  .duration(2000)
  .attr('cx', 200)
  .transition()
  .duration(1000)
  .attr('cy', 200);

Easing Functions

This feature allows you to apply easing functions to transitions. In this example, a 'bounce' easing function is applied to the transition of the circle's 'cx' attribute.

import * as d3 from 'd3';

const svg = d3.select('svg');
const circle = svg.append('circle')
  .attr('cx', 50)
  .attr('cy', 50)
  .attr('r', 40);

circle.transition()
  .duration(2000)
  .ease(d3.easeBounce)
  .attr('cx', 200);

Other packages similar to @types/d3-transition

FAQs

Package last updated on 22 Aug 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