kora il y a 2 ans
Parent
commit
925adb93cd
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      js/word_cloud.js

+ 5 - 5
js/word_cloud.js

@@ -93,10 +93,11 @@ function prepareWords(tempArray){
     const words = [];
 
     if (tempArray.length < 8) { // Less than 8 results -- font size is just = count/2 + constant
-      for (let entry in tempArray) {
-        let text = entry['text'];
-        let preSize = entry['count'] + 36;
-        let link = entry['hlink'];
+      for (let k=tempArray.length-1; k>=0; k--) {
+        let text = tempArray[k]['text'];
+        let preSize = tempArray[k]['count'] + 36;
+        console.log('mann', preSize)
+        let link = tempArray[k]['hlink'];
         words.push(
             {
                 'text': text,
@@ -238,7 +239,6 @@ function draw(words, svg) {
              .append("a")
              .attr("href", word => word.hlink)
              .attr("data-toggle", "tooltip")
-             .attr("title", word => word.size)
              .text( word => { return word.text; });
 
         //Entering and exiting words