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
Name | Type | Description |
---|---|---|
analysisModel | AnalysisModel | An instance of the AnalysisModel class containing review analysis data. |
Defined in
Properties
analysisModel
• analysisModel: AnalysisModel
Defined in
starsStatisticalModel
• starsStatisticalModel: StarsStatisticalModel
Defined in
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
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
median
▸ median(): number
Calculates the median (middle value) of the star ratings.
Returns
number
The median of the star ratings.
Defined in
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.
Name | Type |
---|---|
interquartileRange | number |
lowerQuartile | number |
upperQuartile | number |
Defined in
standardDeviation
▸ standardDeviation(): number
Calculates the standard deviation of the star ratings.
Returns
number
The standard deviation of the star ratings.