Platform
Solutions
Resources
Pricing
Sign in
Sign up
AHJ George
Workspace
Fork
Public
By
AHJ George
Edited
Mar 29, 2023
Fork of
Lesson 4, Transformations
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barX
(
olympians
,
{
x
:
1
,
y
:
"nationality"
,
sort
:
{
y
:
"x"
,
reverse
:
true
,
limit
:
10
}
,
title
:
"name"
}
)
,
]
,
marginLeft
:
50
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barX
(
olympians
,
Plot
.
groupY
(
{
x
:
"count"
,
title
:
"count"
}
,
{
y
:
"nationality"
,
sort
:
{
y
:
"x"
,
reverse
:
true
,
limit
:
10
}
}
)
)
,
Plot
.
ruleX
(
[
0
]
)
]
,
marginLeft
:
50
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barX
(
olympians
,
Plot
.
groupY
(
{
x
:
"mean"
}
,
{
y
:
"sport"
,
x
:
"height"
,
sort
:
{
y
:
"x"
,
reverse
:
true
,
limit
:
13
}
}
)
)
,
Plot
.
ruleX
(
[
0
]
)
]
,
marginLeft
:
100
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
dot
(
olympians
,
{
x
:
"weight"
,
stroke
:
"steelblue"
,
opacity
:
.3
}
)
,
]
,
x
:
{
label
:
"weight (kg) →"
}
,
width
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
dot
(
olympians
,
Plot
.
dodgeY
(
{
x
:
"weight"
,
stroke
:
"steelblue"
,
r
:
1
}
)
)
,
]
,
x
:
{
label
:
"weight (kg) →"
}
,
width
,
height
:
1200
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
rectY
(
olympians
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"weight"
}
)
)
,
Plot
.
ruleY
(
[
0
]
)
]
,
width
}
)
Insert cell
Insert cell
viewof
numBins
=
Inputs
.
range
(
[
1
,
100
]
,
{
label
:
"Number of bins"
,
step
:
1
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
rectY
(
olympians
,
Plot
.
binX
(
{
y
:
"count"
,
title
:
"x"
}
,
{
x
:
"weight"
,
thresholds
:
numBins
}
)
)
,
Plot
.
ruleY
(
[
0
]
)
]
,
width
,
marginLeft
:
50
}
)
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barY
(
olympians
,
Plot
.
groupX
(
{
y
:
"count"
}
,
{
x
:
"nationality"
,
sort
:
{
x
:
"y"
,
reverse
:
true
,
limit
:
10
}
}
)
)
,
]
,
color
:
{
legend
:
true
}
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barY
(
olympians
,
Plot
.
groupX
(
{
y
:
"count"
}
,
{
x
:
"nationality"
,
fill
:
"sport"
,
title
:
"sport"
,
sort
:
{
x
:
"y"
,
reverse
:
true
,
limit
:
10
}
}
)
)
,
]
,
color
:
{
legend
:
true
}
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barY
(
olympians
,
Plot
.
groupX
(
{
y
:
"count"
}
,
{
x
:
"nationality"
,
fill
:
"sex"
,
title
:
"sport"
,
sort
:
{
x
:
"y"
,
reverse
:
true
,
limit
:
10
}
}
)
)
,
]
,
color
:
{
domain
:
[
"male"
,
"female"
]
,
legend
:
true
}
}
)
Insert cell
Insert cell
DonutChart
(
islands
,
{
name
:
d
=>
d
.
name
,
value
:
d
=>
d
.
value
,
innerRadius
:
0
}
)
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
y
:
{
tickFormat
:
"s"
}
,
marks
:
[
Plot
.
areaY
(
industries
,
{
x
:
"date"
,
offset
:
stacking
===
"baseline"
?
null
:
stacking
,
y
:
"unemployed"
,
fill
:
"industry"
}
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
ruleY
(
[
0
]
)
,
Plot
.
lineY
(
aapl
,
Plot
.
windowY
(
{
x
:
"Date"
,
y
:
"Close"
,
reduce
:
reducer
,
k
:
k
}
)
)
]
}
)
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
ruleY
(
[
1
]
)
,
Plot
.
line
(
stocks
,
Plot
.
normalizeY
(
{
x
:
"Date"
,
y
:
"Close"
,
stroke
:
"Symbol"
,
title
:
"Symbol"
}
)
)
,
]
,
y
:
{
type
:
"log"
,
grid
:
true
,
label
:
"↑ Change in price (%)"
,
tickFormat
:
(
f
=>
x
=>
f
(
(
x
-
1
)
*
100
)
)
(
d3
.
format
(
"+d"
)
)
}
,
}
)
Insert cell
Insert cell
import
{
Plot
}
from
"@mkfreeman/plot-tooltip"
Insert cell
import
{
islands
}
from
"@observablehq/datavis-course-lesson-1-introduction"
Insert cell
import
{
DonutChart
}
from
"@d3/donut-chart"
Insert cell
import
{
stocks
}
from
"@observablehq/plot-map"
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
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
Add comment
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
Add comment
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
numBins
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
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
Add comment
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
stacking
Edit
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
k
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
reducer
Edit
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
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
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML