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

@types/d3-shape

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-shape

TypeScript definitions for D3JS d3-shape module

  • 3.0.2
  • ts3.6
  • ts3.7
  • ts3.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
decreased by-18.08%
Maintainers
1
Weekly downloads
 
Created

What is @types/d3-shape?

The @types/d3-shape package provides TypeScript type definitions for d3-shape, a D3 module for creating graphical shapes like lines, areas, arcs, pies, and more. These definitions allow developers to use d3-shape in TypeScript projects with type checking, enabling better development experience and error handling.

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

Line Generation

Generates a SVG path data string for a line connecting a series of points.

import * as d3 from 'd3-shape';

const line = d3.line()
    .x((d) => d.x)
    .y((d) => d.y);
const points = [{ x: 0, y: 0 }, { x: 10, y: 10 }];
const pathData = line(points);

Area Generation

Creates an area defined by a line along its top edge and a baseline along the bottom.

import * as d3 from 'd3-shape';

const area = d3.area()
    .x((d) => d.x)
    .y0(0)
    .y1((d) => d.y);
const points = [{ x: 0, y: 0 }, { x: 10, y: 10 }];
const pathData = area(points);

Pie Chart Generation

Generates pie chart sectors, calculating the start and end angles for each data point.

import * as d3 from 'd3-shape';

const pie = d3.pie()
    .value((d) => d.value);
const data = [{ value: 10 }, { value: 20 }];
const arcs = pie(data);

Other packages similar to @types/d3-shape

FAQs

Package last updated on 16 Jul 2021

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