Published
Edited
Oct 16, 2020
1 star
Insert cell
md`# My first notebook`
Insert cell
Insert cell
html `<p>Text <i>here</i> </p> `
Insert cell
y = x+3;
Insert cell
Insert cell
z = square(x,y)
Insert cell
zz = square2(x,y);
Insert cell
md`The value of zz is **${zz}**.`
Insert cell
htmlcreator('Xavier')

Insert cell
md `## Inputs`
Insert cell
viewof value = html `<input type=range min="0" max="100" value="20" step="1">`
Insert cell
md `by using 'viewof' built-in Observable we cane update the value of the selector, for value now is **${value}**`
Insert cell
viewof selected = html`<select name="weather">
<option value="clear">Clear</option>
<option value="cloudy">Cloudy</option>
<option value="rainy">Rainy</option>
<option value="windy">Windy</option>
</select>`
Insert cell
Insert cell
value
Insert cell
html`<svg width="128" height="128" fill="none" stroke="black">
<rect x="10" y=10 width="${value}" height="50" style="fill:rgb(200,20,30);stroke-width:0" />
<rect x="50" y="30" width="120" height="60" style="fill:rgba(20,200,30, 0.4);stroke-width:0" />
</svg>`
Insert cell
Insert cell
Insert cell
weather = await FileAttachment("power_plants.csv").csv();
Insert cell
Insert cell
md `## Apendix`
Insert cell
42*x + 87
Insert cell
square = function(value, value2){
value2 = value2 + 2;
return value * value2;
}
Insert cell
square2 = (value,value2) => {
value2 = value2 + 2;
return value*value2;
}
Insert cell
htmlcreator = function(word){
return html`<p>Hello <b>${word}</b>!</p>`
}
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