Merge pull request #3636 from influxdata/bugfix/single-stat

Fix line graph + single stat dygraphs
bugfix/fix-everything
Chris Henn 2018-06-12 09:20:20 -07:00 committed by GitHub
commit 707ec3099c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -1,9 +1,9 @@
import React, { import React, {
Component, Component,
ReactNode,
CSSProperties, CSSProperties,
MouseEvent, MouseEvent,
ReactElement, ReactElement,
Children,
} from 'react' } from 'react'
import {connect} from 'react-redux' import {connect} from 'react-redux'
import _ from 'lodash' import _ from 'lodash'
@ -70,7 +70,6 @@ interface Props {
dygraphRef?: (r: HTMLDivElement) => void dygraphRef?: (r: HTMLDivElement) => void
onZoom?: (u: number | string, l: number | string) => void onZoom?: (u: number | string, l: number | string) => void
mode?: string mode?: string
children?: ReactNode
} }
interface State { interface State {
@ -308,7 +307,7 @@ class Dygraph extends Component<Props, State> {
private get isGraphNested(): boolean { private get isGraphNested(): boolean {
const {children} = this.props const {children} = this.props
return _.get(children, '0', false) return Children.count(children) > 0
} }
private get dygraphStyle(): CSSProperties { private get dygraphStyle(): CSSProperties {