From 1a07c3e5e8bf618f4481660182f35ad0b3fd703e Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 08:21:47 +0000 Subject: [PATCH] Format code with prettier This commit fixes the style issues introduced in 35778db according to the output from prettier. Details: https://deepsource.io/gh/Jm-Paunlagui/Matrix-Lab-Client/transform/56998653-941f-4bf7-a83b-bb0c56974881/ --- .../src/views/user/dashboard/UserDashboard.js | 883 +++++++++--------- 1 file changed, 452 insertions(+), 431 deletions(-) diff --git a/client/src/views/user/dashboard/UserDashboard.js b/client/src/views/user/dashboard/UserDashboard.js index c0ba8e48..0ae7ff53 100644 --- a/client/src/views/user/dashboard/UserDashboard.js +++ b/client/src/views/user/dashboard/UserDashboard.js @@ -1,11 +1,18 @@ -import React, {useEffect, useState} from "react"; +import React, { useEffect, useState } from "react"; -import {LoadingPageSkeletonImage, LoadingPageSkeletonText,} from "../../../components/loading/LoadingPage"; +import { + LoadingPageSkeletonImage, + LoadingPageSkeletonText, +} from "../../../components/loading/LoadingPage"; import httpClient from "../../../http/httpClient"; -import {Header, HeaderEmail} from "../../../components/headers/Header"; -import {CsvQuestion, SchoolYearList, SemesterList,} from "../../../components/listbox/ListBox"; +import { Header, HeaderEmail } from "../../../components/headers/Header"; +import { + CsvQuestion, + SchoolYearList, + SemesterList, +} from "../../../components/listbox/ListBox"; import DisclosureTogglable from "../../../components/disclosure/DisclosureTogglable"; -import {getCookie, isAuth} from "../../../helpers/Auth"; +import { getCookie, isAuth } from "../../../helpers/Auth"; /** * @description Handles the admin profile @@ -63,32 +70,32 @@ export default function UserDashboard() { school_semester, csv_question, ) => { - if (isAuth().verified_email === "Verified"){ + if (isAuth().verified_email === "Verified") { setSelected({ - ...selected, - school_year, - school_semester, - csv_question, - }); - httpClient - .get( - `/analysis/for_analysis_options_user/${school_year}/${school_semester}/${csv_question}/${token}`, - ) - .then((response) => { - setAnalysis({ - ...analysis, - loading_analysis: false, - overall_sentiments: response.data.overall_sentiments, - image_path_polarity_v_sentiment: - response.data.image_path_polarity_v_sentiment, - image_path_review_length_v_sentiment: - response.data.image_path_review_length_v_sentiment, - image_path_wordcloud: response.data.image_path_wordcloud, - common_phrase: response.data.common_phrase, - common_word: response.data.common_word, - common_words: response.data.common_words, - }); + ...selected, + school_year, + school_semester, + csv_question, }); + httpClient + .get( + `/analysis/for_analysis_options_user/${school_year}/${school_semester}/${csv_question}/${token}`, + ) + .then((response) => { + setAnalysis({ + ...analysis, + loading_analysis: false, + overall_sentiments: response.data.overall_sentiments, + image_path_polarity_v_sentiment: + response.data.image_path_polarity_v_sentiment, + image_path_review_length_v_sentiment: + response.data.image_path_review_length_v_sentiment, + image_path_wordcloud: response.data.image_path_wordcloud, + common_phrase: response.data.common_phrase, + common_word: response.data.common_word, + common_words: response.data.common_words, + }); + }); } }; @@ -96,24 +103,24 @@ export default function UserDashboard() { * @description Loads the analysis options */ const optionsForPVS = () => { - if (isAuth().verified_email === "Verified"){ + if (isAuth().verified_email === "Verified") { httpClient - .get(`/analysis/options-for-file-data-dashboard`) - .then((response) => { - // loadPolarityVsentiment(response.data.school_year[0].school_year, response.data.school_semester[0].school_semester, response.data.csv_question[0].csv_question) - setOptions({ - ...options, - school_year_to_choose: response.data.school_year, - school_semester_to_choose: response.data.school_semester, - csv_question_to_choose: response.data.csv_question, + .get(`/analysis/options-for-file-data-dashboard`) + .then((response) => { + // loadPolarityVsentiment(response.data.school_year[0].school_year, response.data.school_semester[0].school_semester, response.data.csv_question[0].csv_question) + setOptions({ + ...options, + school_year_to_choose: response.data.school_year, + school_semester_to_choose: response.data.school_semester, + csv_question_to_choose: response.data.csv_question, + }); + setSelected({ + ...selected, + school_year: response.data.school_year[0].school_year, + school_semester: response.data.school_semester[0].school_semester, + csv_question: response.data.csv_question[0].csv_question, + }); }); - setSelected({ - ...selected, - school_year: response.data.school_year[0].school_year, - school_semester: response.data.school_semester[0].school_semester, - csv_question: response.data.csv_question[0].csv_question, - }); - }); } }; @@ -143,412 +150,426 @@ export default function UserDashboard() { return (
- { - isAuth().verified_email === "Verified" ? ( - <> -
-
-
-
-

Show By

+ {isAuth().verified_email === "Verified" ? ( + <> +
+
+
+
+

Show By

+
+
+
+
+
-
-
-
- -
-
- -
-
-
- -
+
+
+
+ +
-
-
-
-

- Number of Positive and Negative Sentiments -

- -

- The overall sentiments of the students' feedbacks. -

-
-
-

- Your Overall Sentiments -

- {loading_analysis ? ( - <> - - - - ) : ( - overall_sentiments.map((overall) => ( +
+
+
+
+
+

+ Number of Positive and Negative Sentiments +

+ +

+ The overall sentiments of the students' feedbacks. +

+
+
+

+ Your Overall Sentiments +

+ {loading_analysis ? ( + <> + + + + ) : ( + overall_sentiments.map((overall) => ( +
+
-
-
- -
-
-

- {overall.percentage} % -

-

- with {overall.value} responses from {overall.year} -

-
-
+
- )) - )} -
-
-
-

- Sentiment vs Polarity -

- -

- Sentiment refers to the emotional or attitudinal content of a - piece of text, such as a statement, review, or social media - post. It is the overall feeling or attitude expressed in the - text. -

-

- Polarity, on the other hand, is a measure of the positivity or - negativity of a piece of text. It is typically calculated by - analyzing the words and phrases used in the text and assigning a - positive or negative score to each one. The overall polarity of - the text is then determined by summing up these scores. -

-
-
-
- {loading_analysis ? ( - - ) : ( - <> - sentiment_v_pol -

- Polar words and phrases are usually associated with strong or clearly defined sentiment, while non-polar refers to words and phrases typically used in everyday. -

- - )} -
-
-
-
-

- Sentiment vs Response Length -

- -

- The length of the responses is a good indicator of the amount of - detail the students have provided in their responses. The longer - the response, the more detail the student has provided. -

-

- The sentiment of the responses is also a good indicator of the - amount of detail the students have provided in their responses. - The more positive the sentiment, the more detail the student has - provided but sometimes the sentiment can be negative but the - response is still detailed. -

-

- Note: When the students are happy with there professor, the - responses are usually short and positive. When the students are - unhappy with there professor, the responses are usually long and - negative. -

-
-
-
- {loading_analysis ? ( - - ) : ( - <> - review_len_v_sentiment -

- When the students are happy with there professor, the - responses are usually short and positive. When the students are - unhappy with there professor, the responses are usually long and - negative. -

- - )} -
-
-
-
-

Word Cloud

- -

- A word cloud is a visual representation of the frequencies of - words in a given text or set of texts. It is typically created - by displaying each word in the text as a separate label in a - font size proportional to its frequency. The more frequently a - word appears in the text, the larger it is displayed in the word - cloud. -

-

- Word clouds can be useful for quickly visualizing the most - common words in a text and identifying trends or patterns. They - are often used in sentiment analysis as a way of summarizing the - overall sentiment of a text or group of texts. -

-
-
-
- {loading_analysis ? ( - - ) : ( - <> - wordcloud -

- The word cloud shows the most common words in the responses. The larger the word, the more common it is. -

- - )} +
+

+ {overall.percentage} % +

+

+ with {overall.value} responses from {overall.year} +

+
+
-
+ )) + )} +
+
+
+

+ Sentiment vs Polarity +

+ +

+ Sentiment refers to the emotional or attitudinal content of + a piece of text, such as a statement, review, or social + media post. It is the overall feeling or attitude expressed + in the text. +

+

+ Polarity, on the other hand, is a measure of the positivity + or negativity of a piece of text. It is typically calculated + by analyzing the words and phrases used in the text and + assigning a positive or negative score to each one. The + overall polarity of the text is then determined by summing + up these scores. +

+
-
-
-

- Most Common Words in Trigrams (3 words) -

- +
+ {loading_analysis ? ( + + ) : ( + <> + sentiment_v_pol

- A trigram is a group of three consecutive words in a given text. - Trigrams are often used in natural language processing and - linguistics to analyze the frequencies and patterns of words in a - text. + Polar words and phrases are usually associated with strong + or clearly defined sentiment, while non-polar refers to + words and phrases typically used in everyday.

-

- By analyzing the trigrams, we can see the most common phrases that - students use in their responses. -

- -
-
- {loading_analysis ? ( - <> - - - - - ) : ( - common_phrase.map((phrase) => ( -
-
-
-
- -
-
-

- {phrase.word} -

-

- repeated {phrase.frequency}. -

-
-
-
-
- )) - )} -
+ + )} +
+
+
+
+

+ Sentiment vs Response Length +

+ +

+ The length of the responses is a good indicator of the + amount of detail the students have provided in their + responses. The longer the response, the more detail the + student has provided. +

+

+ The sentiment of the responses is also a good indicator of + the amount of detail the students have provided in their + responses. The more positive the sentiment, the more detail + the student has provided but sometimes the sentiment can be + negative but the response is still detailed. +

+

+ Note: When the students are happy with there professor, the + responses are usually short and positive. When the students + are unhappy with there professor, the responses are usually + long and negative. +

+
-
-
-

- Most Common Words in Bigrams (2 words) -

- +
+ {loading_analysis ? ( + + ) : ( + <> + review_len_v_sentiment

- A bigram is a group of two consecutive words in a given text. - Bigrams are often used in natural language processing and - linguistics to analyze the frequencies and patterns of words in a - text. + When the students are happy with there professor, the + responses are usually short and positive. When the + students are unhappy with there professor, the responses + are usually long and negative.

+ + )} +
+
+
+
+

+ Word Cloud +

+ +

+ A word cloud is a visual representation of the frequencies + of words in a given text or set of texts. It is typically + created by displaying each word in the text as a separate + label in a font size proportional to its frequency. The more + frequently a word appears in the text, the larger it is + displayed in the word cloud. +

+

+ Word clouds can be useful for quickly visualizing the most + common words in a text and identifying trends or patterns. + They are often used in sentiment analysis as a way of + summarizing the overall sentiment of a text or group of + texts. +

+
+
+
+ {loading_analysis ? ( + + ) : ( + <> + wordcloud

- By analyzing the bigrams, we can see the most common phrases used - by students in their responses. + The word cloud shows the most common words in the + responses. The larger the word, the more common it is.

- -
-
- {loading_analysis ? ( - <> - - - - - - ) : ( - common_words.map((phrase) => ( -
-
-
-
- -
-
-

- {phrase.word} -

-

- repeated {phrase.frequency}. -

-
-
+ + )} +
+
+
+
+
+

+ Most Common Words in Trigrams (3 words) +

+ +

+ A trigram is a group of three consecutive words in a given + text. Trigrams are often used in natural language processing + and linguistics to analyze the frequencies and patterns of + words in a text. +

+

+ By analyzing the trigrams, we can see the most common phrases + that students use in their responses. +

+
+
+
+ {loading_analysis ? ( + <> + + + + + ) : ( + common_phrase.map((phrase) => ( +
+
+
+
+ +
+
+

+ {phrase.word} +

+

+ repeated {phrase.frequency}. +

- )) - )} -
-
-
-
-

- Most Common Words in Unigrams (1 word) -

- -

- A unigram is a single word in a given text. Unigrams are often - used in natural language processing and linguistics to analyze the - frequencies and patterns of words in a text. -

-

- By analyzing the unigrams, we can see the most common words used - by students in their responses. -

-
-
-
- {loading_analysis ? ( - <> - - - - - - ) : ( - common_word.map((phrase) => ( -
-
-
-
- -
-
-

- {phrase.word} -

-

- repeated {phrase.frequency}. -

-
-
+
+
+ )) + )} +
+
+
+
+

+ Most Common Words in Bigrams (2 words) +

+ +

+ A bigram is a group of two consecutive words in a given text. + Bigrams are often used in natural language processing and + linguistics to analyze the frequencies and patterns of words + in a text. +

+

+ By analyzing the bigrams, we can see the most common phrases + used by students in their responses. +

+
+
+
+ {loading_analysis ? ( + <> + + + + + + ) : ( + common_words.map((phrase) => ( +
+
+
+
+ +
+
+

+ {phrase.word} +

+

+ repeated {phrase.frequency}. +

- )) - )} -
-
- - ) : () - } +
+
+ )) + )} +
+
+
+
+

+ Most Common Words in Unigrams (1 word) +

+ +

+ A unigram is a single word in a given text. Unigrams are often + used in natural language processing and linguistics to analyze + the frequencies and patterns of words in a text. +

+

+ By analyzing the unigrams, we can see the most common words + used by students in their responses. +

+
+
+
+ {loading_analysis ? ( + <> + + + + + + ) : ( + common_word.map((phrase) => ( +
+
+
+
+ +
+
+

+ {phrase.word} +

+

+ repeated {phrase.frequency}. +

+
+
+
+
+ )) + )} +
+
+ + ) : ( + + )}
); }