Published
Edited
Dec 24, 2020
20 stars
Hello, PGLiteINSEE ParquetHello, apcachDruidJS workerHello, OrbitWord Tour: 40k words and their friendsHello, spectral.jsHello, petite-vueHello, @thi.ng/grid-iteratorsHello, thumbhashHello, SwissGLHello, QOI (and glitches)Hello, orbHello, cosmographHello, TabulatorUsing d3.blur with PlotMath.cbrtHello debounceColorcetHello, gliiHello, Open MeteoHello, PyWaveletsHello, typesenseHello, libgifHello, kmeans-engineHappy anniversary, Project Gutenberg!Hello, fflateHello, ArchieML!Hello, d3-bboxCollideHello, jsgeoda!Hello, EDTF!Hello, protovis!Hello, placekeyHello, fuse.jsHello, Reorder.js
Hello, shadow DOM
jszipHello, procedural-glHello, qhullHello, genetic-jsDruidJSHello, Tippy.jsHello, paintWorkletBig πHello, AutoencoderHello, Shakespearean UUIDsHello, ccwt.jsHello, constrainautorHello, talismanHello, polygon-offsetHello p-queueHello async-poolHello rollup-plugin-asciiHello, algebra.jsHello, pixi.jsHello, d3-renderHello zip/unzipCumulative Wikipedia DonationsHTML <details>regl textureHello, npyjsHello protobufHello, pencil touchHello, LOESSHello html2canvaslegra mapscolor2cssHello, ecsy2D point distributionsHello, delatinThe gpu.js loopDijkstra’s shortest-path treeHello nojacko/Dijkstras-jsHello, tcort/dijkstrajsHello, lambdabaa/dijkstraHello, gpu.js v2Hello jsqrHello qrcodeHello SharedArrayBufferHello GamePad APIHello vtk.jsHello nd4jsHello BiofabricTravelling with a self-organizing mapHello glitchHello UMAP-jsHello pandemoniumHello iocaneHello JSON-editorHello d3-griddingHello mljs/knnWorkerHello lalolibImage to GPU.jsImage to blink.jsTissot's indicatrixVega projectionsHello WebCLGLUsing d3-inertia with observableVideo contouring 3ngraph: pagerank, louvain…Union-FindPerceptron (simple statistics)mljsHello h3-jsEmoji FlagsHello, poisson-disk-sampling
Insert cell
Insert cell
function shadowRoot(el) {
const shadowRoot = el.attachShadow({mode: "open"});
while (el.firstChild) shadowRoot.appendChild(el.firstChild);
return el;
}
Insert cell
shadowRoot(html`<div>Hello! Content with a fancy CSS.</div><style>div { background: #fefe88 }</style>`)
Insert cell
shadowRoot(
html`<div>Hello! Content with another fancy CSS.</div><style>div { background: brown; color: white; }</style>`
)
Insert cell
html`<div>This div is unaffected by the CSS inside any of the shadow roots.</div>`
Insert cell
Insert cell
shadowRoot(
html`<div class="change">This .change div will use the global stylesheet
<style>.change { font-style: italic; }</style>
</div>`
)
Insert cell
shadowRoot(
html`<div><!-- wrapper -->
<div class="change">This .change div will use the shadow stylesheet
<style>.change { font-style: italic; }</style>
</div>`
)
Insert cell
html`<style>.change { font-variant: small-caps }`
Insert cell
Insert cell
shadowRoot(html`<div><style>
:host {background: coral; width: 200px; height: 100px; border-radius: 10px}
`)
Insert cell
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