Socket
Socket
Sign inDemoInstall

@types/d3-dispatch

Package Overview
Dependencies
0
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-dispatch


Version published
Maintainers
1
Install size
3.66 kB
Created

Package description

What is @types/d3-dispatch?

The @types/d3-dispatch package provides TypeScript type definitions for the d3-dispatch package, which is part of the D3 (Data-Driven Documents) JavaScript library. This package helps in managing and dispatching custom events in complex applications. It is particularly useful when integrating D3 with TypeScript projects, as it ensures type safety and enhances code readability and maintainability.

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

Creating a dispatch

This code demonstrates how to create a dispatcher with custom event types: 'load', 'progress', and 'error'. It allows you to register and trigger these events in your application.

import { dispatch } from 'd3-dispatch';

const dispatcher = dispatch('load', 'progress', 'error');

Registering event listeners

This code shows how to register different event listeners for the events created in the dispatcher. Each event type has a corresponding function that will be called when that event is dispatched.

dispatcher.on('load', loadData);
dispatcher.on('progress', updateProgress);
dispatcher.on('error', handleError);

Dispatching events

This code illustrates how to dispatch the 'load' and 'progress' events with associated data. The 'load' event is dispatched with a URL, and the 'progress' event with a numeric value representing progress.

dispatcher.call('load', this, { url: 'http://example.com/data' });
dispatcher.call('progress', this, 50);

Other packages similar to @types/d3-dispatch

Readme

Source

Installation

npm install --save @types/d3-dispatch

Summary

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

Details

Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/d3-dispatch

Additional Details

  • Last updated: Mon, 08 Aug 2016 20:24:46 GMT
  • File structure: ProperModule
  • Library Dependencies: none
  • Module Dependencies: none
  • Global values: none

Credits

These definitions were written by Alex Ford https://github.com/gustavderdrache, Boris Yankov https://github.com/borisyankov, Tom Wanzek https://github.com/tomwanzek.

FAQs

Last updated on 08 Aug 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc