Issue T10576
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

'...' in Survey Analytics Pack Word Cloud

Word missing in wordcloud

created 2 years ago

Hello,

i have a strange issue going on with my wordcloud. I have following data, but it won't show the word 'great' or 'greater' in the wordcloud.

{question1: 'sunny'}
{question1: 'cloudy'}
{question1: 'Great'}
{question1: 'Noice '}
{question1: 'Great'}
{question1: 'Cloudy'}
{question1: 'Excellent'}
{question1: 'Kai'}
{question1: 'Sunny test Jessi '}

If I replace the word 'great' with any other word, it will show up!
You will see in the plunker that the visualizer.data has all the words, however, visualizer.getData() does NOT include the word 'great':
['sunny', 2]
['cloudy', 2]
['noice', 1]
['excellent', 1]
['kai', 1]
['test', 1]
['jes…', 1]

Can you tell me why that is?
https://plnkr.co/edit/MtNz6d4OjZflTG83

Thank you,
Manuela

Comments (2)

    Hello Manuela,
    Thank you for contacting us. I forwarded this issue to the team for further investigation. Please follow this thread for further details: https://github.com/surveyjs/survey-analytics/issues/272.

    Let us know if you have any questions or require further assistance.

    Thank you,
    Jane
    SurveyJS Team

      Hello Manuela,
      We researched this issue and determined that the Wordcloud defines the stopWordsDictionary collection. It includes words which should be excluded from the output, and the General word was in the list. As a temporary solution, you can override the getStopWords function and exclude the Great from the array of stop words:

      JavaScript
      var stopWords = SurveyAnalytics.textHelper.getStopWords(); stopWords.splice(stopWords.indexOf('great'), 1);

      Example.

      We'll continue investigating this and drop a line once we have additional information.

      Thank you

      Answers approved by surveyjs Support

      created 2 years ago

      Hello Manuela,
      I discussed this issue with the team and confirmed that we define a collection of special so-called stop words. These words are excluded from Wordcloud visualization. These are basically some auxiliary and functional words which are filtered out from the survey result.
      A full list of stopwords is available at wordcloud/stopwords/english. There is no single universal list of stop words, and you're welcome to add or remove words from this list.

      To add a new word to the stopword list:

      JavaScript
      SurveyAnalytics.textHelper.getStopWords().push("...");

      To remove a word (for example, Great) from the stopword list:

      JavaScript
      var stopWords = SurveyAnalytics.textHelper.getStopWords(); stopWords.splice(stopWords.indexOf('great'), 1);

      Example.

      Please feel free to contact us if you have any questions or require further assistance.

      Thank you,
      Jane
      SurveyJS Taam