@grafana/scenes 6.11.0--canary.1121.15019988505.0 → 6.11.0
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 +19 -0
- package/dist/esm/components/SceneApp/SceneApp.js +2 -2
- package/dist/esm/components/SceneApp/SceneApp.js.map +1 -1
- package/dist/esm/components/SceneApp/SceneAppPage.js +18 -2
- package/dist/esm/components/SceneApp/SceneAppPage.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/SceneObjectBase.js +1 -1
- package/dist/esm/core/SceneObjectBase.js.map +1 -1
- package/dist/esm/core/SceneScopesBridge.js +93 -0
- package/dist/esm/core/SceneScopesBridge.js.map +1 -0
- package/dist/esm/core/sceneGraph/cloneSceneObject.js +45 -0
- package/dist/esm/core/sceneGraph/cloneSceneObject.js.map +1 -0
- package/dist/esm/core/sceneGraph/index.js +2 -2
- package/dist/esm/core/sceneGraph/index.js.map +1 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js +5 -9
- package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
- package/dist/esm/core/sceneGraph/utils.js +1 -43
- package/dist/esm/core/sceneGraph/utils.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +33 -10
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/variables/VariableDependencyConfig.js +1 -4
- package/dist/esm/variables/VariableDependencyConfig.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +18 -19
- package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelectors.js +0 -3
- package/dist/esm/variables/components/VariableValueSelectors.js.map +1 -1
- package/dist/esm/variables/constants.js +1 -2
- package/dist/esm/variables/constants.js.map +1 -1
- package/dist/esm/variables/groupby/GroupByVariable.js +2 -2
- package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/esm/variables/sets/SceneVariableSet.js +7 -10
- package/dist/esm/variables/sets/SceneVariableSet.js.map +1 -1
- package/dist/esm/variables/types.js.map +1 -1
- package/dist/index.d.ts +52 -54
- package/dist/index.js +162 -119
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/variables/variants/ScopesVariable.js +0 -80
- package/dist/esm/variables/variants/ScopesVariable.js.map +0 -1
|
@@ -8,6 +8,8 @@ import { VariableValueRecorder } from '../VariableValueRecorder.js';
|
|
|
8
8
|
class SceneVariableSet extends SceneObjectBase {
|
|
9
9
|
constructor(state) {
|
|
10
10
|
super(state);
|
|
11
|
+
/** Variables that have changed in since the activation or since the first manual value change */
|
|
12
|
+
this._variablesThatHaveChanged = /* @__PURE__ */ new Set();
|
|
11
13
|
/** Variables that are scheduled to be validated and updated */
|
|
12
14
|
this._variablesToUpdate = /* @__PURE__ */ new Set();
|
|
13
15
|
/** Variables currently updating */
|
|
@@ -134,8 +136,7 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
134
136
|
_updateNextBatch() {
|
|
135
137
|
for (const variable of this._variablesToUpdate) {
|
|
136
138
|
if (!variable.validateAndUpdate) {
|
|
137
|
-
|
|
138
|
-
continue;
|
|
139
|
+
throw new Error("Variable added to variablesToUpdate but does not have validateAndUpdate");
|
|
139
140
|
}
|
|
140
141
|
if (this._updating.has(variable)) {
|
|
141
142
|
continue;
|
|
@@ -191,6 +192,7 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
191
192
|
this._updateNextBatch();
|
|
192
193
|
}
|
|
193
194
|
_handleVariableValueChanged(variableThatChanged) {
|
|
195
|
+
this._variablesThatHaveChanged.add(variableThatChanged);
|
|
194
196
|
this._addDependentVariablesToUpdateQueue(variableThatChanged);
|
|
195
197
|
if (!this._updating.has(variableThatChanged)) {
|
|
196
198
|
this._updateNextBatch();
|
|
@@ -217,10 +219,7 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
217
219
|
if (this._updating.has(otherVariable) && otherVariable.onCancel) {
|
|
218
220
|
otherVariable.onCancel();
|
|
219
221
|
}
|
|
220
|
-
|
|
221
|
-
this._variablesToUpdate.add(otherVariable);
|
|
222
|
-
}
|
|
223
|
-
otherVariable.variableDependency.variableUpdateCompleted(variableThatChanged, true);
|
|
222
|
+
this._variablesToUpdate.add(otherVariable);
|
|
224
223
|
}
|
|
225
224
|
}
|
|
226
225
|
}
|
|
@@ -232,7 +231,8 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
232
231
|
if (!this.parent) {
|
|
233
232
|
return;
|
|
234
233
|
}
|
|
235
|
-
this._traverseSceneAndNotify(this.parent, variable,
|
|
234
|
+
this._traverseSceneAndNotify(this.parent, variable, this._variablesThatHaveChanged.has(variable));
|
|
235
|
+
this._variablesThatHaveChanged.delete(variable);
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
238
|
* Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables
|
|
@@ -264,9 +264,6 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
264
264
|
* For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.
|
|
265
265
|
*/
|
|
266
266
|
isVariableLoadingOrWaitingToUpdate(variable) {
|
|
267
|
-
if (variable.state.loading) {
|
|
268
|
-
return true;
|
|
269
|
-
}
|
|
270
267
|
if (variable.isAncestorLoading && variable.isAncestorLoading()) {
|
|
271
268
|
return true;
|
|
272
269
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneVariableSet.js","sources":["../../../../src/variables/sets/SceneVariableSet.ts"],"sourcesContent":["import { VariableRefresh } from '@grafana/data';\nimport { Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport {\n SceneVariable,\n SceneVariableDependencyConfigLike,\n SceneVariables,\n SceneVariableSetState,\n SceneVariableValueChangedEvent,\n} from '../types';\nimport { VariableValueRecorder } from '../VariableValueRecorder';\n\nexport class SceneVariableSet extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n /** Variables that are scheduled to be validated and updated */\n private _variablesToUpdate = new Set<SceneVariable>();\n\n /** Variables currently updating */\n private _updating = new Map<SceneVariable, VariableUpdateInProgress>();\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n /**\n * This makes sure SceneVariableSet's higher up in the chain notify us when parent level variables complete update batches.\n **/\n protected _variableDependency = new SceneVariableSetVariableDependencyHandler(\n this._handleParentVariableUpdatesCompleted.bind(this)\n );\n\n public getByName(name: string): SceneVariable | undefined {\n // TODO: Replace with index\n return this.state.variables.find((x) => x.state.name === name);\n }\n\n public constructor(state: SceneVariableSetState) {\n super(state);\n\n this.addActivationHandler(this._onActivate);\n }\n\n /**\n * Subscribes to child variable value changes, and starts the variable value validation process\n */\n private _onActivate = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n // Subscribe to changes to child variables\n this._subs.add(\n this.subscribeToEvent(SceneVariableValueChangedEvent, (event) => this._handleVariableValueChanged(event.payload))\n );\n\n this._subs.add(\n timeRange.subscribeToState(() => {\n this._refreshTimeRangeBasedVariables();\n })\n );\n\n // Subscribe to state changes\n this._subs.add(this.subscribeToState(this._onStateChanged));\n\n this._checkForVariablesThatChangedWhileInactive();\n\n // Add all variables that need updating to queue\n for (const variable of this.state.variables) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n\n // Return deactivation handler;\n return this._onDeactivate;\n };\n\n /**\n * Add all variables that depend on the changed variable to the update queue\n */\n private _refreshTimeRangeBasedVariables() {\n for (const variable of this.state.variables) {\n if ('refresh' in variable.state && variable.state.refresh === VariableRefresh.onTimeRangeChanged) {\n this._variablesToUpdate.add(variable);\n }\n }\n this._updateNextBatch();\n }\n\n /**\n * Cancel all currently running updates\n */\n private _onDeactivate = () => {\n for (const update of this._updating.values()) {\n update.subscription?.unsubscribe();\n }\n\n // Remember current variable values\n for (const variable of this.state.variables) {\n // if the current variable is not in queue to update and validate and not being actively updated then the value is ok\n if (!this._variablesToUpdate.has(variable) && !this._updating.has(variable)) {\n this._variableValueRecorder.recordCurrentValue(variable);\n }\n }\n\n this._variablesToUpdate.clear();\n this._updating.clear();\n };\n\n /**\n * Look for new variables that need to be initialized\n */\n private _onStateChanged = (newState: SceneVariableSetState, oldState: SceneVariableSetState) => {\n const variablesToUpdateCountStart = this._variablesToUpdate.size;\n\n // Check for removed variables\n for (const variable of oldState.variables) {\n if (!newState.variables.includes(variable)) {\n const updating = this._updating.get(variable);\n if (updating?.subscription) {\n updating.subscription.unsubscribe();\n }\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n }\n\n // Check for new variables\n for (const variable of newState.variables) {\n if (!oldState.variables.includes(variable)) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n }\n\n // Only start a new batch if there was no batch already running\n if (variablesToUpdateCountStart === 0 && this._variablesToUpdate.size > 0) {\n this._updateNextBatch();\n }\n };\n\n /**\n * If variables changed while in in-active state we don't get any change events, so we need to check for that here.\n */\n private _checkForVariablesThatChangedWhileInactive() {\n if (!this._variableValueRecorder.hasValues()) {\n return;\n }\n\n for (const variable of this.state.variables) {\n if (this._variableValueRecorder.hasValueChanged(variable)) {\n writeVariableTraceLog(variable, 'Changed while in-active');\n this._addDependentVariablesToUpdateQueue(variable);\n }\n }\n }\n\n private _variableNeedsUpdate(variable: SceneVariable): boolean {\n if (variable.isLazy) {\n return false;\n }\n\n if (!variable.validateAndUpdate) {\n return false;\n }\n\n // If we have recorded valid value (even if it has changed since we do not need to re-validate this variable)\n if (this._variableValueRecorder.hasRecordedValue(variable)) {\n writeVariableTraceLog(variable, 'Skipping updateAndValidate current value valid');\n return false;\n }\n\n return true;\n }\n\n /**\n * This loops through variablesToUpdate and update all that can.\n * If one has a dependency that is currently in variablesToUpdate it will be skipped for now.\n */\n private _updateNextBatch() {\n for (const variable of this._variablesToUpdate) {\n if (!variable.validateAndUpdate) {\n console.error('Variable added to variablesToUpdate but does not have validateAndUpdate');\n continue;\n }\n\n // Ignore it if it's already started\n if (this._updating.has(variable)) {\n continue;\n }\n\n // Wait for variables that has dependencies that also needs updates\n if (sceneGraph.hasVariableDependencyInLoadingState(variable)) {\n continue;\n }\n\n const variableToUpdate: VariableUpdateInProgress = {\n variable,\n };\n\n this._updating.set(variable, variableToUpdate);\n writeVariableTraceLog(variable, 'updateAndValidate started');\n\n variableToUpdate.subscription = variable.validateAndUpdate().subscribe({\n next: () => this._validateAndUpdateCompleted(variable),\n complete: () => this._validateAndUpdateCompleted(variable),\n error: (err) => this._handleVariableError(variable, err),\n });\n }\n }\n\n /**\n * A variable has completed its update process. This could mean that variables that depend on it can now be updated in turn.\n */\n private _validateAndUpdateCompleted(variable: SceneVariable) {\n if (!this._updating.has(variable)) {\n return;\n }\n\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n writeVariableTraceLog(variable, 'updateAndValidate completed');\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n public cancel(variable: SceneVariable) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n\n private _handleVariableError(variable: SceneVariable, err: Error) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n variable.setState({ loading: false, error: err.message });\n\n console.error('SceneVariableSet updateAndValidate error', err);\n\n writeVariableTraceLog(variable, 'updateAndValidate error', err);\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n private _handleVariableValueChanged(variableThatChanged: SceneVariable) {\n this._addDependentVariablesToUpdateQueue(variableThatChanged);\n\n // Ignore this change if it is currently updating\n if (!this._updating.has(variableThatChanged)) {\n this._updateNextBatch();\n this._notifyDependentSceneObjects(variableThatChanged);\n }\n }\n\n /**\n * This is called by any parent level variable set to notify scene that an update batch is completed.\n * This is the main mechanism lower level variable set's react to changes on higher levels.\n */\n private _handleParentVariableUpdatesCompleted(variable: SceneVariable, hasChanged: boolean) {\n // First loop through changed variables and add any of our variables that depend on the higher level variable to the update queue\n if (hasChanged) {\n this._addDependentVariablesToUpdateQueue(variable);\n }\n\n // If we have variables to update but none are currently updating kick of a new update batch\n if (this._variablesToUpdate.size > 0 && this._updating.size === 0) {\n this._updateNextBatch();\n }\n }\n\n private _addDependentVariablesToUpdateQueue(variableThatChanged: SceneVariable) {\n for (const otherVariable of this.state.variables) {\n if (otherVariable.variableDependency) {\n if (otherVariable.variableDependency.hasDependencyOn(variableThatChanged.state.name)) {\n writeVariableTraceLog(otherVariable, 'Added to update queue, dependant variable value changed');\n\n if (this._updating.has(otherVariable) && otherVariable.onCancel) {\n otherVariable.onCancel();\n }\n\n if (otherVariable.validateAndUpdate) {\n this._variablesToUpdate.add(otherVariable);\n }\n\n otherVariable.variableDependency.variableUpdateCompleted(variableThatChanged, true);\n }\n }\n }\n }\n\n /**\n * Walk scene object graph and update all objects that depend on variables that have changed\n */\n private _notifyDependentSceneObjects(variable: SceneVariable) {\n if (!this.parent) {\n return;\n }\n\n this._traverseSceneAndNotify(this.parent, variable, true);\n }\n\n /**\n * Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables\n */\n private _traverseSceneAndNotify(sceneObject: SceneObject, variable: SceneVariable, hasChanged: boolean) {\n // No need to notify variables under this SceneVariableSet\n if (this === sceneObject) {\n return;\n }\n\n // Skip non active scene objects\n if (!sceneObject.isActive) {\n return;\n }\n\n // If we find a nested SceneVariableSet that has a variable with the same name we stop the traversal\n if (sceneObject.state.$variables && sceneObject.state.$variables !== this) {\n const localVar = sceneObject.state.$variables.getByName(variable.state.name);\n // If local variable is viewed as loading when ancestor is loading we propagate a change\n if (localVar?.isAncestorLoading) {\n variable = localVar;\n } else if (localVar) {\n return;\n }\n }\n\n if (sceneObject.variableDependency) {\n sceneObject.variableDependency.variableUpdateCompleted(variable, hasChanged);\n }\n\n sceneObject.forEachChild((child) => this._traverseSceneAndNotify(child, variable, hasChanged));\n }\n\n /**\n * Return true if variable is waiting to update or currently updating.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable) {\n // TODO add test for this condition\n if (variable.state.loading) {\n return true;\n }\n\n if (variable.isAncestorLoading && variable.isAncestorLoading()) {\n return true;\n }\n\n if (this._variablesToUpdate.has(variable) || this._updating.has(variable)) {\n return true;\n }\n\n // Last scenario is to check the variable's own dependencies as well\n return sceneGraph.hasVariableDependencyInLoadingState(variable);\n }\n}\n\nexport interface VariableUpdateInProgress {\n variable: SceneVariable;\n subscription?: Unsubscribable;\n}\n\nfunction writeVariableTraceLog(variable: SceneVariable, message: string, err?: Error) {\n if (err) {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`, err);\n } else {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`);\n }\n}\n\nclass SceneVariableSetVariableDependencyHandler implements SceneVariableDependencyConfigLike {\n public constructor(private _variableUpdatesCompleted: (variable: SceneVariable, hasChanged: boolean) => void) {}\n\n private _emptySet = new Set<string>();\n\n public getNames(): Set<string> {\n return this._emptySet;\n }\n\n public hasDependencyOn(name: string): boolean {\n return false;\n }\n\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void {\n this._variableUpdatesCompleted(variable, hasChanged);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,yBAAyB,eAAiE,CAAA;AAAA,EAqB9F,YAAY,KAA8B,EAAA;AAC/C,IAAA,KAAA,CAAM,KAAK,CAAA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AAnF,IAAA,IAAA,CAAA,yBAAA,GAAA,yBAAA;AAE3B,IAAQ,IAAA,CAAA,SAAA,uBAAgB,GAAY,EAAA;AAAA;AAF2E,EAIxG,QAAwB,GAAA;AAC7B,IAAA,OAAO,IAAK,CAAA,SAAA;AAAA;AACd,EAEO,gBAAgB,IAAuB,EAAA;AAC5C,IAAO,OAAA,KAAA;AAAA;AACT,EAEO,uBAAA,CAAwB,UAAyB,UAA2B,EAAA;AACjF,IAAK,IAAA,CAAA,yBAAA,CAA0B,UAAU,UAAU,CAAA;AAAA;AAEvD;;;;"}
|
|
1
|
+
{"version":3,"file":"SceneVariableSet.js","sources":["../../../../src/variables/sets/SceneVariableSet.ts"],"sourcesContent":["import { VariableRefresh } from '@grafana/data';\nimport { Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport {\n SceneVariable,\n SceneVariableDependencyConfigLike,\n SceneVariables,\n SceneVariableSetState,\n SceneVariableValueChangedEvent,\n} from '../types';\nimport { VariableValueRecorder } from '../VariableValueRecorder';\n\nexport class SceneVariableSet extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n /** Variables that have changed in since the activation or since the first manual value change */\n private _variablesThatHaveChanged = new Set<SceneVariable>();\n\n /** Variables that are scheduled to be validated and updated */\n private _variablesToUpdate = new Set<SceneVariable>();\n\n /** Variables currently updating */\n private _updating = new Map<SceneVariable, VariableUpdateInProgress>();\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n /**\n * This makes sure SceneVariableSet's higher up in the chain notify us when parent level variables complete update batches.\n **/\n protected _variableDependency = new SceneVariableSetVariableDependencyHandler(\n this._handleParentVariableUpdatesCompleted.bind(this)\n );\n\n public getByName(name: string): SceneVariable | undefined {\n // TODO: Replace with index\n return this.state.variables.find((x) => x.state.name === name);\n }\n\n public constructor(state: SceneVariableSetState) {\n super(state);\n\n this.addActivationHandler(this._onActivate);\n }\n\n /**\n * Subscribes to child variable value changes, and starts the variable value validation process\n */\n private _onActivate = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n // Subscribe to changes to child variables\n this._subs.add(\n this.subscribeToEvent(SceneVariableValueChangedEvent, (event) => this._handleVariableValueChanged(event.payload))\n );\n\n this._subs.add(\n timeRange.subscribeToState(() => {\n this._refreshTimeRangeBasedVariables();\n })\n );\n\n // Subscribe to state changes\n this._subs.add(this.subscribeToState(this._onStateChanged));\n\n this._checkForVariablesThatChangedWhileInactive();\n\n // Add all variables that need updating to queue\n for (const variable of this.state.variables) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n\n // Return deactivation handler;\n return this._onDeactivate;\n };\n\n /**\n * Add all variables that depend on the changed variable to the update queue\n */\n private _refreshTimeRangeBasedVariables() {\n for (const variable of this.state.variables) {\n if ('refresh' in variable.state && variable.state.refresh === VariableRefresh.onTimeRangeChanged) {\n this._variablesToUpdate.add(variable);\n }\n }\n this._updateNextBatch();\n }\n\n /**\n * Cancel all currently running updates\n */\n private _onDeactivate = () => {\n for (const update of this._updating.values()) {\n update.subscription?.unsubscribe();\n }\n\n // Remember current variable values\n for (const variable of this.state.variables) {\n // if the current variable is not in queue to update and validate and not being actively updated then the value is ok\n if (!this._variablesToUpdate.has(variable) && !this._updating.has(variable)) {\n this._variableValueRecorder.recordCurrentValue(variable);\n }\n }\n\n this._variablesToUpdate.clear();\n this._updating.clear();\n };\n\n /**\n * Look for new variables that need to be initialized\n */\n private _onStateChanged = (newState: SceneVariableSetState, oldState: SceneVariableSetState) => {\n const variablesToUpdateCountStart = this._variablesToUpdate.size;\n\n // Check for removed variables\n for (const variable of oldState.variables) {\n if (!newState.variables.includes(variable)) {\n const updating = this._updating.get(variable);\n if (updating?.subscription) {\n updating.subscription.unsubscribe();\n }\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n }\n\n // Check for new variables\n for (const variable of newState.variables) {\n if (!oldState.variables.includes(variable)) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n }\n\n // Only start a new batch if there was no batch already running\n if (variablesToUpdateCountStart === 0 && this._variablesToUpdate.size > 0) {\n this._updateNextBatch();\n }\n };\n\n /**\n * If variables changed while in in-active state we don't get any change events, so we need to check for that here.\n */\n private _checkForVariablesThatChangedWhileInactive() {\n if (!this._variableValueRecorder.hasValues()) {\n return;\n }\n\n for (const variable of this.state.variables) {\n if (this._variableValueRecorder.hasValueChanged(variable)) {\n writeVariableTraceLog(variable, 'Changed while in-active');\n this._addDependentVariablesToUpdateQueue(variable);\n }\n }\n }\n\n private _variableNeedsUpdate(variable: SceneVariable): boolean {\n if (variable.isLazy) {\n return false;\n }\n\n if (!variable.validateAndUpdate) {\n return false;\n }\n\n // If we have recorded valid value (even if it has changed since we do not need to re-validate this variable)\n if (this._variableValueRecorder.hasRecordedValue(variable)) {\n writeVariableTraceLog(variable, 'Skipping updateAndValidate current value valid');\n return false;\n }\n\n return true;\n }\n\n /**\n * This loops through variablesToUpdate and update all that can.\n * If one has a dependency that is currently in variablesToUpdate it will be skipped for now.\n */\n private _updateNextBatch() {\n for (const variable of this._variablesToUpdate) {\n if (!variable.validateAndUpdate) {\n throw new Error('Variable added to variablesToUpdate but does not have validateAndUpdate');\n }\n\n // Ignore it if it's already started\n if (this._updating.has(variable)) {\n continue;\n }\n\n // Wait for variables that has dependencies that also needs updates\n if (sceneGraph.hasVariableDependencyInLoadingState(variable)) {\n continue;\n }\n\n const variableToUpdate: VariableUpdateInProgress = {\n variable,\n };\n\n this._updating.set(variable, variableToUpdate);\n writeVariableTraceLog(variable, 'updateAndValidate started');\n\n variableToUpdate.subscription = variable.validateAndUpdate().subscribe({\n next: () => this._validateAndUpdateCompleted(variable),\n complete: () => this._validateAndUpdateCompleted(variable),\n error: (err) => this._handleVariableError(variable, err),\n });\n }\n }\n\n /**\n * A variable has completed its update process. This could mean that variables that depend on it can now be updated in turn.\n */\n private _validateAndUpdateCompleted(variable: SceneVariable) {\n if (!this._updating.has(variable)) {\n return;\n }\n\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n writeVariableTraceLog(variable, 'updateAndValidate completed');\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n public cancel(variable: SceneVariable) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n\n private _handleVariableError(variable: SceneVariable, err: Error) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n variable.setState({ loading: false, error: err.message });\n\n console.error('SceneVariableSet updateAndValidate error', err);\n\n writeVariableTraceLog(variable, 'updateAndValidate error', err);\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n private _handleVariableValueChanged(variableThatChanged: SceneVariable) {\n this._variablesThatHaveChanged.add(variableThatChanged);\n this._addDependentVariablesToUpdateQueue(variableThatChanged);\n\n // Ignore this change if it is currently updating\n if (!this._updating.has(variableThatChanged)) {\n this._updateNextBatch();\n this._notifyDependentSceneObjects(variableThatChanged);\n }\n }\n\n /**\n * This is called by any parent level variable set to notify scene that an update batch is completed.\n * This is the main mechanism lower level variable set's react to changes on higher levels.\n */\n private _handleParentVariableUpdatesCompleted(variable: SceneVariable, hasChanged: boolean) {\n // First loop through changed variables and add any of our variables that depend on the higher level variable to the update queue\n if (hasChanged) {\n this._addDependentVariablesToUpdateQueue(variable);\n }\n\n // If we have variables to update but none are currently updating kick of a new update batch\n if (this._variablesToUpdate.size > 0 && this._updating.size === 0) {\n this._updateNextBatch();\n }\n }\n\n private _addDependentVariablesToUpdateQueue(variableThatChanged: SceneVariable) {\n for (const otherVariable of this.state.variables) {\n if (otherVariable.variableDependency) {\n if (otherVariable.variableDependency.hasDependencyOn(variableThatChanged.state.name)) {\n writeVariableTraceLog(otherVariable, 'Added to update queue, dependant variable value changed');\n\n if (this._updating.has(otherVariable) && otherVariable.onCancel) {\n otherVariable.onCancel();\n }\n\n this._variablesToUpdate.add(otherVariable);\n }\n }\n }\n }\n\n /**\n * Walk scene object graph and update all objects that depend on variables that have changed\n */\n private _notifyDependentSceneObjects(variable: SceneVariable) {\n if (!this.parent) {\n return;\n }\n\n this._traverseSceneAndNotify(this.parent, variable, this._variablesThatHaveChanged.has(variable));\n this._variablesThatHaveChanged.delete(variable);\n }\n\n /**\n * Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables\n */\n private _traverseSceneAndNotify(sceneObject: SceneObject, variable: SceneVariable, hasChanged: boolean) {\n // No need to notify variables under this SceneVariableSet\n if (this === sceneObject) {\n return;\n }\n\n // Skip non active scene objects\n if (!sceneObject.isActive) {\n return;\n }\n\n // If we find a nested SceneVariableSet that has a variable with the same name we stop the traversal\n if (sceneObject.state.$variables && sceneObject.state.$variables !== this) {\n const localVar = sceneObject.state.$variables.getByName(variable.state.name);\n // If local variable is viewed as loading when ancestor is loading we propagate a change\n if (localVar?.isAncestorLoading) {\n variable = localVar;\n } else if (localVar) {\n return;\n }\n }\n\n if (sceneObject.variableDependency) {\n sceneObject.variableDependency.variableUpdateCompleted(variable, hasChanged);\n }\n\n sceneObject.forEachChild((child) => this._traverseSceneAndNotify(child, variable, hasChanged));\n }\n\n /**\n * Return true if variable is waiting to update or currently updating.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable) {\n if (variable.isAncestorLoading && variable.isAncestorLoading()) {\n return true;\n }\n\n if (this._variablesToUpdate.has(variable) || this._updating.has(variable)) {\n return true;\n }\n\n // Last scenario is to check the variable's own dependencies as well\n return sceneGraph.hasVariableDependencyInLoadingState(variable);\n }\n}\n\nexport interface VariableUpdateInProgress {\n variable: SceneVariable;\n subscription?: Unsubscribable;\n}\n\nfunction writeVariableTraceLog(variable: SceneVariable, message: string, err?: Error) {\n if (err) {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`, err);\n } else {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`);\n }\n}\n\nclass SceneVariableSetVariableDependencyHandler implements SceneVariableDependencyConfigLike {\n public constructor(private _variableUpdatesCompleted: (variable: SceneVariable, hasChanged: boolean) => void) {}\n\n private _emptySet = new Set<string>();\n\n public getNames(): Set<string> {\n return this._emptySet;\n }\n\n public hasDependencyOn(name: string): boolean {\n return false;\n }\n\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void {\n this._variableUpdatesCompleted(variable, hasChanged);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,yBAAyB,eAAiE,CAAA;AAAA,EAwB9F,YAAY,KAA8B,EAAA;AAC/C,IAAA,KAAA,CAAM,KAAK,CAAA;AAvBb;AAAA,IAAQ,IAAA,CAAA,yBAAA,uBAAgC,GAAmB,EAAA;AAG3D;AAAA,IAAQ,IAAA,CAAA,kBAAA,uBAAyB,GAAmB,EAAA;AAGpD;AAAA,IAAQ,IAAA,CAAA,SAAA,uBAAgB,GAA6C,EAAA;AAErE,IAAQ,IAAA,CAAA,sBAAA,GAAyB,IAAI,qBAAsB,EAAA;AAK3D;AAAA;AAAA;AAAA,IAAA,IAAA,CAAU,sBAAsB,IAAI,yCAAA;AAAA,MAClC,IAAA,CAAK,qCAAsC,CAAA,IAAA,CAAK,IAAI;AAAA,KACtD;AAgBA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,cAAc,MAAM;AAC1B,MAAM,MAAA,SAAA,GAAY,UAAW,CAAA,YAAA,CAAa,IAAI,CAAA;AAE9C,MAAA,IAAA,CAAK,KAAM,CAAA,GAAA;AAAA,QACT,IAAA,CAAK,iBAAiB,8BAAgC,EAAA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AAAA;AAGT,IAAI,IAAA,IAAA,CAAK,mBAAmB,GAAI,CAAA,QAAQ,KAAK,IAAK,CAAA,SAAA,CAAU,GAAI,CAAA,QAAQ,CAAG,EAAA;AACzE,MAAO,OAAA,IAAA;AAAA;AAIT,IAAO,OAAA,UAAA,CAAW,oCAAoC,QAAQ,CAAA;AAAA;AAElE;AAOA,SAAS,qBAAA,CAAsB,QAAyB,EAAA,OAAA,EAAiB,GAAa,EAAA;AACpF,EAAA,IAAI,GAAK,EAAA;AACP,IAAc,aAAA,CAAA,kBAAA,EAAoB,YAAY,QAAS,CAAA,KAAA,CAAM,IAAI,CAAM,GAAA,EAAA,OAAO,IAAI,GAAG,CAAA;AAAA,GAChF,MAAA;AACL,IAAA,aAAA,CAAc,oBAAoB,CAAY,SAAA,EAAA,QAAA,CAAS,MAAM,IAAI,CAAA,GAAA,EAAM,OAAO,CAAE,CAAA,CAAA;AAAA;AAEpF;AAEA,MAAM,yCAAuF,CAAA;AAAA,EACpF,YAAoB,yBAAmF,EAAA;AAAnF,IAAA,IAAA,CAAA,yBAAA,GAAA,yBAAA;AAE3B,IAAQ,IAAA,CAAA,SAAA,uBAAgB,GAAY,EAAA;AAAA;AAF2E,EAIxG,QAAwB,GAAA;AAC7B,IAAA,OAAO,IAAK,CAAA,SAAA;AAAA;AACd,EAEO,gBAAgB,IAAuB,EAAA;AAC5C,IAAO,OAAA,KAAA;AAAA;AACT,EAEO,uBAAA,CAAwB,UAAyB,UAA2B,EAAA;AACjF,IAAK,IAAA,CAAA,yBAAA,CAA0B,UAAU,UAAU,CAAA;AAAA;AAEvD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/variables/types.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { BusEventWithPayload } from '@grafana/data';\nimport { VariableType, VariableHide } from '@grafana/schema';\n\nimport { SceneObject, SceneObjectState } from '../core/types';\n\nexport interface SceneVariableState extends SceneObjectState {\n type: VariableType;\n name: string;\n label?: string;\n hide?: VariableHide;\n skipUrlSync?: boolean;\n loading?: boolean;\n error?: any | null;\n description?: string | null;\n}\n\nexport interface SceneVariable<TState extends SceneVariableState = SceneVariableState> extends SceneObject<TState> {\n /**\n * This function is called on activation or when a dependency changes.\n */\n validateAndUpdate?(): Observable<ValidateAndUpdateResult>;\n\n /**\n * Should return the value for the given field path\n */\n getValue(fieldPath?: string): VariableValue | undefined | null;\n\n /**\n * Should return the value display text, used by the \"text\" formatter\n * Example: ${podId:text}\n * Useful for variables that have non user friendly values but friendly display text names.\n */\n getValueText?(fieldPath?: string): string;\n\n /**\n * For special edge case senarios. For example local function that locally scoped variables can implement.\n **/\n isAncestorLoading?(): boolean;\n\n /**\n * Allows cancelling variable execution.\n */\n onCancel?(): void;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/variables/types.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { BusEventWithPayload } from '@grafana/data';\nimport { VariableType, VariableHide } from '@grafana/schema';\n\nimport { SceneObject, SceneObjectState } from '../core/types';\n\nexport interface SceneVariableState extends SceneObjectState {\n type: VariableType;\n name: string;\n label?: string;\n hide?: VariableHide;\n skipUrlSync?: boolean;\n loading?: boolean;\n error?: any | null;\n description?: string | null;\n}\n\nexport interface SceneVariable<TState extends SceneVariableState = SceneVariableState> extends SceneObject<TState> {\n /**\n * This function is called on activation or when a dependency changes.\n */\n validateAndUpdate?(): Observable<ValidateAndUpdateResult>;\n\n /**\n * Should return the value for the given field path\n */\n getValue(fieldPath?: string): VariableValue | undefined | null;\n\n /**\n * Should return the value display text, used by the \"text\" formatter\n * Example: ${podId:text}\n * Useful for variables that have non user friendly values but friendly display text names.\n */\n getValueText?(fieldPath?: string): string;\n\n /**\n * For special edge case senarios. For example local function that locally scoped variables can implement.\n **/\n isAncestorLoading?(): boolean;\n\n /**\n * Allows cancelling variable execution.\n */\n onCancel?(): void;\n\n /**\n * @experimental\n * Indicates that a variable loads values lazily when user interacts with the variable dropdown.\n */\n isLazy?: boolean;\n}\n\nexport type VariableValue = VariableValueSingle | VariableValueSingle[];\n\nexport type VariableValueSingle = string | boolean | number | CustomVariableValue;\n\n/**\n * This is for edge case values like the custom \"allValue\" that should not be escaped/formatted like other values\n * The custom all value usually contain wildcards that should not be escaped.\n */\nexport interface CustomVariableValue {\n /**\n * The format name or function used in the expression\n */\n formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string;\n}\n\nexport interface ValidateAndUpdateResult {}\nexport interface VariableValueOption {\n label: string;\n value: VariableValueSingle;\n group?: string;\n}\n\nexport interface SceneVariableSetState extends SceneObjectState {\n variables: SceneVariable[];\n}\n\nexport interface SceneVariables extends SceneObject<SceneVariableSetState> {\n /**\n * Will look for and return variable matching name\n */\n getByName(name: string): SceneVariable | undefined;\n /**\n * Will return true if the variable is loading or waiting for an update to complete.\n */\n isVariableLoadingOrWaitingToUpdate(variable: SceneVariable): boolean;\n}\n\nexport class SceneVariableValueChangedEvent extends BusEventWithPayload<SceneVariable> {\n public static type = 'scene-variable-changed-value';\n}\n\nexport interface SceneVariableDependencyConfigLike {\n /** Return all variable names this object depend on */\n getNames(): Set<string>;\n\n /** Used to check for dependency on a specific variable */\n hasDependencyOn(name: string): boolean;\n\n /**\n * Will be called when the VariableSet have completed an update process or when a variable has changed value.\n **/\n variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void;\n}\n\n/**\n * Used in CustomFormatterFn\n */\nexport interface CustomFormatterVariable {\n name: string;\n type: VariableType;\n multi?: boolean;\n includeAll?: boolean;\n}\n\nexport type VariableCustomFormatterFn = (\n value: unknown,\n legacyVariableModel: Partial<CustomFormatterVariable>,\n legacyDefaultFormatter?: VariableCustomFormatterFn\n) => string;\n\nexport type InterpolationFormatParameter = string | VariableCustomFormatterFn | undefined;\n\nexport function isCustomVariableValue(value: VariableValue): value is CustomVariableValue {\n return typeof value === 'object' && 'formatter' in value;\n}\n"],"names":[],"mappings":";;AA0FO,MAAM,uCAAuC,mBAAmC,CAAA;AAEvF;AAFa,8BAAA,CACG,IAAO,GAAA,8BAAA;AAkChB,SAAS,sBAAsB,KAAoD,EAAA;AACxF,EAAO,OAAA,OAAO,KAAU,KAAA,QAAA,IAAY,WAAe,IAAA,KAAA;AACrD;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _grafana_data from '@grafana/data';
|
|
2
|
-
import { BusEventWithPayload, EventBus, BusEvent, BusEventType, BusEventHandler, PanelMenuItem, FieldConfigSource, PanelPlugin, AbsoluteTimeRange, PanelData, InterpolateFunction, PanelModel, TimeRange, DataTransformContext, DataFrame, DataQueryRequest, DataSourceGetTagKeysOptions, DataSourceGetTagValuesOptions, IconName, PageLayoutType, UrlQueryMap, DataQuery as DataQuery$1, DataSourceApi, Registry, RegistryItem, ScopedVars, AdHocVariableFilter, GetTagResponse, MetricFindValue, SelectableValue, VariableRefresh as VariableRefresh$1, VariableSort,
|
|
2
|
+
import { BusEventWithPayload, EventBus, BusEvent, BusEventType, BusEventHandler, PanelMenuItem, FieldConfigSource, PanelPlugin, AbsoluteTimeRange, PanelData, InterpolateFunction, PanelModel, TimeRange, DataTransformContext, DataFrame, DataQueryRequest, DataSourceGetTagKeysOptions, DataSourceGetTagValuesOptions, Scope, IconName, PageLayoutType, UrlQueryMap, DataQuery as DataQuery$1, DataSourceApi, Registry, RegistryItem, ScopedVars, AdHocVariableFilter, GetTagResponse, MetricFindValue, SelectableValue, VariableRefresh as VariableRefresh$1, VariableSort, EventFilterOptions, AnnotationEvent, AnnotationQuery, DataTransformerConfig, TimeOption, FieldConfig, FieldType, FieldValueMatcherConfig, ScopedVar, RawTimeRange } from '@grafana/data';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ComponentType,
|
|
4
|
+
import React__default, { ComponentType, CSSProperties, PointerEvent, ForwardRefExoticComponent } from 'react';
|
|
5
5
|
import * as rxjs from 'rxjs';
|
|
6
6
|
import { Observable, Subscription, Unsubscribable, MonoTypeOperatorFunction, ReplaySubject } from 'rxjs';
|
|
7
7
|
import * as _grafana_schema from '@grafana/schema';
|
|
8
8
|
import { VariableType, VariableHide, TimeZone, DataQuery, DataTopic, DataSourceRef, VariableRefresh, LoadingState, DashboardCursorSync, MatcherConfig, TableFieldOptions } from '@grafana/schema';
|
|
9
9
|
import { PanelContext, WeekStart, IconName as IconName$1 } from '@grafana/ui';
|
|
10
|
-
import { LocationService, VariableInterpolation
|
|
10
|
+
import { ScopesContextValue, LocationService, VariableInterpolation } from '@grafana/runtime';
|
|
11
11
|
import { Location } from 'history';
|
|
12
12
|
import ReactGridLayout from 'react-grid-layout';
|
|
13
13
|
import { Options, FieldConfig as FieldConfig$1 } from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';
|
|
@@ -63,10 +63,6 @@ interface SceneVariable<TState extends SceneVariableState = SceneVariableState>
|
|
|
63
63
|
* Allows cancelling variable execution.
|
|
64
64
|
*/
|
|
65
65
|
onCancel?(): void;
|
|
66
|
-
/**
|
|
67
|
-
* Edge case for variables that is hidden but wants to be render to access react contexts (ScopesVariable)
|
|
68
|
-
*/
|
|
69
|
-
hiddenRender?(): React.ReactNode;
|
|
70
66
|
/**
|
|
71
67
|
* @experimental
|
|
72
68
|
* Indicates that a variable loads values lazily when user interacts with the variable dropdown.
|
|
@@ -279,10 +275,6 @@ interface VariableDependencyConfigOptions<TState extends SceneObjectState> {
|
|
|
279
275
|
* Handle time macros.
|
|
280
276
|
*/
|
|
281
277
|
handleTimeMacros?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* Depends on scopes
|
|
284
|
-
*/
|
|
285
|
-
dependsOnScopes?: boolean;
|
|
286
278
|
}
|
|
287
279
|
declare class VariableDependencyConfig<TState extends SceneObjectState> implements SceneVariableDependencyConfigLike {
|
|
288
280
|
private _sceneObject;
|
|
@@ -414,6 +406,7 @@ declare class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends Scen
|
|
|
414
406
|
private _onSeriesVisibilityChange;
|
|
415
407
|
private _onInstanceStateChange;
|
|
416
408
|
private _onToggleLegendSort;
|
|
409
|
+
clone(): this;
|
|
417
410
|
private buildPanelContext;
|
|
418
411
|
}
|
|
419
412
|
|
|
@@ -658,6 +651,36 @@ declare class EmbeddedScene extends SceneObjectBase<EmbeddedSceneState> {
|
|
|
658
651
|
}
|
|
659
652
|
declare function EmbeddedSceneRenderer({ model }: SceneComponentProps<EmbeddedScene>): React__default.JSX.Element;
|
|
660
653
|
|
|
654
|
+
declare class SceneScopesBridge extends SceneObjectBase {
|
|
655
|
+
static Component: typeof SceneScopesBridgeRenderer;
|
|
656
|
+
protected _renderBeforeActivation: boolean;
|
|
657
|
+
private _contextSubject;
|
|
658
|
+
getValue(): Scope[];
|
|
659
|
+
/**
|
|
660
|
+
* Emits values of the selected scopes array. It emits the current value and the previous value if there is a change.
|
|
661
|
+
* @param cb
|
|
662
|
+
*/
|
|
663
|
+
subscribeToValue(cb: (newScopes: Scope[], prevScopes: Scope[]) => void): Unsubscribable;
|
|
664
|
+
isLoading(): boolean;
|
|
665
|
+
subscribeToLoading(cb: (loading: boolean) => void): Unsubscribable;
|
|
666
|
+
setEnabled(enabled: boolean): void;
|
|
667
|
+
setReadOnly(readOnly: boolean): void;
|
|
668
|
+
/**
|
|
669
|
+
* This method is used to keep the context up to date with the scopes context received from React
|
|
670
|
+
*
|
|
671
|
+
* Its rationale is:
|
|
672
|
+
* - When a new context is available, check if we have pending scopes passed from the URL
|
|
673
|
+
* - If we have pending scopes, ask the new context to load them
|
|
674
|
+
* - The loading should happen in a setTimeout to allow the existing context to pass its values to the URL sync handler
|
|
675
|
+
* - If a new context is received, propagate it as a new value in the behavior subject
|
|
676
|
+
* - If a new value is received, force a re-render to trigger the URL sync handler
|
|
677
|
+
*/
|
|
678
|
+
updateContext(newContext: ScopesContextValue | undefined): void;
|
|
679
|
+
private get context();
|
|
680
|
+
private get contextObservable();
|
|
681
|
+
}
|
|
682
|
+
declare function SceneScopesBridgeRenderer({ model }: SceneComponentProps<SceneScopesBridge>): null;
|
|
683
|
+
|
|
661
684
|
interface SceneRouteMatch<Params extends {
|
|
662
685
|
[K in keyof Params]?: string;
|
|
663
686
|
} = {}> {
|
|
@@ -670,6 +693,7 @@ interface SceneAppState extends SceneObjectState {
|
|
|
670
693
|
pages: SceneAppPageLike[];
|
|
671
694
|
name?: string;
|
|
672
695
|
urlSyncOptions?: SceneUrlSyncOptions;
|
|
696
|
+
scopesBridge?: SceneScopesBridge;
|
|
673
697
|
}
|
|
674
698
|
interface SceneAppRoute {
|
|
675
699
|
path: string;
|
|
@@ -714,6 +738,7 @@ interface SceneAppPageState extends SceneObjectState {
|
|
|
714
738
|
*/
|
|
715
739
|
getFallbackPage?: () => SceneAppPageLike;
|
|
716
740
|
layout?: PageLayoutType;
|
|
741
|
+
useScopes?: boolean;
|
|
717
742
|
}
|
|
718
743
|
interface SceneAppPageLike extends SceneObject<SceneAppPageState>, DataRequestEnricher {
|
|
719
744
|
initializeScene(scene: SceneObject): void;
|
|
@@ -941,9 +966,8 @@ declare class AdHocFiltersVariable extends SceneObjectBase<AdHocFiltersVariableS
|
|
|
941
966
|
static Component: typeof AdHocFiltersVariableRenderer;
|
|
942
967
|
private _scopedVars;
|
|
943
968
|
private _dataSourceSrv;
|
|
969
|
+
private _scopesBridge;
|
|
944
970
|
private _originalValues;
|
|
945
|
-
/** Needed for scopes dependency */
|
|
946
|
-
protected _variableDependency: VariableDependencyConfig<AdHocFiltersVariableState>;
|
|
947
971
|
protected _urlSync: AdHocFiltersVariableUrlSyncHandler;
|
|
948
972
|
constructor(state: Partial<AdHocFiltersVariableState>);
|
|
949
973
|
private _activationHandler;
|
|
@@ -1196,6 +1220,7 @@ declare class GroupByVariable extends MultiValueVariable<GroupByVariableState> {
|
|
|
1196
1220
|
static Component: typeof GroupByVariableRenderer;
|
|
1197
1221
|
isLazy: boolean;
|
|
1198
1222
|
protected _urlSync: SceneObjectUrlSyncHandler;
|
|
1223
|
+
private _scopesBridge;
|
|
1199
1224
|
validateAndUpdate(): Observable<ValidateAndUpdateResult>;
|
|
1200
1225
|
private _updateValueGivenNewOptions;
|
|
1201
1226
|
getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]>;
|
|
@@ -1392,9 +1417,9 @@ declare function getAncestor<ParentType>(sceneObject: SceneObject, ancestorType:
|
|
|
1392
1417
|
*/
|
|
1393
1418
|
declare function findDescendents<T extends SceneObject>(scene: SceneObject, descendentType: SceneType<T>): T[];
|
|
1394
1419
|
/**
|
|
1395
|
-
* Will
|
|
1420
|
+
* Will walk up the scene object graph to the closest $scopesBridge scene object
|
|
1396
1421
|
*/
|
|
1397
|
-
declare function
|
|
1422
|
+
declare function getScopesBridge(sceneObject: SceneObject): SceneScopesBridge | undefined;
|
|
1398
1423
|
|
|
1399
1424
|
declare const sceneGraph: {
|
|
1400
1425
|
getVariables: typeof getVariables;
|
|
@@ -1412,7 +1437,7 @@ declare const sceneGraph: {
|
|
|
1412
1437
|
getAncestor: typeof getAncestor;
|
|
1413
1438
|
getQueryController: typeof getQueryController;
|
|
1414
1439
|
findDescendents: typeof findDescendents;
|
|
1415
|
-
|
|
1440
|
+
getScopesBridge: typeof getScopesBridge;
|
|
1416
1441
|
};
|
|
1417
1442
|
|
|
1418
1443
|
interface ActWhenVariableChangedState extends SceneObjectState {
|
|
@@ -1679,6 +1704,8 @@ declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> impleme
|
|
|
1679
1704
|
private _dataLayersMerger;
|
|
1680
1705
|
private _timeSub?;
|
|
1681
1706
|
private _timeSubRange?;
|
|
1707
|
+
private _scopesSub?;
|
|
1708
|
+
private _scopesSubBridge?;
|
|
1682
1709
|
private _containerWidth?;
|
|
1683
1710
|
private _variableValueRecorder;
|
|
1684
1711
|
private _results;
|
|
@@ -1717,11 +1744,12 @@ declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> impleme
|
|
|
1717
1744
|
private _onDeactivate;
|
|
1718
1745
|
setContainerWidth(width: number): void;
|
|
1719
1746
|
isDataReadyToDisplay(): boolean;
|
|
1747
|
+
private subscribeToScopesChanges;
|
|
1720
1748
|
private subscribeToTimeRangeChanges;
|
|
1721
1749
|
runQueries(): void;
|
|
1722
1750
|
private getMaxDataPoints;
|
|
1723
1751
|
cancelQuery(): void;
|
|
1724
|
-
private
|
|
1752
|
+
private runWithTimeRangeAndScopes;
|
|
1725
1753
|
clone(withState?: Partial<QueryRunnerState>): this;
|
|
1726
1754
|
private prepareRequests;
|
|
1727
1755
|
private onDataReceived;
|
|
@@ -1856,7 +1884,7 @@ interface VariableSelectProps {
|
|
|
1856
1884
|
/** To provide an option to hide the label in the variable value selector */
|
|
1857
1885
|
hideLabel?: boolean;
|
|
1858
1886
|
}
|
|
1859
|
-
declare function VariableValueSelectWrapper({ variable, layout, showAlways, hideLabel }: VariableSelectProps):
|
|
1887
|
+
declare function VariableValueSelectWrapper({ variable, layout, showAlways, hideLabel }: VariableSelectProps): React__default.JSX.Element | null;
|
|
1860
1888
|
|
|
1861
1889
|
interface VariableValueControlState extends SceneObjectState {
|
|
1862
1890
|
layout?: ControlsLayout;
|
|
@@ -1871,6 +1899,8 @@ declare class VariableValueControl extends SceneObjectBase<VariableValueControlS
|
|
|
1871
1899
|
declare function VariableValueControlRenderer({ model }: SceneComponentProps<VariableValueControl>): React__default.JSX.Element | null;
|
|
1872
1900
|
|
|
1873
1901
|
declare class SceneVariableSet extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {
|
|
1902
|
+
/** Variables that have changed in since the activation or since the first manual value change */
|
|
1903
|
+
private _variablesThatHaveChanged;
|
|
1874
1904
|
/** Variables that are scheduled to be validated and updated */
|
|
1875
1905
|
private _variablesToUpdate;
|
|
1876
1906
|
/** Variables currently updating */
|
|
@@ -1973,41 +2003,6 @@ declare class TestVariable extends MultiValueVariable<TestVariableState> {
|
|
|
1973
2003
|
static Component: ({ model }: SceneComponentProps<MultiValueVariable>) => React__default.JSX.Element;
|
|
1974
2004
|
}
|
|
1975
2005
|
|
|
1976
|
-
interface ScopesVariableState extends SceneVariableState {
|
|
1977
|
-
/**
|
|
1978
|
-
* Last captured state from ScopesContext
|
|
1979
|
-
*/
|
|
1980
|
-
scopes: Scope[];
|
|
1981
|
-
/**
|
|
1982
|
-
* Set to true if you want to the variable to enable / disable scopes when activated / deactivated
|
|
1983
|
-
*/
|
|
1984
|
-
enable?: boolean;
|
|
1985
|
-
}
|
|
1986
|
-
declare class ScopesVariable extends SceneObjectBase<ScopesVariableState> implements SceneVariable<ScopesVariableState> {
|
|
1987
|
-
protected _renderBeforeActivation: boolean;
|
|
1988
|
-
protected _context: ScopesContextValue | undefined;
|
|
1989
|
-
constructor(state: Partial<ScopesVariableState>);
|
|
1990
|
-
/**
|
|
1991
|
-
* Temporary simple implementation to stringify the scopes.
|
|
1992
|
-
*/
|
|
1993
|
-
getValue(fieldPath: string): VariableValue;
|
|
1994
|
-
getScopes(): Scope[] | undefined;
|
|
1995
|
-
/**
|
|
1996
|
-
* This method is used to keep the context up to date with the scopes context received from React
|
|
1997
|
-
* 1) Subscribes to ScopesContext state changes and synchronizes it with the variable state
|
|
1998
|
-
* 2) Handles enable / disabling of scopes based on variable enable option.
|
|
1999
|
-
*/
|
|
2000
|
-
setContext(context: ScopesContextValue | undefined): (() => void) | undefined;
|
|
2001
|
-
updateStateFromContext(state: {
|
|
2002
|
-
loading: boolean;
|
|
2003
|
-
value: Scope[];
|
|
2004
|
-
}): void;
|
|
2005
|
-
/**
|
|
2006
|
-
* Special function that enables variables to be hidden but still render to access react contexts
|
|
2007
|
-
*/
|
|
2008
|
-
hiddenRender(): ReactNode;
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
2006
|
interface LocalValueVariableState extends SceneVariableState {
|
|
2012
2007
|
value: VariableValue;
|
|
2013
2008
|
text: VariableValue;
|
|
@@ -2497,6 +2492,9 @@ declare class SceneAppPage extends SceneObjectBase<SceneAppPageState> implements
|
|
|
2497
2492
|
static Component: typeof SceneAppPageRenderer;
|
|
2498
2493
|
private _sceneCache;
|
|
2499
2494
|
private _drilldownCache;
|
|
2495
|
+
private _scopesBridge;
|
|
2496
|
+
constructor(state: SceneAppPageState);
|
|
2497
|
+
private _activationHandler;
|
|
2500
2498
|
initializeScene(scene: EmbeddedScene): void;
|
|
2501
2499
|
getScene(routeMatch: SceneRouteMatch): EmbeddedScene;
|
|
2502
2500
|
getDrilldownPage(drilldown: SceneAppDrilldownView, routeMatch: SceneRouteMatch<{}>): SceneAppPageLike;
|
|
@@ -3031,5 +3029,5 @@ declare const sceneUtils: {
|
|
|
3031
3029
|
isGroupByVariable: typeof isGroupByVariable;
|
|
3032
3030
|
};
|
|
3033
3031
|
|
|
3034
|
-
export { AdHocFiltersVariable, ConstantVariable, ControlsLabel, CustomVariable, DataProviderProxy, DataSourceVariable, EmbeddedScene, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, GroupByVariable, IntervalVariable, LazyLoader, LocalValueVariable, MultiOrSingleValueSelect, MultiValueVariable, NestedScene, NewSceneObjectAddedEvent, 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,
|
|
3032
|
+
export { AdHocFiltersVariable, ConstantVariable, ControlsLabel, CustomVariable, DataProviderProxy, DataSourceVariable, EmbeddedScene, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, GroupByVariable, IntervalVariable, LazyLoader, LocalValueVariable, MultiOrSingleValueSelect, MultiValueVariable, NestedScene, NewSceneObjectAddedEvent, 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, SceneScopesBridge, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneVariableSet, SceneVariableValueChangedEvent, SplitLayout, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UserActionEvent, VariableDependencyConfig, VariableValueControl, VariableValueSelectWrapper, VariableValueSelectors, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelExploreButton, VizPanelMenu, index$1 as behaviors, index as dataLayers, formatRegistry, getExploreURL, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };
|
|
3035
3033
|
export type { AdHocFilterWithLabels, CancelActivationHandler, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DeepPartial, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FiltersRequestEnricher, FormatVariable, InterpolationFormatParameter, MacroVariableConstructor, MultiValueVariableState, QueryRunnerState, SceneActivationHandler, SceneAppDrilldownView, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneComponent, SceneComponentProps, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformerState, SceneDeactivationHandler, SceneFlexItemLike, SceneFlexItemState, SceneGridItemLike, SceneGridItemStateLike, SceneInteractionProfileEvent, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectState, SceneObjectStateChangedPayload, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimeRangeLike, SceneTimeRangeState, SceneUrlSyncOptions, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSetState, SceneVariableState, SceneVariables, UrlSyncManagerLike, UseStateHookOptions, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableGetOptionsArgs, VariableValue, VariableValueOption, VariableValueSingle, VizConfig, VizPanelState };
|