Platform
Resources
Pricing
Sign in
Get started
深度碎片
as simple as possible
Workspace
Fork
Published
Observable tutorials
By
深度碎片
Edited
Oct 21, 2019
Fork of
Generator Cells, Functions and Objects
Observable tutorials
File Attachments
Slide
Views are Mutable Values
Generator Cells, Functions and Objects
Custom Generators
Notebook Visualizer
Hello and Welcome!
Synchronized Views
Introduction to Promises
Introduction to Views
Introduction to HTML
Introduction to Data
Introduction to Generators
Downloading and Embedding Notebooks
(2nd) Tutorial 1: Lunch calculator
(0th) Observable: The User Manual
(1st) Five-Minute Introduction
Insert cell
Insert cell
i
=
{
for
(
let
i
=
0
;
i
<
1e6
;
++
i
)
{
yield
i
;
}
}
Insert cell
Insert cell
function
*
range
(
n
)
{
for
(
let
i
=
0
;
i
<
n
;
++
i
)
{
yield
i
;
}
}
Insert cell
Insert cell
{
let
n
=
1e6
;
return
range
(
n
)
;
}
Insert cell
Insert cell
range
(
1e6
)
Insert cell
Insert cell
{
let
sum
=
0
;
for
(
const
i
of
range
(
1e3
)
)
{
sum
+=
i
;
}
return
sum
;
}
Insert cell
Insert cell
{
for
(
const
i
of
range
(
Infinity
)
)
{
yield
Promises
.
tick
(
1000
,
i
+
1
)
;
}
}
Insert cell
Insert cell
[
...
range
(
1e3
)
]
Insert cell
Insert cell
new
Float32Array
(
range
(
1e3
)
)
Insert cell
new
Set
(
range
(
1e3
)
)
Insert cell
Insert cell
function
*
oscillator
(
period
)
{
while
(
true
)
{
yield
Math
.
sin
(
Date
.
now
(
)
/
period
)
;
}
}
Insert cell
Insert cell
{
for
(
const
t
of
oscillator
(
1000
)
)
{
yield
html
`<svg viewBox="0 0 12 12" width=128 height=128>
<circle stroke=black stroke-width=${
1.5
+
t
} fill=none cx=6 cy=6 r=${
3.5
+
t
}></circle>
</svg>`
;
}
}
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
Compare fork
Fork
View
Export
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
range
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
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
spread_iterator_array
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
typedArray_set_iterable
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
generator_oscillation
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
oscillator
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