PR review changes

pull/3010/head
ebb-tide 2018-03-19 14:41:34 -07:00
parent ed446d62e1
commit fb604a1570
1 changed files with 10 additions and 8 deletions

View File

@ -22,6 +22,7 @@ class TableGraph extends Component {
super(props)
this.state = {
data: [[]],
unzippedData: [[]],
hoveredColumnIndex: NULL_COLUMN_INDEX,
hoveredRowIndex: NULL_ROW_INDEX,
sortByColumnIndex: -1,
@ -55,17 +56,18 @@ class TableGraph extends Component {
}
handleHover = (columnIndex, rowIndex) => () => {
if (this.props.onSetHoverTime) {
const {data} = this.state
const hoverTime = this.props.tableOptions.verticalTimeAxis
const {onSetHoverTime, tableOptions} = this.props
const {data} = this.state
if (onSetHoverTime) {
const hoverTime = tableOptions.verticalTimeAxis
? data[rowIndex][0]
: data[0][columnIndex]
this.props.onSetHoverTime(hoverTime.toString())
this.setState({
hoveredColumnIndex: columnIndex,
hoveredRowIndex: rowIndex,
})
onSetHoverTime(hoverTime.toString())
}
this.setState({
hoveredColumnIndex: columnIndex,
hoveredRowIndex: rowIndex,
})
}
handleMouseOut = () => {