Platform
Resources
Pricing
Sign in
Get started
Spring 2020 Info Vis
UW iSchool Course INFO 474: focused on designing and building visualizations to better understand and communicate about pressing issues.
Workspace
Fork
Published
By
Yutian Lei
Edited
Fork of
Networks
•
1 fork
1 star
1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart
Insert cell
viewof
name
=
text
(
{
title
:
"Enter a name"
,
submit
:
null
}
)
Insert cell
viewof
group
=
text
(
{
title
:
"Enter a group number"
,
submit
:
null
}
)
Insert cell
{
const
button
=
html
`<button>submit`
;
button
.
onclick
=
submitNode
;
return
button
;
}
Insert cell
viewof
name1
=
select
(
{
title
:
"Select a name"
,
options
:
getName
(
data
)
,
value
:
"Myriel"
}
)
Insert cell
viewof
name2
=
select
(
{
title
:
"Select another name"
,
options
:
getName
(
data
)
,
value
:
"Napoleon"
}
)
Insert cell
viewof
length
=
text
(
{
title
:
"Enter length of link"
,
submit
:
null
}
)
Insert cell
{
const
btn
=
html
`<button>submit`
;
btn
.
onclick
=
submitLink
;
return
btn
;
}
Insert cell
Insert cell
Insert cell
Insert cell
import
{
chart
}
with
{
data
}
from
'@d3/force-directed-graph'
Insert cell
mutable
data
=
FileAttachment
(
"miserables.json"
)
.
json
(
)
Insert cell
import
{
text
,
button
,
select
}
from
"@jashkenas/inputs"
Insert cell
_
=
require
(
'lodash'
)
Insert cell
getName
=
function
(
data
)
{
let
result
=
[
]
;
for
(
let
i
=
0
;
i
<
data
.
nodes
.
length
;
i
++
)
{
result
.
push
(
data
.
nodes
[
i
]
.
id
)
;
}
return
result
;
}
Insert cell
submitNode
=
(
)
=>
{
const
Data
=
_
.
cloneDeep
(
data
)
;
if
(
name
!=
""
&&
group
!=
""
)
{
data
.
nodes
.
unshift
(
{
id
:
name
,
group
:
group
}
)
;
mutable
data
=
Data
;
}
}
Insert cell
submitLink
=
(
)
=>
{
if
(
name1
!=
""
&&
name2
!=
""
&&
length
!=
""
)
{
let
Data
=
_
.
cloneDeep
(
data
)
;
Data
.
links
.
unshift
(
{
source
:
name1
,
target
:
name2
,
length
:
+
length
}
)
;
mutable
data
=
Data
;
}
}
Insert cell
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