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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more