@luzmo/embed 7.5.0-es2021 → 8.0.0-es2021
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -0
- package/README.md +2 -2
- package/index.cjs +1589 -143
- package/index.js +1583 -129
- package/index.rn.cjs +1375 -0
- package/index.rn.js +1305 -0
- package/index.shared.cjs +1486 -0
- package/index.shared.js +1412 -0
- package/luzmo-embed.min.js +197 -96
- package/package.json +22 -2
- package/src/index.common.d.ts +18 -0
- package/src/index.d.ts +3 -3
- package/src/index.rn.d.ts +1 -0
- package/src/index.shared.d.ts +2 -0
- package/src/lib/dashboard/dashboard-base.d.ts +5 -1
- package/src/lib/iq-components/luzmo-iq-answer.d.ts +1 -2
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +1 -1
- package/src/lib/shared/constants/class-constants.d.ts +1 -0
- package/src/lib/shared/helpers/browser-check.d.ts +2 -0
- package/src/lib/shared/helpers/default-parameters.d.ts +2 -0
- package/src/lib/shared/helpers/error.d.ts +5 -0
- package/src/lib/shared/helpers/extents.d.ts +7 -0
- package/src/lib/shared/helpers/get-loader.d.ts +5 -0
- package/src/lib/shared/helpers/iframe-url.d.ts +1 -0
- package/src/lib/shared/helpers/promise-dispatch.d.ts +3 -0
- package/src/lib/shared/helpers/remote-federation.d.ts +56 -0
- package/src/lib/shared/helpers/set-selected-data-utils.d.ts +7 -0
- package/src/lib/shared/helpers/styles.d.ts +8 -0
- package/src/lib/shared/helpers/translations.d.ts +24 -0
- package/src/lib/shared/helpers/update-iframe-url.d.ts +1 -0
- package/src/lib/shared/helpers/utils.d.ts +27 -0
- package/src/lib/shared/methods/export-dashboard.d.ts +5 -0
- package/src/lib/shared/methods/get-accessible-dashboards.d.ts +3 -0
- package/src/lib/shared/methods/get-dashboard-context.d.ts +3 -0
- package/src/lib/shared/methods/get-data.d.ts +3 -0
- package/src/lib/shared/methods/get-filters.d.ts +3 -0
- package/src/lib/shared/methods/get-insights.d.ts +3 -0
- package/src/lib/shared/methods/index.d.ts +13 -0
- package/src/lib/shared/methods/refresh-data.d.ts +2 -0
- package/src/lib/shared/methods/reload-dashboard.d.ts +2 -0
- package/src/lib/shared/methods/send-export-email.d.ts +4 -0
- package/src/lib/shared/methods/set-authorization.d.ts +2 -0
- package/src/lib/shared/methods/set-edit-mode.d.ts +3 -0
- package/src/lib/shared/methods/set-preview.d.ts +3 -0
- package/src/lib/shared/methods/set-selected-data.d.ts +4 -0
- package/src/lib/shared/models/common.model.d.ts +105 -0
- package/src/lib/shared/models/dashboard-context.model.d.ts +50 -0
- package/src/lib/shared/models/dashboard.model.d.ts +59 -0
- package/src/lib/shared/models/embed-error-event.model.d.ts +17 -0
- package/src/lib/shared/models/events.model.d.ts +94 -0
- package/src/lib/shared/models/filter-input.model.d.ts +101 -0
- package/src/lib/shared/models/filter-output.model.d.ts +17 -0
- package/src/lib/shared/models/filters.model.d.ts +26 -0
- package/src/lib/shared/models/index.d.ts +12 -0
- package/src/lib/shared/models/styles.model.d.ts +32 -0
- package/src/lib/shared/models/translation.model.d.ts +2 -0
- package/src/lib/shared/models/viz-item-post-message.model.d.ts +56 -0
- package/src/lib/shared/models/viz-item.model.d.ts +8 -0
- package/src/lib/shared/models/viz-items/areachart.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/barchart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/choroplethmap.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/circlepack.model.d.ts +2 -0
- package/src/lib/shared/models/viz-items/columnchart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/datetime.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/donutchart.model.d.ts +2 -0
- package/src/lib/shared/models/viz-items/dropdownfilter.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/index.d.ts +36 -0
- package/src/lib/shared/models/viz-items/linechart.model.d.ts +36 -0
- package/src/lib/shared/models/viz-items/parallelcoordinatesplot.model.d.ts +14 -0
- package/src/lib/shared/models/viz-items/piechart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/scatterplot.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/slicer.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/slider.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/stripplot.model.d.ts +15 -0
- package/src/lib/shared/models/viz-items/sunburst.model.d.ts +14 -0
- package/src/lib/shared/models/viz-items/treemap.model.d.ts +24 -0
- package/src/lib/shared/service/calculate-dimensions.d.ts +1 -0
- package/src/lib/shared/service/extend-and-validate.d.ts +2 -0
- package/src/lib/{helper → utils}/embed-error.utils.d.ts +1 -1
- package/src/lib/viz-item/viz-item.base.d.ts +2 -2
- /package/src/lib/{helper → utils}/event-bus-handler.d.ts +0 -0
- /package/src/lib/{helper → utils}/json-schema-utils.d.ts +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { FilterOrigin } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { DashboardDimensions, ScreenMode } from './common.model';
|
|
3
|
+
import { DashboardContext, VizItemContext } from './dashboard-context.model';
|
|
4
|
+
import type { DashboardFilterOutput } from './filter-output.model';
|
|
5
|
+
interface EventDataBase {
|
|
6
|
+
dashboardId?: string;
|
|
7
|
+
dashboardSlug?: string;
|
|
8
|
+
integrationId?: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
screenMode?: ScreenMode;
|
|
12
|
+
type?: string;
|
|
13
|
+
}
|
|
14
|
+
interface LoadEventData extends EventDataBase {
|
|
15
|
+
type: 'load';
|
|
16
|
+
dimensions: DashboardDimensions;
|
|
17
|
+
}
|
|
18
|
+
interface ChangedFiltersEventData extends EventDataBase {
|
|
19
|
+
type: 'changedFilters';
|
|
20
|
+
changed: DashboardFilterOutput;
|
|
21
|
+
filters: DashboardFilterOutput;
|
|
22
|
+
itemId: string;
|
|
23
|
+
origin: FilterOrigin;
|
|
24
|
+
}
|
|
25
|
+
interface ContextChangedEventData extends EventDataBase {
|
|
26
|
+
type: 'contextChanged';
|
|
27
|
+
context?: DashboardContext;
|
|
28
|
+
}
|
|
29
|
+
interface VizItemContextChangedEventData {
|
|
30
|
+
type: 'contextChanged';
|
|
31
|
+
context: VizItemContext;
|
|
32
|
+
}
|
|
33
|
+
interface ItemsRenderedEventData extends EventDataBase {
|
|
34
|
+
type: 'chartsRendered';
|
|
35
|
+
}
|
|
36
|
+
interface CustomEventData extends EventDataBase {
|
|
37
|
+
itemId: string;
|
|
38
|
+
data: {
|
|
39
|
+
event: string;
|
|
40
|
+
language: string;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface LoadEvent {
|
|
45
|
+
data: LoadEventData;
|
|
46
|
+
}
|
|
47
|
+
export interface ChangedFiltersEvent {
|
|
48
|
+
data: ChangedFiltersEventData;
|
|
49
|
+
}
|
|
50
|
+
export interface ContextChangedEvent {
|
|
51
|
+
data: ContextChangedEventData;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Emitted by `luzmo-embed-viz-item` whenever a flex chart's live context (slots,
|
|
55
|
+
* options, filters) changes, so context-aware embeds (e.g. the Luzmo IQ chat
|
|
56
|
+
* component) can re-read the chart without polling.
|
|
57
|
+
*/
|
|
58
|
+
export interface VizItemContextChangedEvent {
|
|
59
|
+
data: VizItemContextChangedEventData;
|
|
60
|
+
}
|
|
61
|
+
export interface CustomEvent {
|
|
62
|
+
data: CustomEventData;
|
|
63
|
+
}
|
|
64
|
+
export interface ItemsRenderedEvent {
|
|
65
|
+
data: ItemsRenderedEventData;
|
|
66
|
+
}
|
|
67
|
+
interface ExportedEventData extends EventDataBase {
|
|
68
|
+
type: 'exported';
|
|
69
|
+
}
|
|
70
|
+
export interface ExportedEvent {
|
|
71
|
+
data: ExportedEventData;
|
|
72
|
+
}
|
|
73
|
+
type DashboardAction = 'addColumnToSlot' | 'addFormulaToSlot' | 'removeColumnFromSlot' | 'removeItem' | 'addItem' | 'cloneItem' | 'addItemFilter' | 'updateItemFilter' | 'removeItemFilter' | 'addDashboardFilter' | 'removeDashboardFilter' | 'updateDashboardFilter' | 'addParameter' | 'updateParameter' | 'removeParameter' | 'openDatasetDetail' | 'linkDatasets' | 'authorizationExpired';
|
|
74
|
+
interface DashboardActionEventData extends EventDataBase {
|
|
75
|
+
type: 'dashboardAction';
|
|
76
|
+
action: DashboardAction;
|
|
77
|
+
dropType?: 'add' | 'replace';
|
|
78
|
+
item?: {
|
|
79
|
+
id: string;
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
column?: {
|
|
83
|
+
id: string;
|
|
84
|
+
name: {
|
|
85
|
+
[k: string]: string | void;
|
|
86
|
+
};
|
|
87
|
+
type: string;
|
|
88
|
+
datasetId: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface DashboardActionEvent {
|
|
92
|
+
data: DashboardActionEventData;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { FilterGroup, FilterOperators, ItemFilter, ItemFilterRangeValue, ItemFilterRelativeDate, ItemFilterScalar } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
export type FilterInputCondition = FilterOperators | Uppercase<FilterOperators>;
|
|
3
|
+
export type FilterInputParameterType = 'hierarchy' | 'numeric' | 'datetime' | 'hierarchy[]' | 'numeric[]' | 'datetime[]';
|
|
4
|
+
export type FilterInputParameterDefinition<Value> = {
|
|
5
|
+
parameter: string;
|
|
6
|
+
type: FilterInputParameterType;
|
|
7
|
+
value: Value;
|
|
8
|
+
};
|
|
9
|
+
type FilterInputReferenceBase = {
|
|
10
|
+
datasetId: string;
|
|
11
|
+
level?: number;
|
|
12
|
+
discretization?: FilterInputDiscretization;
|
|
13
|
+
aggregation?: FilterInputAggregation;
|
|
14
|
+
unnest?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type FilterInputReference = (FilterInputReferenceBase & {
|
|
17
|
+
columnId: string;
|
|
18
|
+
formulaId?: never;
|
|
19
|
+
formula?: never;
|
|
20
|
+
columnExpression?: never;
|
|
21
|
+
}) | (FilterInputReferenceBase & {
|
|
22
|
+
formulaId: string;
|
|
23
|
+
columnId?: never;
|
|
24
|
+
formula?: never;
|
|
25
|
+
columnExpression?: never;
|
|
26
|
+
}) | (FilterInputReferenceBase & {
|
|
27
|
+
formula: string;
|
|
28
|
+
columnId?: never;
|
|
29
|
+
formulaId?: never;
|
|
30
|
+
columnExpression?: never;
|
|
31
|
+
}) | (FilterInputReferenceBase & {
|
|
32
|
+
columnExpression: string;
|
|
33
|
+
columnId?: never;
|
|
34
|
+
formulaId?: never;
|
|
35
|
+
formula?: never;
|
|
36
|
+
});
|
|
37
|
+
export type FilterInputDiscretization = {
|
|
38
|
+
type: 'none' | 'linear' | 'powerset';
|
|
39
|
+
bins?: number;
|
|
40
|
+
over?: FilterInputReference[];
|
|
41
|
+
};
|
|
42
|
+
export type FilterInputAggregation = {
|
|
43
|
+
type: string;
|
|
44
|
+
datasetId?: string;
|
|
45
|
+
columnId?: string;
|
|
46
|
+
level?: number;
|
|
47
|
+
discretization?: FilterInputDiscretization;
|
|
48
|
+
unnest?: boolean;
|
|
49
|
+
};
|
|
50
|
+
type FilterInputMetadata = {
|
|
51
|
+
id?: string;
|
|
52
|
+
ignoredItemIds?: string[] | null;
|
|
53
|
+
};
|
|
54
|
+
type FilterInputValue<Value> = Value | FilterInputParameterDefinition<Value>;
|
|
55
|
+
type FilterInputComparableValue<Value> = FilterInputValue<Value> | FilterInputReference;
|
|
56
|
+
type FilterInputWithValue<Expression extends string, Value, AllowReference extends boolean = false> = FilterInputReference & FilterInputMetadata & {
|
|
57
|
+
expression: Expression;
|
|
58
|
+
value: AllowReference extends true ? FilterInputComparableValue<Value> : FilterInputValue<Value>;
|
|
59
|
+
};
|
|
60
|
+
type FilterInputStringExpression = '? like ?' | '? not like ?' | '? starts with ?' | '? not starts with ?' | '? ends with ?' | '? not ends with ?' | '? has value starting with ?' | '? has value ending with ?' | '? has value containing ?' | '? does not have value containing ?';
|
|
61
|
+
type FilterInputComparisonExpression = '? < ?' | '? <= ?' | '? > ?' | '? >= ?';
|
|
62
|
+
type FilterInputLengthExpression = '? length = ?' | '? length >= ?' | '? length <= ?';
|
|
63
|
+
type FilterInputSetExpression = '? includes all ?' | '? includes any ?' | '? includes only ?';
|
|
64
|
+
type FilterInputRelativeDateExpression = 'last_now' | 'to_date' | 'last_available' | 'last_completed' | 'next_now' | 'next_full' | 'more_than_ago' | 'or_more_ago' | 'ago' | 'WTD' | 'MTD' | 'QTD' | 'YTD';
|
|
65
|
+
export type CleanFilterInput = (FilterInputReference & FilterInputMetadata & {
|
|
66
|
+
expression: '? is null' | '? is not null';
|
|
67
|
+
value?: never;
|
|
68
|
+
}) | FilterInputWithValue<'? = ?' | '? != ?', ItemFilterScalar, true> | FilterInputWithValue<FilterInputStringExpression, string> | FilterInputWithValue<FilterInputComparisonExpression, string | number | Date, true> | FilterInputWithValue<'? in ?' | '? not in ?', ItemFilterScalar[]> | FilterInputWithValue<'? between ?', ItemFilterRangeValue> | FilterInputWithValue<'? includes ?' | '? excludes ?', ItemFilterScalar> | FilterInputWithValue<FilterInputSetExpression, ItemFilterScalar[]> | FilterInputWithValue<FilterInputLengthExpression, number> | (FilterInputReference & FilterInputMetadata & {
|
|
69
|
+
expression: FilterInputRelativeDateExpression;
|
|
70
|
+
value: ItemFilterRelativeDate | FilterInputParameterDefinition<ItemFilterRelativeDate>;
|
|
71
|
+
});
|
|
72
|
+
export type CleanFilterInputGroup = {
|
|
73
|
+
id?: string;
|
|
74
|
+
condition: FilterInputCondition;
|
|
75
|
+
filters: (CleanFilterInput | CleanFilterInputGroup)[];
|
|
76
|
+
};
|
|
77
|
+
export type CleanFilterClauseInputGroup = CleanFilterInputGroup & {
|
|
78
|
+
clause: 'where' | 'having';
|
|
79
|
+
};
|
|
80
|
+
export type QueryOrFilterInput = {
|
|
81
|
+
or: (ItemFilter | QueryFilterInput | QueryOrFilterInput)[];
|
|
82
|
+
};
|
|
83
|
+
export type QueryFilterInput = (ItemFilter | QueryOrFilterInput)[];
|
|
84
|
+
type OperatorFilterInputGroupFilters = (ItemFilter | CleanFilterInput | CleanFilterInputGroup | FilterGroup | OperatorFilterInputGroup)[];
|
|
85
|
+
type OperatorFilterInputSubGroups = (FilterGroup | OperatorFilterInputGroup)[];
|
|
86
|
+
export type OperatorFilterInputGroup = Omit<FilterGroup, 'condition' | 'filters' | 'subGroups'> & {
|
|
87
|
+
operator: FilterInputCondition;
|
|
88
|
+
clause?: 'where' | 'having';
|
|
89
|
+
} & ({
|
|
90
|
+
filters: OperatorFilterInputGroupFilters;
|
|
91
|
+
subGroups?: OperatorFilterInputSubGroups;
|
|
92
|
+
} | {
|
|
93
|
+
filters?: OperatorFilterInputGroupFilters;
|
|
94
|
+
subGroups: OperatorFilterInputSubGroups;
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Canonical groups remain supported for every customer. Query, clean, and operator-group
|
|
98
|
+
* shapes require the customer-scoped filter-alignment feature to be enabled.
|
|
99
|
+
*/
|
|
100
|
+
export type FilterInput = FilterGroup[] | QueryFilterInput | CleanFilterClauseInputGroup[] | CleanFilterInput[] | OperatorFilterInputGroup[];
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FilterGroup, FilterOperators, ItemFilterOrigin } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { CleanFilterInput } from './filter-input.model';
|
|
3
|
+
export type CleanFilter = CleanFilterInput;
|
|
4
|
+
export type CleanFilterGroup = {
|
|
5
|
+
id?: string;
|
|
6
|
+
condition: FilterOperators;
|
|
7
|
+
filters: (CleanFilter | CleanFilterGroup)[];
|
|
8
|
+
};
|
|
9
|
+
export type CleanFilterClauseGroup = CleanFilterGroup & {
|
|
10
|
+
clause: 'where' | 'having';
|
|
11
|
+
};
|
|
12
|
+
export type CleanRetrievedFilterGroup = CleanFilterClauseGroup & {
|
|
13
|
+
origin?: Exclude<ItemFilterOrigin, 'dashboardFilter'>;
|
|
14
|
+
itemId?: string;
|
|
15
|
+
};
|
|
16
|
+
export type DashboardFilterOutput = FilterGroup[] | CleanRetrievedFilterGroup[];
|
|
17
|
+
export type ItemFilterOutput = FilterGroup[] | CleanFilterClauseGroup[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
export type AvailableSlots = 'category' | 'x-axis' | 'y-axis' | 'dimension' | 'slidermetric' | 'time' | 'levels' | 'geo' | 'coordinates';
|
|
3
|
+
export type StringOrNumber = string | number;
|
|
4
|
+
export type ParametersInput = StringOrNumber[] | StringOrNumber;
|
|
5
|
+
export type SelectedDataReference = {
|
|
6
|
+
slot?: AvailableSlots;
|
|
7
|
+
set?: never;
|
|
8
|
+
column?: never;
|
|
9
|
+
level?: number;
|
|
10
|
+
decimals?: number;
|
|
11
|
+
} | {
|
|
12
|
+
slot?: never;
|
|
13
|
+
set: string;
|
|
14
|
+
column: string;
|
|
15
|
+
level?: number;
|
|
16
|
+
decimals?: number;
|
|
17
|
+
};
|
|
18
|
+
export type SelectedDataIn = {
|
|
19
|
+
expression?: FilterExpression;
|
|
20
|
+
parameters?: [
|
|
21
|
+
SelectedDataReference,
|
|
22
|
+
ParametersInput
|
|
23
|
+
];
|
|
24
|
+
properties?: Record<string, StringOrNumber | unknown>;
|
|
25
|
+
};
|
|
26
|
+
export type SelectedDataInput = Partial<Record<FilterOperators, (SelectedDataIn | SelectedDataInput)[]>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './common.model';
|
|
2
|
+
export * from './dashboard-context.model';
|
|
3
|
+
export * from './dashboard.model';
|
|
4
|
+
export * from './events.model';
|
|
5
|
+
export * from './filter-input.model';
|
|
6
|
+
export * from './filter-output.model';
|
|
7
|
+
export * from './filters.model';
|
|
8
|
+
export * from './styles.model';
|
|
9
|
+
export * from './translation.model';
|
|
10
|
+
export * from './viz-item-post-message.model';
|
|
11
|
+
export * from './embed-error-event.model';
|
|
12
|
+
export * from './viz-item.model';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface IframeStyles {
|
|
2
|
+
width?: string;
|
|
3
|
+
opacity?: number;
|
|
4
|
+
height?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ContainerLoaderStyles {
|
|
7
|
+
display?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PlStyles {
|
|
11
|
+
'border-top'?: string;
|
|
12
|
+
'border-right'?: string;
|
|
13
|
+
'border-left'?: string;
|
|
14
|
+
'border-bottom'?: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
height?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface LcStyles {
|
|
19
|
+
padding?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface LoaderStyles {
|
|
22
|
+
background?: string;
|
|
23
|
+
width?: string;
|
|
24
|
+
height?: string;
|
|
25
|
+
'min-height'?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ContainerStyles {
|
|
28
|
+
background?: string;
|
|
29
|
+
width?: string;
|
|
30
|
+
height?: string;
|
|
31
|
+
display?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FilterOrigin, VizItemOptions, VizItemExportType } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { ItemFilterOutput } from './filter-output.model';
|
|
3
|
+
type VizItemPostMessageMetadata = {
|
|
4
|
+
dashboardId?: string;
|
|
5
|
+
itemId?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
type: VizItemPostMessageType;
|
|
8
|
+
contextId?: string;
|
|
9
|
+
options?: VizItemOptions;
|
|
10
|
+
};
|
|
11
|
+
export type VizItemPostMessageLoadEvent = VizItemPostMessageMetadata & {
|
|
12
|
+
type: 'load';
|
|
13
|
+
};
|
|
14
|
+
export type VizItemPostMessageRenderedEvent = VizItemPostMessageMetadata & {
|
|
15
|
+
type: 'rendered';
|
|
16
|
+
};
|
|
17
|
+
export type VizItemPostMessageExportedEvent = VizItemPostMessageMetadata & {
|
|
18
|
+
type: 'exported';
|
|
19
|
+
exportType: VizItemExportType;
|
|
20
|
+
};
|
|
21
|
+
export type VizItemPostMessageChangedFiltersEvent = VizItemPostMessageMetadata & {
|
|
22
|
+
type: 'changedFilters';
|
|
23
|
+
changed: ItemFilterOutput;
|
|
24
|
+
filters: ItemFilterOutput;
|
|
25
|
+
item: string;
|
|
26
|
+
origin: FilterOrigin;
|
|
27
|
+
};
|
|
28
|
+
export type VizItemPostMessageCustomEventEvent = VizItemPostMessageMetadata & {
|
|
29
|
+
type: 'customEvent';
|
|
30
|
+
data?: {
|
|
31
|
+
event: string;
|
|
32
|
+
language: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type VizItemPostMessageAuthorizationExpiredEvent = VizItemPostMessageMetadata & {
|
|
37
|
+
type: 'authorizationExpired';
|
|
38
|
+
};
|
|
39
|
+
export type VizItemPostMessageErrorEvent = VizItemPostMessageMetadata & {
|
|
40
|
+
type: 'error';
|
|
41
|
+
errorMsg: string;
|
|
42
|
+
error: {
|
|
43
|
+
msg: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type VizItemPostMessageEventMap = {
|
|
47
|
+
'load': VizItemPostMessageLoadEvent;
|
|
48
|
+
'rendered': VizItemPostMessageRenderedEvent;
|
|
49
|
+
'exported': VizItemPostMessageExportedEvent;
|
|
50
|
+
'changedFilters': VizItemPostMessageChangedFiltersEvent;
|
|
51
|
+
'customEvent': VizItemPostMessageCustomEventEvent;
|
|
52
|
+
'authorizationExpired': VizItemPostMessageAuthorizationExpiredEvent;
|
|
53
|
+
'error': VizItemPostMessageErrorEvent;
|
|
54
|
+
};
|
|
55
|
+
type VizItemPostMessageType = keyof VizItemPostMessageEventMap;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const libraryTypeToWebComponentTypeMapping: Record<string, string>;
|
|
2
|
+
export declare const libraryAcceptedParametersList: string[];
|
|
3
|
+
export type CanFilter = string[] | 'all';
|
|
4
|
+
export type VizItemCanFilter = CanFilter;
|
|
5
|
+
export type GetInsightsOptions = {
|
|
6
|
+
customPrompt?: string;
|
|
7
|
+
wordLength?: number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput } from '../filters.model';
|
|
3
|
+
type AreaChartFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? in ?' | '? >= ?' | '? <= ?' | '? < ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'x-axis'>;
|
|
8
|
+
},
|
|
9
|
+
ParametersInput
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type AreaChartSelectedDataInput = Partial<Record<FilterOperators, (AreaChartFilterIn | AreaChartSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput } from '../filters.model';
|
|
3
|
+
type BarchartFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? between ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'y-axis'>;
|
|
8
|
+
},
|
|
9
|
+
ParametersInput
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
type BarchartFilterIn2 = SelectedDataIn & {
|
|
13
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
14
|
+
parameters: [
|
|
15
|
+
{
|
|
16
|
+
slot: Extract<AvailableSlots, 'y-axis'>;
|
|
17
|
+
},
|
|
18
|
+
string[]
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
type BarchartFilterInput1 = Partial<Record<FilterOperators, (BarchartFilterIn | BarchartFilterInput1)[]>>;
|
|
22
|
+
type BarchartFilterInput2 = Partial<Record<FilterOperators, (BarchartFilterIn2 | BarchartFilterInput2)[]>>;
|
|
23
|
+
export type BarChartSelectedDataInput = BarchartFilterInput1 | BarchartFilterInput2;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, StringOrNumber } from '../filters.model';
|
|
3
|
+
type ChoroplethFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'geo'>;
|
|
8
|
+
},
|
|
9
|
+
StringOrNumber[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type ChoroplethSelectedDataInput = Partial<Record<FilterOperators, (ChoroplethFilterIn | ChoroplethSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput } from '../filters.model';
|
|
3
|
+
type ColumnchartFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? between ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'y-axis'>;
|
|
8
|
+
},
|
|
9
|
+
ParametersInput
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
type ColumnchartFilterIn2 = SelectedDataIn & {
|
|
13
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
14
|
+
parameters: [
|
|
15
|
+
{
|
|
16
|
+
slot: Extract<AvailableSlots, 'y-axis'>;
|
|
17
|
+
},
|
|
18
|
+
string[]
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
type ColumnchartFilterInput1 = Partial<Record<FilterOperators, (ColumnchartFilterIn | ColumnchartFilterInput1)[]>>;
|
|
22
|
+
type ColumnchartFilterInput2 = Partial<Record<FilterOperators, (ColumnchartFilterIn2 | ColumnchartFilterInput2)[]>>;
|
|
23
|
+
export type ColumnChartSelectedDataInput = ColumnchartFilterInput1 | ColumnchartFilterInput2;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn } from '../filters.model';
|
|
3
|
+
type DatetimeFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'time'>;
|
|
8
|
+
},
|
|
9
|
+
string[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type DatetimeSelectedDataInput = Partial<Record<FilterOperators, (DatetimeFilterIn | DatetimeSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput } from '../filters.model';
|
|
3
|
+
type DropdownFilterFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? between ?' | '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'dimension'>;
|
|
8
|
+
},
|
|
9
|
+
ParametersInput
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type DropdownFilterSelectedDataInput = Partial<Record<FilterOperators, (DropdownFilterFilterIn | DropdownFilterSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SelectedDataInput } from '../filters.model';
|
|
2
|
+
import { AreaChartSelectedDataInput } from './areachart.model';
|
|
3
|
+
import { BarChartSelectedDataInput } from './barchart.model';
|
|
4
|
+
import { ChoroplethSelectedDataInput } from './choroplethmap.model';
|
|
5
|
+
import { CirclepackSelectedDataInput } from './circlepack.model';
|
|
6
|
+
import { ColumnChartSelectedDataInput } from './columnchart.model';
|
|
7
|
+
import { DatetimeSelectedDataInput } from './datetime.model';
|
|
8
|
+
import { DonutChartSelectedDataInput } from './donutchart.model';
|
|
9
|
+
import { DropdownFilterSelectedDataInput } from './dropdownfilter.model';
|
|
10
|
+
import { LinechartSelectedDataInput } from './linechart.model';
|
|
11
|
+
import { ParallelCoordinatesPlotSelectedDataInput } from './parallelcoordinatesplot.model';
|
|
12
|
+
import { PieChartSelectedDataInput } from './piechart.model';
|
|
13
|
+
import { ScatterplotSelectedDataInput } from './scatterplot.model';
|
|
14
|
+
import { SlicerSelectedDataInput } from './slicer.model';
|
|
15
|
+
import { SliderSelectedDataInput } from './slider.model';
|
|
16
|
+
import { StripPlotSelectedDataInput } from './stripplot.model';
|
|
17
|
+
import { SunburstSelectedDataInput } from './sunburst.model';
|
|
18
|
+
import { TreemapSelectedDataInput } from './treemap.model';
|
|
19
|
+
export * from './barchart.model';
|
|
20
|
+
export * from './columnchart.model';
|
|
21
|
+
export * from './datetime.model';
|
|
22
|
+
export * from './slider.model';
|
|
23
|
+
export * from './dropdownfilter.model';
|
|
24
|
+
export * from './areachart.model';
|
|
25
|
+
export * from './slicer.model';
|
|
26
|
+
export * from './scatterplot.model';
|
|
27
|
+
export * from './piechart.model';
|
|
28
|
+
export * from './linechart.model';
|
|
29
|
+
export * from './choroplethmap.model';
|
|
30
|
+
export * from './treemap.model';
|
|
31
|
+
export * from './donutchart.model';
|
|
32
|
+
export * from './sunburst.model';
|
|
33
|
+
export * from './circlepack.model';
|
|
34
|
+
export * from './parallelcoordinatesplot.model';
|
|
35
|
+
export * from './stripplot.model';
|
|
36
|
+
export type CombinedSelectedDataInput = SelectedDataInput | BarChartSelectedDataInput | ColumnChartSelectedDataInput | SliderSelectedDataInput | DropdownFilterSelectedDataInput | DatetimeSelectedDataInput | AreaChartSelectedDataInput | SlicerSelectedDataInput | LinechartSelectedDataInput | ScatterplotSelectedDataInput | PieChartSelectedDataInput | ChoroplethSelectedDataInput | TreemapSelectedDataInput | DonutChartSelectedDataInput | SunburstSelectedDataInput | CirclepackSelectedDataInput | ParallelCoordinatesPlotSelectedDataInput | StripPlotSelectedDataInput;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, StringOrNumber } from '../filters.model';
|
|
3
|
+
type LinechartFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?' | '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'x-axis'>;
|
|
8
|
+
},
|
|
9
|
+
StringOrNumber[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
type LinechartFilterIn2 = SelectedDataIn & {
|
|
13
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?'>;
|
|
14
|
+
parameters: [
|
|
15
|
+
{
|
|
16
|
+
slot: Extract<AvailableSlots, 'x-axis'>;
|
|
17
|
+
},
|
|
18
|
+
[
|
|
19
|
+
StringOrNumber
|
|
20
|
+
]
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
type LinechartFilterIn3 = SelectedDataIn & {
|
|
24
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
25
|
+
parameters: [
|
|
26
|
+
{
|
|
27
|
+
slot: Extract<AvailableSlots, 'x-axis'>;
|
|
28
|
+
},
|
|
29
|
+
string[]
|
|
30
|
+
];
|
|
31
|
+
};
|
|
32
|
+
type LinechartFilterInput1 = Partial<Record<FilterOperators, (LinechartFilterIn | LinechartFilterInput1)[]>>;
|
|
33
|
+
type LinechartFilterInput2 = Partial<Record<FilterOperators, (LinechartFilterIn2 | LinechartFilterInput2)[]>>;
|
|
34
|
+
type LinechartFilterInput3 = Partial<Record<FilterOperators, (LinechartFilterIn3 | LinechartFilterInput3)[]>>;
|
|
35
|
+
export type LinechartSelectedDataInput = LinechartFilterInput1 | LinechartFilterInput2 | LinechartFilterInput3;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, StringOrNumber } from '../filters.model';
|
|
3
|
+
type ParallelCoordinatesPlotFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?' | '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'coordinates'>;
|
|
8
|
+
level: number;
|
|
9
|
+
},
|
|
10
|
+
StringOrNumber[]
|
|
11
|
+
];
|
|
12
|
+
};
|
|
13
|
+
export type ParallelCoordinatesPlotSelectedDataInput = Partial<Record<FilterOperators, (ParallelCoordinatesPlotFilterIn | ParallelCoordinatesPlotSelectedDataInput)[]>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput, StringOrNumber } from '../filters.model';
|
|
3
|
+
type PiechartFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? between ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'category'>;
|
|
8
|
+
},
|
|
9
|
+
ParametersInput
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
type PiechartFilterIn2 = SelectedDataIn & {
|
|
13
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
14
|
+
parameters: [
|
|
15
|
+
{
|
|
16
|
+
slot: Extract<AvailableSlots, 'category'>;
|
|
17
|
+
},
|
|
18
|
+
StringOrNumber[]
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
type PiechartFilterInput1 = Partial<Record<FilterOperators, (PiechartFilterIn | PiechartFilterInput1)[]>>;
|
|
22
|
+
type PiechartFilterInput2 = Partial<Record<FilterOperators, (PiechartFilterIn2 | PiechartFilterInput2)[]>>;
|
|
23
|
+
export type PieChartSelectedDataInput = PiechartFilterInput1 | PiechartFilterInput2;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, StringOrNumber } from '../filters.model';
|
|
3
|
+
type ScatterplotFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?' | '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'x-axis' | 'y-axis'>;
|
|
8
|
+
},
|
|
9
|
+
StringOrNumber[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type ScatterplotSelectedDataInput = Partial<Record<FilterOperators, (ScatterplotFilterIn | ScatterplotSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, ParametersInput, StringOrNumber } from '../filters.model';
|
|
3
|
+
type SlicerFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? in ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'dimension'>;
|
|
8
|
+
},
|
|
9
|
+
StringOrNumber[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
type SlicerFilterIn2 = SelectedDataIn & {
|
|
13
|
+
expression: Extract<FilterExpression, '? between ?'>;
|
|
14
|
+
parameters: [
|
|
15
|
+
{
|
|
16
|
+
slot: Extract<AvailableSlots, 'dimension'>;
|
|
17
|
+
},
|
|
18
|
+
ParametersInput
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
type SlicerFilterInput1 = Partial<Record<FilterOperators, (SlicerFilterIn | SlicerFilterInput1)[]>>;
|
|
22
|
+
type SlicerFilterInput2 = Partial<Record<FilterOperators, (SlicerFilterIn2 | SlicerFilterInput2)[]>>;
|
|
23
|
+
export type SlicerSelectedDataInput = SlicerFilterInput1 | SlicerFilterInput2;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterExpression, FilterOperators } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { AvailableSlots, SelectedDataIn, StringOrNumber } from '../filters.model';
|
|
3
|
+
type SliderFilterIn = SelectedDataIn & {
|
|
4
|
+
expression: Extract<FilterExpression, '? >= ?' | '? < ?'>;
|
|
5
|
+
parameters: [
|
|
6
|
+
{
|
|
7
|
+
slot: Extract<AvailableSlots, 'slidermetric'>;
|
|
8
|
+
},
|
|
9
|
+
StringOrNumber[]
|
|
10
|
+
];
|
|
11
|
+
};
|
|
12
|
+
export type SliderSelectedDataInput = Partial<Record<FilterOperators, (SliderFilterIn | SliderSelectedDataInput)[]>>;
|
|
13
|
+
export {};
|