Platform
Resources
Pricing
Sign in
Get started
Max Rydahl Andersen
Danish guy enjoying working on open source software. Making things happen at Red Hat.
Workspace
Fork
Published
By
Max Rydahl Andersen
Edited
Aug 26, 2021
ISC
1
Insert cell
Insert cell
Insert cell
function
autoBox
(
)
{
document
.
body
.
appendChild
(
this
)
;
const
{
x
,
y
,
width
,
height
}
=
this
.
getBBox
(
)
;
document
.
body
.
removeChild
(
this
)
;
return
[
x
,
y
,
width
,
height
]
;
}
Insert cell
data
=
FileAttachment
(
"flare-2.json"
)
.
json
(
)
Insert cell
tree
=
data
=>
{
const
root
=
d3
.
hierarchy
(
data
)
.
sort
(
(
a
,
b
)
=>
d3
.
descending
(
a
.
height
,
b
.
height
)
||
d3
.
ascending
(
a
.
data
.
name
,
b
.
data
.
name
)
)
;
root
.
dx
=
10
;
root
.
dy
=
width
/
(
root
.
height
+
1
)
;
return
d3
.
cluster
(
)
.
nodeSize
(
[
root
.
dx
,
root
.
dy
]
)
(
root
)
;
}
Insert cell
d3
=
require
(
"d3@6"
)
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
chart
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
autoBox
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
tree
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