Published
Edited
Oct 19, 2020
1 star
Insert cell
Insert cell
Insert cell
import { React, jsx } from '@mbostock/hello-jsx'
Insert cell
React.render(jsx`<div style={{fontWeight:700}}>I am using React!</div>`)
Insert cell
md `Let's make a list`
Insert cell
function List(props) {
const { items } = props;
return jsx({ items })`<div>
<ul>
${items.map(item => `<li>${item}</li>`).join('')}
</ul>
</div>`;
}
Insert cell
React.render(jsx({ List, items: ['a', 'b', 'c'] })`<List items={items}/>`)
Insert cell
myBox = (color = "#ccc") => ({
margin: '.5rem',
border: `2px solid ${color}`,
borderRadius: '.5rem'
})
Insert cell
hello = React.render(
jsx({
style: myBox('#ccc')
})`<div style={style}>Hello!</div>`
)
Insert cell
d3 = require('d3')
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