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

How Can I Clear wordcloud #61

Open
zw231212 opened this issue Nov 23, 2016 · 3 comments
Open

How Can I Clear wordcloud #61

zw231212 opened this issue Nov 23, 2016 · 3 comments

Comments

@zw231212
Copy link

zw231212 commented Nov 23, 2016

When I use a select tag to change wordcloud's size(use ajax) ,the former words maybe overlap words now。Then I use $(...).html("") to clear the former wordcloud ,but when the former wordcloud is still rendering , I change the word number, then words could overlap.

Is there a safety param or method to clear the former wordcloud?

code eg:

$("#queryrecordWordCloud").html(" ");//clear former wordcloud
var word_array = [];
$.ajax({
	"url":"...",
	"type":"POST",
	"data":{},
	"dataType":"JSON",
	"async":false,
	success:function (data) {
		word_array=data;
	},
	error:function () {
		//...
	}
});
$("#queryrecordWordCloud").jQCloud(word_array);//render wordcloud
@pallaviMN
Copy link

@zw231212 , did u get any solution for this problem?

@zw231212
Copy link
Author

zw231212 commented Jan 17, 2017

@pallaviMN No,When It is rendering,Just not to choose change the size.

@churcho
Copy link

churcho commented Jul 11, 2017

I came across this error as well and on inspecting the div, I realised that the words are enclosed in span tags. To clear the div use $('#div-id').find('span').remove(). One thing I also noticed is that sometimes I would execute the clear command while the word rendering is not complete, you can overcome this by setting delayedMode' to false or only calling the re-render if a flag is true and you'd set that flag to true by using the afterWordRender` callback function.

Hope that helps someone else who lands here :-)

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

3 participants