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

This commit is contained in:
Torkel Ödegaard 2021-10-05 12:53:25 +02:00 committed by GitHub
parent cdeb3e730d
commit ead8429210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -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>

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 };