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

Word cloud, font size and positionning #57

Open
kermitt2 opened this issue Nov 28, 2016 · 2 comments
Open

Word cloud, font size and positionning #57

kermitt2 opened this issue Nov 28, 2016 · 2 comments

Comments

@kermitt2
Copy link
Member

I changed the word cloud to take into account keyword frequency by scaling the font size (linear scaling). However, there are some issues with the positioning, because the dimension of cloud cannot be known in advance nor its the position in the svg canvas.

So before it was like that, same font size for all key words (17px):
screenshot from 2016-11-28 05-43-41

Now, in general it's ok, but there's often some empty space between the inner g element and the svg canvas size that should be removed (maybe by looking at the position of the words):
screenshot from 2016-11-28 05-19-07

It happen that for the same set of words, it can be quite good:
screenshot from 2016-11-28 05-21-30

Or bad with cut words:
screenshot from 2016-11-28 05-23-49

Note that for avoiding large words to be removed by the d3.cloud algorithm (see jasondavies/d3-cloud#36), I've a bit enlarged the cloud size as compared to the svg canvas size. It's a decent compromise, but some cut words can happen from time to time. Ideally I think the cloud size should not be enlarged, but the cloud should be translated in the svg canvas in a more case-to-case manner by looking at the position of the words, and the size of the svg canvas should be adjusted to the one of the inner g element.

@Aazhar
Copy link
Member

Aazhar commented Nov 28, 2016

c17b26a

@kermitt2
Copy link
Member Author

Most likely better to move to another more reliable and predictable word cloud library.
The one of Kibana looks very nice.
See https://github.com/elastic/kibana/tree/master/src/core_plugins/tagcloud
elastic/kibana#8104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants