Closed villasv closed 3 years ago
Hi,
We never try the lib into wasm context. FYI the data model is very large (it's why it's so long to build). Maybe there is also a runtime issue about memory. From my quick search, you can try to increase the memory allowed for wasm, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow.
I'm interested if it fixed the issue or not (in this case I'll investigate deeper tomorrow).
It seems that there is indeed a problem of memory consumption, which I confirmed by just taking a Vegalite spec that successfully builds and building it twice and the same error will show up. Kinda not sure what to do next... either go back to using JSON specs or find out exactly how much memory I'll have to pay for this lib.
I tried several approaches (I didn't know wasm), including made some changes in the vegalite_4 api (more Box to allocate on the heap).
what is working (with 2 graphs with axis enabled) is to increase the stack size to 1.5mb:
Add file b4-site\.cargo\config
with:
[target.wasm32-unknown-unknown]
rustflags = [
"-C", "link-args=-z stack-size=1500000",
]
Oooooh that solves it for me and indeed searching for that configuration I can see it popping up in situations similar to mine.
Thanks @davidB!
Thanks you for taking time to report the issue, providing a not too long reproducible case, and for the feedback about integration with wasm. I release a new version 0.6.0 that should be use less stack (and more heap) but behave like the previous one on wasm (always need to increase the stack size).
First of all, thanks for this library. By reading the create's docs.rs I've been mostly able to sort things out by myself. I've been stuck on a problem though:
The issue happens if I uncomment the axis related lines in the following snippet:
The complete project is here: https://github.com/villasv/b4/tree/15627e85080ad4daeb427b2fae079ad61f329bb5/b4-site
Am I missing something? Can you give me directions to fix this or just achieve what I want (axis & tooltip formatting)?