refresh graph data will use filtered plotted signals in componentWillRecieveProps

main
Andy Haden 2017-07-20 15:37:48 -07:00
parent fbe861b65f
commit e54897495e
1 changed files with 5 additions and 3 deletions

View File

@ -178,7 +178,7 @@ export default class Explorer extends Component {
if(nextMessage && curMessage) {
// refresh graph data if the message entry lengths
// do not match
this.refreshGraphData(nextProps.messages);
this.refreshGraphData(nextProps.messages, plottedSignals);
}
if(JSON.stringify(nextProps.currentParts) !== JSON.stringify(this.props.currentParts)) {
@ -255,11 +255,13 @@ export default class Explorer extends Component {
// }
}
refreshGraphData(messages) {
refreshGraphData(messages, plottedSignals) {
if(typeof messages === 'undefined') {
messages = this.props.messages;
}
const {plottedSignals} = this.state;
if(typeof plottedSignals === 'undefined') {
plottedSignals = this.state.plottedSignals;
}
let graphData = Array(plottedSignals.length);
plottedSignals.forEach((plotSignals, index) => {
const plotGraphData = this.calcGraphData(plotSignals, messages);