Platform
Resources
Pricing
Sign in
Get started
Fil
Vocateur.
Workspace
Fork
Public
By
Fil
Edited
Jan 17
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import
{
zipreader
}
from
"@fil/jszip"
Insert cell
book
=
zipreader
(
f
)
Insert cell
chapters
=
Promise
.
all
(
Array
.
from
(
book
)
.
filter
(
(
[
d
]
)
=>
d
.
match
(
/\.(x?html)$/
)
)
.
map
(
(
[
,
p
]
)
=>
p
)
)
Insert cell
texts
=
chapters
.
map
(
text
)
Insert cell
function
text
(
x
)
{
const
div
=
document
.
createElement
(
"div"
)
;
div
.
innerHTML
=
x
;
return
(
div
.
textContent
||
div
.
innerText
||
""
)
.
replaceAll
(
/\s+/g
,
" "
)
.
trim
(
)
;
}
Insert cell
counts
=
texts
.
filter
(
(
text
)
=>
text
.
toLowerCase
(
)
.
startsWith
(
start
.
toLowerCase
(
)
)
)
.
map
(
(
text
)
=>
(
{
text
,
words
:
text
.
split
(
/\s+/g
)
.
length
}
)
)
Insert cell
totalWords
=
d3
.
sum
(
counts
,
(
{
words
}
)
=>
words
)
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
f
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
start
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
book
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chapters
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
texts
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
text
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
counts
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
totalWords
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML