Skip to content

DashboardWidget

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.WebApp/Client/app/models/dashboard/dashboard-widget.model.ts (line 11)

Part of: Pams

DashboardWidget manages the state and data transformations for a dashboard widget. It synchronizes labels, responds to data-source and color changes, builds schemas, combines selections, and refreshes chart and pie data.

Methods

MethodSignatureReturns
syncLabelssyncLabels(source: Array<string>)void
DataSourceChangedDataSourceChanged()void
ChangeColorChangeColor(serial: string, value: string)void
BuildSchemaBuildSchema()void
CombaineSelectionCombaineSelection()void
updateChartsupdateCharts()void
createPieDatacreatePieData(dataSource: undefined, chart: undefined)void

Properties

PropertyType
IDnumber
PrimaryIDnumber
DisplayIDstring
Captionstring
DatasourceInitany[]
Datasourceany
OrginalDatasourceany
MasterFilterboolean
AcceptFilterany[]
chartsany
FilterStringstring
FilterSelectionTypestring
ChartSeriseSelectionTypestring
CurrentDataany
tableTable
viewView
isTableboolean
Operationsany[]
DataOperationsDashboardDataFields[]
IsSelectedboolean
isNestedboolean
Stackedboolean
ExpBarboolean
selectedArgumentArray<DimensionField>
selectedSeriseArray<DimensionField>
AutoColoredMeasureboolean
ColorschemaListArray<schema>
colorCounternumber
colorPlatteany
ItemGridStackItem
WidgetTypeDashboardWidgetTypeEnum
GridStackMainWidthnumber
ColorContextany
ColorBehaviorboolean
widgetLabelsArray<{label:string ,priority:number}>

Where it refuses work

  • DashboardWidget stops the work with an early return when inx == all_Fields.length.

Diagram

mermaid
graph LR
  DataSource[Data Source] --> Changed[DataSourceChanged]
  Changed --> Schema[BuildSchema]
  Schema --> Selection[CombaineSelection]
  Selection --> Charts[updateCharts]
  Charts --> PieData[createPieData]
  Labels[syncLabels] --> Charts
  Color[ChangeColor] --> Charts

Usage

ts
import { DashboardWidget } from './models/dashboard/dashboard-widget.model';

const widget = new DashboardWidget();

widget.DataSourceChanged();
widget.syncLabels();
widget.ChangeColor();
widget.BuildSchema();
widget.CombaineSelection();
widget.updateCharts();
widget.createPieData();

AI Coding Instructions

  • Keep chart refresh logic within updateCharts() so data updates follow a single path.
  • Call BuildSchema() after a data-source change when widget fields or chart configuration must be rebuilt.
  • Keep label updates in syncLabels() rather than changing chart labels directly in calling code.
  • Preserve the existing CombaineSelection() method name when calling or modifying the class.

Relationships

  • IMPORTS → DashboardWidgetTypeEnum
  • IMPORTS → Table
  • IMPORTS → View
  • IMPORTS → platte
  • IMPORTS → Query
  • IMPORTS → DashboardDataFields
  • IMPORTS → DataTypeEnum
  • IMPORTS → OperationTypeEnum
  • IMPORTS → QueryTypeEnum
  • IMPORTS → chartType
  • IMPORTS → DimensionField
  • IMPORTS → DateGroupEnum

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • DashboardGroupPams/Web/Pams.WebApp/Client/app/models/dashboard/dashboard-group.model.ts:2

Was this page helpful?

Download as PDF