Platform
Resources
Pricing
Sign in
Get started
SUGIMOTO Tatsuo
Designer, Artist, Researcher, Educator @sugi2000lab . co-translator for Japanese edition of “Generative Design” and “Code as Creative Medium”.
Workspace
Fork
Published
By
SUGIMOTO Tatsuo
Edited
Nov 1, 2019
Fork of
D3 Tutorial 07-1
Insert cell
md
`# D3 Tutorial 07-4`
Insert cell
dataset
=
[
5
,
10
,
15
,
20
,
25
]
Insert cell
div
=
html
`<div></div>`
Insert cell
d3
.
select
(
div
)
.
selectAll
(
"p"
)
.
data
(
dataset
)
.
enter
(
)
.
append
(
"p"
)
.
text
(
function
(
d
)
{
return
d
;
}
)
.
style
(
"color"
,
function
(
d
)
{
if
(
d
>
15
)
{
// 15 が区切り
return
"red"
;
}
else
{
return
"black"
;
}
}
)
;
Insert cell
d3
=
require
(
'd3@5'
)
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dataset
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
div
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML