Merge pull request #3636 from influxdata/bugfix/single-stat
Fix line graph + single stat dygraphsbugfix/fix-everything
commit
707ec3099c
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue