Published
Edited
Jun 24, 2022
2 forks
Importers
Insert cell
Insert cell
## Yet another notebook environment

With **markdown** to document and organize your analysis, including...

...equations

${
tex.block`t_0 = \int_0^\infty \frac{dz}{(1+z) H(z)}`
}

...and other goodies

${
mermaid`graph LR
paw --> root --> jupyter --> observable
IDL --> jupyter`
}

The underlying language is javascript, not python, but simple expressions look very similar, e.g.
Insert cell
x = 2
Insert cell
y = 2 * x
Insert cell
A markdown cell can embed code, e.g.
- x+1 = ${x+1}
- y**2 = ${y**2}

Observable notebooks are **reactive**:
- each cell knows what other cells it depends on (minimap)
- changes propagate automatically (sidebars)
- like excel and modern web frameworks (React)
- notebook ordering and execution sequence of cells is irrelevant!
Insert cell
Insert cell
viewof z = Inputs.range([0, 100], {label: "z", step: 1})
Insert cell
...and the value of x+y+z is ${x+y+z}
Insert cell
Insert cell
Insert cell
sampleData = FileAttachment("sample-data.fits")
Insert cell
import {readFITSTable} from "@dkirkby/fits"
Insert cell
data = readFITSTable(sampleData)
Insert cell
Insert cell
Insert cell
import {SummaryTable} from "@observablehq/summary-table"
Insert cell
summary = SummaryTable(data)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function selection(tgt) {
const isSouth = (tgt.TARGET_RA < 85) || (tgt.TARGET_RA > 300);
return (tgt.GMAG - tgt.RMAG > options.GRmin) &&
(tgt.ZMAG < options.ZMAGmax) &&
options.ttypes.includes(tgt.TARGET_TYPE) && (
(options.region == "All") ||
((options.region == "South") && isSouth) ||
((options.region == "North") && !isSouth));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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