Platform
Resources
Pricing
Sign in
Contact us
Shirley Wu
Award-winning creative focused on data-driven art and visualizations, trying to push the boundaries of the web one visual story at a time ✨
Workspace
Fork
Published
Frontend Masters Workshops
By
Shirley Wu
Edited
Aug 3, 2018
Fork of
Building Custom Data Visualizations, Starter
•
2 forks
Importers
14 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
winsMetascores
=
_
.
map
(
data
,
d
=>
{
// Nominated for 1 Oscar. Another 11 wins & 21 nominations.
let
wins
=
d
.
Awards
.
match
(
/(\d+) win/
)
;
wins
=
wins
?
wins
[
1
]
:
0
;
return
{
wins
:
+
wins
,
score
:
+
d
.
Metascore
,
title
:
d
.
Title
,
}
}
)
Insert cell
vegalite
(
{
data
:
{
values
:
winsMetascores
}
,
mark
:
'point'
,
encoding
:
{
y
:
{
type
:
'quantitative'
,
field
:
'score'
,
scale
:
{
type
:
'log'
}
,
}
,
x
:
{
type
:
'quantitative'
,
field
:
'wins'
,
}
,
}
}
)
Insert cell
Insert cell
yearScoreGenre
=
_
.
map
(
data
,
d
=>
{
return
{
date
:
new
Date
(
d
.
Released
)
,
score
:
+
d
.
Metascore
,
genre
:
d
.
Genre
?
d
.
Genre
.
split
(
', '
)
[
0
]
:
''
,
}
}
)
Insert cell
Insert cell
monthGenrePopularity
=
_
.
chain
(
data
)
.
map
(
d
=>
{
return
_
.
map
(
d
.
Genre
.
split
(
', '
)
,
genre
=>
{
return
{
date
:
new
Date
(
d
.
Released
)
,
genre
,
votes
:
+
(
d
.
imdbVotes
.
replace
(
/\,/g
,
''
)
)
,
}
}
)
}
)
.
flatten
(
)
.
value
(
)
Insert cell
Insert cell
vegalite
(
{
data
:
{
values
:
monthGenrePopularity
}
,
mark
:
'rect'
,
encoding
:
{
x
:
{
field
:
'date'
,
type
:
'ordinal'
,
timeUnit
:
'month'
}
,
y
:
{
field
:
'genre'
,
type
:
'nominal'
}
,
color
:
{
type
:
'quantitative'
,
aggregate
:
'max'
,
field
:
'votes'
}
,
}
}
)
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 fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
winsMetascores
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
yearScoreGenre
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
monthGenrePopularity
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vegalite
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
_
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML