Platform
Resources
Pricing
Sign in
Get started
Lionel Radisson
Generative artist, sharing my journey in visual experiments.
Workspace
Fork
Published unlisted
By
Lionel Radisson
Edited
Feb 10, 2021
4
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
svg1
=
svg
`<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200" />
</svg>`
Insert cell
Insert cell
FileAttachment
(
"svg-image-rasterization.png"
)
.
image
(
)
Insert cell
Insert cell
Insert cell
imageURL
=
FileAttachment
(
"mk135@1.png"
)
.
url
(
)
Insert cell
svg2
=
svg
`<svg width="50" height="50">
<image href="${
imageURL
}" width="50" height="50" />
<circle cx="25" cy="25" r="12" fill="red" stroke="none" />
</svg>`
Insert cell
Insert cell
FileAttachment
(
"svg2.png"
)
.
image
(
)
Insert cell
Insert cell
viewof
file
=
html
`<input type="file" accept="image/*">`
Insert cell
img
=
{
const
img
=
new
Image
(
)
img
.
src
=
URL
.
createObjectURL
(
file
)
return
img
}
Insert cell
svg
`<svg width="200" height="200" style="background: black">
<image href="${
img
.
src
}" width="100%" height="100%" />
</svg>`
Insert cell
Insert cell
FileAttachment
(
"svg-image-rasterization@1.png"
)
.
image
(
)
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
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
svg1
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
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
imageURL
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
svg2
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
file
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
img
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML