Closed wesslen closed 7 years ago
Hi @wesslen !
We need to test if that line don't modify the actual widget behavior. A priori I don't know (I'm not a d3 js expert).
If you are sure about that line you can do a pull request ;)!
Sounds good. I tried to test (forked the library) and it didn't work but I'll look into it. I'll try to solve on my and then do a pull request (I need to learn how to). Regardless, thanks for your time and your great package!
-Ryan
Any help you need just tell me ;)!
Wow! Thanks @nz-stefan!! Great add! Closing issue.
Thanks @nz-stefan!! I'm very glad you helped to @wesslen
Hi- First, thanks for a great widget. This is very helpful.
I've built a shiny app that interacts between visNetwork and d3wordcloud. I select a node (which is a topic, e.g. LDA) which will then populate the d3wordcloud.
The problem: after the first interaction, the wordcloud will not remove words that have not been used as a top word for new clicked nodes (topics).
The issue is because I do not use all words but only a subset -- the reason I need to limit is larger models when there's potentially 10,000+ words, I only want to plot the top 100 words.
Here's a simplified example, using a pre-created network and word-topic matrix consisting of 10 words and 6 topics (hence 10x6 matrix).
Notice that there is not a problem if you comment out line
w <- w[1:5,]
, as when you update all words it words.However, as I mentioned, I will need to use a subset of inputs as there are usually too many words and I'll need to reduce to (say) top 100.
I spoke with a colleague who is more familiar with D3 and javascript and he recommended that this problem could be solved by adding the line
to line 231 to "/inst/htmlwidgets/d3wordcloud.js" to reset the word cloud to blank before rerunning the word cloud each time.
Essentially, I do not think this would effect anyone else as this just clears the cloud before running each time.
Would it be possible to make this change? If not, do you have any suggestions?
Worst case, I can create my own fork but for my app I need users to have access to this library, and therefore they would pull from my fork.