Platform
Resources
Pricing
Sign in
Contact us
Fil
Vocateur.
Workspace
Fork
Public
Hello
By
Fil
Edited
Jan 13, 2022
Importers
26 stars
Insert cell
Insert cell
fflate
=
import
(
"https://cdn.skypack.dev/fflate?min"
)
Insert cell
Insert cell
Insert cell
Insert cell
A
=
fetch
(
CORS_PROXY
+
"https://data.cquest.org/elections/RG2021/resultats-par-niveau-bv-t1-france-entiere-2021-06-22-11h36.csv.gz"
)
.
then
(
(
d
)
=>
d
.
arrayBuffer
(
)
)
Insert cell
A1
=
d3
.
dsvFormat
(
";"
)
.
parse
(
fflate
.
strFromU8
(
fflate
.
decompressSync
(
new
Uint8Array
(
A
)
)
)
)
Insert cell
Insert cell
B
=
fetch
(
CORS_PROXY
+
"https://visionscarto.net/obs/jszip-demo/data.zip"
)
.
then
(
(
d
)
=>
d
.
arrayBuffer
(
)
)
.
then
(
(
buffer
)
=>
fflate
.
unzipSync
(
new
Uint8Array
(
buffer
)
)
)
Insert cell
B1
=
Object
.
fromEntries
(
Object
.
entries
(
B
)
.
map
(
(
[
key
,
buf
]
)
=>
[
key
,
d3
.
csvParse
(
fflate
.
strFromU8
(
buf
)
,
d3
.
autoType
)
]
)
)
Insert cell
Insert cell
b
=
new
Blob
(
[
fflate
.
zipSync
(
{
// Directories can be nested structures, as in an actual filesystem
dir1
:
{
nested
:
{
"hello.txt"
:
fflate
.
strToU8
(
"Hello world!"
)
}
}
}
)
]
)
Insert cell
DOM
.
download
(
b
,
"file.zip"
,
"Download this file"
)
Insert cell
fflate
.
unzipSync
(
new
Uint8Array
(
await
b
.
arrayBuffer
(
)
)
)
Insert cell
import
{
CORS_PROXY
}
from
"@fil/cors-proxy"
Insert cell
Insert cell
evaluate_compressed_size
(
"aaaaaaaaaaaaaaaaaaaaaa"
)
Insert cell
function
evaluate_compressed_size
(
text
)
{
if
(
typeof
text
!==
"string"
)
text
=
JSON
.
stringify
(
text
)
;
return
fflate
.
zipSync
(
{
test
:
fflate
.
strToU8
(
text
)
}
)
.
length
;
}
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
fflate
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
A
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
A1
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
B
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
B1
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
b
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
evaluate_compressed_size
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML