Platform
Resources
Pricing
Sign in
Get started
Toph Tucker
Workspace
Fork
Published
Testing / Helping
By
Toph Tucker
Edited
Jan 19, 2022
BSD 3-Clause
3 forks
17 stars
1
Insert cell
Insert cell
mutable
station
=
""
Insert cell
chart
=
d3
.
create
(
"div"
)
.
datum
(
data
)
.
call
(
map
)
.
call
(
(
g
)
=>
g
.
select
(
"svg"
)
.
attr
(
"height"
,
height
)
)
.
call
(
d3
.
zoom
(
)
.
on
(
"zoom"
,
function
(
e
)
{
d3
.
select
(
this
)
.
select
(
"g"
)
.
attr
(
"transform"
,
e
.
transform
.
toString
(
)
)
;
}
)
)
.
node
(
)
Insert cell
data
=
FileAttachment
(
"stations.json"
)
.
json
(
)
Insert cell
height
=
1000
Insert cell
map
=
tubeMap
(
)
.
width
(
width
)
.
height
(
height
)
.
margin
(
{
top
:
20
,
right
:
20
,
bottom
:
40
,
left
:
100
}
)
.
on
(
"click"
,
(
name
)
=>
(
mutable
station
=
name
)
)
Insert cell
style
=
htl
.
html
`<style>
text {
font-family: sans-serif;
fill: #0019A8;
cursor: pointer;
}
</style>`
Insert cell
tubeMap
=
(
await
require
(
"d3-tube-map@1.5.0/dist/d3-tube-map.min.js"
)
)
.
tubeMap
Insert cell
d3
=
require
(
"d3@7"
)
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
station
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
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
map
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
style
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tubeMap
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML