D3 Tutorial
Data Transformation and Scale Functions
Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University
D3 Tutorial Data Transformation and Scale Functions Edit by Jiayi - - PowerPoint PPT Presentation
D3 Tutorial Data Transformation and Scale Functions Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University Populations of cities - Scaling Scale populations so that we can display bars within the screen London: 86.74 pixels
Data Transformation and Scale Functions
Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University
86.74 pixels
42.93 pixels
22.44 pixels
115.1 pixels
86.74 pixels
42.93 pixels
22.44 pixels
115.1 pixels
domain (x) and range (y)
600 px
600 px
600 px
(*) + -)
600 px
600 px
values, but if we provide 3 or more values the scale function is subdivided into multiple segments
2 4 6 8 10 #ddd is hexadecimal representation of rgb(221, 221, 221) Light Grey
preset (or custom) interpolator
2 4 6 8 10 d3.interpolateRainbow
d3.interpolateRainbow d3.interpolateBrBG d3.interpolateBlues d3.interpolateViridis d3.interpolateRainbow
discrete quantities defined by the range
100
100
100
50
values (also specified by an array)
1 2 3 4 5 6 7 8 9
dividing the continuous range into uniform bands
dimension
and paddingInnter are ratios
zero
dimension
is a ratio