Published
Edited
Sep 12, 2022
1 star
Insert cell
Insert cell
Insert cell
testExport = html`<svg width=400 height=400>
<rect width=400 height=400 fill="#ff9300"></rect>
<image
class="fill-mainImg"
x="0"
y="0"
width="${mainImg.width * 0.3}"
height="${mainImg.height * 0.3}"
href="${await mainImg.src}"
/>
</svg>
`
Insert cell
Insert cell
testExport1 = html`<svg width=400 height=400>
<rect width=400 height=400 fill="#ffd478"></rect>
<image
class="fill-mainImg"
x="0"
y="0"
width="${mainImg.width * 0.3}"
height="${mainImg.height * 0.3}"
href="data:image/svg+xml;utf8,${await FileAttachment("mainImg.svg").text().then(d => d.replace(/^.*?<svg /, "<svg ").replace(/"/g, '&quot;'))}"
/>
</svg>
`
Insert cell
Insert cell
mainImg = FileAttachment("mainImg.svg").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.
Learn more