@vizzly/dashboard 0.14.3 → 0.14.4-dev-e20496d46b8f1db9142fb978a46d77efd06b995f
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/dist/charts/src/PieChart/PieChart.d.ts +2 -2
- package/dist/charts/src/types.d.ts +3 -2
- package/dist/charts/src/utils/buildTooltipStyles.d.ts +3 -4
- package/dist/charts/src/v2/components/GoalLine/GoalLine.d.ts +15 -0
- package/dist/charts/src/v2/components/GoalLine/index.d.ts +1 -0
- package/dist/charts/src/v2/components/Legend/Legend.d.ts +14 -0
- package/dist/charts/src/v2/components/Legend/LegendItem/LegendItem.d.ts +11 -0
- package/dist/charts/src/v2/components/Legend/LegendItem/index.d.ts +1 -0
- package/dist/charts/src/v2/components/Legend/LegendItemBox/LegendItemBox.d.ts +3 -0
- package/dist/charts/src/v2/components/Legend/LegendItemBox/index.d.ts +1 -0
- package/dist/charts/src/v2/components/Legend/index.d.ts +1 -0
- package/dist/charts/src/v2/components/LineChart/LineChart.d.ts +20 -0
- package/dist/charts/src/v2/components/LineChart/buildMargin.d.ts +9 -0
- package/dist/charts/src/v2/components/LineChart/index.d.ts +1 -0
- package/dist/charts/src/v2/components/Tooltip/Tooltip.d.ts +21 -0
- package/dist/charts/src/v2/components/Tooltip/index.d.ts +1 -0
- package/dist/charts/src/v2/constants/COLORS.d.ts +1 -0
- package/dist/charts/src/v2/index.d.ts +1 -0
- package/dist/charts/src/v2/types.d.ts +1 -0
- package/dist/charts/src/v2/utils/addTrendAndForecast.d.ts +21 -0
- package/dist/charts/src/v2/utils/flattenData.d.ts +14 -0
- package/dist/charts/src/v2/utils/getChartThemeCSS.d.ts +9 -0
- package/dist/charts/src/v2/utils/getClipArea.d.ts +16 -0
- package/dist/charts/src/v2/utils/getColor.d.ts +9 -0
- package/dist/charts/src/v2/utils/getTooltipData.d.ts +30 -0
- package/dist/charts/src/v2/utils/getTrend.d.ts +24 -0
- package/dist/charts/src/v2/utils/index.d.ts +7 -0
- package/dist/dashboard/src/contexts/GlobalProvider/useGlobalProvider.d.ts +12 -30
- package/dist/index.js +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/AreaChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/BarChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/BasicTable/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/FunnelChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/HorizontalBarChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/LineChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/LineChartV2/toQueries.d.ts +4 -0
- package/dist/results-driver/src/driver/VizzlyQuery/PieChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/PivotTable/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/RichText/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/commonToQueries.d.ts +1 -1
- package/dist/services/src/index.d.ts +0 -1
- package/dist/shared-logic/src/AdditionalFilter/AdditionalFilter.d.ts +1 -1
- package/dist/shared-logic/src/AdditionalFilter/constants.d.ts +0 -3
- package/dist/shared-logic/src/AdditionalFilter/types.d.ts +0 -1
- package/dist/shared-logic/src/Component/setAttributes.d.ts +1 -1
- package/dist/shared-logic/src/Component/types.d.ts +24 -3
- package/dist/shared-logic/src/ComponentInterface/types.d.ts +2 -0
- package/dist/shared-logic/src/CustomField/CustomField.d.ts +3 -2
- package/dist/shared-logic/src/CustomField/CustomMetric/build.d.ts +11 -0
- package/dist/shared-logic/src/CustomField/CustomMetric/combineFilters.d.ts +2 -0
- package/dist/shared-logic/src/CustomField/CustomMetric/index.d.ts +10 -0
- package/dist/shared-logic/src/CustomField/CustomMetric/mockDataSet.d.ts +2 -0
- package/dist/shared-logic/src/CustomField/types.d.ts +10 -2
- package/dist/shared-logic/src/DataSet/DataSet.d.ts +1 -1
- package/dist/shared-logic/src/FeatureToggle/types.d.ts +4 -0
- package/dist/shared-logic/src/Filter/combineFilters.d.ts +1 -0
- package/dist/shared-logic/src/Filter/relative.d.ts +2 -1
- package/dist/shared-logic/src/LineChartV2/adjustTicks.d.ts +3 -0
- package/dist/shared-logic/src/LineChartV2/attributesSchema.d.ts +3 -0
- package/dist/shared-logic/src/LineChartV2/buildLineChartRepresentation.d.ts +39 -0
- package/dist/shared-logic/src/LineChartV2/buildTrendAndForecast.d.ts +25 -0
- package/dist/shared-logic/src/LineChartV2/constants.d.ts +3 -0
- package/dist/shared-logic/src/LineChartV2/getAxisFormattingFunction.d.ts +13 -0
- package/dist/shared-logic/src/LineChartV2/getConditionalFormatting.d.ts +7 -0
- package/dist/shared-logic/src/LineChartV2/getData.d.ts +18 -0
- package/dist/shared-logic/src/LineChartV2/getGoalLines.d.ts +10 -0
- package/dist/shared-logic/src/LineChartV2/getMinAndMax.d.ts +14 -0
- package/dist/shared-logic/src/LineChartV2/getScaleAndTicks.d.ts +50 -0
- package/dist/shared-logic/src/LineChartV2/getStyleDefinition.d.ts +8 -0
- package/dist/shared-logic/src/LineChartV2/getTrendsAndForecastsData.d.ts +41 -0
- package/dist/shared-logic/src/LineChartV2/getXScale.d.ts +18 -0
- package/dist/shared-logic/src/LineChartV2/index.d.ts +4 -0
- package/dist/shared-logic/src/LineChartV2/prepareData.d.ts +34 -0
- package/dist/shared-logic/src/LineChartV2/setAttributes.d.ts +4 -0
- package/dist/shared-logic/src/LineChartV2/types.d.ts +79 -0
- package/dist/shared-logic/src/Logger/Logger.d.ts +2 -0
- package/dist/shared-logic/src/Result/Result.d.ts +0 -1
- package/dist/shared-logic/src/Result/types.d.ts +2 -0
- package/dist/shared-logic/src/Variables/Variables.d.ts +1 -0
- package/dist/shared-logic/src/getComponentInterface.d.ts +1 -0
- package/dist/shared-ui/src/api/useQueryEffect.d.ts +1 -1
- package/dist/shared-ui/src/base/MultiSelect.d.ts +1 -0
- package/dist/shared-ui/src/base/Select/Control.d.ts +1 -0
- package/dist/shared-ui/src/base/layout/Flex.styles.d.ts +1 -0
- package/dist/shared-ui/src/components/ComboChart/ComboChartView.d.ts +1 -4
- package/dist/shared-ui/src/components/CustomMetric/CustomMetric.d.ts +5 -2
- package/dist/shared-ui/src/components/CustomMetric/CustomMetricField.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/CustomMetricVariable.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/MetricOverview.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/OperatorIcon.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/buildCustomMetric.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/formatFormula.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/init.d.ts +1 -1
- package/dist/shared-ui/src/components/CustomMetric/{pickAvailableItems.d.ts → items.d.ts} +13 -3
- package/dist/shared-ui/src/components/HeadlineStats/HeadlineStats.d.ts +2 -1
- package/dist/shared-ui/src/components/ItemPicker/ItemPicker.d.ts +4 -4
- package/dist/shared-ui/src/components/LineChartV2/LineChartV2.d.ts +22 -0
- package/dist/shared-ui/src/components/LineChartV2/LineChartV2View.d.ts +17 -0
- package/dist/shared-ui/src/components/LineChartV2/index.d.ts +2 -0
- package/dist/shared-ui/src/components/Studio/StudioModals.d.ts +1 -1
- package/dist/shared-ui/src/contexts/DashboardBehaviour/types.d.ts +1 -1
- package/dist/shared-ui/src/contexts/DashboardContext/types.d.ts +7 -1
- package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/CustomMetric/CustomMetricModal.d.ts +3 -0
- package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/CustomMetric/types.d.ts +3 -0
- package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/CustomMetric/useCustomMetric.d.ts +16 -0
- package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/customMetricText.d.ts +3 -11
- package/dist/shared-ui/src/library/DataPanel/CustomMetricsInput.d.ts +1 -1
- package/dist/shared-ui/src/library/DataPanel/SortInput/formatTitleWithAggregate.d.ts +1 -1
- package/dist/shared-ui/src/library/DataPanel/SortInput.d.ts +2 -0
- package/dist/shared-ui/src/library/DataPanel/Trends/TrendsInput.d.ts +1 -1
- package/dist/shared-ui/src/library/DataPanel/Trends/types.d.ts +1 -1
- package/dist/shared-ui/src/library/DataPanel/removeHiddenFieldsFromAttributes.d.ts +6 -0
- package/package.json +3 -3
- package/dist/shared-ui/src/library/DataPanel/deleteRemovedHiddenFieldsFromAttributes.ts.d.ts +0 -6
- /package/dist/{shared-ui/src/components → shared-logic/src/CustomField}/CustomMetric/types.d.ts +0 -0
- /package/dist/shared-ui/src/components/CustomMetric/{pickAvailableItems.test.d.ts → items.test.d.ts} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { KeyId, Tick, Key, GoalLine } from './types';
|
|
2
|
+
import { QueryAttributes } from '../QueryAttributes/types';
|
|
3
|
+
import { DataType } from '../Field/types';
|
|
4
|
+
declare type FormattingFunction = (value: any, nullValueAlias?: string) => string;
|
|
5
|
+
interface getScaleAndTicksArgs {
|
|
6
|
+
data: {
|
|
7
|
+
[key: string]: Date | number | string | null;
|
|
8
|
+
}[];
|
|
9
|
+
xKey: string | null;
|
|
10
|
+
xScaleDataType: DataType;
|
|
11
|
+
keys: {
|
|
12
|
+
[key: KeyId]: Key;
|
|
13
|
+
};
|
|
14
|
+
yKeys: string[];
|
|
15
|
+
nullValue: string | undefined;
|
|
16
|
+
tickCountYAxis: number;
|
|
17
|
+
fillMissingXTicks: boolean;
|
|
18
|
+
formattingFunctionX: FormattingFunction;
|
|
19
|
+
formattingFunctionY: FormattingFunction;
|
|
20
|
+
xAxisPostfix: string;
|
|
21
|
+
xAxisPrefix: string;
|
|
22
|
+
yAxisPostfix: string;
|
|
23
|
+
yAxisPrefix: string;
|
|
24
|
+
order: QueryAttributes.Order[];
|
|
25
|
+
goalLines: GoalLine[];
|
|
26
|
+
}
|
|
27
|
+
interface getScaleAndTicksReturn {
|
|
28
|
+
x: {
|
|
29
|
+
ticks: Array<Tick<Date | string | number>>;
|
|
30
|
+
scale: {
|
|
31
|
+
max: number | Date | null;
|
|
32
|
+
min: number | Date | null;
|
|
33
|
+
key: KeyId | null;
|
|
34
|
+
ordering: 'asc' | 'desc' | null;
|
|
35
|
+
dataType: DataType;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
y: {
|
|
39
|
+
ticks: Array<Tick<number>>;
|
|
40
|
+
scale: {
|
|
41
|
+
max: number;
|
|
42
|
+
min: number;
|
|
43
|
+
key: null;
|
|
44
|
+
ordering: 'asc' | 'desc';
|
|
45
|
+
dataType: 'number';
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare const getScaleAndTicks: ({ data, xKey, yKeys, xScaleDataType, nullValue, tickCountYAxis, fillMissingXTicks, formattingFunctionX, formattingFunctionY, xAxisPostfix, xAxisPrefix, yAxisPostfix, yAxisPrefix, order, keys, goalLines, }: getScaleAndTicksArgs) => getScaleAndTicksReturn;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { LegendItem } from './types';
|
|
3
|
+
interface getStyleDefinitionArgs {
|
|
4
|
+
colors: CSSProperties['color'][];
|
|
5
|
+
yKeys: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const getStyleDefinition: ({ colors, yKeys }: getStyleDefinitionArgs) => LegendItem[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DataItem, KeyId, Key } from './types';
|
|
2
|
+
import { Component } from '../Component/types';
|
|
3
|
+
import { DataType } from '../Field/types';
|
|
4
|
+
interface getTrendsAndForecastsDataArgs {
|
|
5
|
+
chartData: {
|
|
6
|
+
[keyId: string]: DataItem;
|
|
7
|
+
}[];
|
|
8
|
+
keys: {
|
|
9
|
+
[keyId: string]: Key;
|
|
10
|
+
};
|
|
11
|
+
xKey: KeyId;
|
|
12
|
+
yKeys: KeyId[];
|
|
13
|
+
formattingFunctionX: (value: any, noValueReplacement?: string) => string;
|
|
14
|
+
formattingFunctionY: (value: any, noValueReplacement?: string) => string;
|
|
15
|
+
nullValue: string | undefined;
|
|
16
|
+
trendsAndForecasts?: Component.Trends[];
|
|
17
|
+
xAxisPostfix: string;
|
|
18
|
+
xAxisPrefix: string;
|
|
19
|
+
yAxisPostfix: string;
|
|
20
|
+
yAxisPrefix: string;
|
|
21
|
+
xScaleDataType: DataType;
|
|
22
|
+
orderFunction: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare const getTrendsAndForecastsData: ({ chartData, formattingFunctionX, formattingFunctionY, keys, nullValue, orderFunction, trendsAndForecasts, xAxisPostfix, xAxisPrefix, xKey, xScaleDataType, yAxisPostfix, yAxisPrefix, yKeys, }: getTrendsAndForecastsDataArgs) => {
|
|
25
|
+
chartData: {
|
|
26
|
+
[keyId: string]: DataItem;
|
|
27
|
+
}[];
|
|
28
|
+
newChartData?: undefined;
|
|
29
|
+
newYKeys?: undefined;
|
|
30
|
+
newKeys?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
newChartData: ({
|
|
33
|
+
[x: string]: DataItem;
|
|
34
|
+
} | null)[];
|
|
35
|
+
newYKeys: string[];
|
|
36
|
+
newKeys: {
|
|
37
|
+
[keyId: string]: Key;
|
|
38
|
+
};
|
|
39
|
+
chartData?: undefined;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeyId, Key } from './types';
|
|
2
|
+
import { QueryAttributes } from '../QueryAttributes/types';
|
|
3
|
+
import { DataType } from '../Field/types';
|
|
4
|
+
interface getXScaleArgs {
|
|
5
|
+
xKey: string | null;
|
|
6
|
+
xScaleDataType: DataType;
|
|
7
|
+
order: QueryAttributes.Order[];
|
|
8
|
+
keys: {
|
|
9
|
+
[key: string]: Key;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const getXScale: ({ order, xKey, xScaleDataType, keys }: getXScaleArgs) => {
|
|
13
|
+
dataType: DataType;
|
|
14
|
+
key: KeyId | null;
|
|
15
|
+
ordering: 'asc' | 'desc' | null;
|
|
16
|
+
xScaleIsDimension: boolean;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Result } from '../Result/types';
|
|
2
|
+
import { PivotConfig } from '../PivotConfig/types';
|
|
3
|
+
import { QueryAttributes } from '../QueryAttributes/types';
|
|
4
|
+
import { DataType } from '../Field/types';
|
|
5
|
+
import { DateTimeFormatter, NumberFormatter } from './types';
|
|
6
|
+
interface prepareDataArgs {
|
|
7
|
+
result: Result;
|
|
8
|
+
pivotConfig: PivotConfig;
|
|
9
|
+
measures: QueryAttributes.Measure[];
|
|
10
|
+
dimensions: QueryAttributes.Dimension[];
|
|
11
|
+
xKey: string;
|
|
12
|
+
xKeyFunction: string;
|
|
13
|
+
xKeyDataType: DataType;
|
|
14
|
+
xKeyField: Result.Field | undefined;
|
|
15
|
+
numberFormatOptions: {
|
|
16
|
+
[id: string]: NumberFormatter;
|
|
17
|
+
};
|
|
18
|
+
dateTimeFormatOptions: {
|
|
19
|
+
[id: string]: DateTimeFormatter;
|
|
20
|
+
};
|
|
21
|
+
defaultFormats: () => {
|
|
22
|
+
[functionId: string]: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const prepareData: ({ result, pivotConfig, measures, dimensions, xKey, xKeyFunction, xKeyDataType, xKeyField, defaultFormats, numberFormatOptions, dateTimeFormatOptions, }: prepareDataArgs) => {
|
|
26
|
+
data: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
}[];
|
|
29
|
+
xScaleDataType: "string" | "number" | "boolean" | "date_time";
|
|
30
|
+
xScaleIsDateTimeAsNumber: boolean;
|
|
31
|
+
yKeys: string[];
|
|
32
|
+
keys: {};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Component } from '../Component/types';
|
|
2
|
+
import { ComponentInterfaceConfig } from '../ComponentInterface/types';
|
|
3
|
+
declare const _default: (config: ComponentInterfaceConfig) => (lineChart: Component.LineChartV2Attributes, partial: Partial<Component.LineChartV2Attributes>) => Component.LineChartV2Attributes;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DataType } from '../Field/types';
|
|
2
|
+
export declare type KeyId = string;
|
|
3
|
+
export declare type Operator = string;
|
|
4
|
+
export declare type ConditionalFormattingRule = {
|
|
5
|
+
operator: Operator;
|
|
6
|
+
value: any;
|
|
7
|
+
color: string;
|
|
8
|
+
yKey: KeyId;
|
|
9
|
+
};
|
|
10
|
+
export declare type Axis<SupportedVizzlyDataTypes, AxisKeys> = {
|
|
11
|
+
ticks: Tick<SupportedVizzlyDataTypes>[];
|
|
12
|
+
scale: {
|
|
13
|
+
dataType: DataType;
|
|
14
|
+
key: KeyId | null;
|
|
15
|
+
ordering: 'asc' | 'desc' | null;
|
|
16
|
+
min: SupportedVizzlyDataTypes | null;
|
|
17
|
+
max: SupportedVizzlyDataTypes | null;
|
|
18
|
+
};
|
|
19
|
+
postfix: string;
|
|
20
|
+
prefix: string;
|
|
21
|
+
title: string | null;
|
|
22
|
+
} & AxisKeys;
|
|
23
|
+
export declare type LegendItemStyleLine = {
|
|
24
|
+
type: 'line';
|
|
25
|
+
strokeDasharray: string | number | null;
|
|
26
|
+
strokeWidth: number;
|
|
27
|
+
};
|
|
28
|
+
export declare type LegendItem = {
|
|
29
|
+
yKey: KeyId;
|
|
30
|
+
color: string;
|
|
31
|
+
style: LegendItemStyleLine;
|
|
32
|
+
};
|
|
33
|
+
export declare type Key = {
|
|
34
|
+
key: KeyId;
|
|
35
|
+
keyFormatted: string;
|
|
36
|
+
dataType: DataType;
|
|
37
|
+
};
|
|
38
|
+
export declare type Tick<DataType> = {
|
|
39
|
+
value: DataType;
|
|
40
|
+
valueFormatted: string | null;
|
|
41
|
+
scaleValue: DataType | null;
|
|
42
|
+
};
|
|
43
|
+
export declare type LineChartRepresentation = {
|
|
44
|
+
keys: {
|
|
45
|
+
[key: KeyId]: Key;
|
|
46
|
+
};
|
|
47
|
+
x: Axis<Date | string | number, {
|
|
48
|
+
key: KeyId;
|
|
49
|
+
}>;
|
|
50
|
+
y: Axis<number, {
|
|
51
|
+
keys: KeyId[];
|
|
52
|
+
}>;
|
|
53
|
+
conditionalFormattingRules: ConditionalFormattingRule[];
|
|
54
|
+
goalLines: GoalLine[];
|
|
55
|
+
data: {
|
|
56
|
+
[keyId: string]: DataItem;
|
|
57
|
+
}[];
|
|
58
|
+
lines: LegendItem[];
|
|
59
|
+
};
|
|
60
|
+
export declare type DataItem = {
|
|
61
|
+
value: number | string | null;
|
|
62
|
+
valueAlias: string | null;
|
|
63
|
+
valueFormatted: string | null;
|
|
64
|
+
};
|
|
65
|
+
export declare type GoalLine = {
|
|
66
|
+
value: number;
|
|
67
|
+
valueFormatted: string | null;
|
|
68
|
+
color: string;
|
|
69
|
+
strokeStyle?: 'dashed' | 'solid';
|
|
70
|
+
strokeWidth: number;
|
|
71
|
+
};
|
|
72
|
+
export declare type DateTimeFormatter = {
|
|
73
|
+
formatter: (date: Date) => string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
export declare type NumberFormatter = {
|
|
77
|
+
formatter: (number: number | undefined | null, noValueReplacement?: string) => string;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
@@ -6,6 +6,8 @@ export declare const setupLogger: (newLogLevel: LogLevel, onLogLevelChange?: ((n
|
|
|
6
6
|
logInfo: (...message: any) => void;
|
|
7
7
|
logWarning: (...message: any) => void;
|
|
8
8
|
logProperties: (...message: any) => void;
|
|
9
|
+
getCurrentLogLevel: () => LogLevel;
|
|
10
|
+
updateLogLevel: (newLevel: LogLevel) => void;
|
|
9
11
|
};
|
|
10
12
|
export declare const logDebug: (...message: any) => void;
|
|
11
13
|
export declare const logInfo: (...message: any) => void;
|
|
@@ -5,3 +5,4 @@ export declare const build: (variables?: VariablesCallback | undefined) => Varia
|
|
|
5
5
|
export declare const findVariable: (value: string, detect: (input: string) => string[] | undefined, variableList?: VariableList | undefined) => string[] | undefined;
|
|
6
6
|
export declare const useValue: (value: any, variables?: VariableList | undefined) => any;
|
|
7
7
|
export declare const validate: (value: string, variables?: VariableList | undefined) => boolean;
|
|
8
|
+
export declare function extractValue(variables: VariableList, key: string): import("../../../shared-logic/src/Variables/types").VariableTypes;
|
|
@@ -13,6 +13,7 @@ declare function getComponentInterface(type: 'basicTable', config?: ComponentInt
|
|
|
13
13
|
declare function getComponentInterface(type: 'horizontalBarChart', config?: ComponentInterfaceConfig): ComponentInterface<Component.HorizontalBarChartAttributes>;
|
|
14
14
|
declare function getComponentInterface(type: 'areaChart', config?: ComponentInterfaceConfig): ComponentInterface<Component.AreaChartAttributes>;
|
|
15
15
|
declare function getComponentInterface(type: 'lineChart', config?: ComponentInterfaceConfig): ComponentInterface<Component.LineChartAttributes>;
|
|
16
|
+
declare function getComponentInterface(type: 'lineChartV2', config?: ComponentInterfaceConfig): ComponentInterface<Component.LineChartV2Attributes>;
|
|
16
17
|
declare function getComponentInterface(type: 'barChart', config?: ComponentInterfaceConfig): ComponentInterface<Component.BarChartAttributes>;
|
|
17
18
|
declare function getComponentInterface(type: 'funnelChart', config?: ComponentInterfaceConfig): ComponentInterface<Component.FunnelChartAttributes>;
|
|
18
19
|
declare function getComponentInterface(type: ComponentType, config?: ComponentInterfaceConfig): ComponentInterface<Component.Attributes>;
|
|
@@ -4,6 +4,6 @@ import { FilterConfig } from '../../../shared-logic/src/AdditionalFilter/types';
|
|
|
4
4
|
import { DataSet } from '../../../shared-logic/src/DataSet/types';
|
|
5
5
|
import { QueryableEntity } from './useQueryEffect/types';
|
|
6
6
|
import { UseVariableState } from '../contexts/Variables/types';
|
|
7
|
-
export declare const useQueryEffect: (queries: QueryableEntity, runQueriesCallback: VizzlyComponents.runQueriesCallbackInternal, onResultsCallback: (results: Array<Result | null>) => void, filterConfig: FilterConfig, dataSet: DataSet, componentType?: "progress" | "areaChart" | "barChart" | "basicTable" | "comboChart" | "custom" | "dataTable" | "funnelChart" | "horizontalBarChart" | "lineChart" | "mercatorMap" | "pieChart" | "richText" | "scatterChart" | "singleStat" | undefined, variables?: UseVariableState | undefined) => {
|
|
7
|
+
export declare const useQueryEffect: (queries: QueryableEntity, runQueriesCallback: VizzlyComponents.runQueriesCallbackInternal, onResultsCallback: (results: Array<Result | null>) => void, filterConfig: FilterConfig, dataSet: DataSet, componentType?: "progress" | "areaChart" | "barChart" | "basicTable" | "comboChart" | "custom" | "dataTable" | "funnelChart" | "horizontalBarChart" | "lineChart" | "lineChartV2" | "mercatorMap" | "pieChart" | "richText" | "scatterChart" | "singleStat" | undefined, variables?: UseVariableState | undefined) => {
|
|
8
8
|
queriesAreChanging: boolean;
|
|
9
9
|
};
|
|
@@ -24,6 +24,7 @@ export declare const MultiSelect: FunctionComponent<{
|
|
|
24
24
|
dropdownForFilter?: boolean;
|
|
25
25
|
onFreeTextSelected?: (() => void) | undefined;
|
|
26
26
|
freeTextOptions?: FreeTextOptions;
|
|
27
|
+
isFilter?: boolean;
|
|
27
28
|
}>;
|
|
28
29
|
export declare function getSelectedIndices<T extends {
|
|
29
30
|
value: string;
|
|
@@ -37,6 +37,7 @@ export declare type FlexStyleProps = {
|
|
|
37
37
|
justifyItems?: CSSProperties['justifyItems'];
|
|
38
38
|
alignSelf?: CSSProperties['alignSelf'];
|
|
39
39
|
gridArea?: CSSProperties['gridArea'];
|
|
40
|
+
lineHeight?: CSSProperties['lineHeight'];
|
|
40
41
|
};
|
|
41
42
|
export declare const flexStyles: (props: FlexStyleProps) => {
|
|
42
43
|
(variantOptions: Object): string;
|
|
@@ -22,10 +22,7 @@ declare const _default: React.MemoExoticComponent<(props: Pick<VizzlyComponents.
|
|
|
22
22
|
[id: string]: import("../../contexts/DashboardBehaviour/types").NumberFormatter;
|
|
23
23
|
};
|
|
24
24
|
dateTimeFormatOptions: {
|
|
25
|
-
[id: string]:
|
|
26
|
-
formatter: (date: Date) => string;
|
|
27
|
-
description: string;
|
|
28
|
-
};
|
|
25
|
+
[id: string]: import("../../contexts/DashboardBehaviour/types").DateTimeFormatter;
|
|
29
26
|
};
|
|
30
27
|
}) => JSX.Element>;
|
|
31
28
|
export default _default;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { DataSet } from '../../../../shared-logic/src/DataSet/types';
|
|
3
|
-
import * as Types from '
|
|
3
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
4
|
+
import { AcceptedTypes } from '../../../../shared-logic/src/CustomField/types';
|
|
4
5
|
export declare const CustomMetric: FunctionComponent<{
|
|
5
6
|
dataSet: DataSet;
|
|
6
|
-
metric: Types.Metric;
|
|
7
|
+
metric: Types.Metric | undefined;
|
|
7
8
|
onChange?: (metric: Types.Metric | undefined) => void;
|
|
9
|
+
isEditing?: boolean;
|
|
10
|
+
supportedTypes: AcceptedTypes[];
|
|
8
11
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import * as Types from '
|
|
2
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
3
3
|
import { DataSet as DataSetType } from '../../../../shared-logic/src/DataSet/types';
|
|
4
4
|
export declare const CustomMetricField: FunctionComponent<{
|
|
5
5
|
field: Types.Field;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import * as Types from '
|
|
2
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
3
3
|
export declare const CustomMetricVariable: FunctionComponent<{
|
|
4
4
|
variable: Types.Variable;
|
|
5
5
|
onDeleteItem: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PickerThing } from '../ItemPicker/ItemPicker';
|
|
2
|
-
import * as Types from '
|
|
2
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
3
3
|
export declare function updateOperatorValue(value: Types.Operator, index: number, item: Types.Operator | Types.NumberInput | Types.Field | Types.Variable | Types.IfLogic): {
|
|
4
4
|
type: Types.PropertyType.Operator;
|
|
5
5
|
op: Types.OperatorType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as Types from '
|
|
1
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
2
2
|
import { TextOverride } from '../../../../shared-logic/src/Translations/types';
|
|
3
3
|
export declare const formatFormula: (obj: Types.Operator | Types.NumberInput | Types.Field | Types.Variable | Types.IfLogic | undefined, isNested: boolean | undefined, textOverride: TextOverride) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Types from '
|
|
1
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
2
2
|
export declare const initMetric: (selected?: import("../../base/ListView/types").ListViewItem<{
|
|
3
3
|
type?: string | undefined;
|
|
4
4
|
}> | undefined) => Types.Metric | undefined;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as Types from '
|
|
3
|
-
|
|
2
|
+
import * as Types from '../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
3
|
+
import { AcceptedTypes } from '../../../../shared-logic/src/CustomField/types';
|
|
4
|
+
export declare const getUsableItems: (supportedTypes: Array<AcceptedTypes>) => ({
|
|
5
|
+
things: any;
|
|
6
|
+
title: string;
|
|
7
|
+
id: string;
|
|
8
|
+
} | {
|
|
9
|
+
things: any;
|
|
10
|
+
title: string;
|
|
11
|
+
id: string;
|
|
12
|
+
})[];
|
|
13
|
+
declare type ItemSelection = {
|
|
4
14
|
[key: string]: (Types.OperatorType | Types.PropertyType)[];
|
|
5
15
|
};
|
|
6
|
-
export declare const pickAvailableItems: (selection:
|
|
16
|
+
export declare const pickAvailableItems: (selection: ItemSelection) => ({
|
|
7
17
|
things: any;
|
|
8
18
|
title: string;
|
|
9
19
|
id: string;
|
|
@@ -3,5 +3,6 @@ import { BarChartProps } from '../BarChart/types';
|
|
|
3
3
|
import { FunnelChartProps } from '../FunnelChart/types';
|
|
4
4
|
import { AreaChartProps } from '../AreaChart/AreaChart';
|
|
5
5
|
import { LineChartProps } from '../LineChart/LineChart';
|
|
6
|
-
|
|
6
|
+
import { LineChartV2Props } from '../LineChartV2/LineChartV2';
|
|
7
|
+
export declare type HeadlineStatsProps = LineChartProps | BarChartProps | AreaChartProps | FunnelChartProps | LineChartV2Props;
|
|
7
8
|
export declare const HeadlineStats: FunctionComponent<HeadlineStatsProps>;
|
|
@@ -8,11 +8,11 @@ export declare type PickerItem = {
|
|
|
8
8
|
title: string;
|
|
9
9
|
things: Array<PickerThing>;
|
|
10
10
|
};
|
|
11
|
-
declare type
|
|
11
|
+
export declare type ItemPickerProps = {
|
|
12
12
|
show: boolean;
|
|
13
13
|
title: string;
|
|
14
14
|
items: Array<PickerItem>;
|
|
15
|
-
onClose: (
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onSave: (selected: PickerThing) => void;
|
|
16
17
|
};
|
|
17
|
-
export declare const ItemPicker: FunctionComponent<
|
|
18
|
-
export {};
|
|
18
|
+
export declare const ItemPicker: FunctionComponent<ItemPickerProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VizzlyComponents } from '../../types';
|
|
3
|
+
import { Component as ComponentType } from '../../../../shared-logic/src/Component/types';
|
|
4
|
+
import { DataSet as DataSetType } from '../../../../shared-logic/src/DataSet/types';
|
|
5
|
+
import { Result } from '../../../../shared-logic/src/Result/types';
|
|
6
|
+
import { DashboardBehaviour, IdPrefix } from '../../contexts/DashboardBehaviour/types';
|
|
7
|
+
import { AdditionalFilter } from '../../../../shared-logic/src/AdditionalFilter/types';
|
|
8
|
+
export declare type LineChartV2Props = {
|
|
9
|
+
component: ComponentType<ComponentType.LineChartV2Attributes>;
|
|
10
|
+
runQueriesCallback: VizzlyComponents.runQueriesCallbackInternal;
|
|
11
|
+
setResults: (results: (Result | null)[]) => void;
|
|
12
|
+
setLocalFilters: (localFilters: ComponentType['localFilters']) => void;
|
|
13
|
+
setParameterUpdate: (payload: ComponentType['updatesFromParameters']) => void;
|
|
14
|
+
globalFilters: AdditionalFilter[];
|
|
15
|
+
dataSet: DataSetType;
|
|
16
|
+
id: string;
|
|
17
|
+
dashboardBehaviour: DashboardBehaviour;
|
|
18
|
+
library?: boolean;
|
|
19
|
+
updateComponentAttributes: (attributes: ComponentType.LineChartV2Attributes) => void;
|
|
20
|
+
idPrefix: IdPrefix;
|
|
21
|
+
};
|
|
22
|
+
export declare const LineChartV2: (props: LineChartV2Props) => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VizzlyComponents } from '../../types';
|
|
3
|
+
import { Component } from '../../../../shared-logic/src/Component/types';
|
|
4
|
+
import { Dashboard } from '../../../../shared-logic/src/Dashboard/types';
|
|
5
|
+
import { IdPrefix, DashboardBehaviour } from '../../contexts/DashboardBehaviour/types';
|
|
6
|
+
import { HeadlineStatsProps } from '../HeadlineStats/HeadlineStats';
|
|
7
|
+
export declare type LineChartV2ViewProps = Omit<VizzlyComponents.ViewProps<{
|
|
8
|
+
attributes: Component.LineChartV2Attributes;
|
|
9
|
+
}>, 'supportedTimeTruncFunctions' | 'supportedTransformationFunctions' | 'supportedAggregates'>;
|
|
10
|
+
export declare const LineChartV2View: (props: LineChartV2ViewProps & {
|
|
11
|
+
dashboard?: Dashboard;
|
|
12
|
+
library?: boolean;
|
|
13
|
+
numberFormatOptions: DashboardBehaviour['numberFormatOptions'];
|
|
14
|
+
dateTimeFormatOptions: DashboardBehaviour['dateTimeFormatOptions'];
|
|
15
|
+
propsForHeadline: HeadlineStatsProps;
|
|
16
|
+
idPrefix: IdPrefix;
|
|
17
|
+
}) => JSX.Element;
|
|
@@ -24,7 +24,7 @@ declare type OverrideDeveloperInfo = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare type IdPrefix = 'dashboard' | 'library' | 'editor';
|
|
26
26
|
export declare type Mode = 'endUser' | 'admin';
|
|
27
|
-
declare type DateTimeFormatter = {
|
|
27
|
+
export declare type DateTimeFormatter = {
|
|
28
28
|
formatter: (date: Date) => string;
|
|
29
29
|
description: string;
|
|
30
30
|
};
|
|
@@ -23,6 +23,8 @@ import { ProgressModalProps } from '../../library/DataPanel/Progress/types';
|
|
|
23
23
|
import { ConditionalFormattingModalProps } from '../../library/StylePanel/ConditionalFormatting/types';
|
|
24
24
|
import { TrendLinesModalProps } from '../../library/DataPanel/Trends/types';
|
|
25
25
|
import { GoalLineModalProps } from '../../library/StylePanel/GoalLine/types';
|
|
26
|
+
import { ItemPickerProps } from '../../components/ItemPicker/ItemPicker';
|
|
27
|
+
import { CustomMetricModalProps } from '../../library/DataPanel/CustomFieldInput/CustomMetric/types';
|
|
26
28
|
export declare enum ModalType {
|
|
27
29
|
Drilldown = "drilldown",
|
|
28
30
|
AdvancedFilter = "advancedFilter",
|
|
@@ -38,7 +40,9 @@ export declare enum ModalType {
|
|
|
38
40
|
Progress = "progress",
|
|
39
41
|
ConditionalFormatting = "conditionalFormatting",
|
|
40
42
|
TrendLines = "trendLines",
|
|
41
|
-
GoalLines = "goalLines"
|
|
43
|
+
GoalLines = "goalLines",
|
|
44
|
+
CalculatedField = "calculatedField",
|
|
45
|
+
ItemPicker = "itemPicker"
|
|
42
46
|
}
|
|
43
47
|
export declare type EditorModalPropsMap = {
|
|
44
48
|
[ModalType.Drilldown]: DrilldownModalProps;
|
|
@@ -56,6 +60,8 @@ export declare type EditorModalPropsMap = {
|
|
|
56
60
|
[ModalType.ConditionalFormatting]: ConditionalFormattingModalProps;
|
|
57
61
|
[ModalType.TrendLines]: TrendLinesModalProps;
|
|
58
62
|
[ModalType.GoalLines]: GoalLineModalProps;
|
|
63
|
+
[ModalType.CalculatedField]: CustomMetricModalProps;
|
|
64
|
+
[ModalType.ItemPicker]: ItemPickerProps;
|
|
59
65
|
};
|
|
60
66
|
declare type ModalChanges<T extends ModalType> = {
|
|
61
67
|
modal: T;
|
package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/CustomMetric/useCustomMetric.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metric as MetricType } from '../../../../../../shared-logic/src/CustomField/CustomMetric/types';
|
|
2
|
+
import { MetricField } from '../../../../../../shared-logic/src/CustomField/types';
|
|
3
|
+
import { QueryEngineConfig } from '../../../../../../shared-logic/src/QueryEngineConfig/types';
|
|
4
|
+
export declare type WipCustomMetricField = {
|
|
5
|
+
publicName: string;
|
|
6
|
+
metric?: MetricType;
|
|
7
|
+
};
|
|
8
|
+
export declare const useCustomMetric: (queryEngineConfig: QueryEngineConfig, initialField: MetricField | undefined, onNewCustomField: (customMetric: MetricField) => void) => {
|
|
9
|
+
publicName: string;
|
|
10
|
+
onChange: (partial: Partial<WipCustomMetricField>) => void;
|
|
11
|
+
resetState: () => void;
|
|
12
|
+
metric: import("../../../../../../shared-logic/src/CustomField/CustomMetric/types").Operator | import("../../../../../../shared-logic/src/CustomField/CustomMetric/types").IfLogic | undefined;
|
|
13
|
+
isEditing: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
handleUpsert: () => void;
|
|
16
|
+
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
+
import { CustomFieldCategory } from '../../../../../shared-logic/src/CustomField/types';
|
|
1
2
|
import { TextOverride } from '../../../../../shared-logic/src/Translations/types';
|
|
2
|
-
|
|
3
|
-
math: string;
|
|
4
|
-
'rules-based_groups': string;
|
|
5
|
-
percentage: string;
|
|
6
|
-
conditional: string;
|
|
7
|
-
number_formatting: string;
|
|
8
|
-
date_difference: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function customMetricText<K extends keyof TextOverrideKeys>(key: K, textOverride: TextOverride): {
|
|
3
|
+
export declare function customMetricText(key: CustomFieldCategory, textOverride: TextOverride): {
|
|
11
4
|
title: string;
|
|
12
5
|
subtext: string;
|
|
13
6
|
};
|
|
14
|
-
export declare function buildCustomMetricTitle
|
|
15
|
-
export {};
|
|
7
|
+
export declare function buildCustomMetricTitle(key: CustomFieldCategory, textOverride: TextOverride): string;
|
|
@@ -10,4 +10,4 @@ export declare const CustomMetricsInput: FunctionComponent<{
|
|
|
10
10
|
queryEngineConfig: QueryEngineConfig;
|
|
11
11
|
componentType: ComponentType;
|
|
12
12
|
}>;
|
|
13
|
-
export declare const mapCategoryToModalType: (category?: "rules" | "math" | "percentage" | "
|
|
13
|
+
export declare const mapCategoryToModalType: (category?: "rules" | "math" | "percentage" | "roundedNumber" | "dateCalculation" | "conditional" | "calculatedField" | undefined) => ModalType | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const formatTitleWithAggregate: (name: string,
|
|
1
|
+
declare const formatTitleWithAggregate: (name: string, aggregateTitle?: string | boolean | undefined) => string;
|
|
2
2
|
export default formatTitleWithAggregate;
|