Platform
Solutions
Resources
Pricing
Sign in
Sign up
Fil
Vocateur.
Workspace
Fork
Published
2 collections
By
Fil
Edited
Sep 13, 2021
3 stars
Hello
Hello, PGLite
INSEE Parquet
Hello, apcach
DruidJS worker
Hello, Orbit
Word Tour: 40k words and their friends
Hello, spectral.js
Hello, petite-vue
Hello, @thi.ng/grid-iterators
Hello, thumbhash
Hello, SwissGL
Hello, QOI (and glitches)
Hello, orb
Hello, cosmograph
Hello, Tabulator
Using d3.blur with Plot
Math.cbrt
Hello debounce
Colorcet
Hello, glii
Hello, Open Meteo
Hello, PyWavelets
Hello, typesense
Hello, libgif
Hello, kmeans-engine
Happy anniversary, Project Gutenberg!
Hello, fflate
Hello, ArchieML!
Hello, d3-bboxCollide
Hello, jsgeoda!
Hello, EDTF!
Hello, protovis!
Hello, placekey
Hello, fuse.js
Hello, Reorder.js
Hello, shadow DOM
jszip
Hello, procedural-gl
Hello, qhull
Hello, genetic-js
DruidJS
Hello, Tippy.js
Hello, paintWorklet
Big π
Hello, Autoencoder
Hello, Shakespearean UUIDs
Hello, ccwt.js
Hello, constrainautor
Hello, talisman
Hello, polygon-offset
Hello p-queue
Hello async-pool
Hello rollup-plugin-ascii
Hello, algebra.js
Hello, pixi.js
Hello, d3-render
Hello zip/unzip
Cumulative Wikipedia Donations
HTML <details>
regl texture
Hello, npyjs
Hello protobuf
Hello, pencil touch
Hello, LOESS
Hello html2canvas
legra maps
color2css
Hello, ecsy
2D point distributions
Hello, delatin
The gpu.js loop
Dijkstra’s shortest-path tree
Hello nojacko/Dijkstras-js
Hello, tcort/dijkstrajs
Hello, lambdabaa/dijkstra
Hello, gpu.js v2
Hello jsqr
Hello qrcode
Hello SharedArrayBuffer
Hello GamePad API
Hello vtk.js
Hello nd4js
Hello Biofabric
Travelling with a self-organizing map
Hello glitch
Hello UMAP-js
Hello pandemonium
Hello iocane
Hello JSON-editor
Hello d3-gridding
Hello mljs/knn
Worker
Hello lalolib
Image to GPU.js
Image to blink.js
Tissot's indicatrix
Vega projections
Hello WebCLGL
Using d3-inertia with observable
Video contouring 3
ngraph: pagerank, louvain…
Union-Find
Perceptron (simple statistics)
mljs
Hello h3-js
Emoji Flags
Hello, poisson-disk-sampling
Also listed in…
Meta
Insert cell
Insert cell
sharedBuffer
=
new
SharedArrayBuffer
(
Int32Array
.
BYTES_PER_ELEMENT
*
1e7
)
// 4 bytes per item in a Float32Array
Insert cell
import
{
worker
}
from
"@fil/worker"
Insert cell
Insert cell
C
=
navigator
.
hardwareConcurrency
||
4
Insert cell
runWorkers
=
{
launchWorkers
;
const
seed
=
Math
.
random
(
)
,
time
=
performance
.
now
(
)
;
await
Promise
.
all
(
Array
.
from
(
{
length
:
C
}
,
(
_
,
start
)
=>
new
Promise
(
notify
=>
worker
(
compute
,
{
seed
,
sharedBuffer
,
start
,
n
:
1000
,
C
}
)
(
notify
)
)
)
)
;
return
performance
.
now
(
)
-
time
;
}
Insert cell
(
runWorkers
,
new
Float32Array
(
sharedBuffer
)
)
Insert cell
function
compute
(
options
)
{
const
sharedArray
=
new
Float32Array
(
options
.
sharedBuffer
)
,
n
=
options
.
n
||
1000
,
C
=
navigator
.
hardwareConcurrency
||
4
;
for
(
let
i
=
options
.
start
;
i
<
sharedArray
.
length
;
i
+=
C
)
{
for
(
let
a
=
0
;
a
<
n
;
a
++
// make it slow :D
)
sharedArray
[
i
]
=
Math
.
cos
(
i
/
100
+
options
.
seed
)
;
}
return
"anything"
;
// a message saying we're done
}
Insert cell
Insert cell
Insert cell
normal
=
{
if
(
!
launchNormal
)
return
;
const
seed
=
Math
.
random
(
)
,
time
=
performance
.
now
(
)
;
for
(
let
start
=
0
;
start
<
C
;
start
++
)
compute
(
{
seed
,
sharedBuffer
,
start
,
n
:
1000
,
C
}
)
;
return
performance
.
now
(
)
-
time
;
}
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Listed in...
Meta
Fil
Hello
Fil
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sharedBuffer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
launchWorkers
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
C
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
runWorkers
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
compute
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
launchNormal
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
normal
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML