@grafana/scenes 6.47.1--canary.1303.19493819306.0 → 6.47.1
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 +12 -0
- package/dist/esm/index.js +2 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/variables/utils.js +1 -47
- package/dist/esm/variables/utils.js.map +1 -1
- package/dist/index.d.ts +184 -188
- package/dist/index.js +1 -48
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -988,90 +988,11 @@ interface MacroVariableConstructor {
|
|
|
988
988
|
*/
|
|
989
989
|
declare function registerVariableMacro(name: string, macro: MacroVariableConstructor, replace?: boolean): () => void;
|
|
990
990
|
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
maxDataPoints?: number;
|
|
997
|
-
liveStreaming?: boolean;
|
|
998
|
-
maxDataPointsFromWidth?: boolean;
|
|
999
|
-
cacheTimeout?: DataQueryRequest['cacheTimeout'];
|
|
1000
|
-
queryCachingTTL?: DataQueryRequest['queryCachingTTL'];
|
|
1001
|
-
/**
|
|
1002
|
-
* When set to auto (the default) query runner will issue queries on activate (when variable dependencies are ready) or when time range change.
|
|
1003
|
-
* Set to manual to have full manual control over when queries are issued. Try not to set this. This is mainly useful for unit tests, or special edge case workflows.
|
|
1004
|
-
*/
|
|
1005
|
-
runQueriesMode?: 'auto' | 'manual';
|
|
1006
|
-
dataLayerFilter?: DataLayerFilter;
|
|
1007
|
-
_hasFetchedData?: boolean;
|
|
1008
|
-
}
|
|
1009
|
-
declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {
|
|
1010
|
-
private _querySub?;
|
|
1011
|
-
private _dataLayersSub?;
|
|
1012
|
-
private _dataLayersMerger;
|
|
1013
|
-
private _timeSub?;
|
|
1014
|
-
private _timeSubRange?;
|
|
1015
|
-
private _containerWidth?;
|
|
1016
|
-
private _variableValueRecorder;
|
|
1017
|
-
private _results;
|
|
1018
|
-
private _scopedVars;
|
|
1019
|
-
private _layerAnnotations?;
|
|
1020
|
-
private _resultAnnotations?;
|
|
1021
|
-
private _isInView;
|
|
1022
|
-
private _bypassIsInView;
|
|
1023
|
-
private _queryNotExecutedWhenOutOfView;
|
|
1024
|
-
getResultsStream(): ReplaySubject<SceneDataProviderResult>;
|
|
1025
|
-
protected _variableDependency: VariableDependencyConfig<QueryRunnerState>;
|
|
1026
|
-
private _drilldownDependenciesManager;
|
|
1027
|
-
constructor(initialState: QueryRunnerState);
|
|
1028
|
-
private _onActivate;
|
|
1029
|
-
private _handleDataLayers;
|
|
1030
|
-
private _onLayersReceived;
|
|
1031
|
-
/**
|
|
1032
|
-
* This tries to start a new query whenever a variable completes or is changed.
|
|
1033
|
-
*
|
|
1034
|
-
* We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.
|
|
1035
|
-
* Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will
|
|
1036
|
-
* find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and
|
|
1037
|
-
* not issue any query.
|
|
1038
|
-
*
|
|
1039
|
-
* When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting
|
|
1040
|
-
* the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will
|
|
1041
|
-
* only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will
|
|
1042
|
-
* be called many times until all dependencies are in a non loading state. *
|
|
1043
|
-
*/
|
|
1044
|
-
private onVariableUpdatesCompleted;
|
|
1045
|
-
/**
|
|
1046
|
-
* Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query
|
|
1047
|
-
*/
|
|
1048
|
-
private onAnyVariableChanged;
|
|
1049
|
-
private _isRelevantAutoVariable;
|
|
1050
|
-
private shouldRunQueriesOnActivate;
|
|
1051
|
-
private _isDataTimeRangeStale;
|
|
1052
|
-
private _onDeactivate;
|
|
1053
|
-
setContainerWidth(width: number): void;
|
|
1054
|
-
isDataReadyToDisplay(): boolean;
|
|
1055
|
-
private subscribeToTimeRangeChanges;
|
|
1056
|
-
runQueries(): void;
|
|
1057
|
-
private getMaxDataPoints;
|
|
1058
|
-
cancelQuery(): void;
|
|
1059
|
-
private runWithTimeRange;
|
|
1060
|
-
clone(withState?: Partial<QueryRunnerState>): this;
|
|
1061
|
-
private prepareRequests;
|
|
1062
|
-
private onDataReceived;
|
|
1063
|
-
private _combineDataLayers;
|
|
1064
|
-
private _setNoDataState;
|
|
1065
|
-
/**
|
|
1066
|
-
* Walk up the scene graph and find any ExtraQueryProviders.
|
|
1067
|
-
*
|
|
1068
|
-
* This will return an array of the closest provider of each type.
|
|
1069
|
-
*/
|
|
1070
|
-
private getClosestExtraQueryProviders;
|
|
1071
|
-
private isQueryModeAuto;
|
|
1072
|
-
isInViewChanged(isInView: boolean): void;
|
|
1073
|
-
bypassIsInViewChanged(bypassIsInView: boolean): void;
|
|
1074
|
-
}
|
|
991
|
+
declare function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]): string;
|
|
992
|
+
declare function escapeLabelValueInExactSelector(labelValue: string): string;
|
|
993
|
+
declare function escapeLabelValueInRegexSelector(labelValue: string): string;
|
|
994
|
+
declare function escapeUrlPipeDelimiters(value: string | undefined): string;
|
|
995
|
+
declare function escapeURLDelimiters(value: string | undefined): string;
|
|
1075
996
|
|
|
1076
997
|
declare class AdHocFiltersVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {
|
|
1077
998
|
private _variable;
|
|
@@ -1244,6 +1165,20 @@ declare class AdHocFiltersVariable extends SceneObjectBase<AdHocFiltersVariableS
|
|
|
1244
1165
|
}
|
|
1245
1166
|
declare function AdHocFiltersVariableRenderer({ model }: SceneComponentProps<AdHocFiltersVariable>): React__default.JSX.Element;
|
|
1246
1167
|
|
|
1168
|
+
interface ConstantVariableState extends SceneVariableState {
|
|
1169
|
+
value: VariableValue;
|
|
1170
|
+
}
|
|
1171
|
+
declare class ConstantVariable extends SceneObjectBase<ConstantVariableState> implements SceneVariable<ConstantVariableState> {
|
|
1172
|
+
protected _variableDependency: VariableDependencyConfig<ConstantVariableState>;
|
|
1173
|
+
private _prevValue;
|
|
1174
|
+
constructor(initialState: Partial<ConstantVariableState>);
|
|
1175
|
+
/**
|
|
1176
|
+
* This function is called on when SceneVariableSet is activated or when a dependency changes.
|
|
1177
|
+
*/
|
|
1178
|
+
validateAndUpdate(): Observable<ValidateAndUpdateResult>;
|
|
1179
|
+
getValue(): VariableValue;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1247
1182
|
interface MultiValueVariableState extends SceneVariableState {
|
|
1248
1183
|
value: VariableValue;
|
|
1249
1184
|
text: VariableValue;
|
|
@@ -1318,108 +1253,6 @@ declare abstract class MultiValueVariable<TState extends MultiValueVariableState
|
|
|
1318
1253
|
onSearchChange?(searchFilter: string): void;
|
|
1319
1254
|
}
|
|
1320
1255
|
|
|
1321
|
-
interface GroupByVariableState extends MultiValueVariableState {
|
|
1322
|
-
/** Defaults to "Group" */
|
|
1323
|
-
name: string;
|
|
1324
|
-
/** The visible keys to group on */
|
|
1325
|
-
defaultOptions?: MetricFindValue[];
|
|
1326
|
-
/** Base filters to always apply when looking up keys */
|
|
1327
|
-
baseFilters?: AdHocVariableFilter[];
|
|
1328
|
-
/** Datasource to use for getTagKeys and also controls which scene queries the group by should apply to */
|
|
1329
|
-
datasource: DataSourceRef | null;
|
|
1330
|
-
/** Default value set for this groupBy. When this field is set, changing value will allow the user to restore back to this default value */
|
|
1331
|
-
defaultValue?: {
|
|
1332
|
-
text: VariableValue;
|
|
1333
|
-
value: VariableValue;
|
|
1334
|
-
};
|
|
1335
|
-
/** Needed for url sync when passing flag to another dashboard */
|
|
1336
|
-
restorable?: boolean;
|
|
1337
|
-
/** Controls if the group by can be changed */
|
|
1338
|
-
readOnly?: boolean;
|
|
1339
|
-
/**
|
|
1340
|
-
* @experimental
|
|
1341
|
-
* Controls the layout and design of the label.
|
|
1342
|
-
* Vertical layout does not yet support operator selector.
|
|
1343
|
-
*/
|
|
1344
|
-
layout?: ControlsLayout;
|
|
1345
|
-
/**
|
|
1346
|
-
* Defaults to same-datasource which means group by will automatically be applied to all queries with the same data source as this GroupBySet.
|
|
1347
|
-
* In manual mode no queries are re-run on changes, and you have to manually apply the filter to whatever queries you want.
|
|
1348
|
-
*/
|
|
1349
|
-
applyMode?: 'auto' | 'manual';
|
|
1350
|
-
/**
|
|
1351
|
-
* Filter out the keys that do not match the regex.
|
|
1352
|
-
*/
|
|
1353
|
-
tagKeyRegexFilter?: RegExp;
|
|
1354
|
-
/**
|
|
1355
|
-
* Extension hook for customizing the key lookup.
|
|
1356
|
-
* Return replace: true if you want to override the default lookup
|
|
1357
|
-
* Return replace: false if you want to combine the results with the default lookup
|
|
1358
|
-
*/
|
|
1359
|
-
getTagKeysProvider?: getTagKeysProvider;
|
|
1360
|
-
/**
|
|
1361
|
-
* Holds the applicability for each of the selected keys
|
|
1362
|
-
*/
|
|
1363
|
-
keysApplicability?: DrilldownsApplicability[];
|
|
1364
|
-
/**
|
|
1365
|
-
* state for checking whether drilldown applicability is enabled
|
|
1366
|
-
*/
|
|
1367
|
-
applicabilityEnabled?: boolean;
|
|
1368
|
-
}
|
|
1369
|
-
type getTagKeysProvider = (set: GroupByVariable, currentKey: string | null) => Promise<{
|
|
1370
|
-
replace?: boolean;
|
|
1371
|
-
values: MetricFindValue[] | GetTagResponse;
|
|
1372
|
-
}>;
|
|
1373
|
-
declare class GroupByVariable extends MultiValueVariable<GroupByVariableState> {
|
|
1374
|
-
static Component: typeof GroupByVariableRenderer;
|
|
1375
|
-
isLazy: boolean;
|
|
1376
|
-
protected _urlSync: SceneObjectUrlSyncHandler;
|
|
1377
|
-
validateAndUpdate(): Observable<ValidateAndUpdateResult>;
|
|
1378
|
-
private _updateValueGivenNewOptions;
|
|
1379
|
-
getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]>;
|
|
1380
|
-
constructor(initialState: Partial<GroupByVariableState>);
|
|
1381
|
-
private _activationHandler;
|
|
1382
|
-
getApplicableKeys(): VariableValue;
|
|
1383
|
-
getGroupByApplicabilityForQueries(value: VariableValue, queries: SceneDataQuery[]): Promise<DrilldownsApplicability[] | undefined>;
|
|
1384
|
-
_verifyApplicability(): Promise<void>;
|
|
1385
|
-
checkIfRestorable(values: VariableValue): boolean;
|
|
1386
|
-
restoreDefaultValues(): void;
|
|
1387
|
-
/**
|
|
1388
|
-
* Get possible keys given current filters. Do not call from plugins directly
|
|
1389
|
-
*/
|
|
1390
|
-
_getKeys: (ds: DataSourceApi) => Promise<GetTagResponse | MetricFindValue[]>;
|
|
1391
|
-
/**
|
|
1392
|
-
* Allows clearing the value of the variable to an empty value. Overrides default behavior of a MultiValueVariable
|
|
1393
|
-
*/
|
|
1394
|
-
getDefaultMultiState(options: VariableValueOption[]): {
|
|
1395
|
-
value: VariableValueSingle[];
|
|
1396
|
-
text: string[];
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
declare function GroupByVariableRenderer({ model }: SceneComponentProps<GroupByVariable>): React__default.JSX.Element;
|
|
1400
|
-
|
|
1401
|
-
declare function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]): string;
|
|
1402
|
-
declare function escapeLabelValueInExactSelector(labelValue: string): string;
|
|
1403
|
-
declare function escapeLabelValueInRegexSelector(labelValue: string): string;
|
|
1404
|
-
declare function escapeUrlPipeDelimiters(value: string | undefined): string;
|
|
1405
|
-
declare function escapeURLDelimiters(value: string | undefined): string;
|
|
1406
|
-
declare function verifyDrilldownApplicability(sourceObject: SceneObject, queriesDataSource: DataSourceRef | undefined, drilldownDatasource: DataSourceRef | null, isApplicabilityEnabled?: boolean): boolean;
|
|
1407
|
-
declare function getDrilldownApplicability(queryRunner: SceneQueryRunner, filtersVar?: AdHocFiltersVariable, groupByVar?: GroupByVariable): Promise<DrilldownsApplicability[] | undefined>;
|
|
1408
|
-
|
|
1409
|
-
interface ConstantVariableState extends SceneVariableState {
|
|
1410
|
-
value: VariableValue;
|
|
1411
|
-
}
|
|
1412
|
-
declare class ConstantVariable extends SceneObjectBase<ConstantVariableState> implements SceneVariable<ConstantVariableState> {
|
|
1413
|
-
protected _variableDependency: VariableDependencyConfig<ConstantVariableState>;
|
|
1414
|
-
private _prevValue;
|
|
1415
|
-
constructor(initialState: Partial<ConstantVariableState>);
|
|
1416
|
-
/**
|
|
1417
|
-
* This function is called on when SceneVariableSet is activated or when a dependency changes.
|
|
1418
|
-
*/
|
|
1419
|
-
validateAndUpdate(): Observable<ValidateAndUpdateResult>;
|
|
1420
|
-
getValue(): VariableValue;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
1256
|
interface CustomVariableState extends MultiValueVariableState {
|
|
1424
1257
|
query: string;
|
|
1425
1258
|
}
|
|
@@ -1513,6 +1346,86 @@ declare class QueryVariable extends MultiValueVariable<QueryVariableState> {
|
|
|
1513
1346
|
static Component: ({ model }: SceneComponentProps<MultiValueVariable>) => React__default.JSX.Element;
|
|
1514
1347
|
}
|
|
1515
1348
|
|
|
1349
|
+
interface GroupByVariableState extends MultiValueVariableState {
|
|
1350
|
+
/** Defaults to "Group" */
|
|
1351
|
+
name: string;
|
|
1352
|
+
/** The visible keys to group on */
|
|
1353
|
+
defaultOptions?: MetricFindValue[];
|
|
1354
|
+
/** Base filters to always apply when looking up keys */
|
|
1355
|
+
baseFilters?: AdHocVariableFilter[];
|
|
1356
|
+
/** Datasource to use for getTagKeys and also controls which scene queries the group by should apply to */
|
|
1357
|
+
datasource: DataSourceRef | null;
|
|
1358
|
+
/** Default value set for this groupBy. When this field is set, changing value will allow the user to restore back to this default value */
|
|
1359
|
+
defaultValue?: {
|
|
1360
|
+
text: VariableValue;
|
|
1361
|
+
value: VariableValue;
|
|
1362
|
+
};
|
|
1363
|
+
/** Needed for url sync when passing flag to another dashboard */
|
|
1364
|
+
restorable?: boolean;
|
|
1365
|
+
/** Controls if the group by can be changed */
|
|
1366
|
+
readOnly?: boolean;
|
|
1367
|
+
/**
|
|
1368
|
+
* @experimental
|
|
1369
|
+
* Controls the layout and design of the label.
|
|
1370
|
+
* Vertical layout does not yet support operator selector.
|
|
1371
|
+
*/
|
|
1372
|
+
layout?: ControlsLayout;
|
|
1373
|
+
/**
|
|
1374
|
+
* Defaults to same-datasource which means group by will automatically be applied to all queries with the same data source as this GroupBySet.
|
|
1375
|
+
* In manual mode no queries are re-run on changes, and you have to manually apply the filter to whatever queries you want.
|
|
1376
|
+
*/
|
|
1377
|
+
applyMode?: 'auto' | 'manual';
|
|
1378
|
+
/**
|
|
1379
|
+
* Filter out the keys that do not match the regex.
|
|
1380
|
+
*/
|
|
1381
|
+
tagKeyRegexFilter?: RegExp;
|
|
1382
|
+
/**
|
|
1383
|
+
* Extension hook for customizing the key lookup.
|
|
1384
|
+
* Return replace: true if you want to override the default lookup
|
|
1385
|
+
* Return replace: false if you want to combine the results with the default lookup
|
|
1386
|
+
*/
|
|
1387
|
+
getTagKeysProvider?: getTagKeysProvider;
|
|
1388
|
+
/**
|
|
1389
|
+
* Holds the applicability for each of the selected keys
|
|
1390
|
+
*/
|
|
1391
|
+
keysApplicability?: DrilldownsApplicability[];
|
|
1392
|
+
/**
|
|
1393
|
+
* state for checking whether drilldown applicability is enabled
|
|
1394
|
+
*/
|
|
1395
|
+
applicabilityEnabled?: boolean;
|
|
1396
|
+
}
|
|
1397
|
+
type getTagKeysProvider = (set: GroupByVariable, currentKey: string | null) => Promise<{
|
|
1398
|
+
replace?: boolean;
|
|
1399
|
+
values: MetricFindValue[] | GetTagResponse;
|
|
1400
|
+
}>;
|
|
1401
|
+
declare class GroupByVariable extends MultiValueVariable<GroupByVariableState> {
|
|
1402
|
+
static Component: typeof GroupByVariableRenderer;
|
|
1403
|
+
isLazy: boolean;
|
|
1404
|
+
protected _urlSync: SceneObjectUrlSyncHandler;
|
|
1405
|
+
validateAndUpdate(): Observable<ValidateAndUpdateResult>;
|
|
1406
|
+
private _updateValueGivenNewOptions;
|
|
1407
|
+
getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]>;
|
|
1408
|
+
constructor(initialState: Partial<GroupByVariableState>);
|
|
1409
|
+
private _activationHandler;
|
|
1410
|
+
getApplicableKeys(): VariableValue;
|
|
1411
|
+
getGroupByApplicabilityForQueries(value: VariableValue, queries: SceneDataQuery[]): Promise<DrilldownsApplicability[] | undefined>;
|
|
1412
|
+
_verifyApplicability(): Promise<void>;
|
|
1413
|
+
checkIfRestorable(values: VariableValue): boolean;
|
|
1414
|
+
restoreDefaultValues(): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* Get possible keys given current filters. Do not call from plugins directly
|
|
1417
|
+
*/
|
|
1418
|
+
_getKeys: (ds: DataSourceApi) => Promise<GetTagResponse | MetricFindValue[]>;
|
|
1419
|
+
/**
|
|
1420
|
+
* Allows clearing the value of the variable to an empty value. Overrides default behavior of a MultiValueVariable
|
|
1421
|
+
*/
|
|
1422
|
+
getDefaultMultiState(options: VariableValueOption[]): {
|
|
1423
|
+
value: VariableValueSingle[];
|
|
1424
|
+
text: string[];
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
declare function GroupByVariableRenderer({ model }: SceneComponentProps<GroupByVariable>): React__default.JSX.Element;
|
|
1428
|
+
|
|
1516
1429
|
interface SwitchVariableState extends SceneVariableState {
|
|
1517
1430
|
value: string;
|
|
1518
1431
|
enabledValue: string;
|
|
@@ -2175,6 +2088,91 @@ declare class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase<SceneT
|
|
|
2175
2088
|
onTimeZoneChange(timeZone: string): void;
|
|
2176
2089
|
}
|
|
2177
2090
|
|
|
2091
|
+
interface QueryRunnerState extends SceneObjectState {
|
|
2092
|
+
data?: PanelData;
|
|
2093
|
+
queries: SceneDataQuery[];
|
|
2094
|
+
datasource?: DataSourceRef;
|
|
2095
|
+
minInterval?: string;
|
|
2096
|
+
maxDataPoints?: number;
|
|
2097
|
+
liveStreaming?: boolean;
|
|
2098
|
+
maxDataPointsFromWidth?: boolean;
|
|
2099
|
+
cacheTimeout?: DataQueryRequest['cacheTimeout'];
|
|
2100
|
+
queryCachingTTL?: DataQueryRequest['queryCachingTTL'];
|
|
2101
|
+
/**
|
|
2102
|
+
* When set to auto (the default) query runner will issue queries on activate (when variable dependencies are ready) or when time range change.
|
|
2103
|
+
* Set to manual to have full manual control over when queries are issued. Try not to set this. This is mainly useful for unit tests, or special edge case workflows.
|
|
2104
|
+
*/
|
|
2105
|
+
runQueriesMode?: 'auto' | 'manual';
|
|
2106
|
+
dataLayerFilter?: DataLayerFilter;
|
|
2107
|
+
_hasFetchedData?: boolean;
|
|
2108
|
+
}
|
|
2109
|
+
declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {
|
|
2110
|
+
private _querySub?;
|
|
2111
|
+
private _dataLayersSub?;
|
|
2112
|
+
private _dataLayersMerger;
|
|
2113
|
+
private _timeSub?;
|
|
2114
|
+
private _timeSubRange?;
|
|
2115
|
+
private _containerWidth?;
|
|
2116
|
+
private _variableValueRecorder;
|
|
2117
|
+
private _results;
|
|
2118
|
+
private _scopedVars;
|
|
2119
|
+
private _layerAnnotations?;
|
|
2120
|
+
private _resultAnnotations?;
|
|
2121
|
+
private _isInView;
|
|
2122
|
+
private _bypassIsInView;
|
|
2123
|
+
private _queryNotExecutedWhenOutOfView;
|
|
2124
|
+
getResultsStream(): ReplaySubject<SceneDataProviderResult>;
|
|
2125
|
+
protected _variableDependency: VariableDependencyConfig<QueryRunnerState>;
|
|
2126
|
+
private _drilldownDependenciesManager;
|
|
2127
|
+
constructor(initialState: QueryRunnerState);
|
|
2128
|
+
private _onActivate;
|
|
2129
|
+
private _handleDataLayers;
|
|
2130
|
+
private _onLayersReceived;
|
|
2131
|
+
/**
|
|
2132
|
+
* This tries to start a new query whenever a variable completes or is changed.
|
|
2133
|
+
*
|
|
2134
|
+
* We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.
|
|
2135
|
+
* Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will
|
|
2136
|
+
* find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and
|
|
2137
|
+
* not issue any query.
|
|
2138
|
+
*
|
|
2139
|
+
* When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting
|
|
2140
|
+
* the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will
|
|
2141
|
+
* only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will
|
|
2142
|
+
* be called many times until all dependencies are in a non loading state. *
|
|
2143
|
+
*/
|
|
2144
|
+
private onVariableUpdatesCompleted;
|
|
2145
|
+
/**
|
|
2146
|
+
* Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query
|
|
2147
|
+
*/
|
|
2148
|
+
private onAnyVariableChanged;
|
|
2149
|
+
private _isRelevantAutoVariable;
|
|
2150
|
+
private shouldRunQueriesOnActivate;
|
|
2151
|
+
private _isDataTimeRangeStale;
|
|
2152
|
+
private _onDeactivate;
|
|
2153
|
+
setContainerWidth(width: number): void;
|
|
2154
|
+
isDataReadyToDisplay(): boolean;
|
|
2155
|
+
private subscribeToTimeRangeChanges;
|
|
2156
|
+
runQueries(): void;
|
|
2157
|
+
private getMaxDataPoints;
|
|
2158
|
+
cancelQuery(): void;
|
|
2159
|
+
private runWithTimeRange;
|
|
2160
|
+
clone(withState?: Partial<QueryRunnerState>): this;
|
|
2161
|
+
private prepareRequests;
|
|
2162
|
+
private onDataReceived;
|
|
2163
|
+
private _combineDataLayers;
|
|
2164
|
+
private _setNoDataState;
|
|
2165
|
+
/**
|
|
2166
|
+
* Walk up the scene graph and find any ExtraQueryProviders.
|
|
2167
|
+
*
|
|
2168
|
+
* This will return an array of the closest provider of each type.
|
|
2169
|
+
*/
|
|
2170
|
+
private getClosestExtraQueryProviders;
|
|
2171
|
+
private isQueryModeAuto;
|
|
2172
|
+
isInViewChanged(isInView: boolean): void;
|
|
2173
|
+
bypassIsInViewChanged(bypassIsInView: boolean): void;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2178
2176
|
interface DataProviderSharerState extends SceneDataState {
|
|
2179
2177
|
source: SceneObjectRef<SceneDataProvider>;
|
|
2180
2178
|
}
|
|
@@ -3596,8 +3594,6 @@ declare const sceneUtils: {
|
|
|
3596
3594
|
isSwitchVariable: typeof isSwitchVariable;
|
|
3597
3595
|
isRepeatCloneOrChildOf: typeof isRepeatCloneOrChildOf;
|
|
3598
3596
|
buildPathIdFor: typeof buildPathIdFor;
|
|
3599
|
-
verifyDrilldownApplicability: typeof verifyDrilldownApplicability;
|
|
3600
|
-
getDrilldownApplicability: typeof getDrilldownApplicability;
|
|
3601
3597
|
};
|
|
3602
3598
|
|
|
3603
3599
|
export { AdHocFiltersComboboxRenderer, AdHocFiltersVariable, AdHocFiltersVariableController, ConstantVariable, ControlsLabel, CustomVariable, DataProviderProxy, DataSourceVariable, EmbeddedScene, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, GroupByVariable, IntervalVariable, LazyLoader, LocalValueVariable, MultiOrSingleValueSelect, MultiValueVariable, NestedScene, NewSceneObjectAddedEvent, PATH_ID_SEPARATOR, PanelBuilders, PanelOptionsBuilders, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, SceneApp, SceneAppPage, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataTransformer, SceneDebugger, SceneFlexItem, SceneFlexLayout, SceneGridItem, SceneGridLayout, SceneGridLayoutDragStartEvent, SceneGridRow, SceneObjectBase, SceneObjectRef, SceneObjectStateChangedEvent, SceneObjectUrlSyncConfig, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariableSet, SceneVariableValueChangedEvent, ScopesVariable, SplitLayout, SwitchVariable, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UserActionEvent, VariableDependencyConfig, VariableValueControl, VariableValueSelectWrapper, VariableValueSelectors, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelExploreButton, VizPanelMenu, index$2 as behaviors, index as dataLayers, escapeUrlPipeDelimiters, formatRegistry, getExploreURL, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, loadResources, index$1 as performanceUtils, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync, writePerformanceLog };
|
package/dist/index.js
CHANGED
|
@@ -9071,50 +9071,6 @@ function getNonApplicablePillStyles(theme) {
|
|
|
9071
9071
|
})
|
|
9072
9072
|
};
|
|
9073
9073
|
}
|
|
9074
|
-
function verifyDrilldownApplicability(sourceObject, queriesDataSource, drilldownDatasource, isApplicabilityEnabled) {
|
|
9075
|
-
const datasourceUid = sceneGraph.interpolate(sourceObject, queriesDataSource == null ? void 0 : queriesDataSource.uid);
|
|
9076
|
-
return Boolean(
|
|
9077
|
-
isApplicabilityEnabled && datasourceUid === sceneGraph.interpolate(sourceObject, drilldownDatasource == null ? void 0 : drilldownDatasource.uid)
|
|
9078
|
-
);
|
|
9079
|
-
}
|
|
9080
|
-
async function getDrilldownApplicability(queryRunner, filtersVar, groupByVar) {
|
|
9081
|
-
var _a, _b, _c, _d, _e, _f;
|
|
9082
|
-
if (!filtersVar && !groupByVar) {
|
|
9083
|
-
return;
|
|
9084
|
-
}
|
|
9085
|
-
const datasource = queryRunner.state.datasource;
|
|
9086
|
-
const queries = (_b = (_a = queryRunner.state.data) == null ? void 0 : _a.request) == null ? void 0 : _b.targets;
|
|
9087
|
-
const ds = await getDataSource(datasource, {
|
|
9088
|
-
__sceneObject: wrapInSafeSerializableSceneObject(queryRunner)
|
|
9089
|
-
});
|
|
9090
|
-
if (!ds.getDrilldownsApplicability) {
|
|
9091
|
-
return;
|
|
9092
|
-
}
|
|
9093
|
-
const dsUid = sceneGraph.interpolate(queryRunner, datasource == null ? void 0 : datasource.uid);
|
|
9094
|
-
const timeRange = sceneGraph.getTimeRange(queryRunner).state.value;
|
|
9095
|
-
const groupByKeys = [];
|
|
9096
|
-
const filters = [];
|
|
9097
|
-
const hasGroupByApplicability = groupByVar && dsUid === sceneGraph.interpolate(groupByVar, (_c = groupByVar == null ? void 0 : groupByVar.state.datasource) == null ? void 0 : _c.uid);
|
|
9098
|
-
const hasFiltersApplicability = filtersVar && dsUid === sceneGraph.interpolate(filtersVar, (_e = (_d = filtersVar.state) == null ? void 0 : _d.datasource) == null ? void 0 : _e.uid);
|
|
9099
|
-
if (!hasGroupByApplicability && !hasFiltersApplicability) {
|
|
9100
|
-
return;
|
|
9101
|
-
}
|
|
9102
|
-
if (hasGroupByApplicability) {
|
|
9103
|
-
groupByKeys.push(
|
|
9104
|
-
...Array.isArray(groupByVar.state.value) ? groupByVar.state.value.map((v) => String(v)) : groupByVar.state.value ? [String(groupByVar.state.value)] : []
|
|
9105
|
-
);
|
|
9106
|
-
}
|
|
9107
|
-
if (hasFiltersApplicability) {
|
|
9108
|
-
filters.push(...filtersVar.state.filters, ...(_f = filtersVar.state.originFilters) != null ? _f : []);
|
|
9109
|
-
}
|
|
9110
|
-
return await ds.getDrilldownsApplicability({
|
|
9111
|
-
groupByKeys,
|
|
9112
|
-
filters,
|
|
9113
|
-
queries,
|
|
9114
|
-
timeRange,
|
|
9115
|
-
scopes: sceneGraph.getScopes(queryRunner)
|
|
9116
|
-
});
|
|
9117
|
-
}
|
|
9118
9074
|
|
|
9119
9075
|
class ConstantVariable extends SceneObjectBase {
|
|
9120
9076
|
constructor(initialState) {
|
|
@@ -16178,10 +16134,7 @@ const sceneUtils = {
|
|
|
16178
16134
|
isGroupByVariable,
|
|
16179
16135
|
isSwitchVariable,
|
|
16180
16136
|
isRepeatCloneOrChildOf,
|
|
16181
|
-
buildPathIdFor
|
|
16182
|
-
//drilldowns
|
|
16183
|
-
verifyDrilldownApplicability,
|
|
16184
|
-
getDrilldownApplicability
|
|
16137
|
+
buildPathIdFor
|
|
16185
16138
|
};
|
|
16186
16139
|
|
|
16187
16140
|
exports.AdHocFiltersComboboxRenderer = AdHocFiltersComboboxRenderer;
|