Dashboard\Widgets\Dash
Overview
Dash widget for building dashboards
Extends
Implements
- Larajax\Contracts\ViewComponentInterface
Public Properties
public array $name
name for the dash
public array $code
code as a unique identifier for the dash
public array $reports
reports configuration
public bool $canCreateAndEdit
canCreateAndEdit the dash
public bool $manageUrl
manageUrl for updating the dash
public bool $showInterval
showInterval toggles the interval selector for date ranges
public string $defaultStart
defaultStart specifies default start keyword: today, week, month, quarter, year
public string $defaultEnd
defaultEnd specifies default end keyword: today, week, month, quarter, year
public string $defaultInterval
defaultInterval specifies default grouping interval: day, week, month, quarter, year
public string $defaultCompare
defaultCompare specifies default compare mode: none, prev-period, prev-year
public bool $canMakeDefault
public bool $canResetLayout
public bool $isCustom
isCustom is true when the reports configuration has come from a saved/custom data source.
public bool $isPersonalized
isPersonalized is true when the reports configuration has come from the user preferences instead of the shared dashboard definition.
Show inherited public properties
Inherited Public Properties
- $implement - extensions for this class. (defined in October\Rain\Extension\Extendable)
- $vars - is a list of variables to pass to the page. (defined in Backend\Classes\WidgetBase)
- $layout - to use for the view. (defined in Backend\Classes\WidgetBase)
- $suppressLayout - prevents the use of a layout. (defined in Backend\Classes\WidgetBase)
- $assetPath - specifies the relative path to the asset directory. (defined in Backend\Classes\WidgetBase)
- $assetUrlPath - specifies the public path to the asset directory. (defined in Backend\Classes\WidgetBase)
- $config - supplied. (defined in Backend\Classes\WidgetBase)
- $alias - defined for this widget. (defined in Backend\Classes\WidgetBase)
- $controller - object. (defined in Backend\Classes\WidgetBase)
Protected Properties
protected $defaultAlias
defaultAlias to identify this widget.
protected boolean $reportsDefined
reportsDefined determines if report definitions have been created.
protected array $allReports
allReports used in this dash.
See Also
protected ?array $allRows
allRows used in this dash.
protected array $reportWidgets
reportWidgets collection of all reports widgets used in this dash.
protected Backend\Classes\DashManager $dashManager
Show inherited protected properties
Inherited Protected Properties
- $extensionData - contains class reflection information, including behaviors. (defined in October\Rain\Extension\Extendable)
- $extendableStaticMethods - is a collection of static methods used by behaviors. (defined in October\Rain\Extension\Extendable)
- $viewPath - specifies a path to the views directory. (defined in Backend\Classes\WidgetBase)
- $layoutPath - specifies a path to the layout directory. (defined in Backend\Classes\WidgetBase)
- $viewPathGuessCache - remembers path guesses for performance. (defined in Backend\Classes\WidgetBase)
- $assets - Collection of assets to display in the layout. (defined in Backend\Classes\WidgetBase)
- $assetBundles - Collection of combined and prioritized assets. (defined in Backend\Classes\WidgetBase)
- $assetDefaults - is the default attributes for assets. (defined in Backend\Classes\WidgetBase)
- $configPath - specifies a path to the config directory. (defined in Backend\Classes\WidgetBase)
- $emitterSingleEventCollection - of events to be fired once only. (defined in Backend\Classes\WidgetBase)
- $emitterEventCollection - of all registered events. (defined in Backend\Classes\WidgetBase)
- $emitterEventSorted - collection. (defined in Backend\Classes\WidgetBase)
- $fatalError - stores the object used for a fatal error. (defined in Backend\Classes\WidgetBase)
Public Methods
public addReports()
public addReports(array $reports): October\Rain\Element\ElementHolder
addReports programmatically, used internally and for extensibility
public bindToController()
public bindToController(): void
bindToController ensure reports are defined and report widgets are registered so they can also be bound to the controller this allows their AJAX features to operate.
public getPropertyOptions()
public getPropertyOptions(string $property): array
getPropertyOptions returns options for multi-option properties (drop-downs, etc.)
public getReportWidget()
public getReportWidget(string $report): void
getReportWidget returns a specified report widget
public getReportWidgets()
public getReportWidgets(): array
getReportWidgets for the instance
public init()
public init(): void
init the widget, called by the constructor and free from its parameters.
public nameToId()
public nameToId($input $input): string
nameToId is a helper method to convert a report name to a valid ID attribute
public onCommitDashboard()
public onCommitDashboard(): void
onCommitDashboard handler
public onGetWidgetCustomData()
public onGetWidgetCustomData(): void
public onGetWidgetData()
public onGetWidgetData(): void
public onGetWidgetStaticContent()
public onGetWidgetStaticContent(): void
public onInspectableGetOptions()
public onInspectableGetOptions(): void
public onResetDashboard()
public onResetDashboard(): void
onResetDashboard handler
public onRunCustomWidgetHandler()
public onRunCustomWidgetHandler(): void
onRunCustomWidgetHandler handler
public onRunDataSourceHandler()
public onRunDataSourceHandler(): void
onRunDataSourceHandler handler
public onSaveDashboard()
public onSaveDashboard(): void
onSaveDashboard handler
public removeField()
public removeField($name): bool
removeField programmatically
public removeReport()
public removeReport($name): bool
removeReport programmatically
public render()
public render(): void
render this widget along with its collection of report widgets.
Inherited Public Methods
- __call() - calls an undefined local method. (defined in October\Rain\Extension\Extendable)
- __callStatic() - calls an undefined static method. (defined in October\Rain\Extension\Extendable)
- __construct() - the widget. (defined in Backend\Classes\WidgetBase)
- __get() - an undefined property. (defined in October\Rain\Extension\Extendable)
- __set() - an undefined property. (defined in October\Rain\Extension\Extendable)
- __sleep() - prepare the object for serialization. (defined in October\Rain\Extension\Extendable)
- __wakeup() - when a model is being unserialized, check if it needs to be booted. (defined in October\Rain\Extension\Extendable)
- addCss() - includes a StyleSheet asset to the asset list. (defined in Backend\Classes\WidgetBase)
- addCssBundle() - includes a CSS asset to the bundled combiner pipeline. (defined in Backend\Classes\WidgetBase)
- addDynamicMethod() - programmatically adds a method to the extendable class. (defined in October\Rain\Extension\Extendable)
- addDynamicProperty() - programmatically adds a property to the extendable class. (defined in October\Rain\Extension\Extendable)
- addJs() - includes a JavaScript asset to the asset list. (defined in Backend\Classes\WidgetBase)
- addJsBundle() - includes a JS asset to the bundled combiner pipeline. (defined in Backend\Classes\WidgetBase)
- addRss() - adds an RSS link asset to the asset list. Call $this->makeAssets(). (defined in Backend\Classes\WidgetBase)
- addViewPath() - prepends a path on the available view path locations. (defined in Backend\Classes\WidgetBase)
- asExtension() - is short hand for
getClassExtension()method, except takes the short. (defined in October\Rain\Extension\Extendable) - bindEvent() - creates a new event binding. (defined in Backend\Classes\WidgetBase)
- bindEventOnce() - creates a new event binding that fires once only. (defined in Backend\Classes\WidgetBase)
- clearExtendedClasses() - (defined in October\Rain\Extension\Extendable)
- combineAssets() - runs asset paths through the Asset Combiner. (defined in Backend\Classes\WidgetBase)
- createIn() - builds a component instance against the given controller, (defined in Backend\Classes\WidgetBase)
- extend() - this class with a closure. (defined in October\Rain\Extension\Extendable)
- extendClassWith() - dynamically extends a class with a specified behavior. (defined in October\Rain\Extension\Extendable)
- extendableCall() - magic method for
__call(). (defined in October\Rain\Extension\Extendable) - extendableCallStatic() - magic method for
__callStatic(). (defined in October\Rain\Extension\Extendable) - extendableConstruct() - should be called as part of the constructor. (defined in October\Rain\Extension\Extendable)
- extendableDestruct() - should be called when serializing the object. (defined in October\Rain\Extension\Extendable)
- extendableExtendCallback() - is a helper method for
::extend()static method. (defined in October\Rain\Extension\Extendable) - extendableGet() - magic method for
__get(). (defined in October\Rain\Extension\Extendable) - extendableSet() - magic method for
__set(). (defined in October\Rain\Extension\Extendable) - fireEvent() - and call the listeners. (defined in Backend\Classes\WidgetBase)
- fireSystemEvent() - fires a combination of local and global events. The first segment is removed. (defined in Backend\Classes\WidgetBase)
- fireViewEvent() - is a special event function used for extending within view files, (defined in Backend\Classes\WidgetBase)
- flushAssets() - disables the use, and subsequent broadcast, of assets. This is useful. (defined in Backend\Classes\WidgetBase)
- getAssetPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\WidgetBase)
- getAssetPaths() - returns an array of all registered asset paths. (defined in Backend\Classes\WidgetBase)
- getAssetPathsWithAttributes() - returns an array of all registered asset paths. (defined in Backend\Classes\WidgetBase)
- getClassExtension() - returns a behavior object from an extendable class, example:. (defined in October\Rain\Extension\Extendable)
- getClassMethodAsReflector() - (defined in October\Rain\Extension\Extendable)
- getClassMethods() - gets a list of class methods, extension equivalent of get_class_methods(). (defined in October\Rain\Extension\Extendable)
- getConfig() - is a safe accessor for configuration values. (defined in Backend\Classes\WidgetBase)
- getConfigPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\WidgetBase)
- getController() - returns the controller using this widget. (defined in Backend\Classes\WidgetBase)
- getDynamicProperties() - returns all dynamic properties and their values. (defined in October\Rain\Extension\Extendable)
- getEventHandler() - returns a fully qualified event handler name for this widget. (defined in Backend\Classes\WidgetBase)
- getFatalError() - returns error message. (defined in Backend\Classes\WidgetBase)
- getId() - returns a unique ID for this widget. Useful in creating HTML markup. (defined in Backend\Classes\WidgetBase)
- getViewPath() - locates a file based on its definition. The file name can be prefixed. (defined in Backend\Classes\WidgetBase)
- getViewPaths() - returns the active view path locations. (defined in Backend\Classes\WidgetBase)
- getWidget() - (defined in Backend\Classes\WidgetBase)
- guessConfigPath() - guesses the package path for the called class. (defined in Backend\Classes\WidgetBase)
- guessConfigPathFrom() - guesses the package path from a specified class. (defined in Backend\Classes\WidgetBase)
- guessViewPath() - guesses the package path for the called class. (defined in Backend\Classes\WidgetBase)
- guessViewPathFrom() - guesses the package path from a specified class, including. (defined in Backend\Classes\WidgetBase)
- handleError() - sets standard page variables in the case of a controller error. (defined in Backend\Classes\WidgetBase)
- hasAssetsDefined() - returns true if assets any have been added. (defined in Backend\Classes\WidgetBase)
- hasFatalError() - returns true if a fatal error has been set. (defined in Backend\Classes\WidgetBase)
- implementClassWith() - will implement an extension using non-interference and should. (defined in October\Rain\Extension\Extendable)
- isClassExtendedWith() - checks if extendable class is extended with a behavior object. (defined in October\Rain\Extension\Extendable)
- isClassInstanceOf() - checks if the class implements the supplied interface methods. (defined in October\Rain\Extension\Extendable)
- make() - builds the component and binds it to the current controller. (defined in Backend\Classes\WidgetBase)
- makeAssets() - outputs
<link>and<script>tags to load assets previously added with addJs and addCss method calls. (defined in Backend\Classes\WidgetBase) - makeConfig() - reads the contents of the supplied file and applies it to this object. (defined in Backend\Classes\WidgetBase)
- makeConfigFromArray() - makes a config object from an array, making the first. (defined in Backend\Classes\WidgetBase)
- makeFileContents() - includes a file path using output buffering. (defined in Backend\Classes\WidgetBase)
- makeFormWidget() - object with the supplied form field and widget configuration. (defined in Backend\Classes\WidgetBase)
- makeLayout() - renders a layout. (defined in Backend\Classes\WidgetBase)
- makeLayoutPartial() - renders a layout partial. (defined in Backend\Classes\WidgetBase)
- makePartial() - renders a partial file contents located in the views folder. (defined in Backend\Classes\WidgetBase)
- makeView() - loads a view with the name specified. Applies layout if its name is provided. (defined in Backend\Classes\WidgetBase)
- makeViewContent() - renders supplied contents inside a layout. (defined in Backend\Classes\WidgetBase)
- makeWidget() - object with the supplied configuration file. (defined in Backend\Classes\WidgetBase)
- mergeConfig() - merges two configuration sources, either prepared or not, and returns. (defined in Backend\Classes\WidgetBase)
- methodExists() - checks if a method exists, extension equivalent of method_exists(). (defined in October\Rain\Extension\Extendable)
- propertyExists() - checks if a property exists, extension equivalent of
property_exists(). (defined in October\Rain\Extension\Extendable) - resetSession() - Resets all session data related to this widget. (defined in Backend\Classes\WidgetBase)
- unbindEvent() - destroys an event binding. (defined in Backend\Classes\WidgetBase)
Protected Methods
protected addReportsFromCustomDataSource()
protected addReportsFromCustomDataSource($reports): void
addReportsFromCustomDataSource extracts the reports from a custom data source
protected applyIntervalDefaultsFromDatabase()
protected applyIntervalDefaultsFromDatabase($savedDash): void
applyIntervalDefaultsFromDatabase overrides the widget's interval defaults with values managed by the user via the dashboard form, falling back to the YAML/property defaults when a column is empty.
protected bindPendingReportWidget()
protected bindPendingReportWidget(): void
bindPendingReportWidget binds a report widget that exists in the browser's unsaved dashboard state but not in the persisted definition, using the widget_config posted via the widget's data-request-data scope. Enables AJAX handlers on legacy report widgets prior to saving the dashboard.
protected cleanDefinitionForSave()
protected cleanDefinitionForSave($definition): void
cleanDefinitionForSave removes meta data from the definition since it is not needed for storage
protected defineDashReports()
protected defineDashReports(): void
defineDashReports creates a flat array of dash reports from the configuration and slots reports in to their respective tabs
protected findDimension()
protected findDimension(
$dataSource,
$dimensionCode,
$strict
): Dashboard\Classes\ReportDimension|null
protected findMetric()
protected findMetric(
$dataSource,
$dimension,
$metricCode
): Dashboard\Classes\ReportMetric
protected getConfiguredReportWidget()
protected getConfiguredReportWidget(): void
protected getRequestedDataSource()
protected getRequestedDataSource(
$widgetConfig
): Dashboard\Classes\ReportDataSourceBase
protected getWidgetPropertiesForBrowser()
protected getWidgetPropertiesForBrowser($widget): array
protected initReportWidgetsConcern()
protected initReportWidgetsConcern(): void
protected isReportWidget()
protected isReportWidget($reportType): bool
isReportWidget checks the input resolves to a class extending ReportWidgetBase or VueReportWidgetBase; runs the base-class check for both aliases and fully-qualified names so posted class names cannot skip verification just by containing a backslash
protected isVueReportWidget()
protected isVueReportWidget($reportType): bool
isVueReportWidget returns true if the widget is a vue report widget
protected listAllMetrics()
protected listAllMetrics($dataSource, $dimensionCode): array
protected loadAssets()
protected loadAssets(): void
loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.
protected loadInitialState()
protected loadInitialState(): void
loadInitialState for the dashboards
protected makeDashReport()
protected makeDashReport($name, $config = ]): [Dashboard\Classes\DashReport
makeDashReport creates a dash report object from name and configuration
protected makeDashReportWidget()
protected makeDashReportWidget($report): void
makeDashReportWidget object from a dash report object
protected makeDataSource()
protected makeDataSource(
$dataSourceClass
): Dashboard\Classes\ReportDataSourceBase
protected prepareVars()
protected prepareVars(): void
prepareVars prepares the dash data
protected processDashWidgetReports()
protected processDashWidgetReports($reports): void
processDashWidgetReports processes dash widgets from flexible source (yaml or custom)
protected processDashWidgetReportsFromCustomData()
protected processDashWidgetReportsFromCustomData($reports): void
processDashWidgetReportsFromCustom locates dash widgets from a custom data source
protected processDashWidgetReportsFromYaml()
protected processDashWidgetReportsFromYaml($reports): void
processDashWidgetReports will mutate reports types that are registered as widgets, convert their type to 'widget' and internally allocate the widget object
protected processOverrideFromDatabase()
protected processOverrideFromDatabase(): void
protected processPermissionCheck()
protected processPermissionCheck($reports): void
processPermissionCheck check if user has permissions to show the report and removes it if permission is denied
protected processReportRowWidgetMetrics()
protected processReportRowWidgetMetrics($metrics): void
protected processReportRows()
protected processReportRows($reports): void
protected translateRows()
protected translateRows($rows): array|null
translateRows resolves localizable strings inside the dashboard rows structure just before it is emitted to the Vue state. This is the edge where YAML/saved config flows into the frontend.
Show inherited protected methods
Inherited Protected Methods
- combineBundledAssets() - spins over every bundle definition and combines them to an asset. (defined in Backend\Classes\WidgetBase)
- emitterEventSortEvents() - sorts the listeners for a given event by priority. (defined in Backend\Classes\WidgetBase)
- extendableIsAccessible() - checks if a property is accessible, property equivalent. (defined in October\Rain\Extension\Extendable)
- extensionExtractImplements() - will return classes to implement. (defined in October\Rain\Extension\Extendable)
- extensionExtractMethods() - extracts the available methods from a behavior and adds it. (defined in October\Rain\Extension\Extendable)
- fillFromConfig() - transfers config values stored inside the $config property directly. (defined in Backend\Classes\WidgetBase)
- getAssetEntryBuildPath() - is an internal marker that returns the asset path. (defined in Backend\Classes\WidgetBase)
- getAssetScheme() - is an internal helper to get the asset scheme. (defined in Backend\Classes\WidgetBase)
- getConfigValueFrom() - will apply the config getter convention. (defined in Backend\Classes\WidgetBase)
- getExtendableMethodFromDynamicMethods() - (defined in October\Rain\Extension\Extendable)
- getExtendableMethodFromExtensions() - (defined in October\Rain\Extension\Extendable)
- getLocalPath() - converts a relative path to a local path. (defined in Backend\Classes\WidgetBase)
- getSession() - Retrieves a widget related key/value pair from session data. (defined in Backend\Classes\WidgetBase)
- handleViewException() - handles a view exception. (defined in Backend\Classes\WidgetBase)
- makeSessionId() - Returns a unique session identifier for this widget and controller action. (defined in Backend\Classes\WidgetBase)
- processAssetAttributes() - (defined in Backend\Classes\WidgetBase)
- putSession() - Saves a widget related key/value pair in to session data. (defined in Backend\Classes\WidgetBase)
- readSessionStore() - Reads the widget session store, preferring JSON and falling back to. (defined in Backend\Classes\WidgetBase)
- removeDuplicateAssets() - removes duplicate and global assets from the entire collection. (defined in Backend\Classes\WidgetBase)
- renderAssetAttributes() - takes an asset definition and returns the necessary HTML output. (defined in Backend\Classes\WidgetBase)