Letting code breathe
parent
dfb7527809
commit
cff8f08494
|
@ -40,7 +40,7 @@ class TableGraph extends Component {
|
||||||
labelsColumnWidth: calculateLabelsColumnWidth(props.data.labels),
|
labelsColumnWidth: calculateLabelsColumnWidth(props.data.labels),
|
||||||
hoveredColumnIndex: NULL_ARRAY_INDEX,
|
hoveredColumnIndex: NULL_ARRAY_INDEX,
|
||||||
hoveredRowIndex: NULL_ARRAY_INDEX,
|
hoveredRowIndex: NULL_ARRAY_INDEX,
|
||||||
sortField: 'time',
|
sortField: TIME_FIELD_DEFAULT.internalName,
|
||||||
sortDirection: DEFAULT_SORT,
|
sortDirection: DEFAULT_SORT,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class TableGraph extends Component {
|
||||||
if (
|
if (
|
||||||
_.isEmpty(sortField) ||
|
_.isEmpty(sortField) ||
|
||||||
_.get(this.props, ['tableOptions', 'sortBy', 'internalName'], '') !==
|
_.get(this.props, ['tableOptions', 'sortBy', 'internalName'], '') !==
|
||||||
_.get(nextProps, ['tableOptions', 'sortBy', 'internalName'], '')
|
internalName
|
||||||
) {
|
) {
|
||||||
direction = DEFAULT_SORT
|
direction = DEFAULT_SORT
|
||||||
sortFieldName = internalName
|
sortFieldName = internalName
|
||||||
|
@ -98,6 +98,11 @@ class TableGraph extends Component {
|
||||||
? processedData[0]
|
? processedData[0]
|
||||||
: processedData.map(row => row[0])
|
: processedData.map(row => row[0])
|
||||||
|
|
||||||
|
const labelsColumnWidth = calculateLabelsColumnWidth(
|
||||||
|
processedLabels,
|
||||||
|
fieldNames
|
||||||
|
)
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
data,
|
data,
|
||||||
labels,
|
labels,
|
||||||
|
@ -105,10 +110,7 @@ class TableGraph extends Component {
|
||||||
sortedTimeVals,
|
sortedTimeVals,
|
||||||
sortField: sortFieldName,
|
sortField: sortFieldName,
|
||||||
sortDirection: direction,
|
sortDirection: direction,
|
||||||
labelsColumnWidth: calculateLabelsColumnWidth(
|
labelsColumnWidth,
|
||||||
processedLabels,
|
|
||||||
fieldNames
|
|
||||||
),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,6 +354,7 @@ class TableGraph extends Component {
|
||||||
const tableWidth = _.get(this, ['gridContainer', 'clientWidth'], 0)
|
const tableWidth = _.get(this, ['gridContainer', 'clientWidth'], 0)
|
||||||
const tableHeight = _.get(this, ['gridContainer', 'clientHeight'], 0)
|
const tableHeight = _.get(this, ['gridContainer', 'clientHeight'], 0)
|
||||||
const {scrollToColumn, scrollToRow} = this.calcScrollToColRow()
|
const {scrollToColumn, scrollToRow} = this.calcScrollToColRow()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="table-graph-container"
|
className="table-graph-container"
|
||||||
|
|
Loading…
Reference in New Issue