Platform
Resources
Pricing
Sign in
Get started
Sam Albers
Workspace
Fork
Public
By
Sam Albers
Edited
Apr 26, 2023
Insert cell
dat
=
[
{
name
:
'Paul'
,
city
:
'Denver'
}
,
{
name
:
'Robert'
,
city
:
'Denver'
}
,
{
name
:
'Ian'
,
city
:
'Boston'
}
,
{
name
:
'Cobus'
,
city
:
'Boston'
}
,
{
name
:
'Ayodele'
,
city
:
'New York'
}
,
{
name
:
'Mike'
,
city
:
'New York'
}
,
]
Insert cell
Insert cell
viewof
dropdown1
=
Inputs
.
select
(
[
"Denver"
,
"Boston"
,
"New York"
]
,
{
label
:
"city"
}
)
Insert cell
dropdown1
Insert cell
Insert cell
viewof
dropdown2
=
Inputs
.
select
(
dat
.
filter
(
(
d
)
=>
d
.
city
==
dropdown1
)
.
map
(
(
d
)
=>
(
d
.
name
)
)
)
Insert cell
dropdown2
Insert cell
temp_data
=
dat
.
filter
(
function
(
x
)
{
return
x
.
city
.
includes
(
dropdown1
)
&&
x
.
name
.
includes
(
dropdown2
)
;
}
)
;
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
dat
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
dropdown1
Add comment
Copy import
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
dropdown2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
temp_data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML