From 1540e8b8c73898da41549a8339a2a9dc453364a6 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Mon, 9 Apr 2018 20:20:51 -0700 Subject: [PATCH] Cleanup --- ui/src/shared/components/Annotation.js | 2 +- ui/src/shared/components/Annotations.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/src/shared/components/Annotation.js b/ui/src/shared/components/Annotation.js index c3b5ffd351..aec41fded9 100644 --- a/ui/src/shared/components/Annotation.js +++ b/ui/src/shared/components/Annotation.js @@ -7,9 +7,9 @@ import AnnotationSpan from 'shared/components/AnnotationSpan' import * as schema from 'shared/schemas' const Annotation = ({ + mode, dygraph, annotation, - mode, lastUpdated, staticLegendHeight, }) => ( diff --git a/ui/src/shared/components/Annotations.js b/ui/src/shared/components/Annotations.js index f129249f97..5e105396dd 100644 --- a/ui/src/shared/components/Annotations.js +++ b/ui/src/shared/components/Annotations.js @@ -25,11 +25,12 @@ class Annotations extends Component { componentDidMount() { this.props.dygraph.updateOptions({ - drawCallback: this.heartbeat, + drawCallback: this.redraw, }) } - heartbeat = () => { + redraw = () => { + // force a redraw of annotations this.setState({lastUpdated: Date.now()}) } @@ -69,8 +70,8 @@ class Annotations extends Component { mode={mode} annotation={a} dygraph={dygraph} - staticLegendHeight={staticLegendHeight} lastUpdated={lastUpdated} + staticLegendHeight={staticLegendHeight} /> ))}