Open GiorgioMand opened 3 years ago
yeah this is a problem for me too
@rezaho ^^
I think this is caused by the nature of streamlit and the fact that the code is changing the state on each js "hover" or "click" event on the word cloud. Removing onWordClicked and onWordHovered from here will fix the issue, but will not allow for the state to affect the app state. I didn't needed the hover action it so i solved the problem by commenting out
const onWordClicked = (word) => {
setState((state) => {
return {
clicked: word,
hovered: state.hovered,
}
});
}
const onWordHovered = (word) => {
// setState((state) => {
// return {
// clicked: state.clicked,
// hovered: word,
// }
})
}
and rebuilding the js code, avoiding the refresh caused by the hover event. @rezaho you might consider to change this since it makes the code as is almost unusable
@yochail Can you explain to me how to rebuild? I'm not familiar with javascript. So far, I've cloned rezaho/streamlit-wordcloud, and commented the lines you suggested.
Would you please provide option to disable click and hover?
Could anyone please share some insight on how to disable hover please ~ Really Appreciated
Hello. How do I change the background color? I have tried many ways with no results.
I have added two paramters to the function:
ignore_hover ignore_click
If those are true nothing will be returned and streamlit wont reload the page.
I was testing this, but I got following error , I have both streamlit-wordcloud 0.1.0 and streamlit-wordcloud-v2 0.4.0
Using this way:
wordcloud.visualize(names, tooltip_data_fields={'text': 'keyword', 'value': 'Value', 'rank':'Rank'}, per_word_coloring=False, ignore_hover=True, height=500)
TypeError: visualize() got an unexpected keyword argument 'ignore_hover'
What is required to make it work?
Hey @flucas96, thanks for your effort. The version 2 works just fine. Would you mind telling me how to disable word rotation or at least share you git source code setup for building the dist. It is really annoying to read the words when rotated.
I don't know if you already noticed, but whenever one plots a wordcloud the resulting streamlit page continuously refreshes. This of course invalidate any other filter, since they get restarted over and over.