Observable Framework
Follow this workflow:
- •Inspect
package.jsonscripts andobservablehq.config.js(root,pages,theme,head) before editing. - •Keep content under the configured root (
src/in this project). - •Implement the smallest change that satisfies the request, then run a relevant check (
npm run buildor targeted command).
Work on Pages
- •Create pages as Markdown files in
src/(for examplesrc/wheel-analysis.md). - •Use JavaScript code fences for reactive logic and charts.
- •Use
FileAttachment("data/<file>")for data snapshots generated by loaders. - •If navigation needs manual ordering, update
pagesinobservablehq.config.js.
Work on Data Loaders
- •Put loaders in
src/data/. - •Use
*.jsloaders that fetch/transform data and write tostdout(build captures output as data files). - •Fail fast on non-OK HTTP responses and keep transformations deterministic.
- •Normalize high-cardinality fields when charts require readable legends.
Work on Components
- •Put reusable modules in
src/components/. - •Export plain functions that return Observable-compatible renderables (for example Plot charts).
- •Keep width/height configurable through function options.
Commands
- •Dev server:
npm run dev - •Production build:
npm run build - •Deploy:
npm run deploy - •CLI passthrough:
npm run observable -- <args>
For common patterns and troubleshooting, read references/common-workflows.md.