Cleanup
parent
f6165b9e4b
commit
1540e8b8c7
|
@ -7,9 +7,9 @@ import AnnotationSpan from 'shared/components/AnnotationSpan'
|
||||||
import * as schema from 'shared/schemas'
|
import * as schema from 'shared/schemas'
|
||||||
|
|
||||||
const Annotation = ({
|
const Annotation = ({
|
||||||
|
mode,
|
||||||
dygraph,
|
dygraph,
|
||||||
annotation,
|
annotation,
|
||||||
mode,
|
|
||||||
lastUpdated,
|
lastUpdated,
|
||||||
staticLegendHeight,
|
staticLegendHeight,
|
||||||
}) => (
|
}) => (
|
||||||
|
|
|
@ -25,11 +25,12 @@ class Annotations extends Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.dygraph.updateOptions({
|
this.props.dygraph.updateOptions({
|
||||||
drawCallback: this.heartbeat,
|
drawCallback: this.redraw,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
heartbeat = () => {
|
redraw = () => {
|
||||||
|
// force a redraw of annotations
|
||||||
this.setState({lastUpdated: Date.now()})
|
this.setState({lastUpdated: Date.now()})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,8 +70,8 @@ class Annotations extends Component {
|
||||||
mode={mode}
|
mode={mode}
|
||||||
annotation={a}
|
annotation={a}
|
||||||
dygraph={dygraph}
|
dygraph={dygraph}
|
||||||
staticLegendHeight={staticLegendHeight}
|
|
||||||
lastUpdated={lastUpdated}
|
lastUpdated={lastUpdated}
|
||||||
|
staticLegendHeight={staticLegendHeight}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue