Platform
Resources
Pricing
Sign in
Get started
Vincent Raveneau
CNRS Research Engineer at LIRMM, Montpellier, France.
Workspace
Fork
Published
Advent of code 2021
By
Vincent Raveneau
Edited
Dec 2, 2021
ISC
Fork of
Simple D3
Importers
1 star
1
Advent of code 2021
Day 1: Sonar Sweep
Day 2: Dive!
Day 3: Binary Diagnostic
Day 4: Giant Squid
Day 5: Hydrothermal Venture
Day 6: Lanternfish
Day 7: The Treachery of Whales
Day 8: Seven Segment Search
Day 9: Smoke Basin
Day 10: Syntax Scoring
Day 11: Dumbo Octopus
Day 12: Passage Pathing
Day 13: Transparent Origami
Day 14: Extended Polymerization
Day 15: Chiton
Day 16: Packet Decoder
Day 17: Trick Shot
Day 18: Snailfish
Day 19: Beacon Scanner
Day 20: Trench map
Day 21: Dirac dice
Insert cell
Insert cell
Insert cell
Insert cell
Plot
.
plot
(
{
width
:
width
,
marks
:
[
Plot
.
areaY
(
objectInput
,
{
x
:
"Distance"
,
y
:
"Depth"
,
fill
:
"lightblue"
}
)
,
Plot
.
line
(
objectInput
,
{
x
:
"Distance"
,
y
:
"Depth"
}
)
,
Plot
.
ruleY
(
[
0
]
)
,
]
}
)
Insert cell
Plot
.
plot
(
{
width
:
width
,
marks
:
[
Plot
.
tickX
(
objectInput
,
{
x
:
"Distance"
,
stroke
:
(
d
,
i
)
=>
d
.
Increase
?
"blue"
:
"red"
}
)
]
}
)
Insert cell
Insert cell
Insert cell
Insert cell
objectInput
=
numberInput
.
map
(
(
val
,
index
,
arr
)
=>
{
return
{
Distance
:
index
,
Depth
:
-
val
,
Increase
:
val
>
arr
[
index
-
1
]
}
}
)
Insert cell
numberInput
=
textInput
.
map
(
parseFloat
)
Insert cell
textInput
=
FileAttachment
(
"01_input.txt"
)
.
text
(
)
.
then
(
text
=>
text
.
split
(
"\n"
)
)
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
increaseCount
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
increaseBinned
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
objectInput
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
numberInput
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
textInput
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML