Published
Edited
Jul 15, 2018
Insert cell
Insert cell
jsone("${a} + ${b} = ${a + b}", {a: 2, b: 5})
Insert cell
jsone({"$eval": "a + b"}, {a: 2, b: 5})
Insert cell
Insert cell
Insert cell
Insert cell
{
const template = {
message: "I like to ${words[-1]}",
count: {$eval: "len(words)"}
}
return jsone(template, {words: ['eat', 'sleep', 'code', 'run']})
}
Insert cell
Insert cell
{
const template = {
"message": {
$if: "apples > 0",
then: "There are ${apples} apple(s).",
else: "404 apples not found."
}
}
return md`
- ${jsone(template, {apples: 5}).message}
- ${jsone(template, {apples: 0}).message}
`
}
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