-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Most important words (highest counts) are excluded if they don't fit #36
Comments
We are running into this problem too. I think either solution suggested above would work. Has anyone implemented one of them? Although these words are often the highest ranking ones, they could occur anywhere in the list. |
I implemented an overflow option here https://github.com/john-guerra/d3-cloud |
@john-guerra I tried to replace my version of the layout with your version, and while it does work the scaling and arrangement seem a bit off. It does not seem to take all available width into account. See pictures below to see what I mean. |
@tribe84 your solution looks cool, have you posted your code somewhere? |
@john-guerra nice job on the overflow code. |
Thanks a lot! On Mon Jan 26 2015 at 12:54:19 PM Sanders DeNardi notifications@github.com
|
Hi, var fontScale = d3.scale.linear() See this fiddle for an example: http://jsfiddle.net/ndenmhhw/3/ While this doesn't change the Issue, that the words won't get drawn when they are bigger than the height/width, it let's you controll it through the size parameters. hope this helps someone |
I ran into the same problem as @tribe84. That forced me to rethink my approach to this issue. I ended up increasing the layout space in the place function, such that it is no longer checks sizing bounds but enlarging sizing bounds. Of course I scale my entire SVG on the subsequent draw method. I understand that this solution is not ideal but it seemed to work for me. |
+1 this feature is super needed |
My fix was to create a maximum font size based on the largest size and scale all other words point size. I found that the words are always visible. If you want a larger size simply adjust the maxFontSize variable... Example: //add a variable or dynamically control this value from an input box d3.layout.cloud().size([width, height]) |
Having the same issue. If I have long words they are just left out depending on the position of the other words. Specifying a max font size is not really helping because short words are then very small even they could be a lot bigger... +1 |
You need one more calculation in there. Max size of div / # characters = max pixels per character This might help. So, the above calculation will actually give you the max font sized based on the longest word with the highest value. |
I found a way of fixing this issue. I confirm that all words are rendered by the recursive strategy.
edited http://jsfiddle.net/ndenmhhw/3/
Although it does not always fit your situations, it might help some people annoyed with this issue |
@satotake that looks like a decent idea for a solution. Although the jsfiddle you link is currently broken and doesn't render anything. Probably best to load d3-cloud from github rather than jasondavies.com. |
Building on examples above, I've successfully implemented sorting and sizing of the words by frequency of appearance with duplicate removal: http://codepen.io/znak/details/rOgXoV/ As for the max font size for the biggest word, it could be done with |
hi @john-guerra i used your algorithm but its performance is not good. |
@BhumikaSarswat I'm sorry but your request is too vague |
also, repair scaling in cloud.min.js: [d3.select("input[name=scale]:checked").property("value")]().range([20, 50]), Based on known issue: jasondavies/d3-cloud#36
Any update on this? |
@satotake @axelson |
@jasondavies I really wonder how do I make it? Here is my best to make now below based on satotake's
|
Satotakes and samkugij jsfiddle did not include his proposed workaround using recursive calls. |
Wow, I just stumbled on the same issue in 2018. Thanks for your posts... :-) |
hello @john-guerra |
Sorry I don't have the cycles right now
John.
From my phone, brevity and all
http://johnguerra.co
…On Tue, Oct 8, 2019, 9:24 AM khushbu ***@***.***> wrote:
I implemented an overflow option here
https://github.com/john-guerra/d3-cloud
hello @john-guerra <https://github.com/john-guerra>
can you provide this expmple in d3 v5?
if I am try to run this exaplme in d3 v5 its noy working
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36?email_source=notifications&email_token=AAJJCS5O4IC7QWSHBPUFBDTQNSJZZA5CNFSM4AOSCJC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAULIPQ#issuecomment-539538494>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJJCS5WBUMTPILEFE6IZNLQNSJZZANCNFSM4AOSCJCQ>
.
|
Right now the algorithm leaves out words that are too big to fit on the available width/height. This is OK for smaller words that aren't that important, but it also leaves out the most important words on a cloud without any warning.
http://jsfiddle.net/duto_guerra/VNurQ/
I can think of two solutions:
I was planning on trying to do this myself and send you a pull request, but I would like to hear your preferences and opinion
John
The text was updated successfully, but these errors were encountered: