Platform
Resources
Pricing
Sign in
Get started
Toph Tucker
Workspace
Fork
Published
Utilities
By
Toph Tucker
Edited
Feb 16, 2022
2 stars
Utilities
Pangram composer
Normalize SVG elements to paths
Country codes and flags
Run button
Reactive table
Simple slider with label
Parse sequential dates
Convert JavaScript to Observable JavaScript
Reactive button state
Generate copied cells
Et al.
Oscillate between two values
Pipe
JSON date reviver
Blackjack Distance
Object stringification
Memo Fetch
Autosize margins in Plot
Tree Input
Radial axis ideas
iMessage
vCard Parser
Element Inspector
How to make a toggle button
Lil Output
Get random point around a box
Hello, Prettier
Multitouch Circles
Pathstuff
Structured Text Inputs
Custom Input Example
Hover slider
Color Ramp 2D
Get repeating calendar event dates
Suggest
D3 Hierarchy to JSON
Retab
Cartogram
Insert cell
Insert cell
Insert cell
function
oscillate
(
from
,
to
,
duration
)
{
return
x
=>
from
+
(
to
-
from
)
*
(
0.5
-
0.5
*
Math
.
cos
(
(
2
*
Math
.
PI
/
duration
)
*
x
)
)
}
Insert cell
Insert cell
i
=
oscillate
(
0
,
1
,
1000
)
Insert cell
i
(
now
)
Insert cell
Plot
.
line
(
d3
.
range
(
0
,
1e4
,
10
)
,
{
x
:
d
=>
d
,
y
:
d
=>
i
(
d
)
}
)
.
plot
(
{
width
}
)
Insert cell
Insert cell
oscillate2
=
(
n
)
=>
-
Math
.
abs
(
2
*
(
n
%
1
)
-
1
)
+
1
;
Insert cell
Plot
.
line
(
d3
.
range
(
0
,
3.1
,
0.1
)
,
{
x
:
d
=>
d
,
y
:
d
=>
oscillate2
(
d
)
}
)
.
plot
(
{
width
}
)
Insert cell
Insert cell
scale
=
d3
.
scaleLinear
(
[
0
,
0.1
,
0.5
,
0.6
,
1
]
,
[
0
,
1
,
1
,
0
,
0
]
)
Insert cell
Plot
.
line
(
d3
.
range
(
0
,
2
,
0.01
)
,
{
x
:
d
=>
d
,
y
:
d
=>
scale
(
d
%
1
)
}
)
.
plot
(
)
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
oscillate
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
i
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
oscillate2
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
scale
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML