Giter VIP home page Giter VIP logo

Comments (10)

timcroydon avatar timcroydon commented on July 26, 2024 1

For others seeing this post, I had this problem (items not showing up). It's because the size is the font size, not an arbitrary number. Try normalising your size values to sensible font sizes.

I think this issue is covered in issue #53

from wordcloud2.js.

aaronucsd avatar aaronucsd commented on July 26, 2024

Looks like you need to give the div with the id 'my_canvas' a defined dimensions (w + h). Could you please add this into your usage? It's obvious but not to everyone. Also, can you have more usages/examples? From the demo i'm not able to see how you did it in code. Thanks.

from wordcloud2.js.

timdream avatar timdream commented on July 26, 2024

Looks like you need to give the div with the id 'my_canvas' a defined dimensions (w + h). Could you please add this into your usage? It's obvious but not to everyone. Also, can you have more usages/examples? From the demo i'm not able to see how you did it in code. Thanks.

Sounds reasonable. Would you like to submit a pull request to patch README for that? Thanks!

from wordcloud2.js.

aaronucsd avatar aaronucsd commented on July 26, 2024

Sure. Thanks.

from wordcloud2.js.

aaronucsd avatar aaronucsd commented on July 26, 2024

Btw, i tested with the array below and only HTTP shows up on the rendering. Why not 'foo' and 'bar'? It's a good size display 100%x500px.

this.list = [['foo', 868], ['bar', 832], ['HTTP', 77]];

@timdream Any ideas? Thanks.

from wordcloud2.js.

MiduoWiki avatar MiduoWiki commented on July 26, 2024

This element div.#my_canvas must have height and width

from wordcloud2.js.

liz282907 avatar liz282907 commented on July 26, 2024

i have the same issue, at the first time, the whole page is blank, and i modify the num in list to sensible font sizes. it does work. but there are still some words lost..

from wordcloud2.js.

lyqline avatar lyqline commented on July 26, 2024

I have the same issue, even i gives the same attributes with the official website. I have not find out the reason.someone can help?
let option = {
list: [['Les Misérables', '20'], ['Victor Hugo', '20']],
gridSize: 18,
weightFactor: 3,
fontFamily: 'Average, Times, serif',
backgroundColor: '#333'
};
wordcloud(containerEl, option);

from wordcloud2.js.

lyqline avatar lyqline commented on July 26, 2024

I have found out the reason why nothing has shown.We need to set weightFactor: 1.If weightFactor is too big ,we need to set the attribute drawOutOfBound for true.

from wordcloud2.js.

ryanbooker avatar ryanbooker commented on July 26, 2024

Having a defined width and height makes everything unscalable. i.e. With a response page that changes the size of elements with window size, the word cloud will eventually draw out of bounds. Rather than scale with the space. Using canvas, if you don't specify height, the canvas will scale nicely and the wrapping element height will fit the canvas.

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.