Words not change when words input change
kennj2016 opened this issue · 4 comments
kennj2016 commented
<vue-word-cloud
style="width: 400px; height: 400px;"
:words="dataTagWords"
:color="([, weight]) => weight > 10 ? 'DeepPink' : weight > 5 ? 'RoyalBlue' : 'Indigo'"
font-family="Roboto"
></vue-word-cloud>
SeregPie commented
Please upload your code somewhere, so I can have a look at it.
kennj2016 commented
words = words.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '').toLowerCase();
let words_except = ['a', 'b', 'p', 'n', 'id', 'uses', 'h', 'is', 'was', 'am', 'are', 'the', 'to', 'be', 'to', 'of', 'and',
'in', 'that', 'have', 'i', 'it', 'for', 'on', 'with', 'he', 'as', 'you',
'do', 'at', 'this', 'but', 'his', 'by', "the", "of", "and", "a", "to", "in", "is", "you", "that", "it", "he", "was", "for",
"on", "are", "as", "with", "his", "they", "I", "at", "be", "this", "have", "from", "or",
"one", "had", "by", "word", "but", "not", "what", "all", "were", "we", "when", "your", "can",
"said", "there", "use", "an", "each", "which", "she", "do", "how", "their", "if",
"will", "up", "other", "about", "out", "many", "then", "them", "these", "so", "some", "her",
"would", "make", "like", "him", "into", "time", "has", "look", "two", "more", "write", "go", "see",
"number", "no", "way", "could", "people", "my", "than", "first", "water", "been", "call", "who",
"oil", "its", "now", "find", "long", "down", "day", "did", "get", "come", "made", "may", "part"
];
words = words.replace(/[^a-zA-Z]+/g, ' ');
let reg_replace = "";
for (var i = words_except.length - 1; i >= 0; i--) {
reg_replace = " " + words_except[i] + " ";
words = words.replace(new RegExp(reg_replace, 'gi'), " ");
}
words = words.replace(/([ ]+)/g, '$1§sep§').split('§sep§');
console.log(words.length);
let wordsCloud = [];
for (let k in words) {
if (words.hasOwnProperty(k)) {
let i = words[k].trim();
wordsCloud[i] = (wordsCloud[i] || 0) + 1;
}
}
for (let k in wordsCloud) {
this.dataTagWords.push([k, wordsCloud[k]]);
}
SeregPie commented
Can you please upload a full working example on https://jsfiddle.net
kennj2016 commented
Hi, can you let me know what kind of codes do you want to look at?
the whole project or just some pages?
Thanks
…On Thu, Mar 1, 2018 at 10:53 AM, Sergej Sintschilin < ***@***.***> wrote:
Please upload your code somewhere, so I can have a look at it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATeY-gClYWaHJI5zkFKoWQYEqWLgo0nnks5taBmIgaJpZM4SYdnV>
.