d3 v6.0 Release Notes
-
๐ Released August 26, 2020.
๐ This document covers only major changes. For minor and patch changes, please see the release notes.
๐ D3 now uses native collections (Map and Set) and accepts iterables. d3.group and d3.rollup are powerful new aggregation functions that replace d3.nest and work great with d3-hierarchy and d3-selection. There are lots of new helpers in d3-array, too, such as d3.greatest, d3.quickselect, and d3.fsum.
D3 now passes events directly to listeners, replacing the d3.event global and bringing D3 inline with vanilla JavaScript and most other frameworks.
d3-delaunay (based on Vladimir Agafonkinโs excellent Delaunator) replaces d3-voronoi, offering dramatic improvements to performance, robustness, and search. And thereโs a new d3-geo-voronoi for spherical (geographical) data! d3-random is greatly expanded and includes a fast linear congruential generator for seeded randomness. d3-chord has new layouts for directed and transposed chord diagrams. d3-scale adds a new radial scale type.
โก๏ธ โฆ and a variety of other small enhancements. More than 450 examples have been updated to D3 6.0!
d3-array
- Accept iterables.
- โ Add d3.group.
- โ Add d3.groups.
- โ Add d3.index.
- โ Add d3.indexes.
- โ Add d3.rollup.
- โ Add d3.rollups.
- โ Add d3.maxIndex.
- โ Add d3.minIndex.
- โ Add d3.greatest.
- โ Add d3.greatestIndex.
- โ Add d3.least.
- โ Add d3.leastIndex.
- โ Add d3.bin.
- โ Add d3.count.
- โ Add d3.cumsum.
- โ Add d3.fsum.
- โ Add d3.Adder.
- โ Add d3.quantileSorted.
- โ Add d3.quickselect.
- Add bisector.center.
- ๐ Allow more than two iterables for d3.cross.
- Accept non-sorted input with d3.quantile.
- Fix a array.sort bug in Safari.
- ๐ Fix bin thresholds to ignore NaN input.
- ๐ Fix d3.ticks to not return ticks outside the domain.
- ๐ Improve the performance of d3.median.
๐ See https://observablehq.com/@d3/d3-array-2-0 for details.
d3-brush
- Add event.mode.
- Change brush.on to pass the event directly to listeners.
- ๐ Improve multitouch (two-touch) interaction.
d3-chord
- โ Add d3.chordDirected.
- โ Add d3.chordTranspose.
- โ Add d3.ribbonArrow.
- Add ribbon.padAngle.
- Add ribbon.sourceRadius.
- Add ribbon.targetRadius.
d3-delaunay
- โ Add d3.Delaunay.
d3-drag
- Change drag.on to pass the event directly to listeners.
d3-force
- Add iterations argument to simulation.tick.
- ๐ฎ Add forceCenter.strength.
- ๐ฎ Add forceSimulation.randomSource.
- All built-in forces are now fully deterministic (including โjigglingโ coincident nodes).
- ๐ Improve the default phyllotaxis layout slightly by offsetting by one half-radius.
- ๐ Improve the error message when a link references an unknown node.
- ๐ฎ force.initialize is now passed a random source.
- ๐ Fix bug when initializing nodes with fixed positions.
d3-format
- ๐ Change the default minus sign to the minus sign (โ) instead of hyphen-minus (-).
- ๐ Fix decimal
d
formatting of numbers greater than or equal to 1e21.
d3-geo
- ๐ Fix clipping of some degenerate polygons.
d3-hierarchy
- Accept iterables.
- Add node[Symbol.iterator]; hierarchies are now iterable.
- Add node.find.
- Change node.each to pass the traversal index.
- Change node.eachAfter to pass the traversal index.
- Change node.eachBefore to pass the traversal index.
- ๐ Fix d3.packSiblings for huge circles.
- ๐ Fix divide-by-zero bug in d3.treemapBinary.
- ๐ Fix divide-by-zero bug in d3.treemapResquarify.
d3-interpolate
- Add interpolateZoom.rho. (#25)
- ๐ Allow d3.piecewise to default to using d3.interpolate. #90
- ๐ Change d3.interpolateTransformCss to use DOMMatrix and require absolute units. #83
d3-quadtree
- ๐ Fix an infinite loop when coordinates diverge to huge values.
d3-random
- โ Add d3.randomLcg.
- โ Add d3.randomGamma.
- โ Add d3.randomBeta.
- โ Add d3.randomWeibull.
- โ Add d3.randomCauchy.
- โ Add d3.randomLogistic.
- โ Add d3.randomPoisson.
- โ Add d3.randomInt.
- โ Add d3.randomBinomial.
- โ Add d3.randomGeometric.
- โ Add d3.randomPareto.
- โ Add d3.randomBernoulli.
- Allow d3.randomBates to take fractional n.
- Allow d3.randomIrwinHall to take fractional n.
- 0๏ธโฃ Donโt wrap Math.random in the default source.
Thanks to @Lange, @p-v-d-Veeken, @svanschooten, @Parcly-Taxel and @jrus for your contributions!
d3-scale
- Accept iterables.
- Add diverging.rangeRound.
- Add sequential.range (for compatibility with d3-axis).
- Add sequential.rangeRound.
- Add sequentialQuantile.quantiles.
- โ Add d3.scaleRadial.
- diverging.range can now be used to set the interpolator.
- sequential.range can now be used to set the interpolator.
- d3.scaleDiverging can now accept a range array in place of an interpolator.
- d3.scaleSequential can now accept a range array in place of an interpolator.
- Fix continuous.nice to ensure that niced domains always span ticks.
- ๐ฒ Fix log.ticks for small domains.
- ๐ฒ Fix log.ticks for small domains. #44
- Fix scale.clamp for sequential quantile scales. Thanks, @Fil!
- Fix scale.clamp for continuous scales with more domain values than range values.
- ๐ Fix diverging scales with descending domains.
- Remove deprecated step argument from time.ticks and time.nice.
d3-selection
- Add selection.selectChild.
- Add selection.selectChildren.
- โ Add d3.pointer.
- โ Add d3.pointers.
- Add selection[Symbol.iterator]; selections are now iterable!
- Accept iterables with selection.data.
- Accept iterables with d3.selectAll.
- Change selection.on to pass the event directly to listeners.
- Remove index and group from selection.on listeners!
- โ Remove d3.event!
- โ Remove d3.mouse.
- โ Remove d3.touch.
- โ Remove d3.touches.
- โ Remove d3.customEvent.
- โ Remove d3.clientPoint.
- โ Remove d3.sourceEvent.
- Fix selection.merge(transition) to error.
๐ For an overview of changes, see https://observablehq.com/@d3/d3-selection-2-0.
d3-shape
- Accept iterables.
- Add d3.line(x, y) shorthand.
- Add d3.area(x, y0, y1) shorthand.
- Add d3.symbol(type, size) shorthand.
d3-time-format
- โ Add ISO 8601 โweek yearโ (
%G
and%g
).
d3-timer
- Fix interval.restart to restart as an interval.
d3-transition
- Add transition.easeVarying.
- Add transition[Symbol.iterator]; transitions are now iterable.
- Fix selection.transition to error if the named transition to inherit is not found.k
- Fix transition.end to resolve immediately if the selection is empty.
d3-zoom
- Add zoom.tapDistance.
- Change zoom.on to pass the event directly to listeners.
- Change the default zoom.filter to observe wheel events if the control key is pressed.
- Change the default [zoom.wheelDelta](ttps://github.com/d3/d3-zoom/blob/master/README.md#zoom_wheelDelta) to go faster if the control key is pressed.
- Donโt set touch-action: none.
- โฌ๏ธ Upgrade to d3-selection 2.
๐ฅ Breaking Changes
D3 6.0 introduces several non-backwards-compatible changes.
- โ Remove d3.event.
- Change selection.on to pass the event directly to listeners.
- Change transition.on to pass the event directly to listeners.
- Change brush.on to pass the event directly to listeners.
- Change drag.on to pass the event directly to listeners.
- Change zoom.on to pass the event directly to listeners.
- โ Remove d3.mouse; use d3.pointer.
- โ Remove d3.touch; use d3.pointer.
- โ Remove d3.touches; use d3.pointers.
- โ Remove d3.clientPoint; use d3.pointer.
- โ Remove d3.voronoi; use d3.Delaunay.
- โ Remove d3.nest; use d3.group and d3.rollup.
- โ Remove d3.map; use Map.
- โ Remove d3.set; use Set.
- โ Remove d3.keys; use Object.keys.
- โ Remove d3.values; use Object.values.
- โ Remove d3.entries; use Object.entries.
- ๐ Rename d3.histogram to d3.bin.
- ๐ Rename d3.scan to d3.leastIndex.
- ๐ Change d3.interpolateTransformCss to require absolute units.
- ๐ Change d3.format to default to the minus sign instead of hyphen-minus for negative values.
๐ป D3 now requires a browser that supports ES2015. For older browsers, you must bring your own transpiler.
๐ Lastly, support for Bower has been dropped; D3 is now exclusively published to npm and GitHub.
โฌ๏ธ See our migration guide for help upgrading.