{
class eP extends HTMLElement {
connectedCallback() {
if (this.textContent.length > 0) {
this.plotDataURL = this.textContent;
}
this.plotDataURL =
this.plotDataURL || 'https://episphere.github.io/plot/demo.json';
this.innerHTML = `<a href="${
this.plotDataURL
}" target="_blank" style="font-size:x-small">${
this.plotDataURL
}</a><span style="font-size:xx-small"><br>${Date().slice(0, 34)}</span>`;
let div = document.createElement('div');
this.appendChild(div);
fetch(this.plotDataURL)
.then(x => x.json())
.then(x => Plotly.newPlot(div, x.traces, x.layout));
}
}
customElements.define('epi-plotly', eP);
return eP;
}