Platform
Resources
Pricing
Sign in
Get started
Toph Tucker
Workspace
Fork
Published
Testing / Helping
By
Toph Tucker
Edited
Jan 19, 2022
4 stars
Insert cell
Insert cell
myList
=
[
1
,
2
,
3
]
Insert cell
Insert cell
chart
=
svg
`<svg width="${
width
}" height="20">
<circle r="10" cx="${
width
/
2
}" cy="10" />
</svg>`
Insert cell
Insert cell
6
chart
Insert cell
chart
.
getBoundingClientRect
(
)
.
width
Insert cell
chart
.
outerHTML
Insert cell
Insert cell
chart2
=
{
const
x
=
(
width
/
2
)
*
Math
.
sin
(
now
/
1000
)
;
// this logs the value of x to the cell below
// every time the cell runs, which happens
// whenever `now` changes
mutable
debug
=
x
;
return
svg
`<svg width="${
width
}" height="20">
<g transform="translate(${
width
/
2
}, 10)">
<circle r="10" cx="${
x
}" />
</g>
</svg>`
;
}
Insert cell
mutable
debug
=
null
Insert cell
Insert cell
prettier
=
require
(
"prettier@2"
,
"prettier@2/parser-html.js"
)
Insert cell
~~~
html
${prettier.format(chart2.outerHTML, {
parser: "html",
plugins: [prettier]
})}
~~~
Insert cell
Insert cell
Insert cell
chart
.
__proto__
Insert cell
Insert cell
new
DocumentFragment
(
)
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
myList
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
chart
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
Show 6 comments
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
chart2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
debug
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
prettier
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
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