Comments (4)
You would have to do it with a picture mask by draw the "ocean" on the first and set the "land" color to WordCloud as the color that can be used to place text.
from wordcloud2.js.
Thanks for you reply, but I'm not sure I understand yet. Until now, I always use shape-generator.html to generate cloud shapes. Does the process you describe use shape-generator.html at all? Or is it something I need to do in wordcloud2.js? Where do I set the "land" color?
An example might be useful? Thanks again.
from wordcloud2.js.
- Paste your world image into the canvas. (
ctx.drawImage()
and whatnot) - Ask WordCloud to draw on that canvas with
clearCanvas
tofalse
andbackgroundColor
of the color to be drawn words over (I assume that's the color of the continents for an image of a world map).
https://github.com/timdream/wordcloud2.js/blob/master/API.md#presentation
You don't need shape-generator.html
.
Please consider contributing by submit a pull request to show your work as a new demo once you figure out how to do it :)
from wordcloud2.js.
I'm trying to follow this, but when I set clearCanvas: false, the word cloud doesn't work at all (nothing draws). Would it be possible to post a short code example? Thanks!
from wordcloud2.js.
Related Issues (20)
- Add more data to the callbacks (color, classes and fontWeight ) HOT 7
- Text being cropped at bottom, although drawOutOfBound is false and shrinkToFit is true
- Refresh or redraw with new words dynamically HOT 1
- Word wrap HOT 1
- Internet Explorer 11
- 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
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.