Public
Edited
Oct 26, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
a=10
Insert cell
b = a * 2
Insert cell
Insert cell
Insert cell
Insert cell
<style>
/* Write CSS here */
.myDiv h1 {
font-size: 60px;
}
.myDiv {
color: orange;
}

</style>

<div class='myDiv'>
<h1> HTML is neat!</h1>
<p> It's what all your websites are built in at the end of the day.</p>
<div>
<p>Whoa! I'm writing HTML!!!!!!!! </p>
</div>
<h3>HTML is</h3>
<ul>
<li>Fun</li>
<li>Cool</li>
<li>Old</li>
</ul>
</div>
Insert cell
htl.html`<p> You can write also write HTML in a JavaScript cell using htl.html! We'll do this often for D3 examples, since we're working with JavaScript when writing D3. <br>htl.html을 사용하여 자바스크립트 셀에 HTML을 작성할 수도 있습니다! D3를 작성할 때 자바스크립트로 작업하기 때문에 D3 예제에서 자주 이 작업을 수행할 것입니다.</p>`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
carsData
X
weight (lb)
Y
economy (mpg)
Color
Size
Facet X
Facet Y
Mark
dot
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
{
const label = d => d.data.node
const root = stratifyTree(getDOMTree(myChart))
return graph(root, {label: label})
}
Insert cell
Insert cell
Insert cell
{
const html = htl.html`<div>
<p>First Paragraph</p>
<p>Second Paragraph</p>
<p>Third Paragraph</p>
</div>`;

d3.select(html)
.selectAll("p")
.data([1, 2, 3])
.filter((d, i) => i == 1)
.style("color", "red")
.text((d) => d);

return html;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cars
Type Table, then Shift-Enter. Ctrl-space for more 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