Constructor
new CoreVitalsSummaryController()
Extends
- Controller
Methods
alertColor()
Return the color depending on the time in relation to the KPI
calculateMeanCoreVital()
connect()
Subscribe to the store.
contextData()
Get the data within the 75th percentile of all current results for the given context
coreVitalsGroupingCount()
Get the total count of results plus the number of results within each context.
dataForStackedBarChart()
Get the percentage for each context. The cumulative value informs the data viz at which x axis value the bar should start at. The bar class modifier is used in the CSS to change the bar colour
destroySingleStackedBarDisplay()
Destroy stacked bar charts for each context and set them to undefined so they will be created from scratch again
isDataVizEmpty()
Checks if the visualisation has been created yet
loadSummary()
Shows the loading indicator for the mean core vital values and hides the stacked bar charts and then destroys them so they can be created from scratch again when the new data is fetched from the database.
reconnect()
Handles a repeated Turbo visit to the dashboard page.
removeAlertColors()
Remove all of the color classes for the given target
resize()
Handles a resize of the screen by width but ignores height changes. Deletes the current visualisation and the instances of the stacked bar charts so they will be created from scratch again.
singleStackedBar()
Creates a new instance of the SingleStackedBar class if not created, otherwise returns the instance of the class
singleStackedBarDisplay()
Changes the visibility of the stacked bar charts to either show the data vis or a loading indicator
storeUpdated()
Triggered by the store whenever any store data changes.
updateContextDistribution()
Update the datavisualisation showing the split of good, okay, bad for the context
updateMeanCoreVitalsValue()
Sets the text for the mean core vital for the given context and alters to color to indicate whether it's good, needs improvement or poor.
updateSummary()
Update the summary details for the mean values and stacked bar charts