Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
D3.js stands for Data-Driven Documents, a JavaScript library for dynamic, interactive data visualization.
D3.js was created by Mike Bostock in 2011, based on his PhD studies in the Stanford University data visualization program.
Michael Bostock is an American computer scientist and data visualization specialist. He is one of the co-creators of Observable and a key developer of D3.js.
D3.js was designed for more than just graphs and charts. It's also capable of presenting maps, networks, and ordered lists. It was created for the efficient manipulation of documents based on data.
D3.js makes use of Web Standards such as HTML5, CSS3, and SVG, so it is therefore designed for modern browsers.
Selectors are patterns to select items from the DOM
HTML:
Renders:
SVG:
const circle = svg.selectAll("circle").data(data); circle.enter().append("circle").attr("r", 2.5); circle.attr("cx", function(d) { return d.x; }).attr("cy", function(d) { return d.y; }); circle.exit().remove();
Issues: Performance Components tree DOM manipulation
Important part: D3.js should never manipulate what React is already keeping track of.
The virtual DOM keeps track of the structure, so if at any point of the React lifecycle the DOM is changed without its knowledge, it throws nasty bugs.
It consists in only using D3.js’s helpers to prepare the data, the axes, etc. and then feed all of that to React to be rendered.
No D3.js’s data binding, but handle it with React by specifying a key for all SVG elements.
Good performance overall.
Lost the enter-update-exit pattern.
It forces us to componentize the elements, so it’s easier to reuse.
It comes pretty close to mirroring the structure of the DOM, so it’s easier to keep track of what the components look like.
No entering and exiting.
Use a spacebar or arrow keys to navigate.
Press 'P' to launch speaker console.