This is a web application for counting the frequency of words in a text document and displaying the results in a histogram and a word frequency table.
https://terribly-tiny-tales-1bp20ox7v-akashtripathiiiii.vercel.app/
To use the application, follow these steps:
-
Open your terminal or command prompt.
-
Run the following command to create a new React application using npx and create-react-app:
npx create-react-app terribly-tiny-tales
-
Navigate to the project directory:
cd terribly-tiny-tales-assignment
-
Start the development server:
npm start
-
Install the dependencies:
npm install <library-name>
-
Open your browser and visit
http://localhost:3000
to access the application. -
Click the "Submit" button.
-
The histogram and word frequency table will be displayed with the results.
-
Click on "Export" button to download csv file.
-
Click on "Back" button to go to "Submit" button page.
The application consists of the following components:
-
App
: The main component that handles the fetching of word frequency data and renders the Histogram and WordFrequencyTable components. -
Histogram
: Renders a histogram chart based on the word frequency data. -
WordFrequencyTable
: Displays a table showing the word frequency data. -
SubmitButton
: Renders a button for submitting the text document and triggering the word frequency calculation.
The application utilizes the following libraries and plugins:
-
React: A JavaScript library for building user interfaces.
-
react-chartjs-2: A React wrapper for Chart.js, used for rendering the histogram chart.
-
react-csv: A lightweight library for creating and downloading CSV files in React applications.