Socket
Socket
Sign inDemoInstall

@types/d3

Package Overview
Dependencies
31
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/d3

TypeScript definitions for d3


Version published
Weekly downloads
1.5M
decreased by-11.01%
Maintainers
1
Install size
0.957 MB
Created
Weekly downloads
 

Package description

What is @types/d3?

The @types/d3 package provides TypeScript type definitions for D3.js, a JavaScript library for producing dynamic, interactive data visualizations in web browsers. It enables TypeScript developers to use D3.js with type checking, making development more robust and error-free. The package covers a wide range of visualization techniques and utilities provided by D3.js.

What are @types/d3's main functionalities?

Selecting Elements

Selects the body of the document and appends an SVG element to it. This is foundational for creating any visualizations with D3, as it involves manipulating the DOM based on data.

d3.select('body').append('svg')

Data Binding

Binds an array of data to a list and creates a list item for each element. This demonstrates D3's data-driven approach to DOM manipulation.

d3.select('ul').selectAll('li').data([1, 2, 3]).enter().append('li').text(function(d) { return d; })

Creating Scales

Creates a linear scale for mapping a domain of input data to a range of output values. Scales are crucial for creating charts and graphs.

d3.scaleLinear().domain([0, 100]).range([0, 200])

Generating Axes

Generates a bottom-oriented axis using a specified scale, with a specified number of ticks. Axes are essential for charting, providing context to the data being visualized.

d3.axisBottom(scale).ticks(5)

Other packages similar to @types/d3

Readme

Source

Installation

npm install --save @types/d3

Summary

This package contains type definitions for d3 (https://github.com/d3/d3).

Details

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

index.d.ts

// Last module patch version validated against: 7.4.4

export as namespace d3;

/**
 * Version number in format _Major.Minor.BugFix_, like 7.0.0.
 */
export const version: string;

export * from "d3-array";
export * from "d3-axis";
export * from "d3-brush";
export * from "d3-chord";
export * from "d3-color";
export * from "d3-contour";
export * from "d3-delaunay";
export * from "d3-dispatch";
export * from "d3-drag";
export * from "d3-dsv";
export * from "d3-ease";
export * from "d3-fetch";
export * from "d3-force";
export * from "d3-format";
export * from "d3-geo";
export * from "d3-hierarchy";
export * from "d3-interpolate";
export * from "d3-path";
export * from "d3-polygon";
export * from "d3-quadtree";
export * from "d3-random";
export * from "d3-scale";
export * from "d3-scale-chromatic";
export * from "d3-selection";
export * from "d3-shape";
export * from "d3-time";
export * from "d3-time-format";
export * from "d3-timer";
export * from "d3-transition";
export * from "d3-zoom";

Additional Details

Credits

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

FAQs

Last updated on 07 Nov 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