Skip to main content

Class: StarsViewer

A class for visualizing the review analysis data in a tabular format.

Constructors​

constructor​

• new StarsViewer(analysisModel)

Creates a new StarsViewer instance.

Parameters​

NameTypeDescription
analysisModelAnalysisModelAn instance of the AnalysisModel class containing review analysis data.

Defined in​

components/StarsViewer.tsx:17

Properties​

analysisModel​

• analysisModel: AnalysisModel

Defined in​

components/StarsViewer.tsx:9


starsStatisticalModel​

• starsStatisticalModel: StarsStatisticalModel

Defined in​

components/StarsViewer.tsx:10

Methods​

createTable​

▸ createTable(): Element

Creates a table element for displaying the statistical data of the star ratings.

Returns​

Element

A JSX.Element representing a table with statistical data.

Defined in​

components/StarsViewer.tsx:128


getData​

▸ getData(): StarsStatisticalModel

Retrieves the StarsStatisticalModel instance with calculated statistical data.

Returns​

StarsStatisticalModel

A StarsStatisticalModel instance.

Defined in​

components/StarsViewer.tsx:110


mean​

▸ mean(): number

Calculates the mean (average) of the star ratings.

Returns​

number

The mean of the star ratings.

Defined in​

components/StarsViewer.tsx:27


median​

▸ median(): number

Calculates the median (middle value) of the star ratings.

Returns​

number

The median of the star ratings.

Defined in​

components/StarsViewer.tsx:40


quartiles​

▸ quartiles(): Object

Calculates the quartiles of the star ratings.

Returns​

Object

An object containing the lower quartile (Q1), upper quartile (Q3), and interquartile range (IQR) of the star ratings.

NameType
interquartileRangenumber
lowerQuartilenumber
upperQuartilenumber

Defined in​

components/StarsViewer.tsx:74


standardDeviation​

▸ standardDeviation(): number

Calculates the standard deviation of the star ratings.

Returns​

number

The standard deviation of the star ratings.

Defined in​

components/StarsViewer.tsx:56