Platform
Resources
Pricing
Sign in
Get started
Amit Kapoor
Crafting Visual Stories with Data.
Workspace
Fork
Published
By
Amit Kapoor
Edited
Nov 17, 2021
1 star
Insert cell
#
Cleaning Organ Donor data
Insert cell
function
clean
(
input
,
state
)
{
let
raw
=
input
.
d
;
let
data
=
{
time
:
raw
[
1
]
,
liver
:
raw
[
2
]
,
heart
:
raw
[
3
]
,
kidney
:
raw
[
4
]
}
;
let
table
=
aq
.
table
(
data
)
;
return
table
.
objects
(
)
;
}
Insert cell
d
=
clean
(
input
)
Insert cell
Inputs
.
table
(
d
)
Insert cell
Insert cell
input
=
(
{
d
:
[
8
,
[
"1995"
,
"1996"
,
"1997"
,
"1998"
,
"1999"
,
"2000"
,
"2001"
,
"2002"
,
"2003"
,
"2004"
,
"2005"
,
"2006"
,
"2007"
,
"2008"
,
"2009"
,
"2010"
,
"2011"
,
"2012"
,
"2013"
,
"2014"
,
"2015"
,
"2016"
,
"2017"
,
"2018"
,
"2019"
,
"2020"
,
"2021"
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
4
,
4
,
61
,
24
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
,
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
clean
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d
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
input
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML