Published
Edited
Mar 29, 2022
2 stars
tidy.js cheat sheet for tidyverse folks
Observable primer from vanilla JS for beginners 🙉
Insert cell
Insert cell
observableArray = [4,5,3]
Insert cell
Insert cell
observableArray.map((i)=>i+1)
Insert cell
Insert cell
Insert cell
name = {
let first_name = 'Horus';
let last_name = 'Lupercal';
let result = `${first_name} ${last_name}`;
return(result)
}
Insert cell
Insert cell
({first_name:'Horus', last_name: 'Lupercal' })
Insert cell
Insert cell
o = {
let o = 0;
while (true) {
if (o >= 1) {o = 0;}
yield o;
o += 0.01;
}
}
Insert cell
<p style = "opacity:${o}">blink</p>
Insert cell
### 4. require()

Observable is powered by JavaSript; one of the cooleset consequences is that we can take advantage of the entire JS ecosystem of third-party libraies within Observable notebooks. We can use external JS modules in our notebook with require(). For example, below we use require() to import d3 and assign it as a obseverable variable.
Insert cell
d3 = require('d3')
Insert cell
Insert cell
d3.range(0,10)
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