Platform
Resources
Pricing
Sign in
Get started
Sharon Machlis
Director, Editorial Data & Analytics at Foundry (formerly IDG Communications). Somewhat R-obsessed. Find me on Mastodon @smach@fosstodon.org
Workspace
Fork
Public
By
Sharon Machlis
Edited
Dec 20, 2022
1
Insert cell
Insert cell
Insert cell
states.csv
Filter
Columns
Sort
Slice
Save
Type Table, then Shift-Enter. Ctrl-space for more options.
Insert cell
import
{
aq
,
op
}
from
"@uwdata/arquero"
Insert cell
Insert cell
myTable
=
aq
.
from
(
states
)
Insert cell
myTable
.
view
(
)
Insert cell
dropdown_choices1
=
myTable
.
select
(
'Region'
)
.
dedupe
(
)
.
orderby
(
'Region'
)
.
array
(
'Region'
)
Insert cell
dropdown_choices
=
op
.
concat
(
"All"
,
dropdown_choices1
)
Insert cell
viewof
myFilteringValue
=
Inputs
.
select
(
dropdown_choices
,
{
multiple
:
true
,
label
:
"Select Region: "
}
)
Insert cell
myFilteredTable
=
myTable
.
params
(
{
myFilteringValue
}
)
// .filter((d) => myFilteringValue !== "All" ? d.Region.includes(myFilteringValue) : true)
.
filter
(
aq
.
escape
(
(
d
)
=>
(
myFilteringValue
[
0
]
!==
"All"
&&
myFilteringValue
.
length
!==
0
)
?
myFilteringValue
.
includes
(
d
.
Region
)
:
true
)
)
.
view
(
)
Insert cell
myFilteringValue
.
length
Insert cell
myFilteringValue
[
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
states
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
File attachments
states.csv
CSV
Databases
Filter
Column
Operator
Columns
Sort
Column
Direction
Descending
Ascending
Slice
From
Start
To
End
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
myTable
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dropdown_choices1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dropdown_choices
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myFilteringValue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myFilteredTable
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML