Skip to main content
100%

Overriding notebook-stdlib

✓ Published0🌍 Public
Mmbostock
Last edited Aug 10, 2018
Created on Aug 10, 2018

This example demonstrates how to override a notebook’s default `width` generator with a custom implementation that tracks the size of a specific DOM element. The code uses the Observable notebook runtime, `Runtime.load`, and `Library` to import a notebook and inject a custom `width` function that relies on `stdlib.Generators.observe` and window resize events. The referenced notebook cell named `test` renders into a styled `<div>` element. This approach shows how to replace a standard library method with element-specific behavior.

AI-generated description

Similar vizzes