@grafana/scenes 5.7.4--canary.858.10213075790.0 → 5.7.5--canary.858.10369282107.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +13 -0
- package/dist/esm/behaviors/SceneRenderProfiler.js +37 -2
- package/dist/esm/behaviors/SceneRenderProfiler.js.map +1 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js +5 -0
- package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3584 -3545
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# v5.7.4 (Fri Aug 09 2024)
|
2
|
+
|
3
|
+
#### 🐛 Bug Fix
|
4
|
+
|
5
|
+
- Add backwards compatibility for query variables referencing themselves [#861](https://github.com/grafana/scenes/pull/861) ([@oscarkilhed](https://github.com/oscarkilhed) [@ivanortegaalba](https://github.com/ivanortegaalba))
|
6
|
+
|
7
|
+
#### Authors: 2
|
8
|
+
|
9
|
+
- Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba))
|
10
|
+
- Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed))
|
11
|
+
|
12
|
+
---
|
13
|
+
|
1
14
|
# v5.7.3 (Thu Aug 01 2024)
|
2
15
|
|
3
16
|
#### 🐛 Bug Fix
|
@@ -60,15 +60,18 @@ class SceneRenderProfiler {
|
|
60
60
|
start: measurementStartTs,
|
61
61
|
end: measurementStartTs + n
|
62
62
|
});
|
63
|
+
const profileEndTs = profileStartTs + profileDuration + slowFramesTime;
|
63
64
|
performance.measure("DashboardInteraction", {
|
64
65
|
start: profileStartTs,
|
65
|
-
end:
|
66
|
+
end: profileEndTs
|
66
67
|
});
|
68
|
+
const networkDuration = captureNetwork(profileStartTs, profileEndTs);
|
67
69
|
if (this.queryController.state.onProfileComplete) {
|
68
70
|
this.queryController.state.onProfileComplete({
|
69
71
|
origin: __privateGet(this, _profileInProgress).origin,
|
70
72
|
crumbs: __privateGet(this, _profileInProgress).crumbs,
|
71
|
-
duration: profileDuration + slowFramesTime
|
73
|
+
duration: profileDuration + slowFramesTime,
|
74
|
+
networkDuration
|
72
75
|
});
|
73
76
|
}
|
74
77
|
if (window.__runs) {
|
@@ -131,6 +134,38 @@ function processRecordedSpans(spans) {
|
|
131
134
|
}
|
132
135
|
return [spans[0]];
|
133
136
|
}
|
137
|
+
function captureNetwork(startTs, endTs) {
|
138
|
+
const entries = performance.getEntriesByType("resource");
|
139
|
+
performance.clearResourceTimings();
|
140
|
+
const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);
|
141
|
+
for (const entry of networkEntries) {
|
142
|
+
performance.measure("Network entry " + entry.name, {
|
143
|
+
start: entry.startTime,
|
144
|
+
end: entry.responseEnd
|
145
|
+
});
|
146
|
+
}
|
147
|
+
return calculateNetworkTime(networkEntries);
|
148
|
+
}
|
149
|
+
function calculateNetworkTime(requests) {
|
150
|
+
if (requests.length === 0) {
|
151
|
+
return 0;
|
152
|
+
}
|
153
|
+
requests.sort((a, b) => a.startTime - b.startTime);
|
154
|
+
let totalNetworkTime = 0;
|
155
|
+
let currentStart = requests[0].startTime;
|
156
|
+
let currentEnd = requests[0].responseEnd;
|
157
|
+
for (let i = 1; i < requests.length; i++) {
|
158
|
+
if (requests[i].startTime <= currentEnd) {
|
159
|
+
currentEnd = Math.max(currentEnd, requests[i].responseEnd);
|
160
|
+
} else {
|
161
|
+
totalNetworkTime += currentEnd - currentStart;
|
162
|
+
currentStart = requests[i].startTime;
|
163
|
+
currentEnd = requests[i].responseEnd;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
totalNetworkTime += currentEnd - currentStart;
|
167
|
+
return totalNetworkTime;
|
168
|
+
}
|
134
169
|
|
135
170
|
export { SceneRenderProfiler };
|
136
171
|
//# sourceMappingURL=SceneRenderProfiler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SceneRenderProfiler.js","sources":["../../../src/behaviors/SceneRenderProfiler.ts"],"sourcesContent":["import { writeSceneLog } from '../utils/writeSceneLog';\nimport { SceneQueryControllerLike } from './types';\n\nconst POST_STORM_WINDOW = 2000; // Time after last query to observe slow frames\nconst SPAN_THRESHOLD = 30; // Frames longer than this will be considered slow\n\nexport class SceneRenderProfiler {\n #profileInProgress: {\n // Profile origin, i.e. scene refresh picker\n origin: string;\n crumbs: string[];\n } | null = null;\n\n #profileStartTs: number | null = null;\n #trailAnimationFrameId: number | null = null;\n\n // Will keep measured lengths trailing frames\n #recordedTrailingSpans: number[] = [];\n\n lastFrameTime: number = 0;\n\n public constructor(private queryController: SceneQueryControllerLike) {}\n\n public startProfile(name: string) {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n\n writeSceneLog(this.constructor.name, 'New profile: Stopped recording frames');\n }\n\n this.#profileInProgress = { origin: name, crumbs: [] };\n this.#profileStartTs = performance.now();\n writeSceneLog(this.constructor.name, 'Profile started:', this.#profileInProgress, this.#profileStartTs);\n }\n\n private recordProfileTail(measurementStartTime: number, profileStartTs: number) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)\n );\n }\n\n private measureTrailingFrames = (measurementStartTs: number, lastFrameTime: number, profileStartTs: number) => {\n const currentFrameTime = performance.now();\n const frameLength = currentFrameTime - lastFrameTime;\n this.#recordedTrailingSpans.push(frameLength);\n\n if (currentFrameTime - measurementStartTs! < POST_STORM_WINDOW) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)\n );\n } else {\n const slowFrames = processRecordedSpans(this.#recordedTrailingSpans);\n const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);\n writeSceneLog(\n this.constructor.name,\n 'Profile tail recorded, slow frames duration:',\n slowFramesTime,\n slowFrames,\n this.#profileInProgress\n );\n\n this.#recordedTrailingSpans = [];\n\n // Using performance api to calculate sum of all network requests time starting at performance.now() -profileDuration - slowFramesTime\n // const entries = performance.getEntriesByType('resource');\n\n const n = performance.now();\n\n const profileDuration = measurementStartTs - profileStartTs;\n writeSceneLog(\n this.constructor.name,\n 'Stoped recording, total measured time (network included):',\n profileDuration + slowFramesTime\n );\n this.#trailAnimationFrameId = null;\n performance.measure('DashboardInteraction tail', {\n start: measurementStartTs,\n end: measurementStartTs + n,\n });\n performance.measure('DashboardInteraction', {\n start: profileStartTs,\n end: profileStartTs + profileDuration + slowFramesTime,\n });\n\n if (this.queryController.state.onProfileComplete) {\n this.queryController.state.onProfileComplete({\n origin: this.#profileInProgress!.origin,\n crumbs: this.#profileInProgress!.crumbs,\n duration: profileDuration + slowFramesTime,\n });\n }\n // @ts-ignore\n if (window.__runs) {\n // @ts-ignore\n window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n } else {\n // @ts-ignore\n window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n }\n }\n };\n\n public tryCompletingProfile() {\n writeSceneLog(this.constructor.name, 'Trying to complete profile', this.#profileInProgress);\n if (this.queryController.runningQueriesCount() === 0 && this.#profileInProgress) {\n writeSceneLog(this.constructor.name, 'All queries completed, stopping profile');\n this.recordProfileTail(performance.now(), this.#profileStartTs!);\n }\n }\n\n public isTailRecording() {\n return Boolean(this.#trailAnimationFrameId);\n }\n public cancelTailRecording() {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n writeSceneLog(this.constructor.name, 'Cancelled recording frames, new profile started');\n }\n }\n\n public addCrumb(crumb: string) {\n if (this.#profileInProgress) {\n this.#profileInProgress.crumbs.push(crumb);\n }\n }\n}\n\nfunction processRecordedSpans(spans: number[]) {\n // identifie last span in spans that's bigger than 50\n for (let i = spans.length - 1; i >= 0; i--) {\n if (spans[i] > SPAN_THRESHOLD) {\n return spans.slice(0, i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,IAAA,OAAA,EAAA,CAAA;AAgHF,SAAS,qBAAqB,KAAiB,EAAA;AAE7C,EAAA,KAAA,IAAS,IAAI,KAAM,CAAA,MAAA,GAAS,CAAG,EAAA,CAAA,IAAK,GAAG,CAAK,EAAA,EAAA;AAC1C,IAAI,IAAA,KAAA,CAAM,KAAK,cAAgB,EAAA;AAC7B,MAAA,OAAO,KAAM,CAAA,KAAA,CAAM,CAAG,EAAA,CAAA,GAAI,CAAC,CAAA,CAAA;AAAA,KAC7B;AAAA,GACF;AACA,EAAO,OAAA,CAAC,MAAM,CAAE,CAAA,CAAA,CAAA;AAClB;;;;"}
|
1
|
+
{"version":3,"file":"SceneRenderProfiler.js","sources":["../../../src/behaviors/SceneRenderProfiler.ts"],"sourcesContent":["import { writeSceneLog } from '../utils/writeSceneLog';\nimport { SceneQueryControllerLike } from './types';\n\nconst POST_STORM_WINDOW = 2000; // Time after last query to observe slow frames\nconst SPAN_THRESHOLD = 30; // Frames longer than this will be considered slow\n\nexport class SceneRenderProfiler {\n #profileInProgress: {\n // Profile origin, i.e. scene refresh picker\n origin: string;\n crumbs: string[];\n } | null = null;\n\n #profileStartTs: number | null = null;\n #trailAnimationFrameId: number | null = null;\n\n // Will keep measured lengths trailing frames\n #recordedTrailingSpans: number[] = [];\n\n lastFrameTime: number = 0;\n\n public constructor(private queryController: SceneQueryControllerLike) {}\n\n public startProfile(name: string) {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n\n writeSceneLog(this.constructor.name, 'New profile: Stopped recording frames');\n }\n\n this.#profileInProgress = { origin: name, crumbs: [] };\n this.#profileStartTs = performance.now();\n writeSceneLog(this.constructor.name, 'Profile started:', this.#profileInProgress, this.#profileStartTs);\n }\n\n private recordProfileTail(measurementStartTime: number, profileStartTs: number) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)\n );\n }\n\n private measureTrailingFrames = (measurementStartTs: number, lastFrameTime: number, profileStartTs: number) => {\n const currentFrameTime = performance.now();\n const frameLength = currentFrameTime - lastFrameTime;\n this.#recordedTrailingSpans.push(frameLength);\n\n if (currentFrameTime - measurementStartTs! < POST_STORM_WINDOW) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)\n );\n } else {\n const slowFrames = processRecordedSpans(this.#recordedTrailingSpans);\n const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);\n writeSceneLog(\n this.constructor.name,\n 'Profile tail recorded, slow frames duration:',\n slowFramesTime,\n slowFrames,\n this.#profileInProgress\n );\n\n this.#recordedTrailingSpans = [];\n\n // Using performance api to calculate sum of all network requests time starting at performance.now() -profileDuration - slowFramesTime\n // const entries = performance.getEntriesByType('resource');\n\n const n = performance.now();\n\n const profileDuration = measurementStartTs - profileStartTs;\n writeSceneLog(\n this.constructor.name,\n 'Stoped recording, total measured time (network included):',\n profileDuration + slowFramesTime\n );\n this.#trailAnimationFrameId = null;\n performance.measure('DashboardInteraction tail', {\n start: measurementStartTs,\n end: measurementStartTs + n,\n });\n\n const profileEndTs = profileStartTs + profileDuration + slowFramesTime;\n\n performance.measure('DashboardInteraction', {\n start: profileStartTs,\n end: profileEndTs,\n });\n\n const networkDuration = captureNetwork(profileStartTs, profileEndTs);\n\n if (this.queryController.state.onProfileComplete) {\n this.queryController.state.onProfileComplete({\n origin: this.#profileInProgress!.origin,\n crumbs: this.#profileInProgress!.crumbs,\n duration: profileDuration + slowFramesTime,\n networkDuration,\n });\n }\n // @ts-ignore\n if (window.__runs) {\n // @ts-ignore\n window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n } else {\n // @ts-ignore\n window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n }\n }\n };\n\n public tryCompletingProfile() {\n writeSceneLog(this.constructor.name, 'Trying to complete profile', this.#profileInProgress);\n if (this.queryController.runningQueriesCount() === 0 && this.#profileInProgress) {\n writeSceneLog(this.constructor.name, 'All queries completed, stopping profile');\n this.recordProfileTail(performance.now(), this.#profileStartTs!);\n }\n }\n\n public isTailRecording() {\n return Boolean(this.#trailAnimationFrameId);\n }\n public cancelTailRecording() {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n writeSceneLog(this.constructor.name, 'Cancelled recording frames, new profile started');\n }\n }\n\n public addCrumb(crumb: string) {\n if (this.#profileInProgress) {\n this.#profileInProgress.crumbs.push(crumb);\n }\n }\n}\n\nfunction processRecordedSpans(spans: number[]) {\n // identifie last span in spans that's bigger than 50\n for (let i = spans.length - 1; i >= 0; i--) {\n if (spans[i] > SPAN_THRESHOLD) {\n return spans.slice(0, i + 1);\n }\n }\n return [spans[0]];\n}\n\nfunction captureNetwork(startTs: number, endTs: number) {\n const entries = performance.getEntriesByType('resource');\n performance.clearResourceTimings();\n const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);\n for (const entry of networkEntries) {\n performance.measure('Network entry ' + entry.name, {\n start: entry.startTime,\n end: entry.responseEnd,\n });\n }\n\n return calculateNetworkTime(networkEntries);\n}\n\n// Will calculate total time spent on Network\nfunction calculateNetworkTime(requests: PerformanceResourceTiming[]): number {\n if (requests.length === 0) {\n return 0;\n }\n\n // Step 1: Sort the requests by startTs\n requests.sort((a, b) => a.startTime - b.startTime);\n\n // Step 2: Initialize variables\n let totalNetworkTime = 0;\n let currentStart = requests[0].startTime;\n let currentEnd = requests[0].responseEnd;\n\n // Step 3: Iterate through the sorted list and merge overlapping intervals\n for (let i = 1; i < requests.length; i++) {\n if (requests[i].startTime <= currentEnd) {\n // Overlapping intervals, merge them\n currentEnd = Math.max(currentEnd, requests[i].responseEnd);\n } else {\n // Non-overlapping interval, add the duration to total time\n totalNetworkTime += currentEnd - currentStart;\n\n // Update current interval\n currentStart = requests[i].startTime;\n currentEnd = requests[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S,WAAW,CAAG,EAAA;AACzB,IAAO,OAAA,CAAA,CAAA;AAAA,GACT;AAGA,EAAA,QAAA,CAAS,KAAK,CAAC,CAAA,EAAG,MAAM,CAAE,CAAA,SAAA,GAAY,EAAE,SAAS,CAAA,CAAA;AAGjD,EAAA,IAAI,gBAAmB,GAAA,CAAA,CAAA;AACvB,EAAI,IAAA,YAAA,GAAe,SAAS,CAAG,CAAA,CAAA,SAAA,CAAA;AAC/B,EAAI,IAAA,UAAA,GAAa,SAAS,CAAG,CAAA,CAAA,WAAA,CAAA;AAG7B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,QAAA,CAAS,QAAQ,CAAK,EAAA,EAAA;AACxC,IAAI,IAAA,QAAA,CAAS,CAAG,CAAA,CAAA,SAAA,IAAa,UAAY,EAAA;AAEvC,MAAA,UAAA,GAAa,IAAK,CAAA,GAAA,CAAI,UAAY,EAAA,QAAA,CAAS,GAAG,WAAW,CAAA,CAAA;AAAA,KACpD,MAAA;AAEL,MAAA,gBAAA,IAAoB,UAAa,GAAA,YAAA,CAAA;AAGjC,MAAA,YAAA,GAAe,SAAS,CAAG,CAAA,CAAA,SAAA,CAAA;AAC3B,MAAA,UAAA,GAAa,SAAS,CAAG,CAAA,CAAA,WAAA,CAAA;AAAA,KAC3B;AAAA,GACF;AAGA,EAAA,gBAAA,IAAoB,UAAa,GAAA,YAAA,CAAA;AAEjC,EAAO,OAAA,gBAAA,CAAA;AACT;;;;"}
|
@@ -3,6 +3,7 @@ import { sceneInterpolator } from '../../variables/interpolation/sceneInterpolat
|
|
3
3
|
import { isDataLayer } from '../types.js';
|
4
4
|
import { lookupVariable } from '../../variables/lookupVariable.js';
|
5
5
|
import { getClosest } from './utils.js';
|
6
|
+
import { QueryVariable } from '../../variables/variants/query/QueryVariable.js';
|
6
7
|
|
7
8
|
function getVariables(sceneObject) {
|
8
9
|
var _a;
|
@@ -33,6 +34,10 @@ function hasVariableDependencyInLoadingState(sceneObject) {
|
|
33
34
|
return false;
|
34
35
|
}
|
35
36
|
for (const name of sceneObject.variableDependency.getNames()) {
|
37
|
+
if (sceneObject instanceof QueryVariable && sceneObject.state.name === name) {
|
38
|
+
console.warn("Query variable is referencing itself");
|
39
|
+
continue;
|
40
|
+
}
|
36
41
|
const variable = lookupVariable(name, sceneObject);
|
37
42
|
if (!variable) {
|
38
43
|
continue;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sceneGraph.js","sources":["../../../../src/core/sceneGraph/sceneGraph.ts"],"sourcesContent":["import { ScopedVars } from '@grafana/data';\nimport { EmptyDataNode, EmptyVariableSet } from '../../variables/interpolation/defaults';\n\nimport { sceneInterpolator } from '../../variables/interpolation/sceneInterpolator';\nimport { VariableCustomFormatterFn, SceneVariables } from '../../variables/types';\n\nimport { isDataLayer, SceneDataLayerProvider, SceneDataProvider, SceneLayout, SceneObject } from '../types';\nimport { lookupVariable } from '../../variables/lookupVariable';\nimport { getClosest } from './utils';\nimport { VariableInterpolation } from '@grafana/runtime';\n\n/**\n * Get the closest node with variables\n */\nexport function getVariables(sceneObject: SceneObject): SceneVariables {\n return getClosest(sceneObject, (s) => s.state.$variables) ?? EmptyVariableSet;\n}\n\n/**\n * Will walk up the scene object graph to the closest $data scene object\n */\nexport function getData(sceneObject: SceneObject): SceneDataProvider {\n return getClosest(sceneObject, (s) => s.state.$data) ?? EmptyDataNode;\n}\n\nfunction isSceneLayout(s: SceneObject): s is SceneLayout {\n return 'isDraggable' in s;\n}\n\n/**\n * Will walk up the scene object graph to the closest $layout scene object\n */\nexport function getLayout(scene: SceneObject): SceneLayout | null {\n const parent = getClosest(scene, (s) => (isSceneLayout(s) ? s : undefined));\n if (parent) {\n return parent;\n }\n\n return null;\n}\n\n/**\n * Interpolates the given string using the current scene object as context. *\n *\n * Note: the interpolations array will be mutated by adding information about variables that\n * have been interpolated during replacement. Variables that were specified in the target but not found in\n * the list of available variables are also added to the array. See {@link VariableInterpolation} for more details.\n *\n * @param {VariableInterpolation[]} interpolations an optional array that is updated with interpolated variables.\n */\nexport function interpolate(\n sceneObject: SceneObject,\n value: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: string | VariableCustomFormatterFn,\n interpolations?: VariableInterpolation[]\n): string {\n if (value === '' || value == null) {\n return '';\n }\n\n return sceneInterpolator(sceneObject, value, scopedVars, format, interpolations);\n}\n\n/**\n * Checks if the variable is currently loading or waiting to update.\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 */\nexport function hasVariableDependencyInLoadingState(sceneObject: SceneObject) {\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const name of sceneObject.variableDependency.getNames()) {\n const variable = lookupVariable(name, sceneObject);\n if (!variable) {\n continue;\n }\n\n const set = variable.parent as SceneVariables;\n if (set.isVariableLoadingOrWaitingToUpdate(variable)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction findObjectInternal(\n scene: SceneObject,\n check: (obj: SceneObject) => boolean,\n alreadySearchedChild?: SceneObject,\n shouldSearchUp?: boolean\n): SceneObject | null {\n if (check(scene)) {\n return scene;\n }\n\n let found: SceneObject | null = null;\n\n scene.forEachChild((child) => {\n if (child === alreadySearchedChild) {\n return;\n }\n\n let maybe = findObjectInternal(child, check);\n if (maybe) {\n found = maybe;\n }\n });\n\n if (found) {\n return found;\n }\n\n if (shouldSearchUp && scene.parent) {\n return findObjectInternal(scene.parent, check, scene, true);\n }\n\n return null;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key.\n *\n * Throws error if no key-matching scene object found.\n */\nexport function findByKey(sceneObject: SceneObject, key: string) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n return found;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key and type.\n *\n * Throws error if no key-matching scene object found.\n * Throws error if the given type does not match.\n */\nexport function findByKeyAndType<TargetType extends SceneObject>(\n sceneObject: SceneObject,\n key: string,\n targetType: { new (...args: never[]): TargetType }\n) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n if (!(found instanceof targetType)) {\n throw new Error(`Found scene object with key ${key} does not match type ${targetType.name}`);\n }\n return found;\n}\n\n/**\n * This will search the full scene graph, starting with the scene node passed in, then walking up the parent chain. *\n */\nexport function findObject(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject | null {\n return findObjectInternal(scene, check, undefined, true);\n}\n\n/**\n * This will search down the full scene graph, looking for objects that match the provided predicate.\n */\nexport function findAllObjects(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject[] {\n const found: SceneObject[] = [];\n\n scene.forEachChild((child) => {\n if (check(child)) {\n found.push(child);\n }\n\n found.push(...findAllObjects(child, check));\n });\n\n return found;\n}\n\n/**\n * Will walk up the scene object graph up until the root and collect all SceneDataLayerProvider objects.\n * When localOnly set to true, it will only collect the closest layers.\n */\nexport function getDataLayers(sceneObject: SceneObject, localOnly = false): SceneDataLayerProvider[] {\n let currentLevel: SceneObject | undefined = sceneObject;\n let collected: SceneDataLayerProvider[] = [];\n\n while (currentLevel) {\n const dataProvider = currentLevel.state.$data;\n if (!dataProvider) {\n currentLevel = currentLevel.parent;\n continue;\n }\n\n // Check if data layer exists nested inside another data provider\n if (isDataLayer(dataProvider)) {\n collected = collected.concat(dataProvider);\n } else {\n if (dataProvider.state.$data && isDataLayer(dataProvider.state.$data)) {\n collected = collected.concat(dataProvider.state.$data);\n }\n }\n\n if (localOnly && collected.length > 0) {\n break;\n }\n\n currentLevel = currentLevel.parent;\n }\n\n return collected;\n}\n\n/**\n * A utility function to find the closest ancestor of a given type. This function expects\n * to find it and will throw an error if it does not.\n */\nexport function getAncestor<ParentType>(\n sceneObject: SceneObject,\n ancestorType: { new (...args: never[]): ParentType }\n): ParentType {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent instanceof ancestorType) {\n return parent;\n }\n parent = parent.parent;\n }\n\n if (!parent) {\n throw new Error('Unable to find parent of type ' + ancestorType.name);\n }\n\n return parent as ParentType;\n}\n"],"names":[],"mappings":";;;;;;AAcO,SAAS,aAAa,WAA0C,EAAA;AAdvE,EAAA,IAAA,EAAA,CAAA;AAeE,EAAO,OAAA,CAAA,EAAA,GAAA,UAAA,CAAW,aAAa,CAAC,CAAA,KAAM,EAAE,KAAM,CAAA,UAAU,MAAjD,IAAsD,GAAA,EAAA,GAAA,gBAAA,CAAA;AAC/D,CAAA;AAKO,SAAS,QAAQ,WAA6C,EAAA;AArBrE,EAAA,IAAA,EAAA,CAAA;AAsBE,EAAO,OAAA,CAAA,EAAA,GAAA,UAAA,CAAW,aAAa,CAAC,CAAA,KAAM,EAAE,KAAM,CAAA,KAAK,MAA5C,IAAiD,GAAA,EAAA,GAAA,aAAA,CAAA;AAC1D,CAAA;AAEA,SAAS,cAAc,CAAkC,EAAA;AACvD,EAAA,OAAO,aAAiB,IAAA,CAAA,CAAA;AAC1B,CAAA;AAKO,SAAS,UAAU,KAAwC,EAAA;AAChE,EAAM,MAAA,MAAA,GAAS,WAAW,KAAO,EAAA,CAAC,MAAO,aAAc,CAAA,CAAC,CAAI,GAAA,CAAA,GAAI,KAAU,CAAA,CAAA,CAAA;AAC1E,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAWO,SAAS,WACd,CAAA,WAAA,EACA,KACA,EAAA,UAAA,EACA,QACA,cACQ,EAAA;AACR,EAAI,IAAA,KAAA,KAAU,EAAM,IAAA,KAAA,IAAS,IAAM,EAAA;AACjC,IAAO,OAAA,EAAA,CAAA;AAAA,GACT;AAEA,EAAA,OAAO,iBAAkB,CAAA,WAAA,EAAa,KAAO,EAAA,UAAA,EAAY,QAAQ,cAAc,CAAA,CAAA;AACjF,CAAA;AAQO,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;AACZ,EAAA,IAAI,MAAkC,GAAA,WAAA,CAAA;AAEtC,EAAA,OAAO,MAAQ,EAAA;AACb,IAAA,IAAI,kBAAkB,YAAc,EAAA;AAClC,MAAO,OAAA,MAAA,CAAA;AAAA,KACT;AACA,IAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAA;AAAA,GAClB;AAEA,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,gCAAmC,GAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAAA,GACtE;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
1
|
+
{"version":3,"file":"sceneGraph.js","sources":["../../../../src/core/sceneGraph/sceneGraph.ts"],"sourcesContent":["import { ScopedVars } from '@grafana/data';\nimport { EmptyDataNode, EmptyVariableSet } from '../../variables/interpolation/defaults';\n\nimport { sceneInterpolator } from '../../variables/interpolation/sceneInterpolator';\nimport { VariableCustomFormatterFn, SceneVariables } from '../../variables/types';\n\nimport { isDataLayer, SceneDataLayerProvider, SceneDataProvider, SceneLayout, SceneObject } from '../types';\nimport { lookupVariable } from '../../variables/lookupVariable';\nimport { getClosest } from './utils';\nimport { VariableInterpolation } from '@grafana/runtime';\nimport { QueryVariable } from '../../variables/variants/query/QueryVariable';\n\n/**\n * Get the closest node with variables\n */\nexport function getVariables(sceneObject: SceneObject): SceneVariables {\n return getClosest(sceneObject, (s) => s.state.$variables) ?? EmptyVariableSet;\n}\n\n/**\n * Will walk up the scene object graph to the closest $data scene object\n */\nexport function getData(sceneObject: SceneObject): SceneDataProvider {\n return getClosest(sceneObject, (s) => s.state.$data) ?? EmptyDataNode;\n}\n\nfunction isSceneLayout(s: SceneObject): s is SceneLayout {\n return 'isDraggable' in s;\n}\n\n/**\n * Will walk up the scene object graph to the closest $layout scene object\n */\nexport function getLayout(scene: SceneObject): SceneLayout | null {\n const parent = getClosest(scene, (s) => (isSceneLayout(s) ? s : undefined));\n if (parent) {\n return parent;\n }\n\n return null;\n}\n\n/**\n * Interpolates the given string using the current scene object as context. *\n *\n * Note: the interpolations array will be mutated by adding information about variables that\n * have been interpolated during replacement. Variables that were specified in the target but not found in\n * the list of available variables are also added to the array. See {@link VariableInterpolation} for more details.\n *\n * @param {VariableInterpolation[]} interpolations an optional array that is updated with interpolated variables.\n */\nexport function interpolate(\n sceneObject: SceneObject,\n value: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: string | VariableCustomFormatterFn,\n interpolations?: VariableInterpolation[]\n): string {\n if (value === '' || value == null) {\n return '';\n }\n\n return sceneInterpolator(sceneObject, value, scopedVars, format, interpolations);\n}\n\n/**\n * Checks if the variable is currently loading or waiting to update.\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 */\nexport function hasVariableDependencyInLoadingState(sceneObject: SceneObject) {\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const name of sceneObject.variableDependency.getNames()) {\n // This is for backwards compability. In the old architecture query variables could reference itself in a query without breaking.\n if (sceneObject instanceof QueryVariable && sceneObject.state.name === name) {\n console.warn('Query variable is referencing itself');\n continue;\n }\n\n const variable = lookupVariable(name, sceneObject);\n if (!variable) {\n continue;\n }\n\n const set = variable.parent as SceneVariables;\n if (set.isVariableLoadingOrWaitingToUpdate(variable)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction findObjectInternal(\n scene: SceneObject,\n check: (obj: SceneObject) => boolean,\n alreadySearchedChild?: SceneObject,\n shouldSearchUp?: boolean\n): SceneObject | null {\n if (check(scene)) {\n return scene;\n }\n\n let found: SceneObject | null = null;\n\n scene.forEachChild((child) => {\n if (child === alreadySearchedChild) {\n return;\n }\n\n let maybe = findObjectInternal(child, check);\n if (maybe) {\n found = maybe;\n }\n });\n\n if (found) {\n return found;\n }\n\n if (shouldSearchUp && scene.parent) {\n return findObjectInternal(scene.parent, check, scene, true);\n }\n\n return null;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key.\n *\n * Throws error if no key-matching scene object found.\n */\nexport function findByKey(sceneObject: SceneObject, key: string) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n return found;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key and type.\n *\n * Throws error if no key-matching scene object found.\n * Throws error if the given type does not match.\n */\nexport function findByKeyAndType<TargetType extends SceneObject>(\n sceneObject: SceneObject,\n key: string,\n targetType: { new (...args: never[]): TargetType }\n) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n if (!(found instanceof targetType)) {\n throw new Error(`Found scene object with key ${key} does not match type ${targetType.name}`);\n }\n return found;\n}\n\n/**\n * This will search the full scene graph, starting with the scene node passed in, then walking up the parent chain. *\n */\nexport function findObject(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject | null {\n return findObjectInternal(scene, check, undefined, true);\n}\n\n/**\n * This will search down the full scene graph, looking for objects that match the provided predicate.\n */\nexport function findAllObjects(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject[] {\n const found: SceneObject[] = [];\n\n scene.forEachChild((child) => {\n if (check(child)) {\n found.push(child);\n }\n\n found.push(...findAllObjects(child, check));\n });\n\n return found;\n}\n\n/**\n * Will walk up the scene object graph up until the root and collect all SceneDataLayerProvider objects.\n * When localOnly set to true, it will only collect the closest layers.\n */\nexport function getDataLayers(sceneObject: SceneObject, localOnly = false): SceneDataLayerProvider[] {\n let currentLevel: SceneObject | undefined = sceneObject;\n let collected: SceneDataLayerProvider[] = [];\n\n while (currentLevel) {\n const dataProvider = currentLevel.state.$data;\n if (!dataProvider) {\n currentLevel = currentLevel.parent;\n continue;\n }\n\n // Check if data layer exists nested inside another data provider\n if (isDataLayer(dataProvider)) {\n collected = collected.concat(dataProvider);\n } else {\n if (dataProvider.state.$data && isDataLayer(dataProvider.state.$data)) {\n collected = collected.concat(dataProvider.state.$data);\n }\n }\n\n if (localOnly && collected.length > 0) {\n break;\n }\n\n currentLevel = currentLevel.parent;\n }\n\n return collected;\n}\n\n/**\n * A utility function to find the closest ancestor of a given type. This function expects\n * to find it and will throw an error if it does not.\n */\nexport function getAncestor<ParentType>(\n sceneObject: SceneObject,\n ancestorType: { new (...args: never[]): ParentType }\n): ParentType {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent instanceof ancestorType) {\n return parent;\n }\n parent = parent.parent;\n }\n\n if (!parent) {\n throw new Error('Unable to find parent of type ' + ancestorType.name);\n }\n\n return parent as ParentType;\n}\n"],"names":[],"mappings":";;;;;;;AAeO,SAAS,aAAa,WAA0C,EAAA;AAfvE,EAAA,IAAA,EAAA,CAAA;AAgBE,EAAO,OAAA,CAAA,EAAA,GAAA,UAAA,CAAW,aAAa,CAAC,CAAA,KAAM,EAAE,KAAM,CAAA,UAAU,MAAjD,IAAsD,GAAA,EAAA,GAAA,gBAAA,CAAA;AAC/D,CAAA;AAKO,SAAS,QAAQ,WAA6C,EAAA;AAtBrE,EAAA,IAAA,EAAA,CAAA;AAuBE,EAAO,OAAA,CAAA,EAAA,GAAA,UAAA,CAAW,aAAa,CAAC,CAAA,KAAM,EAAE,KAAM,CAAA,KAAK,MAA5C,IAAiD,GAAA,EAAA,GAAA,aAAA,CAAA;AAC1D,CAAA;AAEA,SAAS,cAAc,CAAkC,EAAA;AACvD,EAAA,OAAO,aAAiB,IAAA,CAAA,CAAA;AAC1B,CAAA;AAKO,SAAS,UAAU,KAAwC,EAAA;AAChE,EAAM,MAAA,MAAA,GAAS,WAAW,KAAO,EAAA,CAAC,MAAO,aAAc,CAAA,CAAC,CAAI,GAAA,CAAA,GAAI,KAAU,CAAA,CAAA,CAAA;AAC1E,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAWO,SAA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AAA;AACL,MAAA,IAAI,aAAa,KAAM,CAAA,KAAA,IAAS,YAAY,YAAa,CAAA,KAAA,CAAM,KAAK,CAAG,EAAA;AACrE,QAAA,SAAA,GAAY,SAAU,CAAA,MAAA,CAAO,YAAa,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAAA,OACvD;AAAA,KACF;AAEA,IAAI,IAAA,SAAA,IAAa,SAAU,CAAA,MAAA,GAAS,CAAG,EAAA;AACrC,MAAA,MAAA;AAAA,KACF;AAEA,IAAA,YAAA,GAAe,YAAa,CAAA,MAAA,CAAA;AAAA,GAC9B;AAEA,EAAO,OAAA,SAAA,CAAA;AACT,CAAA;AAMgB,SAAA,WAAA,CACd,aACA,YACY,EAAA;AACZ,EAAA,IAAI,MAAkC,GAAA,WAAA,CAAA;AAEtC,EAAA,OAAO,MAAQ,EAAA;AACb,IAAA,IAAI,kBAAkB,YAAc,EAAA;AAClC,MAAO,OAAA,MAAA,CAAA;AAAA,KACT;AACA,IAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAA;AAAA,GAClB;AAEA,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,gCAAmC,GAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAAA,GACtE;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
package/dist/index.d.ts
CHANGED
@@ -931,6 +931,7 @@ type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'aler
|
|
931
931
|
interface SceneInteractionProfileEvent {
|
932
932
|
origin: string;
|
933
933
|
duration: number;
|
934
|
+
networkDuration: number;
|
934
935
|
crumbs: string[];
|
935
936
|
}
|
936
937
|
interface SceneQueryStateControllerState extends SceneObjectState {
|