Giter VIP home page Giter VIP logo

Comments (4)

timdream avatar timdream commented on July 26, 2024

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.

av01d avatar av01d commented on July 26, 2024

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.

timdream avatar timdream commented on July 26, 2024
  1. Paste your world image into the canvas. (ctx.drawImage() and whatnot)
  2. Ask WordCloud to draw on that canvas with clearCanvas to false and backgroundColor 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.

nkingsley avatar nkingsley commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.