Published
Edited
Apr 8, 2021
Importers
1 star
Insert cell
Insert cell
pprint(rules, 'rules')
Insert cell
Insert cell
function pprint(obj, name) {
let code = prettier_format(name ?
`${name} = (${JSON.stringify(obj)})` :
`(${JSON.stringify(obj)})`);
return md`~~~js\n${code.slice(0, -2)}\n~~~`;
}
Insert cell
prettier_format = {
let prettier = await require('prettier@2', 'prettier@2/parser-babel.js'),
format_options = {parser: "babel", plugins: [prettier]};
return str => prettier.format(str, format_options);
}
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