문제

I use thejit treemap to display first 50 most frequently used words from a .txt file. My code is deployed here.

After the first text upload I receive JSON result and bind it to thejit control. All good so far. However, if I do another upload of a file without manually refreshing the page I get the result where boxes from the first result overlap with boxes from the second upload.

See the picture below.

overlapping of JSON

Question: how do I reset this control to display only new JSON and discard any previous data?

도움이 되었습니까?

해결책

Empty the div containing the visualisation before loading in the new data.

On the first line of your InitTreeMap function (before the var tm = new $jit.TM.Squarified({ line), add this:

$('#infovis').empty();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top