Public
Edited
Apr 16
1 fork
Insert cell
Insert cell
html`<p> Soy un <i>párrafo.</i> </p>`// https://www.w3schools.com/tags/tag_p.asp
Insert cell
Insert cell
{
const p = document.createElement("p"); // Document es esta página, le agrego un elemento de texto <p>
p.appendChild(document.createTextNode("Yo también soy un ")); // Seteo el texto
p.appendChild(document.createElement("i")).appendChild(document.createTextNode("parrafo.")); // Agrego texto formateado
return p;
}
Insert cell
Insert cell
md`Psss! Yo también soy un *párrafo*.`
Insert cell
Insert cell
md`Mi número favorito es el ${Math.random()*100|0}.` // Shift+Enter múltiples veces para ver como cambia
Insert cell
Insert cell
md`Incrible! podemos usar ${tex`\LaTeX`} para expresiones matemáticas ${tex`E = mc^2`}.`
Insert cell
md`Tambien es posible incrustar componentes gráficos como esta linea: ${sparkline([0, 4, 3, 1, 6, 3, 4])} dentro del texto.`
Insert cell
Insert cell
Insert cell
md`La hora actual es ${new Date(now).toLocaleTimeString()}.`
Insert cell
Insert cell
html`<svg width="720" height="120"> # HTML me provee un componente SVG
<circle cx="40" cy="60" r="10"></circle>
<circle cx="80" cy="60" r="10"></circle>
<circle cx="120" cy="60" r="10"></circle>
</svg>` // cx,cy son las coordenadas de cada círculo y r su radio
Insert cell
Insert cell
html`<svg width="720" height="120"> # HTML me provee un componente SVG
<circle cx="40" cy="60" r="10"></circle>
<rect x="70" y="45" width="30" height="30" stroke="red" fill="transparent" stroke-width="5"/>
<polyline points="120 50 125 60 130 55 135 70 140 65 145 80 "
stroke="orange" fill="transparent" stroke-width="5"/>
</svg>` // cx,cy son las coordenadas de cada círculo y r su radio
Insert cell
Insert cell
barra_slider = html`<input type=range>`
Insert cell
Insert cell
barra_slider.type
Insert cell
barra_slider.value
Insert cell
Insert cell
input_text = html`<input type=text value="Soy un recuadro para escribir texto...">`
Insert cell
Insert cell
viewof input_bar = html`<input type=range>`
Insert cell
input_bar
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