Platform
Resources
Pricing
Sign in
Get started
Cee Nell
Workspace
Fork
Public
By
Cee Nell
Edited
Mar 21, 2023
1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof
color
=
Inputs
.
color
(
{
label
:
"Favorite color"
,
value
:
"#4682b4"
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
barX
(
energy_2021
,
{
x
:
"quadrillion_btu"
,
y
:
"type"
,
fill
:
color
,
stroke
:
"yellow"
,
sort
:
{
y
:
"x"
,
reverse
:
true
}
}
)
,
Plot
.
ruleX
(
[
0
]
)
]
,
marginLeft
:
150
}
)
Insert cell
Insert cell
Insert cell
Insert cell
us_energy.csv
Filter
Columns
Sort
Slice
Save
Type Table, then Shift-Enter. Ctrl-space for more options.
Insert cell
Insert cell
viewof
pickLineWidth
=
Inputs
.
range
(
[
0
,
10
]
,
{
label
:
"Choose line width"
,
step
:
1
}
)
Insert cell
viewof
minYear
=
Inputs
.
range
(
[
1973
,
2021
]
,
{
label
:
"min year"
,
value
:
1973
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
ruleY
(
[
0
]
)
,
Plot
.
lineY
(
energy_production
,
{
x
:
"year"
,
y
:
"quadrillion_btu"
,
stroke
:
"type"
,
strokeWidth
:
pickLineWidth
}
)
]
,
color
:
{
legend
:
true
}
,
x
:
{
domain
:
[
minYear
,
2022
]
}
}
)
Insert cell
Insert cell
Insert cell
Insert cell
power_plants
SELECT * FROM "power_plants"
Insert cell
Insert cell
Plot
.
plot
(
{
projection
:
"albers-usa"
,
marks
:
[
Plot
.
dot
(
us_plants
,
{
x
:
"longitude"
,
y
:
"latitude"
,
fill
:
"primary_source"
,
r
:
"total_capacity"
}
)
,
Plot
.
geo
(
states
)
]
,
r
:
{
range
:
[
0.5
,
12
]
}
}
)
Insert cell
us_plants
.
map
(
(
d
)
=>
d
.
primary_source
)
Insert cell
x
=
6
Insert cell
x
==
5
?
"YA"
:
"NO"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import
{
addTooltips
}
from
"@mkfreeman/plot-tooltip"
Insert cell
Insert cell
energy_2021
=
energy_production
.
filter
(
d
=>
d
.
year
==
2021
)
Insert cell
Insert cell
import
{
power_plants
}
from
"@observablehq/us-energy-mix-bubble-map-recreation"
Insert cell
Insert cell
import
{
states
}
from
"@observablehq/us-energy-mix-bubble-map-recreation"
Insert cell
import
{
showMe
}
from
"@observablehq/show-me"
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
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
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
energy_production
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
File attachments
us_energy.csv
CSV
Databases
Filter
Column
Operator
Columns
Sort
Column
Direction
Descending
Ascending
Slice
From
Start
To
End
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
pickLineWidth
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
minYear
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
us_plants
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
power_plants
File attachments
us_energy.csv
CSV
Databases
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
x
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
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
energy_2021
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
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML