DashboardDatasource: Debounce results slightly to avoid flickering on zoom (#102887)
Debounce all results slightly to avoid false positive DONE flickering
This commit is contained in:
@@ -66,12 +66,16 @@ describe('DashboardDatasource', () => {
|
||||
});
|
||||
|
||||
it('Can subscribe to panel data + transforms', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
const { observable } = setup({ refId: 'A', panelId: 1, withTransforms: true });
|
||||
|
||||
let rsp: DataQueryResponse | undefined;
|
||||
|
||||
observable.subscribe({ next: (data) => (rsp = data) });
|
||||
|
||||
jest.runAllTimers();
|
||||
|
||||
expect(rsp?.data[0].fields[1].values).toEqual([3]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Observable, debounce, defer, finalize, first, interval, map, of } from 'rxjs';
|
||||
import { Observable, debounce, debounceTime, defer, finalize, first, interval, map, of } from 'rxjs';
|
||||
|
||||
import {
|
||||
DataSourceApi,
|
||||
@@ -79,6 +79,7 @@ export class DashboardDatasource extends DataSourceApi<DashboardQuery> {
|
||||
const cleanUp = activateSceneObjectAndParentTree(sourceDataProvider!);
|
||||
|
||||
return sourceDataProvider!.getResultsStream!().pipe(
|
||||
debounceTime(50),
|
||||
map((result) => {
|
||||
return {
|
||||
data: this.getDataFramesForQueryTopic(result.data, query),
|
||||
|
||||
Reference in New Issue
Block a user