Platform
Resources
Pricing
Sign in
Get started
Anders
Workspace
Fork
Published
HEIG-visdom-2020
By
Anders
Edited
Apr 8, 2021
HEIG-visdom-2020
SVG
Quartet d'Anscombe
Markdown
Introduction à D3
Graphiques en bâtons
D3 - Joindre des données à des éléments
Types de visualisation de données
Méthodes sur une liste (Array)
Structures de données javascript
Fonctions Ramda
D3 - définir les axes
D3-shape
Représenter un réseau avec D3
Données cartographiques
La cartographie avec D3
Leaflet et fonds de carte en tuiles
Canvas
Graphiques camembert
Transitions avec D3
Billboard
Apprentissage automatique
Topojson
Observable
D3 hierarchy / tree
Trouver des coordonnées
Leaflet et D3
Insert cell
Insert cell
Insert cell
svg
`
<svg viewBox="0 0 ${
size
.
svg
.
width
} ${
size
.
svg
.
height
}">
<g transform="translate(${
size
.
svg
.
width
/
2
}, 50)">
${
drawLinks
(
root
.
links
(
)
)
}
${
drawNodes
(
root
.
descendants
(
)
)
}
</g>
</svg>
`
Insert cell
Insert cell
size
=
(
{
svg
:
{
width
,
height
:
width
/
5
}
,
node
:
{
width
:
200
,
height
:
50
}
,
}
)
Insert cell
Insert cell
root
=
d3
.
hierarchy
(
data
)
Insert cell
Insert cell
treeGenerator
=
d3
.
tree
(
)
.
nodeSize
(
[
size
.
node
.
width
,
size
.
node
.
height
]
)
Insert cell
Insert cell
tree
=
treeGenerator
(
root
)
Insert cell
Insert cell
drawNodes
=
nodes
=>
svg
`
<g text-anchor="middle">
${
nodes
.
map
(
d
=>
svg
`
<g transform="translate(${
d
.
x
}, ${
d
.
y
})">
<text fill="white" stroke="white" stroke-width="10">${
d
.
data
.
name
}</text>
<text>${
d
.
data
.
name
}</text>
</g>
`
)
}
</g>
`
Insert cell
Insert cell
linkGenerator
=
d3
.
linkVertical
(
)
.
x
(
d
=>
d
.
x
)
.
y
(
d
=>
d
.
y
)
Insert cell
Insert cell
drawLinks
=
links
=>
svg
`
<g>
${
links
.
map
(
d
=>
svg
`
<path d="${
linkGenerator
(
d
)
}" fill="none" stroke="lightgray" />
`
)
}
</g>
`
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
data
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
size
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
root
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
treeGenerator
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
tree
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
drawNodes
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
linkGenerator
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
drawLinks
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