Skip to content

Releases: d3/d3-dispatch

v3.0.1

05 Jun 18:31
904ddf2
Compare
Choose a tag to compare
  • Make build reproducible.

v3.0.0

04 Jun 23:58
037d018
Compare
Choose a tag to compare
  • Adopt type: module.

This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ.

v2.0.0

23 Aug 13:23
@Fil Fil
Compare
Choose a tag to compare

This release adopts ES2015 language features such as for-of and drops support for older browsers, including IE. If you need to support pre-ES2015 environments, you should stick with d3-dispatch 1.x or use a transpiler.

v1.0.6

16 Nov 17:52
Compare
Choose a tag to compare
  • Disallow whitespace and periods in type names passed to d3.dispatch.
  • Add sideEffects: false to the package.json.

v1.0.5

24 Aug 21:13
Compare
Choose a tag to compare
  • Housekeeping.

v1.0.4

24 Aug 18:21
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.3

10 Mar 18:11
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.2

23 Nov 00:28
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.1

02 Aug 21:51
Compare
Choose a tag to compare
  • Add module entry point to package.json.

v1.0.0

14 Jun 22:45
Compare
Choose a tag to compare
  • First stable release.

Changes since D3 3.x

Rather than decorating the dispatch object with each event type, the dispatch object now exposes generic dispatch.call and dispatch.apply methods which take the type string as the first argument. For example, in D3 3.x, you might say:

dispatcher.foo.call(that, "Hello, Foo!");

To dispatch a foo event in D3 4.0, you’d say:

dispatcher.call("foo", that, "Hello, Foo!");

The dispatch.on method now accepts multiple typenames, allowing you to add or remove listeners for multiple events simultaneously. For example, to send both foo and bar events to the same listener:

dispatcher.on("foo bar", function(message) {
  console.log(message);
});

This matches the new behavior of selection.on in d3-selection. The dispatch.on method now validates that the specifier listener is a function, rather than throwing an error in the future.

The new implementation d3.dispatch is faster, using fewer closures to improve performance. There’s also a new dispatch.copy method for making a copy of a dispatcher; this is used by d3-transition to improve the performance of transitions in the common case where all elements in a transition have the same transition event listeners.

See CHANGES for all D3 changes since 3.x.