Published
Edited
Nov 30, 2021
1 star
Insert cell
Insert cell
<div class="element">
This div has the background set by the CSS Paint API
</div>
Insert cell
{
if (CSS.paintWorklet) {
CSS.paintWorklet.addModule(await FileAttachment("worklet.js").url());
}
}
Insert cell
<style>
.element {
background-image: paint(workletName);
padding: 8px;
}
</style>
Insert cell
FileAttachment("worklet.js").url()
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