Platform
Resources
Pricing
Sign in
Contact us
Di
Data Viz Engineer. Author of Practical UI Patterns for Design Systems. Creator of Typey Type for Stenographers.
Workspace
Fork
Published
2 collections
By
Di
Edited
Jan 3, 2021
Reference
Links
Snippets to copy and paste
Data Viz Journal Index
Observable
Sparkline
Working with Vega-Lite
Data Tables
CSV Parsing
Sort by arbitrary array
Also listed in…
Journal: Getting Started with Data Viz
Insert cell
Insert cell
Insert cell
all_versions_in_use
=
[
"0.0.1"
,
"0.1.23"
,
"0.2.30"
,
"0.2.300"
,
"0.2.303"
,
"0.6.2"
,
"0.10.2"
,
"0.10.20"
,
"0.10.25"
,
"0.10.25"
]
Insert cell
Insert cell
versionData
=
[
[
"AppA"
,
"0.2.300"
]
,
[
"AppB"
,
"0.2.30"
]
,
[
"AppC"
,
"0.0.1"
]
,
[
"AppD"
,
"0.10.25"
]
,
[
"AppE"
,
"0.10.2"
]
]
Insert cell
Insert cell
versionData
.
slice
(
0
)
.
map
(
d
=>
d
[
1
]
)
.
sort
(
)
Insert cell
Insert cell
versionData
.
slice
(
0
)
.
sort
(
(
a
,
b
)
=>
all_versions_in_use
.
indexOf
(
a
[
1
]
)
-
all_versions_in_use
.
indexOf
(
b
[
1
]
)
)
Insert cell
Insert cell
Insert cell
// https://github.com/quentinrossetti/version-sort
versionSort
=
require
(
"https://bundle.run/version-sort"
)
Insert cell
versionSort
(
versionData
.
slice
(
)
,
{
nested
:
'1'
}
)
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...
Reference
Di
Journal: Getting Started with Data Viz
Di
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
all_versions_in_use
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
versionData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
versionSort
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML