Comments (6)
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.
Sorry, I couldn't myself clear. Let me explain it with this example-graphic:
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.
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.
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.
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.
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)
- 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.