link here: https://editor.p5js.org/cy1503/sketches/sAjYe7X6X
I worked on the example given in the GitHub.
I want to use the intensity of the text to represent the frequency of words. I created a variable called shade to map the count to be the color intensity and used span to put tokens together as a paragraph visually.
I was using the original example text file of Rainbow, and it took forever to load the result. I asked GPT on this question.
And it suggested solutions below - which are very effective on the performance.
Though used “split(/\W+/)”, there were still numbers and numeric strings appearing. Then I added “isNaN(word)” and “!/\d/.test(word)” to ensure no numbers or numeric characters.