Comments (12)
An easy way to fix this issue is to 'normalize' the array of word's weights. So that the range of weight can only be 10-20, 10-50, etc.. So your not plugging in raw weights, that may cause the browser to crash or have that particular line return 'null'.
Would be nice if the library normalized the weights for you. ;)
from wordcloud2.js.
Thanks for filing!
from wordcloud2.js.
Oh crap, I can actually crash the tab on Chrome with your code here ...
from wordcloud2.js.
... and Firefox hangs w/o any way to recover. I would have to kill the browser.
from wordcloud2.js.
I now concluded this is a bug of the browser, or even the canvas API, but not on the library side. The browsers died at getImageData()
call presumably the large TypedArray data flood into the memory.
I'll file bugs on Firefox and Chrome.
There is no way in JavaScript to know the size limit of the array, or canvas. The way to fix this here would be expose a config allowing people to set a size limit, but again, deciding that limit will be a problem.
from wordcloud2.js.
Sorry for the delay, Firefox bug filed https://bugzilla.mozilla.org/show_bug.cgi?id=952909
from wordcloud2.js.
+1 what's the safe way to work around this? I get the same error even with small values, if they come after an even smaller value. e.g., [..., ['Foo', 10], ['Bar', 11]]
from wordcloud2.js.
Maybe your canvas is too big so the resulting pixel size of word to draw need to be big? Maybe your weightFactor
is set too big?
I don't have a way to workaround this, as I previously stated.
from wordcloud2.js.
I personally have not run into this issue with count values as small as the ones in speg's comment, but have run into it with much larger values. The way I safely got around this was to pick a max count value that would not cause the browser to crash and normalize all count values based on the max value.
As tim suggested, I would definitely make sure your weight factor is not too big as well.
from wordcloud2.js.
Is this still an issue?
My wordcloud crashes servers (i deployed to a meteor server and it crashed that server).
I thought it crashed when the result set was too large, not necessarily because of word size... i have a formula set so the size of the word doesn't get too large. And i only implented that because when the words were too large they would write over the whole screen (behind other dom elements, kinda looked like a nice background feature)
but nevertheless... i'm wondering if large word sets are causing this to crash?
from wordcloud2.js.
I don't know how meteor renders canvases on server (maybe w/ a headless WebKit/Chromium?), but I would imagine this issue is still valid.
from wordcloud2.js.
@ajm113 you're a genious! It worked for me :-)
from wordcloud2.js.
Related Issues (20)
- Text is truncated HOT 1
- Uncaught TypeError: ..... Value is not of type 'long'. HOT 1
- No type for version 1.2.2
- First words aligned
- How to randomize the filling order? HOT 3
- How do I change Device pixel density (dppx)? HOT 1
- Canvas not filled on Chromium
- can you please add example for how to add mouse events
- How can we rotate the text to specific angle?
- How we can add background color to the masked image HOT 1
- Keep getting many null is not an object errors
- Semver Dependency Issue
- Demo pages fails to 'run' on Chrome
- Where can we find the code of the demo page? HOT 1
- Next 14
- treat words as a single rectangle to avoid overlapping?
- How to render correct sizes based on order instead of count?
- Fix low font quality rendering
- Fill the whole canvas
- Add data to DOM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordcloud2.js.