Platform
Solutions
Resources
Pricing
Sign in
Sign up
D3
Bring your data to life.
Workspace
Fork
Public
d3-array
By
Fil
Edited
Oct 24, 2023
ISC
13 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
numbers
=
[
16
,
15
,
18
,
10
,
17
,
14
,
13
,
19
,
11
,
12
]
Insert cell
d3
.
quickselect
(
numbers
.
slice
(
)
,
2
)
Insert cell
Insert cell
Insert cell
d3
.
quickselect
(
[
...
"how to select an array of strings"
]
,
10
)
Insert cell
Insert cell
left
=
4
Insert cell
k
=
6
// must be between >= left and <= right
Insert cell
right
=
8
// inclusive!
Insert cell
input
=
[
0
,
4
,
1
,
6
,
7
,
5
,
8
,
2
,
9
,
3
]
Insert cell
result
=
d3
.
quickselect
(
input
.
slice
(
)
,
k
,
left
,
right
)
Insert cell
Insert cell
Insert cell
Insert cell
result
.
slice
(
left
,
k
+
1
)
Insert cell
Insert cell
d3
.
quickselect
(
[
{
item
:
"Soup"
,
note
:
4
,
emoji
:
"🍜"
}
,
{
item
:
"Cabbage"
,
note
:
1
,
emoji
:
"🥬"
}
,
{
item
:
"Cake"
,
note
:
5
,
emoji
:
"🍰"
}
,
{
item
:
"Ice Cream"
,
note
:
3
,
emoji
:
"🍦"
}
]
,
2
,
// k
0
,
// left
3
,
// right
(
a
,
b
)
=>
a
.
note
-
b
.
note
// comparator
)
Insert cell
Insert cell
d3
=
require
(
"d3-array@3"
)
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
numbers
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Unpin
Show 2 comments
Select
Duplicate
Copy link
Embed
Delete
Edit
Pin
Show 2 comments
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
left
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
k
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
right
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
input
Unpin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
result
Unpin
Add comment
Copy import
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
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
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