Platform
Resources
Pricing
Sign in
Get started
Shruti Mukhtyar
Workspace
Fork
Public
By
Shruti Mukhtyar
Edited
Dec 9, 2022
Fork of
Manipulating SVG Files
2
Insert cell
Insert cell
graphic
=
{
const
text
=
await
FileAttachment
(
"footprint@1.svg"
)
.
text
(
)
;
const
document
=
(
new
DOMParser
)
.
parseFromString
(
text
,
"image/svg+xml"
)
;
const
svg
=
d3
.
select
(
document
.
documentElement
)
.
remove
(
)
;
//const path = svg.selectAll("path[fill='#bbb']");
//const timer = d3.timer(() => path.attr("fill", d3.interpolateRainbow(Date.now() / 10000)));
//invalidation.then(() => timer.stop());
return
svg
.
node
(
)
;
}
Insert cell
Insert cell
d3
=
require
(
"d3@5"
)
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
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
graphic
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
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML