My Fourth Hacktoberfest PR
Rudy Chung
Posted on October 31, 2022
What Did I Work on?
This week, I worked on a new repo word-cloud-generator. This project allows the user to generate a word cloud based on a body of text provided to it. This word cloud can be generated using different methods and with different stylings and can be saved as a .png
file.
The issue I worked on was adding a feature that allowed for selecting the capitalisation of the words in the generated word cloud. This allowed for all words in the word cloud to be all lower-case, all upper-case, or have only the first letter capitalised.
What Changes did I make?
My pull request involved making changes to both the front-end and back-end. The front-end changes I made were relatively simple, just placing radio buttons and labels on the settings panel of the page.
On the back-end, the default capitalisation was all lower-case, which was where I started. I had to first check the radio button that was checked, then modify the words received in the corresponding way.
There was not a built-in method to capitalize the first letter in every word, so I had to find my own solution. This involved iterating through every word, and modifying them to a value built from appending the capitalised first letter to the remainder of the word.
Difficulties
This project used webpack, which caches the page. This also made it so that my changes were not being made when I reloaded the page. It took me a few hours to figure out, but once I found a workaround the process of finding the solution to the issue was only a matter of time.
Posted on October 31, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.