|
1 | | -# Changes in D3 5.0 |
| 1 | +# Changes in D3 6.0 |
2 | 2 |
|
3 | | -[Released March 22, 2018.](https://github.com/d3/d3/releases/tag/v5.0.0) |
| 3 | +[Released August 26, 2020.](https://github.com/d3/d3/releases/tag/v6.0.0) |
4 | 4 |
|
5 | 5 | *This document covers only major changes. For minor and patch changes, please see the [release notes](https://github.com/d3/d3/releases).* |
6 | 6 |
|
| 7 | +D3 6.0 introduces several non-backwards-compatible changes. |
| 8 | + |
| 9 | +**Adoption of ES2015** |
| 10 | + |
| 11 | +* *All* the D3 modules have now adopted ES2015. Developers who need to maintain compatibility with older browsers will use transpilation. [[details](https://observablehq.com/d/f91cccf0cad5e9cb#es2015)] |
| 12 | + |
| 13 | +**d3-selection** has a new event manager: |
| 14 | + |
| 15 | +* d3.event ⇨ (event) passed as the first argument to all listeners [[details](https://observablehq.com/d/f91cccf0cad5e9cb#events)] |
| 16 | +* d3.mouse, d3.touch, d3.touches, d3.clientPoint ⇨ d3.pointer [[details](https://observablehq.com/d/f91cccf0cad5e9cb#pointer)] |
| 17 | + |
| 18 | +**d3-brush**, **d3-drag** and **d3-zoom** also use the new event manager: |
| 19 | + |
| 20 | +* *brush*.on listeners now receive event [[details](https://observablehq.com/d/f91cccf0cad5e9cb#event_brush)] |
| 21 | +* *drag*.on listeners now receive event [[details](https://observablehq.com/d/f91cccf0cad5e9cb#event_drag)] |
| 22 | +* *zoom*.on listeners now receive event [[details](https://observablehq.com/d/f91cccf0cad5e9cb#event_zoom)] |
| 23 | + |
| 24 | +**d3-voronoi** is deprecated, and replaced by [d3-delaunay](https://github.com/d3/d3-delaunay): |
| 25 | + |
| 26 | +* d3.voronoi ⇨ d3.Delaunay [[details](https://observablehq.com/d/f91cccf0cad5e9cb#delaunay)] |
| 27 | + |
| 28 | +**d3-collection** is deprecated, and its methods are replaced: |
| 29 | + |
| 30 | +* d3.nest ⇨ d3.group and d3.rollup (from d3-array) [[details](https://observablehq.com/d/f91cccf0cad5e9cb#group)] |
| 31 | +* d3.map ⇨ Map [[details](https://observablehq.com/d/f91cccf0cad5e9cb#collection)] |
| 32 | +* d3.set ⇨ Set [[details](https://observablehq.com/d/f91cccf0cad5e9cb#collection)] |
| 33 | +* d3.keys ⇨ Object.keys [[details](https://observablehq.com/d/f91cccf0cad5e9cb#collection)] |
| 34 | +* d3.values ⇨ Object.values [[details](https://observablehq.com/d/f91cccf0cad5e9cb#collection)] |
| 35 | +* d3.entries ⇨ Object.entries [[details](https://observablehq.com/d/f91cccf0cad5e9cb#collection)] |
| 36 | + |
| 37 | +**d3-array** has renamed two methods: |
| 38 | +* d3.histogram ⇨ d3.bin [[details](https://observablehq.com/d/f91cccf0cad5e9cb#bin)] |
| 39 | +* d3.scan ⇨ d3.leastIndex [[details](https://observablehq.com/d/f91cccf0cad5e9cb#leastIndex)] |
| 40 | + |
| 41 | +**d3-interpolate** has a breaking change in an ancillary method: |
| 42 | +* d3.interpolateTransformCss is now stricter in its inputs. [[details](https://observablehq.com/d/f91cccf0cad5e9cb#interpolateTransformCss)] |
| 43 | + |
| 44 | +**d3-format** changes its minus sign: |
| 45 | +* The default symbol for the sign of negative values becomes unicode minus instead of hyphen-minus. [[details](https://observablehq.com/d/f91cccf0cad5e9cb#minus)] |
| 46 | + |
| 47 | +**bower** |
| 48 | + |
| 49 | +Support for the [bower](https://github.com/mbostock-bower/d3-bower) package manager has been dropped; use [unpkg](https://unpkg.com/d3) or [cdnjs](https://cdnjs.com/libraries/d3). |
| 50 | + |
| 51 | +……… |
| 52 | + |
| 53 | + |
| 54 | +# Changes in D3 5.0 |
| 55 | + |
| 56 | +[Released March 22, 2018.](https://github.com/d3/d3/releases/tag/v5.0.0) |
| 57 | + |
7 | 58 | D3 5.0 introduces only a few non-backwards-compatible changes. |
8 | 59 |
|
9 | 60 | D3 now uses [Promises](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises) instead of asynchronous callbacks to load data. Promises simplify the structure of asynchronous code, especially in modern browsers that support [async and await](https://javascript.info/async-await). (See this [introduction to promises](https://observablehq.com/@observablehq/introduction-to-promises) on [Observable](https://observablehq.com).) For example, to load a CSV file in v4, you might say: |
|
0 commit comments