Published
Edited
Nov 3, 2020
5 stars
Insert cell
Insert cell
html`<div>${parts.map(
(p, i) => html`<span style="font-size: ${4 / (i + 1)}rem;">${DOM.text(p)}`
)}`
Insert cell
Insert cell
Insert cell
// I generated this file from running the commented-out "script and "scriptRaw" cells bellow. But I didn't want to web-scrape on every page load, so I'm caching with fileAttachments
script = FileAttachment("script.txt").text()
Insert cell
parts.slice().reverse()
Insert cell
parts = {
const parts = [];
let prev = 0;
for (const d of script.matchAll(/\Wbee/g)) {
parts.push(script.substring(prev, d.index));
prev = d.index;
}
return parts;
}
Insert cell
/*script = scriptRaw
.querySelector('pre')
.innerHTML.replace(/\s+/g, ' ')
.replace('Bee Movie Script - Dialogue Transcript ', '')*/
Insert cell
/*scriptRaw = d3.xml(
'https://asg017-cors.herokuapp.com/https://web.njit.edu/~cm395/theBeeMovieScript/'
)//*/
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