@grafana/scenes 4.27.0--canary.766.9369774725.0 → 4.27.0--canary.766.9398430196.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +29 -0
- package/README.md +2 -0
- package/dist/esm/components/SceneTimeRangeCompare.js +55 -1
- package/dist/esm/components/SceneTimeRangeCompare.js.map +1 -1
- package/dist/esm/components/VizPanel/VizPanel.js +3 -0
- package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
- package/dist/esm/core/PanelBuilders/VizConfigBuilder.js +78 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilder.js.map +1 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilders.js +114 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilders.js.map +1 -0
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/ExtraQueryProvider.js +6 -0
- package/dist/esm/querying/ExtraQueryProvider.js.map +1 -0
- package/dist/esm/querying/SceneQueryRunner.js +85 -88
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/querying/extraQueryProcessingOperator.js +46 -0
- package/dist/esm/querying/extraQueryProcessingOperator.js.map +1 -0
- package/dist/esm/utils/writeSceneLog.js +5 -1
- package/dist/esm/utils/writeSceneLog.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +3 -1
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +9 -2
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/components/getOptionSearcher.js +2 -1
- package/dist/esm/variables/components/getOptionSearcher.js.map +1 -1
- package/dist/esm/variables/interpolation/sceneInterpolator.js +3 -3
- package/dist/esm/variables/interpolation/sceneInterpolator.js.map +1 -1
- package/dist/esm/variables/utils.js.map +1 -1
- package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
- package/dist/index.d.ts +256 -146
- package/dist/index.js +1127 -897
- package/dist/index.js.map +1 -1
- package/package.json +4 -7
- package/dist/esm/querying/timeShiftQueryResponseOperator.js +0 -60
- package/dist/esm/querying/timeShiftQueryResponseOperator.js.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import * as _grafana_data from '@grafana/data';
|
2
|
-
import { BusEventWithPayload, PanelData, BusEvent, BusEventType, BusEventHandler, TimeRange, DataQueryRequest, DataTransformContext, DataFrame, PanelPlugin, EventBus, DataQuery, DataSourceApi, Registry, RegistryItem, ScopedVars, AdHocVariableFilter, SelectableValue, MetricFindValue, VariableRefresh as VariableRefresh$1, VariableSort, EventFilterOptions, AnnotationEvent, AnnotationQuery, DataTransformerConfig, PanelMenuItem, FieldConfigSource, PanelModel, AbsoluteTimeRange, InterpolateFunction, IconName as IconName$1, FieldConfig, FieldType, FieldValueMatcherConfig } from '@grafana/data';
|
2
|
+
import { BusEventWithPayload, PanelData, BusEvent, BusEventType, BusEventHandler, TimeRange, DataQueryRequest, DataTransformContext, DataFrame, PanelPlugin, EventBus, DataQuery as DataQuery$1, DataSourceApi, Registry, RegistryItem, ScopedVars, AdHocVariableFilter, SelectableValue, MetricFindValue, VariableRefresh as VariableRefresh$1, VariableSort, EventFilterOptions, AnnotationEvent, AnnotationQuery, DataTransformerConfig, PanelMenuItem, FieldConfigSource, PanelModel, AbsoluteTimeRange, InterpolateFunction, IconName as IconName$1, FieldConfig, FieldType, FieldValueMatcherConfig } from '@grafana/data';
|
3
3
|
import * as React$1 from 'react';
|
4
4
|
import React__default, { CSSProperties, ComponentType } from 'react';
|
5
5
|
import * as rxjs from 'rxjs';
|
6
6
|
import { Observable, Unsubscribable, MonoTypeOperatorFunction, Subscription, ReplaySubject } from 'rxjs';
|
7
7
|
import * as _grafana_schema from '@grafana/schema';
|
8
|
-
import { VariableType, VariableHide, TimeZone, DataTopic,
|
8
|
+
import { VariableType, VariableHide, TimeZone, DataTopic, DataQuery, DataSourceRef, VariableRefresh, LoadingState, DashboardCursorSync, MatcherConfig, TableFieldOptions } from '@grafana/schema';
|
9
9
|
import { VariableInterpolation } from '@grafana/runtime';
|
10
10
|
import { PanelContext, IconName } from '@grafana/ui';
|
11
11
|
import ReactGridLayout from 'react-grid-layout';
|
@@ -309,6 +309,10 @@ interface UseStateHookOptions {
|
|
309
309
|
*/
|
310
310
|
shouldActivateOrKeepAlive?: boolean;
|
311
311
|
}
|
312
|
+
interface SceneDataQuery extends DataQuery {
|
313
|
+
[key: string]: any;
|
314
|
+
timeRangeCompare?: boolean;
|
315
|
+
}
|
312
316
|
|
313
317
|
/**
|
314
318
|
*
|
@@ -422,7 +426,7 @@ declare function useSceneObjectState<TState extends SceneObjectState>(model: Sce
|
|
422
426
|
|
423
427
|
declare function cloneSceneObjectState<TState extends SceneObjectState>(sceneState: TState, withState?: Partial<TState>): TState;
|
424
428
|
|
425
|
-
declare abstract class RuntimeDataSource<TQuery extends DataQuery = DataQuery> extends DataSourceApi<TQuery> {
|
429
|
+
declare abstract class RuntimeDataSource<TQuery extends DataQuery$1 = DataQuery$1> extends DataSourceApi<TQuery> {
|
426
430
|
constructor(pluginId: string, uid: string);
|
427
431
|
testDatasource(): Promise<any>;
|
428
432
|
}
|
@@ -477,143 +481,6 @@ interface MacroVariableConstructor {
|
|
477
481
|
*/
|
478
482
|
declare function registerVariableMacro(name: string, macro: MacroVariableConstructor): () => void;
|
479
483
|
|
480
|
-
interface VariableDependencyConfigOptions<TState extends SceneObjectState> {
|
481
|
-
/**
|
482
|
-
* State paths to scan / extract variable dependencies from. Leave empty to scan all paths.
|
483
|
-
*/
|
484
|
-
statePaths?: Array<keyof TState | '*'>;
|
485
|
-
/**
|
486
|
-
* Explicit list of variable names to depend on. Leave empty to scan state for dependencies.
|
487
|
-
*/
|
488
|
-
variableNames?: string[];
|
489
|
-
/**
|
490
|
-
* Optional way to customize how to handle when a dependent variable changes
|
491
|
-
* If not specified the default behavior is to trigger a re-render
|
492
|
-
*/
|
493
|
-
onReferencedVariableValueChanged?: (variable: SceneVariable) => void;
|
494
|
-
/**
|
495
|
-
* Two scenarios trigger this callback to be called.
|
496
|
-
* 1. When any direct dependency changed value
|
497
|
-
* 2. In case hasDependencyInLoadingState was called and returned true we really care about any variable update. So in this scenario this callback is called
|
498
|
-
* after any variable update completes. This is to cover scenarios where an object is waiting for indirect dependencies to complete.
|
499
|
-
*/
|
500
|
-
onVariableUpdateCompleted?: () => void;
|
501
|
-
/**
|
502
|
-
* Optional way to subscribe to all variable value changes, even to variables that are not dependencies.
|
503
|
-
*/
|
504
|
-
onAnyVariableChanged?: (variable: SceneVariable) => void;
|
505
|
-
}
|
506
|
-
declare class VariableDependencyConfig<TState extends SceneObjectState> implements SceneVariableDependencyConfigLike {
|
507
|
-
private _sceneObject;
|
508
|
-
private _options;
|
509
|
-
private _state;
|
510
|
-
private _dependencies;
|
511
|
-
private _statePaths?;
|
512
|
-
private _isWaitingForVariables;
|
513
|
-
scanCount: number;
|
514
|
-
constructor(_sceneObject: SceneObject<TState>, _options: VariableDependencyConfigOptions<TState>);
|
515
|
-
/**
|
516
|
-
* Used to check for dependency on a specific variable
|
517
|
-
*/
|
518
|
-
hasDependencyOn(name: string): boolean;
|
519
|
-
/**
|
520
|
-
* This is called whenever any set of variables have new values. It is up to this implementation to check if it's relevant given the current dependencies.
|
521
|
-
*/
|
522
|
-
variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void;
|
523
|
-
hasDependencyInLoadingState(): boolean;
|
524
|
-
getNames(): Set<string>;
|
525
|
-
/**
|
526
|
-
* Update variableNames
|
527
|
-
*/
|
528
|
-
setVariableNames(varNames: string[]): void;
|
529
|
-
setPaths(paths: Array<keyof TState | '*'>): void;
|
530
|
-
private scanStateForDependencies;
|
531
|
-
private extractVariablesFrom;
|
532
|
-
}
|
533
|
-
|
534
|
-
interface QueryRunnerState extends SceneObjectState {
|
535
|
-
data?: PanelData;
|
536
|
-
queries: DataQueryExtended[];
|
537
|
-
datasource?: DataSourceRef;
|
538
|
-
minInterval?: string;
|
539
|
-
maxDataPoints?: number;
|
540
|
-
liveStreaming?: boolean;
|
541
|
-
maxDataPointsFromWidth?: boolean;
|
542
|
-
cacheTimeout?: DataQueryRequest['cacheTimeout'];
|
543
|
-
queryCachingTTL?: DataQueryRequest['queryCachingTTL'];
|
544
|
-
dataLayerFilter?: DataLayerFilter;
|
545
|
-
_hasFetchedData?: boolean;
|
546
|
-
}
|
547
|
-
interface DataQueryExtended extends DataQuery$1 {
|
548
|
-
[key: string]: any;
|
549
|
-
timeRangeCompare?: boolean;
|
550
|
-
}
|
551
|
-
declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {
|
552
|
-
private _querySub?;
|
553
|
-
private _dataLayersSub?;
|
554
|
-
private _dataLayersMerger;
|
555
|
-
private _timeSub?;
|
556
|
-
private _timeSubRange?;
|
557
|
-
private _containerWidth?;
|
558
|
-
private _variableValueRecorder;
|
559
|
-
private _results;
|
560
|
-
private _scopedVars;
|
561
|
-
private _layerAnnotations?;
|
562
|
-
private _resultAnnotations?;
|
563
|
-
private _adhocFiltersVar?;
|
564
|
-
private _groupByVar?;
|
565
|
-
getResultsStream(): ReplaySubject<SceneDataProviderResult>;
|
566
|
-
protected _variableDependency: VariableDependencyConfig<QueryRunnerState>;
|
567
|
-
constructor(initialState: QueryRunnerState);
|
568
|
-
private _onActivate;
|
569
|
-
private _handleDataLayers;
|
570
|
-
private _onLayersReceived;
|
571
|
-
/**
|
572
|
-
* This tries to start a new query whenever a variable completes or is changed.
|
573
|
-
*
|
574
|
-
* We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.
|
575
|
-
* Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will
|
576
|
-
* find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and
|
577
|
-
* not issue any query.
|
578
|
-
*
|
579
|
-
* When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting
|
580
|
-
* the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will
|
581
|
-
* only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will
|
582
|
-
* be called many times until all dependencies are in a non loading state. *
|
583
|
-
*/
|
584
|
-
private onVariableUpdatesCompleted;
|
585
|
-
/**
|
586
|
-
* Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query
|
587
|
-
*/
|
588
|
-
private onAnyVariableChanged;
|
589
|
-
private _isRelevantAutoVariable;
|
590
|
-
private shouldRunQueriesOnActivate;
|
591
|
-
private _isDataTimeRangeStale;
|
592
|
-
private _onDeactivate;
|
593
|
-
setContainerWidth(width: number): void;
|
594
|
-
isDataReadyToDisplay(): boolean;
|
595
|
-
private subscribeToTimeRangeChanges;
|
596
|
-
runQueries(): void;
|
597
|
-
private getMaxDataPoints;
|
598
|
-
cancelQuery(): void;
|
599
|
-
private runWithTimeRange;
|
600
|
-
clone(withState?: Partial<QueryRunnerState>): this;
|
601
|
-
private prepareRequests;
|
602
|
-
private onDataReceived;
|
603
|
-
private _combineDataLayers;
|
604
|
-
private _setNoDataState;
|
605
|
-
/**
|
606
|
-
* Will walk up the scene graph and find the closest time range compare object
|
607
|
-
* It performs buttom-up search, including shallow search across object children for supporting controls/header actions
|
608
|
-
*/
|
609
|
-
private getTimeCompare;
|
610
|
-
/**
|
611
|
-
* Walk up scene graph and find the closest filterset with matching data source
|
612
|
-
*/
|
613
|
-
private findAndSubscribeToAdHocFilters;
|
614
|
-
private _updateExplicitVariableDependencies;
|
615
|
-
}
|
616
|
-
|
617
484
|
declare function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]): string;
|
618
485
|
|
619
486
|
declare class AdHocFiltersVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {
|
@@ -733,6 +600,60 @@ declare class ConstantVariable extends SceneObjectBase<ConstantVariableState> im
|
|
733
600
|
getValue(): VariableValue;
|
734
601
|
}
|
735
602
|
|
603
|
+
interface VariableDependencyConfigOptions<TState extends SceneObjectState> {
|
604
|
+
/**
|
605
|
+
* State paths to scan / extract variable dependencies from. Leave empty to scan all paths.
|
606
|
+
*/
|
607
|
+
statePaths?: Array<keyof TState | '*'>;
|
608
|
+
/**
|
609
|
+
* Explicit list of variable names to depend on. Leave empty to scan state for dependencies.
|
610
|
+
*/
|
611
|
+
variableNames?: string[];
|
612
|
+
/**
|
613
|
+
* Optional way to customize how to handle when a dependent variable changes
|
614
|
+
* If not specified the default behavior is to trigger a re-render
|
615
|
+
*/
|
616
|
+
onReferencedVariableValueChanged?: (variable: SceneVariable) => void;
|
617
|
+
/**
|
618
|
+
* Two scenarios trigger this callback to be called.
|
619
|
+
* 1. When any direct dependency changed value
|
620
|
+
* 2. In case hasDependencyInLoadingState was called and returned true we really care about any variable update. So in this scenario this callback is called
|
621
|
+
* after any variable update completes. This is to cover scenarios where an object is waiting for indirect dependencies to complete.
|
622
|
+
*/
|
623
|
+
onVariableUpdateCompleted?: () => void;
|
624
|
+
/**
|
625
|
+
* Optional way to subscribe to all variable value changes, even to variables that are not dependencies.
|
626
|
+
*/
|
627
|
+
onAnyVariableChanged?: (variable: SceneVariable) => void;
|
628
|
+
}
|
629
|
+
declare class VariableDependencyConfig<TState extends SceneObjectState> implements SceneVariableDependencyConfigLike {
|
630
|
+
private _sceneObject;
|
631
|
+
private _options;
|
632
|
+
private _state;
|
633
|
+
private _dependencies;
|
634
|
+
private _statePaths?;
|
635
|
+
private _isWaitingForVariables;
|
636
|
+
scanCount: number;
|
637
|
+
constructor(_sceneObject: SceneObject<TState>, _options: VariableDependencyConfigOptions<TState>);
|
638
|
+
/**
|
639
|
+
* Used to check for dependency on a specific variable
|
640
|
+
*/
|
641
|
+
hasDependencyOn(name: string): boolean;
|
642
|
+
/**
|
643
|
+
* This is called whenever any set of variables have new values. It is up to this implementation to check if it's relevant given the current dependencies.
|
644
|
+
*/
|
645
|
+
variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void;
|
646
|
+
hasDependencyInLoadingState(): boolean;
|
647
|
+
getNames(): Set<string>;
|
648
|
+
/**
|
649
|
+
* Update variableNames
|
650
|
+
*/
|
651
|
+
setVariableNames(varNames: string[]): void;
|
652
|
+
setPaths(paths: Array<keyof TState | '*'>): void;
|
653
|
+
private scanStateForDependencies;
|
654
|
+
private extractVariablesFrom;
|
655
|
+
}
|
656
|
+
|
736
657
|
interface MultiValueVariableState extends SceneVariableState {
|
737
658
|
value: VariableValue;
|
738
659
|
text: VariableValue;
|
@@ -872,7 +793,7 @@ declare class TextBoxVariable extends SceneObjectBase<TextBoxVariableState> impl
|
|
872
793
|
interface QueryVariableState extends MultiValueVariableState {
|
873
794
|
type: 'query';
|
874
795
|
datasource: DataSourceRef | null;
|
875
|
-
query: string |
|
796
|
+
query: string | SceneDataQuery;
|
876
797
|
regex: string;
|
877
798
|
refresh: VariableRefresh$1;
|
878
799
|
sort: VariableSort;
|
@@ -1316,6 +1237,96 @@ declare class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase<SceneT
|
|
1316
1237
|
onTimeZoneChange(timeZone: string): void;
|
1317
1238
|
}
|
1318
1239
|
|
1240
|
+
interface QueryRunnerState extends SceneObjectState {
|
1241
|
+
data?: PanelData;
|
1242
|
+
queries: SceneDataQuery[];
|
1243
|
+
datasource?: DataSourceRef;
|
1244
|
+
minInterval?: string;
|
1245
|
+
maxDataPoints?: number;
|
1246
|
+
liveStreaming?: boolean;
|
1247
|
+
maxDataPointsFromWidth?: boolean;
|
1248
|
+
cacheTimeout?: DataQueryRequest['cacheTimeout'];
|
1249
|
+
queryCachingTTL?: DataQueryRequest['queryCachingTTL'];
|
1250
|
+
dataLayerFilter?: DataLayerFilter;
|
1251
|
+
_hasFetchedData?: boolean;
|
1252
|
+
}
|
1253
|
+
declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {
|
1254
|
+
private _querySub?;
|
1255
|
+
private _dataLayersSub?;
|
1256
|
+
private _dataLayersMerger;
|
1257
|
+
private _timeSub?;
|
1258
|
+
private _timeSubRange?;
|
1259
|
+
private _containerWidth?;
|
1260
|
+
private _variableValueRecorder;
|
1261
|
+
private _results;
|
1262
|
+
private _scopedVars;
|
1263
|
+
private _layerAnnotations?;
|
1264
|
+
private _resultAnnotations?;
|
1265
|
+
private _adhocFiltersVar?;
|
1266
|
+
private _groupByVar?;
|
1267
|
+
getResultsStream(): ReplaySubject<SceneDataProviderResult>;
|
1268
|
+
protected _variableDependency: VariableDependencyConfig<QueryRunnerState>;
|
1269
|
+
constructor(initialState: QueryRunnerState);
|
1270
|
+
private _onActivate;
|
1271
|
+
private _handleDataLayers;
|
1272
|
+
private _onLayersReceived;
|
1273
|
+
/**
|
1274
|
+
* This tries to start a new query whenever a variable completes or is changed.
|
1275
|
+
*
|
1276
|
+
* We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.
|
1277
|
+
* Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will
|
1278
|
+
* find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and
|
1279
|
+
* not issue any query.
|
1280
|
+
*
|
1281
|
+
* When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting
|
1282
|
+
* the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will
|
1283
|
+
* only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will
|
1284
|
+
* be called many times until all dependencies are in a non loading state. *
|
1285
|
+
*/
|
1286
|
+
private onVariableUpdatesCompleted;
|
1287
|
+
/**
|
1288
|
+
* Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query
|
1289
|
+
*/
|
1290
|
+
private onAnyVariableChanged;
|
1291
|
+
private _isRelevantAutoVariable;
|
1292
|
+
private shouldRunQueriesOnActivate;
|
1293
|
+
private _isDataTimeRangeStale;
|
1294
|
+
private _onDeactivate;
|
1295
|
+
setContainerWidth(width: number): void;
|
1296
|
+
isDataReadyToDisplay(): boolean;
|
1297
|
+
private subscribeToTimeRangeChanges;
|
1298
|
+
runQueries(): void;
|
1299
|
+
private getMaxDataPoints;
|
1300
|
+
cancelQuery(): void;
|
1301
|
+
private runWithTimeRange;
|
1302
|
+
clone(withState?: Partial<QueryRunnerState>): this;
|
1303
|
+
private prepareRequests;
|
1304
|
+
private onDataReceived;
|
1305
|
+
private _combineDataLayers;
|
1306
|
+
private _setNoDataState;
|
1307
|
+
/**
|
1308
|
+
* Walk up the scene graph and find any ExtraQueryProviders.
|
1309
|
+
*
|
1310
|
+
* This will return an array of the closest provider of each type.
|
1311
|
+
*/
|
1312
|
+
private getClosestExtraQueryProviders;
|
1313
|
+
/**
|
1314
|
+
* Walk up scene graph and find the closest filterset with matching data source
|
1315
|
+
*/
|
1316
|
+
private findAndSubscribeToAdHocFilters;
|
1317
|
+
private _updateExplicitVariableDependencies;
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
type ExtraQueryDataProcessor = (primary: PanelData, secondary: PanelData) => Observable<PanelData>;
|
1321
|
+
interface ExtraQueryDescriptor {
|
1322
|
+
req: DataQueryRequest;
|
1323
|
+
processor?: ExtraQueryDataProcessor;
|
1324
|
+
}
|
1325
|
+
interface ExtraQueryProvider<T extends SceneObjectState> extends SceneObjectBase<T> {
|
1326
|
+
getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[];
|
1327
|
+
shouldRerun(prev: T, next: T): boolean;
|
1328
|
+
}
|
1329
|
+
|
1319
1330
|
declare abstract class SceneDataLayerSetBase<T extends SceneDataLayerProviderState> extends SceneObjectBase<T> implements SceneDataLayerProvider {
|
1320
1331
|
/** Mark it as a data layer */
|
1321
1332
|
isDataLayer: true;
|
@@ -1401,6 +1412,13 @@ declare class VariableValueSelectors extends SceneObjectBase<VariableValueSelect
|
|
1401
1412
|
static Component: typeof VariableValueSelectorsRenderer;
|
1402
1413
|
}
|
1403
1414
|
declare function VariableValueSelectorsRenderer({ model }: SceneComponentProps<VariableValueSelectors>): React__default.JSX.Element;
|
1415
|
+
interface VariableSelectProps {
|
1416
|
+
layout?: ControlsLayout;
|
1417
|
+
variable: SceneVariable;
|
1418
|
+
/** To override hide from VariableValueSelectByName */
|
1419
|
+
showAlways?: boolean;
|
1420
|
+
}
|
1421
|
+
declare function VariableValueSelectWrapper({ variable, layout, showAlways }: VariableSelectProps): React__default.JSX.Element | null;
|
1404
1422
|
|
1405
1423
|
interface VariableValueControlState extends SceneObjectState {
|
1406
1424
|
layout?: ControlsLayout;
|
@@ -1668,6 +1686,7 @@ declare class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends Scen
|
|
1668
1686
|
onFieldConfigChange: (fieldConfigUpdate: FieldConfigSource<DeepPartial<TFieldConfig>>, replace?: boolean) => void;
|
1669
1687
|
interpolate: InterpolateFunction;
|
1670
1688
|
getDescription: () => string;
|
1689
|
+
clearFieldConfigCache(): void;
|
1671
1690
|
/**
|
1672
1691
|
* Called from the react render path to apply the field config to the data provided by the data provider
|
1673
1692
|
*/
|
@@ -1776,9 +1795,6 @@ declare class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState
|
|
1776
1795
|
}
|
1777
1796
|
declare function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneRefreshPicker>): React__default.JSX.Element;
|
1778
1797
|
|
1779
|
-
interface TimeRangeCompareProvider {
|
1780
|
-
getCompareTimeRange(timeRange: TimeRange): TimeRange | undefined;
|
1781
|
-
}
|
1782
1798
|
interface SceneTimeRangeCompareState extends SceneObjectState {
|
1783
1799
|
compareWith?: string;
|
1784
1800
|
compareOptions: Array<{
|
@@ -1786,7 +1802,7 @@ interface SceneTimeRangeCompareState extends SceneObjectState {
|
|
1786
1802
|
value: string;
|
1787
1803
|
}>;
|
1788
1804
|
}
|
1789
|
-
declare class SceneTimeRangeCompare extends SceneObjectBase<SceneTimeRangeCompareState> implements
|
1805
|
+
declare class SceneTimeRangeCompare extends SceneObjectBase<SceneTimeRangeCompareState> implements ExtraQueryProvider<SceneTimeRangeCompareState> {
|
1790
1806
|
static Component: typeof SceneTimeRangeCompareRenderer;
|
1791
1807
|
protected _urlSync: SceneObjectUrlSyncConfig;
|
1792
1808
|
constructor(state: Partial<SceneTimeRangeCompareState>);
|
@@ -1797,6 +1813,8 @@ declare class SceneTimeRangeCompare extends SceneObjectBase<SceneTimeRangeCompar
|
|
1797
1813
|
}[];
|
1798
1814
|
onCompareWithChanged: (compareWith: string) => void;
|
1799
1815
|
onClearCompare: () => void;
|
1816
|
+
getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[];
|
1817
|
+
shouldRerun(prev: SceneTimeRangeCompareState, next: SceneTimeRangeCompareState): boolean;
|
1800
1818
|
getCompareTimeRange(timeRange: TimeRange): TimeRange | undefined;
|
1801
1819
|
getUrlState(): SceneObjectUrlValues;
|
1802
1820
|
updateFromUrl(values: SceneObjectUrlValues): void;
|
@@ -2196,6 +2214,12 @@ type StandardFieldConfigInterface<T, C, Prefix extends string> = {
|
|
2196
2214
|
[K in Exclude<keyof T, keyof any[]> as `${Prefix}${Capitalize<string & K>}`]: (value: T[K]) => C;
|
2197
2215
|
};
|
2198
2216
|
type StandardFieldConfig = Pick<FieldConfig, 'color' | 'decimals' | 'displayName' | 'filterable' | 'links' | 'mappings' | 'max' | 'min' | 'noValue' | 'thresholds' | 'unit'>;
|
2217
|
+
interface VizConfig<TOptions = {}, TFieldConfig = {}> {
|
2218
|
+
pluginId: string;
|
2219
|
+
pluginVersion: string;
|
2220
|
+
options: DeepPartial<TOptions>;
|
2221
|
+
fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>>;
|
2222
|
+
}
|
2199
2223
|
|
2200
2224
|
declare class StandardFieldConfigOverridesBuilder<T extends StandardFieldConfigOverridesBuilder<T>> implements StandardFieldConfigInterface<StandardFieldConfig, T, 'override'> {
|
2201
2225
|
protected _overrides: Array<{
|
@@ -2504,6 +2528,92 @@ interface Props {
|
|
2504
2528
|
*/
|
2505
2529
|
declare function SceneDebugger({ scene }: Props): React__default.JSX.Element;
|
2506
2530
|
|
2531
|
+
declare class VizConfigBuilder<TOptions extends {}, TFieldConfig extends {}> implements StandardFieldConfigInterface<StandardFieldConfig, VizConfigBuilder<TOptions, TFieldConfig>, 'set'> {
|
2532
|
+
private _fieldConfigBuilder;
|
2533
|
+
private _panelOptionsBuilder;
|
2534
|
+
private _pluginId;
|
2535
|
+
private _pluginVersion;
|
2536
|
+
constructor(pluginId: string, pluginVersion: string, defaultOptions?: () => Partial<TOptions>, defaultFieldConfig?: () => TFieldConfig);
|
2537
|
+
/**
|
2538
|
+
* Set color.
|
2539
|
+
*/
|
2540
|
+
setColor(color: StandardFieldConfig['color']): this;
|
2541
|
+
/**
|
2542
|
+
* Set number of decimals to show.
|
2543
|
+
*/
|
2544
|
+
setDecimals(decimals: StandardFieldConfig['decimals']): this;
|
2545
|
+
/**
|
2546
|
+
* Set field display name.
|
2547
|
+
*/
|
2548
|
+
setDisplayName(displayName: StandardFieldConfig['displayName']): this;
|
2549
|
+
/**
|
2550
|
+
* Set the standard field config property filterable.
|
2551
|
+
*/
|
2552
|
+
setFilterable(filterable: StandardFieldConfig['filterable']): this;
|
2553
|
+
/**
|
2554
|
+
* Set data links.
|
2555
|
+
*/
|
2556
|
+
setLinks(links: StandardFieldConfig['links']): this;
|
2557
|
+
/**
|
2558
|
+
* Set value mappings.
|
2559
|
+
*/
|
2560
|
+
setMappings(mappings: StandardFieldConfig['mappings']): this;
|
2561
|
+
/**
|
2562
|
+
* Set the standard field config property max.
|
2563
|
+
*/
|
2564
|
+
setMax(max: StandardFieldConfig['max']): this;
|
2565
|
+
/**
|
2566
|
+
* Set the standard field config property min.
|
2567
|
+
*/
|
2568
|
+
setMin(min: StandardFieldConfig['min']): this;
|
2569
|
+
/**
|
2570
|
+
* Set the standard field config property noValue.
|
2571
|
+
*/
|
2572
|
+
setNoValue(noValue: StandardFieldConfig['noValue']): this;
|
2573
|
+
/**
|
2574
|
+
* Set the standard field config property thresholds.
|
2575
|
+
*/
|
2576
|
+
setThresholds(thresholds: StandardFieldConfig['thresholds']): this;
|
2577
|
+
/**
|
2578
|
+
* Set the standard field config property unit.
|
2579
|
+
*/
|
2580
|
+
setUnit(unit: StandardFieldConfig['unit']): this;
|
2581
|
+
setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this;
|
2582
|
+
setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this;
|
2583
|
+
/**
|
2584
|
+
* Set an individual panel option. This will merge the value with the existing options.
|
2585
|
+
*/
|
2586
|
+
setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this;
|
2587
|
+
/**
|
2588
|
+
* Build the panel.
|
2589
|
+
*/
|
2590
|
+
build(): VizConfig<TOptions, TFieldConfig>;
|
2591
|
+
}
|
2592
|
+
|
2593
|
+
declare const VizConfigBuilders: {
|
2594
|
+
barchart(): VizConfigBuilder<Options, FieldConfig$1>;
|
2595
|
+
bargauge(): VizConfigBuilder<Options$1, {}>;
|
2596
|
+
datagrid(): VizConfigBuilder<Options$2, {}>;
|
2597
|
+
flamegraph(): VizConfigBuilder<{}, {}>;
|
2598
|
+
gauge(): VizConfigBuilder<Options$3, {}>;
|
2599
|
+
geomap(): VizConfigBuilder<Options$4, {}>;
|
2600
|
+
heatmap(): VizConfigBuilder<Options$5, FieldConfig$2>;
|
2601
|
+
histogram(): VizConfigBuilder<Options$6, FieldConfig$3>;
|
2602
|
+
logs(): VizConfigBuilder<Options$7, {}>;
|
2603
|
+
news(): VizConfigBuilder<Options$8, {}>;
|
2604
|
+
nodegraph(): VizConfigBuilder<Options$9, {}>;
|
2605
|
+
piechart(): VizConfigBuilder<Options$a, FieldConfig$4>;
|
2606
|
+
stat(): VizConfigBuilder<Options$b, {}>;
|
2607
|
+
statetimeline(): VizConfigBuilder<Options$c, FieldConfig$5>;
|
2608
|
+
statushistory(): VizConfigBuilder<Options$d, FieldConfig$6>;
|
2609
|
+
table(): VizConfigBuilder<Options$e, TableFieldOptions>;
|
2610
|
+
text(): VizConfigBuilder<Options$f, {}>;
|
2611
|
+
timeseries(): VizConfigBuilder<Options$g, FieldConfig$7>;
|
2612
|
+
trend(): VizConfigBuilder<{}, {}>;
|
2613
|
+
traces(): VizConfigBuilder<Options$h, FieldConfig$8>;
|
2614
|
+
xychart(): VizConfigBuilder<Options$i, {}>;
|
2615
|
+
};
|
2616
|
+
|
2507
2617
|
declare const sceneUtils: {
|
2508
2618
|
getUrlWithAppState: typeof getUrlWithAppState;
|
2509
2619
|
registerRuntimePanelPlugin: typeof registerRuntimePanelPlugin;
|
@@ -2523,4 +2633,4 @@ declare const sceneUtils: {
|
|
2523
2633
|
isGroupByVariable: typeof isGroupByVariable;
|
2524
2634
|
};
|
2525
2635
|
|
2526
|
-
export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, FieldConfigBuilders, FieldConfigOverridesBuilder, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataState, SceneDataTransformer, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectors, VariableValueSingle, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, getUrlSyncManager, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState };
|
2636
|
+
export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformer, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectWrapper, VariableValueSelectors, VariableValueSingle, VizConfig, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, getUrlSyncManager, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState };
|