Platform
Resources
Pricing
Sign in
Get started
Sagar Limbu
Workspace
Fork
Published
D3_tutorials
By
Sagar Limbu
Edited
Sep 5, 2022
D3_tutorials
Basic Tooltip
HW_9: D3 Geo Map:
D3 Network Visualizing Tweets
D3 STACKED BAR CHART
D3 Scale Time
D3 COLOR SCALE
COLOR scale and LEGEND
Untitled
week 5_tutorial_D3_Data_binding
D3 Path
Insert cell
##
GROUPING SVG elements
Insert cell
height
=
200
Insert cell
data_arr
=
Array
.
from
(
{
length
:
100
}
)
.
map
(
d
=>
(
{
x
:
Math
.
random
(
)
*
width
,
y
:
Math
.
random
(
)
*
height
}
)
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html
`
<svg viewBox= "0 0 ${
width
} ${
height
}">
${
data_arr
.
map
(
d
=>
`<g transform= "translate( ${
d
.
x
}, ${
d
.
y
})">
<circle r="3"/>
<text >N</>
</g>`
)
}
</svg>
`
Insert cell
Insert cell
html
`
<svg viewBox= "0 0 ${
width
} ${
height
}">
${
data_arr
.
map
(
d
=>
`<g transform= "translate( ${
d
.
x
}, ${
d
.
y
})">
<circle fill="green" r="3"/>
</g>`
)
}
<path stroke="blue" fill= "none" d= "$"
</svg>
`
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data_arr
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
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML