|
@@ -22,12 +22,9 @@ export class GaugePanel extends Component<Props, State> {
|
|
|
this.state = {
|
|
this.state = {
|
|
|
value: this.findValue(props),
|
|
value: this.findValue(props),
|
|
|
};
|
|
};
|
|
|
- console.log('CONSTRUCTOR!', this.props.data);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps: Props) {
|
|
componentDidUpdate(prevProps: Props) {
|
|
|
- console.log('UPDATE', this.props.data);
|
|
|
|
|
-
|
|
|
|
|
if (this.props.data !== prevProps.data) {
|
|
if (this.props.data !== prevProps.data) {
|
|
|
this.setState({ value: this.findValue(this.props) });
|
|
this.setState({ value: this.findValue(this.props) });
|
|
|
}
|
|
}
|
|
@@ -37,21 +34,12 @@ export class GaugePanel extends Component<Props, State> {
|
|
|
const { data, options } = props;
|
|
const { data, options } = props;
|
|
|
const { valueOptions } = options;
|
|
const { valueOptions } = options;
|
|
|
|
|
|
|
|
- console.log('FIND VALUE', data);
|
|
|
|
|
-
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
|
- // For now, assume timeseries defaults
|
|
|
|
|
- const xColumn = 1; // time
|
|
|
|
|
- const yColumn = 0; // value
|
|
|
|
|
const vmSeries = processTimeSeries({
|
|
const vmSeries = processTimeSeries({
|
|
|
data,
|
|
data,
|
|
|
- xColumn,
|
|
|
|
|
- yColumn,
|
|
|
|
|
nullValueMode: NullValueMode.Null,
|
|
nullValueMode: NullValueMode.Null,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- console.log('GOT', vmSeries);
|
|
|
|
|
-
|
|
|
|
|
if (vmSeries[0]) {
|
|
if (vmSeries[0]) {
|
|
|
return vmSeries[0].stats[valueOptions.stat];
|
|
return vmSeries[0].stats[valueOptions.stat];
|
|
|
}
|
|
}
|