Curren – d3 js





D3 documentation
https://d3js.org

Javascript review


for (car of cars)

cars.forEach

cars.map() return an array of results
Working with JSON

json.stringify(), convert object to json

json.parse(), to convert json to object
Modules export, import
Asynchronous


SVG graphics


D3.js


import {functions} from ‘d3’



const svg = select(‘svg’) , all svg tag from html

.attr(‘attribute name’), extract values from html

.append, add child tags to an existing tag

.attr(‘attribute name’, value), add attribute and assign value

It’s a good practice to group multiple components

.transition

Bar chart


.enter
.update
.exit

scaleLinear, for numerical data

scaleBand, for nominal data, categories

domain represents “data space”, range represents “display space”

manage margin and innerWidth/Height with calculations

Comments

Popular posts from this blog

Bryan Peterson – Learning to See Creatively

R – Stats, factor count,proportion

R - Supervised Learning