Platform
Resources
Pricing
Sign in
Get started
深度碎片
as simple as possible
Workspace
Fork
Published
d3 source code
By
深度碎片
Edited
Nov 9, 2019
Insert cell
Insert cell
Insert cell
select
(
"h1"
)
// exist and selected
Insert cell
select
(
"h2"
)
// non-exist and filled with null
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.
Insert cell
Insert cell
// export default function(selector) {
select
=
function
(
selector
)
{
return
typeof
selector
===
"string"
?
new
Selection
(
[
[
document
.
querySelector
(
selector
)
]
]
,
[
document
.
documentElement
]
)
:
new
Selection
(
[
[
selector
]
]
,
root
)
;
}
Insert cell
import
{
Selection
,
root
}
from
"@embracelife/d3-selection-src-selection-index-js"
;
Insert cell
Insert cell
import
{
anchorLink
}
from
"@embracelife/tutorial-utilities"
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
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
select
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML