The Aggregations Framework is responsible for presenting a user-friendly means of visualizing potential filters based on the supplied data within the user interface (UI). This aspect of the framework primarily focuses on collecting data from the backend, ensuring it is properly typed, and subsequently displaying it with interactive features. These interactive elements empower users to effortlessly filter the results showcased on the screen, thus enhancing their overall experience.
AggTypes
Name | Value |
---|
TERM | 'term' |
BOOL | 'bool' |
DATE_HISTOGRAM | 'date_histogram' |
HISTOGRAM | 'histogram' |
BROWSE | 'browse' |
DATE_RANGE | 'date_range' |
RANGE | 'range' |
SLIDER | 'slider' |
AggBuilder
This functional component, as implied by its name, serves as the component intended for use in views. Its primary function is to interpret, construct, and present aggregation objects that are transmitted from the backend. It plays a crucial role in rendering and displaying these aggregations within the user interface, making the data provided by the backend more accessible and comprehensible to the end-users.
Each Aggregation Type has its own Functional Component implementation at src/framework/aggs/aggs-components that is used by the builder to construct the UI element to be displayed and handles its events (selection, toggle, slide, etc).
AggUtils
This typescript file is used to provide interfaces and methods that are required by the AggBuilder, some of them are:
AggAction Enum
Name | Value |
---|
ADD | - |
REMOVE | - |
NEGATE | - |
onSelectionPros Interface
Property | Type | Description |
---|
id | string | Identifier. |
value | any | Value. |
action | AggAction | Aggregation action (Enum). |
AggSelection Interface
Property | Type | Description |
---|
id | string | Identifier. |
values | any[] | Array of values. |
negated | any[] | Array of negated values. |
level | number | Level. |
InnerSelection Class
Property | Type | Default | Description |
---|
level | number | 0 | Level. |
negated | Set<any> | - | Set of negated values. |
values | Set<any> | - | Set of values. |
AggProps Interface
Property | Type | Description |
---|
agg | Aggregation | Aggregation data. |
isSelected | (id: string, entry_key: any) => boolean | Function to check if an entry is selected. |
handleEvent | (props: onSelectionPros) => void | Function to handle selection events. |
Aggregation Interface
Property | Type | Description |
---|
id | string | Identifier. |
type | AggsTypes | Type of aggregation (Enum). |
display_name | string | Display name. |
expanded | boolean | Expanded state. |
entries | AggData[] | Array of aggregation data. |
AggData Interface
Property | Type | Description |
---|
key | any | Key. |
count | number | Count. |
display | string | Display value. |
hide_count | boolean | Flag to hide count. |
translate | string | Translation information. |
aggs | [Aggregation] | Array of aggregations (nested). |