diff --git a/src/LineChart/RosLineChart.js b/src/LineChart/RosLineChart.js index 98fa0d1de582e8a34ec5cac4fa7d0c30771dec03..79983bca65b04938ec0b7d24e3911effa5a7379c 100644 --- a/src/LineChart/RosLineChart.js +++ b/src/LineChart/RosLineChart.js @@ -28,7 +28,7 @@ class RosLineChart extends Component { this.listener = new RosLib.Topic(Object.assign({ros : this.props.ros}, this.state.topic)); this.listener.subscribe(function(message) { - + this.setState((state) => { let fields; if (!('fields' in this.state.topic) && ('field' in this.state.topic)) { @@ -36,7 +36,7 @@ class RosLineChart extends Component { } else { fields = this.state.topic.fields; } - + let new_data = this.state.data; fields.forEach((field) => { if (!(field in new_data)) { @@ -61,8 +61,22 @@ class RosLineChart extends Component { } render () { + const config = this.props.node.getConfig() + + if (config.displayMode === "readme") { + return <div> + <h2>This <b>linechart</b> represents a <b>measure</b> evolving over time.</h2> + </div>; + } + + if (config.displayMode === "settings") { + return <div> + <p>config panel</p> + </div>; + } + return <SizedLineChart data={this.state.data} xLabel={this.state.xLabel} yLabel={this.state.yLabel} {...this.props}/> } } -export {RosLineChart} \ No newline at end of file +export {RosLineChart}