SelectContextController

SelectContextController

Stimulus controller that handles the buttons for the various contexts.

Constructor

new SelectContextController()

Source:

Extends

  • Controller

Methods

connect()

Source:

Subscribe to the store.

contextClicked()

Source:

Sets the selected class on the clicked button and updates the store with the context clicked and the data for the context

contextSelected()

Source:

Use the button text to set the context.

disconnect()

Source:

Unsubscribe from the store

reconnect()

Source:

Handles a repeated Turbo visit to the dashboard page.

selectContextData()

Source:

Get the data for the selected context. Also set the value to be used on the x axis. If there is no data for the context then return a dummy object in an array.

storeUpdated()

Source:

Triggered by the store whenever any store data changes. In this case it checks for selectedDataVizData to be set and then sets production as the initially selected context button.