
D3.js Has a Free API That Goes Way Beyond Bar Charts
D3.js is the most powerful data visualization library ever created. Most developers only use it for charts, but its modular API covers everything from geography to physics simulations. D3-Selection: jQuery for Data import { select , selectAll } from " d3-selection " ; // Bind data to DOM elements const bars = select ( " svg " ) . selectAll ( " rect " ) . data ( dataset ) . join ( enter => enter . append ( " rect " ) . attr ( " x " , ( d , i ) => i * 30 ) . attr ( " height " , 0 ) . attr ( " fill " , " steelblue " ) . call ( enter => enter . transition (). duration ( 750 ) . attr ( " height " , d => yScale ( d . value )) . attr ( " y " , d => height - yScale ( d . value ))), update => update . call ( update => update . transition (). duration ( 750 ) . attr ( " height " , d => yScale ( d . value ))), exit => exit . call ( exit => exit . transition (). duration ( 500 ) . attr ( " height " , 0 ) . remove ()) ); D3-Scale: Map Any Domain to Any Range import { scaleLinear , scaleTime , scale
Continue reading on Dev.to Webdev
Opens in a new tab



