Published
Edited
May 22, 2019
7 stars
Insert cell
Insert cell
Insert cell
getFontSize = (base, ratio, size) => {
let fontSize = base * Math.pow(ratio, size)
return Math.round(fontSize)
}
Insert cell
Insert cell
getFontSize(16, 1.313, 4)
Insert cell
Insert cell
getLineHeight = (base, ratio, size, gridSize) => {
let lineHeight = Math.round(base * Math.pow(ratio, size))
return (lineHeight % gridSize === 0) ? lineHeight : lineHeight + (lineHeight % gridSize)
}
Insert cell
Insert cell
getLineHeight(24, 1.212, 4, 4)
Insert cell
Insert cell
Insert cell
Insert cell
exampleTypeScale = generateTypeScale(16, 1.313, 20, 1.24, 4)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more