Exercise

Don't continuously create new word clouds

The word cloud app now has several different inputs, and modifying each one of them causes the word cloud to redraw with the new set of parameters, just as expected.

But this behaviour can also be annoying sometimes. For example, when typing text in the textarea, the word cloud keeps regenerating without waiting for you to finish typing. This can be controlled with isolate().

All the code inside renderWordcloud2() that renders the word cloud has been removed. Your task is to re-create the word cloud and isolate it so that changing the parameters will not automatically trigger a new word cloud.

Instructions

100 XP
  • Ensure the entire word cloud generating function is isolated (line 54).
  • Supply the arguments to create_wordcloud() using the necessary inputs and reactive variables. The arguments for the function are data, num_words, and background (line 56).

The result of this may seem like the app is broken because you will not be able to create a new word cloud, but that will be addressed in a following exercise.