-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a WebAssembly version? #90
Comments
I am also interested in this, since it should provide a better performance. |
ping (@mdaines)? |
@broofa I plan to look at this in the next few days. |
Emscripten can produce a WebAssembly binary for Viz.js using just the While investigating this I built the "lite" version as WebAssembly. The total size (binary + Emscripten loading code + wrapper) appears to be just under 900 KB rather than 1.62 MB. |
I'm fine with an async API. That's very clearly the future (and present) of JS. That is a nice space savings. Any idea if there's a perf improvement with that as well? |
Normally there so many perf improvements between asm.js and WASM versions it's almost unbelievable. |
@mdaines were you able to get this working? I'm really excited for this |
@amilajack I was able to get it to work, but the API for Viz.js needs to change to support asynchronous loading and indicating the location of the binary. Maybe something like this:
I'm planning to change the Viz.js API so that it returns promises and supports web workers more directly, and this would fit with that. I'll post an issue detailing those changes soon. |
I don't know WebAssembly so I don't know if this is useful to you, but here's how I solved asynchronous loading and indicating the location of viz.js in d3-graphviz
Details: |
@amilajack @magjac I've opened #113 to discuss the possible changes. |
@mdaines As I understand post- |
I was thinking it looks something like this:
|
any updates on this ? Is there some guide how to compile this lib to web assembly ? |
This would allow running Viz in a CloudFlare worker for free, which would be pretty neat. |
https://github.com/CyberhavenInc/graphviz-wasm |
Closing because v3 uses WebAssembly. |
Oh wow, didn't notice that this project was un-archived. Good to hear! :) |
I'm not aware of the specifics of viz.js, but it seems that Emscripten allows compiling to WebAssembly just by passing the
-s WASM=1
flag toemcc
.Is that something doable with this library?
The text was updated successfully, but these errors were encountered: