Comments (3)
Sorry for the late reply. This is probably a bug in the browser (not being able to draw a word with the size of 11445
!). I did see an error in the JS console in Firefox (NS_ERROR_FAILURE:
) but it's not actionable since it does not contain any line or backtrace information.
Maybe we could find the real method that throws and wrap it with try {} catch {}
?
from wordcloud2.js.
Hmm. I think that I was under the impression that the number wasn't the font-size but rather the "weight" of the word and that the Javascript would determine the font-size based on that. What you're saying makes sense though, so maybe something as simple as a check on each value to see if it exceeds 500 (or something else reasonable) would be appropriate?
For what it's worth though, I don't think it's the browser that's unable to render text at that size, but rather that the string requested can't fit on the canvas requested at that size. I base this assertion on the fact that I just used Firefox's dev tools to change the font on this page to 20000pt and while everything was HUGE, it didn't explode.
from wordcloud2.js.
Yes, the number is the weight but unless your weight factor is way smaller than 1 I assume 11445 means font-size > 11445px?
DOM rendering is quiet different than 2d canvas rendering, so the former works doesn't means the latter always works, unfortunately. You can refer to #14 and read the previous experiences. However, since the browser did not crash like it did in #14, we should be able to safely "workaround" it with a try ... catch block.
(It is also entirely possible my script did not pass the right parameters to the native code, so it throws at me)
All in all we need to find which call throws first.
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.