Platform
Resources
Pricing
Sign in
Get started
recifs
Fil’s live coding experiments
Workspace
Fork
Public
Array
By
Fil
Edited
Sep 6, 2022
1 star
Array
flat groups
Hello, Growable Typed Arrays
Hello, performance.memory
Bit vector
Insert cell
Insert cell
fg
=
(
data
,
...
selectors
)
=>
{
const
I
=
d3
.
range
(
data
.
length
)
;
return
Array
.
from
(
d3
.
flatGroup
(
I
,
...
selectors
.
map
(
(
s
)
=>
(
i
)
=>
data
[
i
]
[
s
]
)
)
,
(
d
)
=>
[
Object
.
fromEntries
(
selectors
.
map
(
(
s
,
i
)
=>
[
s
,
d
[
i
]
]
)
)
,
d
[
selectors
.
length
]
]
)
;
}
Insert cell
groups
=
fg
(
penguins
,
"island"
,
"sex"
,
"species"
)
Insert cell
groups
[
0
]
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
fg
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
groups
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML