Platform
Resources
Pricing
Sign in
Get started
Jerry Jäppinen
Design, tech, engineering and science. Head of Design and User Research.
Workspace
Fork
Public
By
Jerry Jäppinen
Edited
Jul 31, 2023
Insert cell
Insert cell
live
=
true
Insert cell
fps
=
60
Insert cell
interval
=
1000
/
fps
Insert cell
mutable
timer
=
undefined
Insert cell
Insert cell
function
onTick
(
)
{
}
Insert cell
function
onRealTick
(
)
{
onTick
(
)
doTimer
(
)
}
Insert cell
setTimeout
(
(
)
=>
{
doTimer
(
)
;
}
,
interval
)
Insert cell
function
doTimer
(
ticksPerMinute
)
{
if
(
!
mutable
timer
&&
live
)
{
mutable
timer
=
setTimeout
(
onRealTick
,
interval
)
}
return
mutable
timer
}
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
live
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fps
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
interval
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
timer
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
onTick
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
onRealTick
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
doTimer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML