diff --git a/src/components/widget-plot-table.js b/src/components/widget-plot-table.js index ddca1c0..dd34c1e 100644 --- a/src/components/widget-plot-table.js +++ b/src/components/widget-plot-table.js @@ -9,7 +9,6 @@ import React, { Component } from 'react'; import { LineChart } from 'rd3'; -import { Col } from 'react-bootstrap'; import Table from './table'; import TableColumn from './table-column'; @@ -19,6 +18,7 @@ class WidgetPlotTable extends Component { super(props); this.state = { + size: { w: 0, h: 0 }, signal: 0, firstTimestamp: 0, latestTimestamp: 0, @@ -32,6 +32,9 @@ class WidgetPlotTable extends Component { // check data const simulator = nextProps.widget.simulator; + // plot size + this.setState({ size: { w: this.props.widget.width - 100, h: this.props.widget.height - 20 }}); + if (nextProps.simulation == null || nextProps.data == null || nextProps.data[simulator] == null || nextProps.data[simulator].length === 0 || nextProps.data[simulator].values[0].length === 0) { // clear values this.setState({ values: [], sequence: null, rows: [] }); @@ -81,29 +84,31 @@ class WidgetPlotTable extends Component { render() { return ( -