Platform
Resources
Pricing
Sign in
Get started
Matthew Berger
Workspace
Fork
Published unlisted
By
Matthew Berger
Edited
Feb 28, 2022
3
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
co2_data
=
{
let
the_data
=
await
FileAttachment
(
"co2_data.json"
)
.
json
(
)
the_data
.
forEach
(
datum
=>
{
datum
.
year
=
new
Date
(
datum
.
year
,
0
)
}
)
return
the_data
.
map
(
(
d
,
t
)
=>
{
return
{
...
d
,
tdx
:
t
}
}
)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof
horizon_value
=
Inputs
.
range
(
[
1
,
30
]
,
{
value
:
5
,
step
:
1
,
label
:
"Horizon Value"
}
)
Insert cell
plot
=
{
let
svg
=
d3
.
create
(
'svg'
)
.
attr
(
'width'
,
width
)
.
attr
(
'height'
,
height
)
let
g
=
svg
.
append
(
'g'
)
.
attr
(
'transform'
,
`translate(${
margins
.
left
},${
margins
.
top
})`
)
return
svg
.
node
(
)
}
Insert cell
Insert cell
plot_view
Insert cell
Insert cell
Insert cell
margins
=
(
{
left
:
30
,
right
:
10
,
top
:
60
,
bottom
:
30
}
)
Insert cell
plot_width
=
width
-
(
margins
.
left
+
margins
.
right
)
Insert cell
height
=
700
Insert cell
plot_height
=
height
-
(
margins
.
top
+
margins
.
bottom
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import
{
drawdom
}
from
'91007ee9d5fd152b'
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
co2_data
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
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
horizon_value
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot_view
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
margins
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot_width
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot_height
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
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