Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Words go outside the canvas when many data points exist (Scaling of wordcloud) #110

Open
Zoe-Bot opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Zoe-Bot
Copy link

Zoe-Bot commented Dec 16, 2024

When rendering a word cloud with a large number of data points, words often overflow outside the canvas boundary. This issue occurs even when using the aspect ratio or responsive options provided by Chart.js. There is no way to ensure that the entire word cloud fits within the canvas bounds.

To Reproduce

  1. Use a large dataset to generate a word cloud.
  2. Observe that words are placed outside the canvas area.

Expected behavior

All words in the word cloud should remain within the render canvas.

Screenshots
I have attached a screenshot from your official website example to illustrate the issue.

image

Context

  • Version: chart.js: ^4.4.4, chartjs-chart-wordcloud: ^4.4.2
  • Browser: 131.0.6778.140 (64-Bit)

Suggested Solution

  • Provide an option to set a zoom level or a fit-to-canvas property.
  • Alternatively, add a configuration to auto-scale the word cloud to ensure all words fit within the canvas dimensions.
@Zoe-Bot Zoe-Bot added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant