diff --git a/src/widget/edit-widget/edit-widget-control-creator.js b/src/widget/edit-widget/edit-widget-control-creator.js index 8eb6583..3e6488b 100644 --- a/src/widget/edit-widget/edit-widget-control-creator.js +++ b/src/widget/edit-widget/edit-widget-control-creator.js @@ -33,6 +33,7 @@ import EditWidgetMinMaxControl from './edit-widget-min-max-control'; import EditWidgetParametersControl from './edit-widget-parameters-control'; import EditWidgetICControl from './edit-widget-ic-control'; import EditWidgetPlotColorsControl from './edit-widget-plot-colors-control'; +import EditWidgetPlotModeControl from './edit-widget-plot-mode-control'; //import EditWidgetHTMLContent from './edit-widget-html-content'; export default function CreateControls(widgetType = null, widget = null, sessionToken = null, files = null,ics = null, signals, handleChange) { @@ -75,7 +76,8 @@ export default function CreateControls(widgetType = null, widget = null, session handleChange(e)} />, handleChange(e)} />, handleChange(e)} />, - handleChange(e)} /> + handleChange(e)} />, + handleChange(e)} /> ); break; case 'Table': diff --git a/src/widget/edit-widget/edit-widget-plot-mode-control.js b/src/widget/edit-widget/edit-widget-plot-mode-control.js new file mode 100644 index 0000000..e474ea5 --- /dev/null +++ b/src/widget/edit-widget/edit-widget-plot-mode-control.js @@ -0,0 +1,56 @@ +/** + * This file is part of VILLASweb. + * + * VILLASweb is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VILLASweb is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with VILLASweb. If not, see . + **********************************************************************************/ + +import React, { Component } from 'react'; +import { Form } from 'react-bootstrap'; + +class EditWidgetPlotModeControl extends Component { + constructor(props) { + super(props); + + this.state = { + widget: {}, + }; + } + + static getDerivedStateFromProps(props, state){ + return { + widget: props.widget, + }; + } + + handleModeChange(e){ + + this.props.handleChange({ target: { id: this.props.controlId, value: e.target.value } }); + + } + + render() { + + return ( + + Select mode + this.handleModeChange(e)}> + + + + + ); + } +} + +export default EditWidgetPlotModeControl; \ No newline at end of file diff --git a/src/widget/widget-factory.js b/src/widget/widget-factory.js index 8a9baa8..e2b5f36 100644 --- a/src/widget/widget-factory.js +++ b/src/widget/widget-factory.js @@ -91,6 +91,7 @@ class WidgetFactory { widget.customProperties.yUseMinMax = false; widget.customProperties.lineColors = []; widget.customProperties.showUnit = false; + widget.customProperties.mode = 'auto time-scrolling'; break; case 'Table': widget.minWidth = 200;