Platform
Resources
Pricing
Sign in
Get started
Cora Davis's Workspace
Workspace
Fork
Public
By
Cora Davis
Edited
May 2, 2024
1
Insert cell
Insert cell
Insert cell
arrayData
=
{
const
arrayData
=
[
]
;
for
(
const
key
in
json
)
{
arrayData
.
push
(
{
key
,
value
:
json
[
key
]
}
)
;
}
return
arrayData
}
;
Insert cell
geneArray
=
{
let
geneArray
=
json
.
Genes
return
geneArray
}
;
Insert cell
chart
=
[
{
geneId
:
'a'
,
start
:
1
,
annotation
:
true
}
,
{
geneId
:
'a'
,
start
:
2
,
annotation
:
false
}
,
{
geneId
:
'a'
,
start
:
3
,
annotation
:
false
}
,
]
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
cell
(
chart
,
{
x
:
d
=>
d
.
start
,
y
:
d
=>
d
.
geneID
,
fill
:
d
=>
d
.
annotation
}
)
]
}
)
Insert cell
viewof
range
=
Inputs
.
range
(
[
0
,
100
]
,
{
label
:
"Amount"
,
step
:
1
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
cell
(
geneArray
.
slice
(
-
20
)
,
{
x
:
d
=>
[
d
.
Start
,
d
.
AvailableStarts
]
,
y
:
d
=>
d
.
GeneID
,
fill
:
d
=>
d
.
Start
===
d
.
Start
?
"green"
:
"yellow"
,
}
)
]
,
x
:
{
label
:
"Start Position"
}
,
y
:
{
label
:
"GeneID"
}
,
}
)
;
Insert cell
color
=
{
{
Start
:
"green"
}
{
AvailableStart
:
"yellow"
}
}
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
json
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
arrayData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
geneArray
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chart
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML