@grafana/scenes 5.11.1 → 5.11.3--canary.858.10679390033.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/CHANGELOG.md +17 -5
  2. package/dist/esm/behaviors/SceneQueryController.js +60 -5
  3. package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
  4. package/dist/esm/behaviors/SceneRenderProfiler.js +168 -0
  5. package/dist/esm/behaviors/SceneRenderProfiler.js.map +1 -0
  6. package/dist/esm/components/SceneRefreshPicker.js +20 -5
  7. package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
  8. package/dist/esm/components/VizPanel/VizPanel.js +9 -6
  9. package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
  10. package/dist/esm/core/SceneTimeRange.js +3 -0
  11. package/dist/esm/core/SceneTimeRange.js.map +1 -1
  12. package/dist/esm/core/sceneGraph/getQueryController.js +19 -0
  13. package/dist/esm/core/sceneGraph/getQueryController.js.map +1 -0
  14. package/dist/esm/core/sceneGraph/index.js +2 -1
  15. package/dist/esm/core/sceneGraph/index.js.map +1 -1
  16. package/dist/esm/core/sceneGraph/sceneGraph.js +1 -16
  17. package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/querying/SceneQueryRunner.js +1 -3
  20. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  21. package/dist/esm/querying/registerQueryWithController.js +19 -2
  22. package/dist/esm/querying/registerQueryWithController.js.map +1 -1
  23. package/dist/esm/services/useUrlSync.js.map +1 -1
  24. package/dist/esm/utils/getDataSource.js +17 -1
  25. package/dist/esm/utils/getDataSource.js.map +1 -1
  26. package/dist/esm/variables/components/VariableValueSelect.js +5 -0
  27. package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
  28. package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
  29. package/dist/esm/variables/variants/TestVariable.js.map +1 -1
  30. package/dist/index.d.ts +53 -25
  31. package/dist/index.js +480 -210
  32. package/dist/index.js.map +1 -1
  33. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -925,20 +925,6 @@ declare class UserActionEvent extends BusEventWithPayload<UserActionEventPayload
925
925
  */
926
926
  declare function lookupVariable(name: string, sceneObject: SceneObject): SceneVariable | null;
927
927
 
928
- /**
929
- * Will walk up the scene object graph to the closest $timeRange scene object
930
- */
931
- declare function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike;
932
-
933
- interface SceneQueryStateControllerState extends SceneObjectState {
934
- isRunning: boolean;
935
- }
936
- interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {
937
- isQueryController: true;
938
- cancelAll(): void;
939
- queryStarted(entry: SceneQueryControllerEntry): void;
940
- queryCompleted(entry: SceneQueryControllerEntry): void;
941
- }
942
928
  interface QueryResultWithState {
943
929
  state: LoadingState;
944
930
  }
@@ -948,17 +934,40 @@ interface SceneQueryControllerEntry {
948
934
  origin: SceneObject;
949
935
  cancel?: () => void;
950
936
  }
951
- type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts';
952
- declare class SceneQueryController extends SceneObjectBase<SceneQueryStateControllerState> implements SceneQueryControllerLike {
953
- #private;
937
+ type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts' | 'plugin';
938
+ interface SceneInteractionProfileEvent {
939
+ origin: string;
940
+ duration: number;
941
+ networkDuration: number;
942
+ jsHeapSizeLimit: number;
943
+ usedJSHeapSize: number;
944
+ totalJSHeapSize: number;
945
+ crumbs: string[];
946
+ }
947
+ interface SceneQueryStateControllerState extends SceneObjectState {
948
+ isRunning: boolean;
949
+ enableProfiling?: boolean;
950
+ onProfileComplete?(event: SceneInteractionProfileEvent): void;
951
+ }
952
+ interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {
954
953
  isQueryController: true;
955
- constructor();
954
+ cancelAll(): void;
956
955
  queryStarted(entry: SceneQueryControllerEntry): void;
957
956
  queryCompleted(entry: SceneQueryControllerEntry): void;
958
- private changeRunningQueryCount;
959
- cancelAll(): void;
957
+ startProfile(source: SceneObject): void;
958
+ runningQueriesCount(): number;
960
959
  }
961
960
 
961
+ /**
962
+ * Returns the closest query controller undefined if none found
963
+ */
964
+ declare function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined;
965
+
966
+ /**
967
+ * Will walk up the scene object graph to the closest $timeRange scene object
968
+ */
969
+ declare function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike;
970
+
962
971
  /**
963
972
  * Get the closest node with variables
964
973
  */
@@ -1023,10 +1032,6 @@ declare function getDataLayers(sceneObject: SceneObject, localOnly?: boolean): S
1023
1032
  declare function getAncestor<ParentType>(sceneObject: SceneObject, ancestorType: {
1024
1033
  new (...args: never[]): ParentType;
1025
1034
  }): ParentType;
1026
- /**
1027
- * Returns the closest query controller undefined if none found
1028
- */
1029
- declare function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined;
1030
1035
 
1031
1036
  declare const sceneGraph: {
1032
1037
  getVariables: typeof getVariables;
@@ -1088,6 +1093,19 @@ declare class PanelContextEventBus implements EventBus {
1088
1093
  newScopedBus(key: string, filter: EventFilterOptions): EventBus;
1089
1094
  }
1090
1095
 
1096
+ declare class SceneQueryController extends SceneObjectBase<SceneQueryStateControllerState> implements SceneQueryControllerLike {
1097
+ #private;
1098
+ isQueryController: true;
1099
+ private profiler;
1100
+ constructor(state?: Partial<SceneQueryStateControllerState>);
1101
+ runningQueriesCount: () => number;
1102
+ startProfile(source: SceneObject): void;
1103
+ queryStarted(entry: SceneQueryControllerEntry): void;
1104
+ queryCompleted(entry: SceneQueryControllerEntry): void;
1105
+ private changeRunningQueryCount;
1106
+ cancelAll(): void;
1107
+ }
1108
+
1091
1109
  interface LiveNowTimerState extends SceneObjectState {
1092
1110
  enabled: boolean;
1093
1111
  }
@@ -1821,14 +1839,24 @@ declare class SceneTimePicker extends SceneObjectBase<SceneTimePickerState> {
1821
1839
  declare function SceneTimePickerRenderer({ model }: SceneComponentProps<SceneTimePicker>): React__default.JSX.Element | null;
1822
1840
 
1823
1841
  interface SceneRefreshPickerState extends SceneObjectState {
1842
+ /**
1843
+ * Refresh interval, e.g. 5s, 1m, 2h
1844
+ */
1824
1845
  refresh: string;
1825
1846
  autoEnabled?: boolean;
1826
1847
  autoMinInterval?: string;
1827
1848
  autoValue?: string;
1849
+ /**
1850
+ * List of allowed refresh intervals, e.g. ['5s', '1m']
1851
+ */
1828
1852
  intervals?: string[];
1829
1853
  isOnCanvas?: boolean;
1830
1854
  primary?: boolean;
1831
1855
  withText?: boolean;
1856
+ /**
1857
+ * Overrides the default minRefreshInterval from the grafana config. Can be set to "0s" to remove the minimum refresh interval.
1858
+ */
1859
+ minRefreshInterval?: string;
1832
1860
  }
1833
1861
  declare class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState> {
1834
1862
  static Component: typeof SceneRefreshPickerRenderer;
@@ -2702,4 +2730,4 @@ declare const sceneUtils: {
2702
2730
  isGroupByVariable: typeof isGroupByVariable;
2703
2731
  };
2704
2732
 
2705
- export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, MultiValueVariableState, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, 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, UrlSyncContextProvider, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableGetOptionsArgs, 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, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, renderSelectForVariable, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };
2733
+ export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, MultiValueVariableState, NestedScene, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, 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, SceneInteractionProfileEvent, 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, UrlSyncContextProvider, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableGetOptionsArgs, 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, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, renderSelectForVariable, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };