Annotations: Improve rendering performance of event markers (#39984) (#39999)

(cherry picked from commit ead8429210)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
Grot (@grafanabot)
2021-10-07 10:50:19 +02:00
committed by GitHub
co-authored by Torkel Ödegaard
parent f15be05dec
commit f6199596df
2 changed files with 6 additions and 7 deletions
@@ -1,4 +1,3 @@
import { css } from '@emotion/css';
import React from 'react';
interface MarkerProps {
@@ -13,11 +12,11 @@ interface MarkerProps {
export const Marker: React.FC<MarkerProps> = ({ x, y, children }) => {
return (
<div
className={css`
position: absolute;
top: ${y}px;
left: ${x}px;
`}
style={{
position: 'absolute',
top: `${y}px`,
left: `${x}px`,
}}
>
{children}
</div>
+1 -1
View File
@@ -106,7 +106,7 @@ export class TestDataDataSource extends DataSourceWithBackend<TestDataQuery> {
}
annotationDataTopicTest(target: TestDataQuery, req: DataQueryRequest<TestDataQuery>): Observable<DataQueryResponse> {
const events = this.buildFakeAnnotationEvents(req.range, 10);
const events = this.buildFakeAnnotationEvents(req.range, 50);
const dataFrame = new ArrayDataFrame(events);
dataFrame.meta = { dataTopic: DataTopic.Annotations };