Published
Edited
Nov 25, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
HexGrid, html`<hex-grid name="from an HTML literal"></hex-grid>`
Insert cell
Insert cell
HexGrid = {
class HexGrid extends LitElement {
static get styles() {
return lit.css`
:host {
display: inline-block;
border: 2px solid indigo;
padding: 0.5rem 1.5rem;
margin-bottom: 1rem; }
p {
color: indigo;
font-family: 'Georgia'; }`;
}
static get properties() {
return {
name: { type: String }
}
}
constructor() {
super();
this.name = 'Somebody';
}
render() {
return lit.html`<p>Hello, <em>${this.name}!</em></p>`;
}
}
if( !window.customElements.get( 'hex-grid')) {
window.customElements.define('hex-grid', HexGrid)
}
return HexGrid
}
Insert cell
Insert cell
Insert cell
Insert cell
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