If display bounds are out of sync with time conductor, don't purge data out of bounds (#7732)

* If we're paused, don't purge data out of bounds
* Refactor auto scale utility functions for reuse
* Create new test spec for plot controls
* Move plot related actions into it's own file
* Fix typo for imports
* Remove named exposedFunction as it is causing errors when the method is used on the same page more than once.
* Fix spelling
This commit is contained in:
Shefali Joshi
2024-06-03 08:46:05 -07:00
committed by GitHub
parent eba6f0f505
commit c354e1c2f1
6 changed files with 164 additions and 29 deletions

View File

@ -592,9 +592,6 @@ async function waitForPlotsToRender(page) {
* @return {Promise<PlotPixel[]>}
*/
async function getCanvasPixels(page, canvasSelector) {
const getTelemValuePromise = new Promise((resolve) =>
page.exposeFunction('getCanvasValue', resolve)
);
const canvasHandle = await page.evaluateHandle(
(canvas) => document.querySelector(canvas),
canvasSelector
@ -605,7 +602,7 @@ async function getCanvasPixels(page, canvasSelector) {
);
await waitForPlotsToRender(page);
await page.evaluate(
return page.evaluate(
([canvas, ctx]) => {
// The document canvas is where the plot points and lines are drawn.
// The only way to access the canvas is using document (using page.evaluate)
@ -633,12 +630,10 @@ async function getCanvasPixels(page, canvasSelector) {
i = i + 4;
}
window.getCanvasValue(plotPixels);
return plotPixels;
},
[canvasHandle, canvasContextHandle]
);
return getTelemValuePromise;
}
/**