Notebooks 2.0 is here.
Read the preview announcement
Platform
Resources
Pricing
Sign in
Get started
Showing latest version.
Changes will not be saved.
Maya Gao
Professional pretender. Copy-paste specialist.
Workspace
Fork
Published
By
Maya Gao
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.
Try it for free
Learn more
Compare latest
Fork
View
Export
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getFontSize
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getLineHeight
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
generateTypeScale
Edit
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
exampleTypeScale
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML