Platform
Resources
Pricing
Sign in
Get started
Claudio Esperança
Computer Graphics & Visualization @ufrj.br
Workspace
Fork
Published
By
Claudio Esperança
Edited
Oct 31, 2018
Fork of
WebAssembly Emscripten
1 star
Insert cell
Insert cell
Insert cell
Module
=
require
(
url
)
.
catch
(
(
)
=>
{
const
m
=
window
.
Module
;
if
(
m
.
onRuntimeInitialized
)
return
m
;
// Already initialized.
return
new
Promise
(
resolve
=>
m
.
onRuntimeInitialized
=
(
)
=>
resolve
(
m
)
)
;
}
)
Insert cell
// Convenience function to allocate a buffer in the Module's memory space
// so that we can use it to pass and receive an array of numbers
function
cArray
(
size
)
{
var
offset
=
Module
.
_malloc
(
size
*
8
)
;
Module
.
HEAPF64
.
set
(
new
Float64Array
(
size
)
,
offset
/
8
)
;
return
{
data
:
Module
.
HEAPF64
.
subarray
(
offset
/
8
,
offset
/
8
+
size
)
,
offset
:
offset
,
size
:
size
}
}
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.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Module
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cArray
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
a
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
addToVector
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