Giter VIP home page Giter VIP logo

Comments (6)

timdream avatar timdream commented on July 26, 2024

I am not following ... are you looking at creating a cloud according to the shape drawn by CSS? That would be non-trivial because JavaScript don't have enough layout information to tell the actual shape.

If you are looking at draw the cloud into a specific shape, there are other methods available (with a mask image or with a polar equation), both would work better than getting a shape from CSS!

from wordcloud2.js.

Der-K-2000 avatar Der-K-2000 commented on July 26, 2024

Sorry, I couldn't myself clear. Let me explain it with this example-graphic:

clouds

I want that cloud-shapes sourrounding the tags. With your elements-option I thought, a CSS3-Styling will be more easier to do this. If not, have you any idea, how can I perform such thing with your tool? Or do you know a skript, which wil handle this?

from wordcloud2.js.

timdream avatar timdream commented on July 26, 2024

Ah, that's completely the other way around. What you want is very easy to do by drawing the cloud in a <div> and set some style to div > span. However, the cloud-drawing logic will not account the spacing required for the styling. Anything advanced would probably need to dive into the code...

Speak of, it would be great if there is some way to make the library plug-able to account for these use cases, but I haven't think of a good API yet.

from wordcloud2.js.

Der-K-2000 avatar Der-K-2000 commented on July 26, 2024

Thank you for the reply, but I'm afraid, my expertise is not good enough to realise that. I just saw that CSS-Cloud, which looks pretty nice, but I've noticed, that there are only absolute sizes, so maybe that's a problem with the relativ sizes of the tags in your cloud?

But if you say, it's "very easy" could you please give me a solution or a walkthrough or a link-tipp for this case? I would really appreciate that. Thank you and have a nice week!

from wordcloud2.js.

Der-K-2000 avatar Der-K-2000 commented on July 26, 2024

How to draw the cloud in a div, like you said? I will give it a try, but maybe you can introduce me only in this?

from wordcloud2.js.

timdream avatar timdream commented on July 26, 2024

Pass a DOM Element object into elements argument here:

https://github.com/timdream/wordcloud2.js/blob/master/API.md#usage

If any of the elements is not a <canvas>, the code will attempt to draw text by appending <span> as child elements, instead of using ConvasContext2D API.

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.