Platform
Resources
Pricing
Sign in
Get started
Alf Eaton
Workspace
Fork
Published
By
Alf Eaton
Edited
Oct 22, 2021
Insert cell
Insert cell
Insert cell
"Hello World"
Insert cell
Insert cell
Insert cell
x
=
100
Insert cell
Insert cell
y
=
x
*
5
Insert cell
Insert cell
Insert cell
a
=
{
const
output
=
1
;
return
output
;
}
Insert cell
Insert cell
Insert cell
z
=
Promise
.
resolve
(
x
*
10
)
// fetch, etc
Insert cell
Insert cell
today
=
{
const
result
=
await
new
Promise
(
(
resolve
)
=>
{
resolve
(
{
today
:
new
Date
(
)
}
)
;
}
)
;
return
result
.
today
;
}
Insert cell
Insert cell
Insert cell
counter
=
{
let
value
=
1
;
while
(
true
)
{
await
new
Promise
(
(
resolve
)
=>
setTimeout
(
resolve
,
1000
)
)
;
// wait for 1 second
yield
value
++
;
}
}
Insert cell
Insert cell
Insert cell
<
marquee
>
🦖
</
marquee
>
Insert cell
Insert cell
Insert cell
mutable
clicks
=
2
Insert cell
Insert cell
Insert cell
handleClick
=
(
)
=>
{
mutable
clicks
++
;
}
Insert cell
Insert cell
Insert cell
htl
.
html
`<button onclick=${
handleClick
}>Click me</button>`
Insert cell
Insert cell
Insert cell
viewof
color
=
Inputs
.
color
(
{
value
:
"#24c64d"
}
)
Insert cell
Insert cell
viewof
text
=
Inputs
.
text
(
{
value
:
"Hello World"
}
)
Insert cell
viewof
size
=
Inputs
.
range
(
[
50
,
400
]
,
{
value
:
200
,
step
:
1
}
)
Insert cell
viewof
zoom
=
Inputs
.
range
(
[
-
100
,
100
]
,
{
value
:
0
,
step
:
1
}
)
Insert cell
viewof
angle
=
Inputs
.
range
(
[
0
,
360
]
,
{
value
:
0
,
step
:
1
}
)
Insert cell
Insert cell
<
div
style
=
"perspective:800px;width:${y*2}px;height:${x*2}px;display:flex;align-items:center;justify-content:center;"
>
<
div
style
=
"background:${color};width:${y}px;height:${x}px;display:flex;align-items:center;justify-content:center;color:white;box-shadow:0 2px 3px #aaa;font-size:${size}%;transform: perspective(500px) translate3d(0, 0, ${zoom}px) rotate(${angle}deg);"
>
${text}
</
div
>
</
div
>
Insert cell
Insert cell
Insert cell
items
=
[
{
weight
:
100
,
height
:
200
,
country
:
"A"
}
,
{
weight
:
200
,
height
:
150
,
country
:
"A"
}
,
{
weight
:
300
,
height
:
100
,
country
:
"B"
}
,
{
weight
:
50
,
height
:
20
,
country
:
"C"
}
]
Insert cell
Plot
.
dot
(
items
,
{
x
:
"weight"
,
y
:
"height"
,
fill
:
"country"
}
)
.
plot
(
)
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
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
Edit
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
y
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
a
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
z
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
today
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
counter
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
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
clicks
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
handleClick
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
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
color
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
text
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
size
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
zoom
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
angle
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
items
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