Published
Edited
May 26, 2022
Insert cell
Insert cell
{
let lines = text.replace(/.{60}\S*\s+/g, "$&@").split(/\s+@/) // rough splitting of text on the next space after 60 characters.

let d = d3.create('div')
.attr('class','text')
for (let i = 0; i < lines.length; ++i) {
d.append('p')
.text( lines[i])
.attr('class', d=> (i%2)?'zip':'zap')
}
return d.node()
}
Insert cell
<style>
.text p { margin: 0;
font-size:'18px';
font-family:'Open Sans'}

.zap{ text-decoration: underline #90202230; }
.zip{ text-decoration: underline dotted #90202240; }
</style>
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