Platform
Resources
Pricing
Sign in
Contact us
Eric Field
Building and Using Tools to See. UVA Architecture + Data Science. IT Director. Instructor.
Workspace
Fork
Public
d3 layout and lib examples
By
Eric Field
Edited
Apr 24, 2022
1 fork
1
d3 layout and lib examples
dvlib_layout Overview
Line graphs
Area graphs
Sparkline
Donut or Pie
Pixel Matrix
Treemap
Pack Circles
Sunburst
Dendogram
Clusters
Word Cloud
Clusters - dynamic movement
Pack Circles - dynamic movement
Treemap - dynamic movement
Network Graph - nodes and edges
Combining Layouts - Donuts on GridMap
Radar
Rings - circle with hole mask
Beeswarm - Force Diagram
Heatmap
Pack Circles with Donuts inside
US map with Powerplant Pack Circles
Ring plot on Map - Trust Gap?
Force Directed clustering along a path
Fixed location Network Graph
Radial bar / line
Fitness rings
Curves / distance color gradient
SVG distance along path / curve
Filled Arc Polygon Bands
Connecting multiple visuals in one space
Sankey / Alluvial / Parallel Sets
Insert cell
Insert cell
<
svg
width
=
"500"
height
=
"200"
>
<
g
id
=
"layer1"
>
</
g
>
<!-- one at a time -->
<
g
id
=
"layer2"
transform
=
"translate(300,0)"
>
</
g
>
<!-- all together -->
</
svg
>
Insert cell
Insert cell
viewof
track
=
Inputs
.
range
(
[
0
,
4
]
,
{
label
:
"Track"
,
step
:
1
,
value
:
0
}
)
Insert cell
data
=
FileAttachment
(
"trackFeatures_sample.csv"
)
.
csv
(
)
Insert cell
fields
=
[
"danceability"
,
"energy"
,
"speechiness"
,
"liveness"
,
"valence"
]
Insert cell
onetrack
=
[
data
[
track
]
]
// just one record out of the set. "track" index chosen from range slider above
Insert cell
radarElem
=
d3
.
select
(
svgContainer
)
.
select
(
"#layer1"
)
// the svg element to put the radar in
Insert cell
radar
=
dvRadar
(
radarElem2
,
data
,
fields
,
200
,
options
)
Insert cell
options
=
(
{
maxValue
:
1
,
idField
:
"id"
,
transitionMS
:
1000
,
axisLabelShow
:
true
}
)
Insert cell
radarElem2
=
d3
.
select
(
svgContainer
)
.
select
(
"#layer2"
)
// the svg element to put the radar in
Insert cell
radar2
=
dvRadar
(
radarElem
,
onetrack
,
fields
,
200
,
options
)
Insert cell
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
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
svgContainer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
track
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
fields
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
onetrack
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
radarElem
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
radar
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
options
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
radarElem2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
radar2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML