Platform
Solutions
Resources
Pricing
Sign in
Sign up
D3
Bring your data to life.
Workspace
Fork
Published
d3-array
By
Mike Bostock
Edited
Aug 27, 2020
ISC
24 stars
d3-array
Image Sharpening
d3.blur
d3.rank
d3.flatGroup, d3.flatRollup
d3.mode
d3.groupSort
Set Operations
d3.groups as a hierarchy
d3.fsum, d3.Adder
Time thresholds for d3.bin
d3.cumsum
Tidy Stacked Area Chart
Merging Duplicate Values
d3.zip, d3.transpose
d3.bin
d3.ticks
d3.mean, d3.median, and friends
d3.quickselect
d3.bisect
d3.sum
d3.group, d3.rollup, d3.index
d3.count
d3.min, d3.max, d3.extent
d3.least, d3.greatest
d3.pairs
d3.cross
d3.ascending, d3.descending
d3.merge
d3.range
d3.permute
d3.shuffle
d3-array 2.0
Insert cell
Insert cell
Insert cell
function
*
randoms
(
n
)
{
for
(
let
i
=
0
;
i
<
n
;
++
i
)
{
yield
Math
.
random
(
)
;
}
}
Insert cell
Insert cell
d3
.
min
(
randoms
(
100
)
)
Insert cell
d3
.
sum
(
randoms
(
100
)
)
Insert cell
d3
.
extent
(
randoms
(
100
)
)
Insert cell
Insert cell
d3
.
min
(
new
Set
(
[
1
,
4
,
3
,
2
]
)
)
Insert cell
d3
.
min
(
new
Map
(
[
[
"foo"
,
10
]
,
[
"bar"
,
2
]
]
)
.
values
(
)
)
Insert cell
Insert cell
d3
.
cross
(
[
"small"
,
"large"
]
,
[
"caf"
,
"decaf"
]
,
[
"skim"
,
"whole"
,
"almond"
]
,
[
"latte"
,
"cappucino"
]
,
(
...
parts
)
=>
parts
.
join
(
" "
)
)
Insert cell
Insert cell
data
=
[
{
name
:
"jim"
,
amount
:
"34.0"
,
date
:
"11/12/2015"
}
,
{
name
:
"carl"
,
amount
:
"120.11"
,
date
:
"11/12/2015"
}
,
{
name
:
"stacy"
,
amount
:
"12.01"
,
date
:
"01/04/2016"
}
,
{
name
:
"stacy"
,
amount
:
"34.05"
,
date
:
"01/04/2016"
}
]
Insert cell
d3
.
group
(
data
,
d
=>
d
.
name
)
Insert cell
Insert cell
d3
.
group
(
data
,
d
=>
d
.
name
,
d
=>
d
.
date
)
Insert cell
Insert cell
d3
.
rollup
(
data
,
v
=>
v
.
length
,
d
=>
d
.
name
,
d
=>
d
.
date
)
Insert cell
d3
.
rollup
(
data
,
v
=>
d3
.
sum
(
v
,
d
=>
d
.
amount
)
,
d
=>
d
.
name
)
Insert cell
Insert cell
{
const
values
=
Float64Array
.
from
(
{
length
:
1e6
}
,
Math
.
random
)
;
const
i
=
values
.
length
>>
1
;
d3
.
quickselect
(
values
,
i
)
;
return
values
[
i
]
;
}
Insert cell
Insert cell
Insert cell
d3
=
require
(
"d3-array@2"
)
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
randoms
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
data
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Unpin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Add comment
Select
Duplicate
Copy link
Embed
Delete
d3
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML
JavaScript
Markdown
HTML