Skip to main content

Class: CategoricalViewer

CategoricalViewer is a class for visualizing categorical review analysis data. It processes the analysis data and formats it for use with Chart.js.

Constructors​

constructor​

• new CategoricalViewer(analysisModel)

Creates a new CategoricalViewer instance.

Parameters​

NameTypeDescription
analysisModelAnalysisModelThe analysis model containing review data.

Defined in​

components/CategoricalViewer.tsx:42

Properties​

analysisModel​

• analysisModel: AnalysisModel

Defined in​

components/CategoricalViewer.tsx:36

Methods​

aggregateData​

▸ aggregateData(): CategoryData

Aggregates positive and negative category counts from the analysis model.

Returns​

CategoryData

  • The aggregated category data.

Defined in​

components/CategoricalViewer.tsx:79


convertToChartJSData​

▸ convertToChartJSData(categoryData): ChartJSData

Converts the aggregated category data into the format required by Chart.js.

Parameters​

NameTypeDescription
categoryDataCategoryDataThe aggregated category data.

Returns​

ChartJSData

  • The formatted data for Chart.js.

Defined in​

components/CategoricalViewer.tsx:112


getOptionsAndData​

▸ getOptionsAndData(): Object

Returns the Chart.js options and formatted data.

Returns​

Object

  • The options and data for Chart.js.
NameType
dataChartJSData
optionsany

Defined in​

components/CategoricalViewer.tsx:50