Socket
Socket
Sign inDemoInstall

@types/d3-shape

Package Overview
Dependencies
1
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/d3-shape

TypeScript definitions for d3-shape


Version published
Weekly downloads
3.2M
decreased by-18.45%
Maintainers
1
Install size
141 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

Installation

npm install --save @types/d3-shape

Summary

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

Details

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

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: @types/d3-path

Credits

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

FAQs

Last updated on 21 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