Platform
Resources
Pricing
Sign in
Get started
Fil
Vocateur.
Workspace
Fork
Unlisted
2 collections
By
Fil
Edited
Aug 17, 2023
2 stars
Insert cell
Insert cell
3
{
const
{
defs
,
range
}
=
cheyssonDefs
(
pattern
)
;
return
Plot
.
plot
(
{
color
:
{
range
}
,
marks
:
[
(
)
=>
defs
,
Plot
.
barY
(
penguins
,
Plot
.
stackY
(
Plot
.
groupX
(
{
y
:
"count"
}
,
{
x
:
"island"
,
fill
:
(
d
)
=>
`${
d
.
island
}-${
d
.
sex
}`
,
fillOpacity
:
0.7
,
stroke
:
"#333"
,
strokeWidth
:
2
}
)
)
)
]
}
)
;
}
Insert cell
cheyssonDefs
=
(
pattern
)
=>
{
const
defs
=
svg
`<defs>${
pattern
}`
;
const
range
=
d3
.
select
(
defs
)
.
selectAll
(
"pattern[id]"
)
.
nodes
(
)
.
map
(
(
s
)
=>
d3
.
select
(
s
)
.
attr
(
"id"
)
)
.
map
(
(
id
)
=>
`url(#${
id
})`
)
;
return
{
defs
,
range
}
;
}
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
Listed in...
Plot Experiments
Fil
Plot
Fil
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Show 3 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cheyssonDefs
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
pattern
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML