-
-
-
-
+
+ {
+ this.state.widget.customProperties.zones.map((zone, idx) => {
+ let color = zone.strokeStyle;
+ let width = (zone.max - zone.min)*(260/100);
+ let style = {
+ backgroundColor: color,
+ width: width,
+ height: '40px'
+ }
+
+
+
+ return (
+ )
+ }
+ )
+
+ }
+
+
+ Change color} >
+
+
+
+
+
+
+ Min:
+ this.handleMinChange(e)} />
+ |
+
+ Max:
+ this.handleMaxChange(e)} />
+ |
+
+
-
-
-
+
+
+
+ this.closeEditModal(data)} widget={this.state.widget} zoneIndex={this.state.selectedIndex} controlId={'strokeStyle'} />
;
}
}
diff --git a/src/widget/edit-widget/edit-widget-control-creator.js b/src/widget/edit-widget/edit-widget-control-creator.js
index 2434e7a..bb0d5b5 100644
--- a/src/widget/edit-widget/edit-widget-control-creator.js
+++ b/src/widget/edit-widget/edit-widget-control-creator.js
@@ -122,7 +122,6 @@ export default function CreateControls(widgetType = null, widget = null, session
DialogControls.push(
handleChange(e)} />,
handleChange(e)} />,
- handleChange(e)} />
);
break;
case 'Label':
diff --git a/src/widget/widget-factory.js b/src/widget/widget-factory.js
index 8f99c8a..59ebedf 100644
--- a/src/widget/widget-factory.js
+++ b/src/widget/widget-factory.js
@@ -63,8 +63,10 @@ class WidgetFactory {
widget.minHeight = 5;
widget.width = 20;
widget.height = 20;
- widget.customProperties.on_color = 6;
- widget.customProperties.off_color = 8;
+ widget.customProperties.on_color = '#4287f5';
+ widget.customProperties.on_color_opacity = 1;
+ widget.customProperties.off_color = '#4287f5';
+ widget.customProperties.off_color_opacity = 1;
widget.customProperties.threshold = 0.5;
break;
case 'Value':
@@ -102,7 +104,8 @@ class WidgetFactory {
widget.height = 35;
widget.name = 'Label';
widget.customProperties.textSize = 32;
- widget.customProperties.fontColor = 0;
+ widget.customProperties.fontColor = '#4287f5';
+ widget.customProperties.fontColor_opacity = 1;
widget.customProperties.resizeTopBottomLock = true;
break;
case 'Image':
@@ -118,8 +121,8 @@ class WidgetFactory {
widget.minHeight = 50;
widget.width = 100;
widget.height = 100;
- widget.customProperties.background_color = 1;
- widget.customProperties.font_color = 0;
+ widget.customProperties.background_color = '#4287f5';
+ widget.customProperties.font_color = '#4287f5';
widget.customProperties.on_value = 1;
widget.customProperties.off_value = 0;
widget.customProperties.toggle = false;
@@ -167,9 +170,10 @@ class WidgetFactory {
widget.minHeight = 50;
widget.width = 100;
widget.height = 100;
- widget.customProperties.border_color = 0;
- widget.customProperties.background_color = 9;
- widget.customProperties.background_color_opacity = 0.5;
+ widget.customProperties.border_color = '#4287f5';
+ widget.customProperties.border_color_opacity = 1;
+ widget.customProperties.background_color = '#961520';
+ widget.customProperties.background_color_opacity = 1;
widget.z = 0;
break;
/*case 'HTML':
@@ -183,7 +187,8 @@ class WidgetFactory {
case 'Line':
widget.height = 100;
widget.width = 100;
- widget.customProperties.border_color = 0;
+ widget.customProperties.border_color = '#4287f5';
+ widget.customProperties.border_color_opacity = 1;
widget.customProperties.border_width = 2;
widget.customProperties.rotation = 0;
break;
diff --git a/src/widget/widgets/box.js b/src/widget/widgets/box.js
index 88e7c67..bd0dbee 100644
--- a/src/widget/widgets/box.js
+++ b/src/widget/widgets/box.js
@@ -17,16 +17,13 @@
import React, { Component } from 'react';
-import EditWidgetColorControl from '../edit-widget/edit-widget-color-control';
class WidgetBox extends Component {
render() {
- let colors = EditWidgetColorControl.ColorPalette;
-
let colorStyle = {
- borderColor: colors[this.props.widget.customProperties.border_color],
- backgroundColor: colors[this.props.widget.customProperties.background_color],
+ borderColor: this.props.widget.customProperties.border_color,
+ backgroundColor: this.props.widget.customProperties.background_color,
opacity: this.props.widget.customProperties.background_color_opacity,
}
diff --git a/src/widget/widgets/gauge.js b/src/widget/widgets/gauge.js
index e1f8bfc..b33494a 100644
--- a/src/widget/widgets/gauge.js
+++ b/src/widget/widgets/gauge.js
@@ -219,7 +219,7 @@ class WidgetGauge extends Component {
const step = (maxValue - minValue) / 100;
zones = zones.map(zone => {
- return Object.assign({}, zone, { min: (zone.min * step) + +minValue, max: zone.max * step + +minValue, strokeStyle: '#' + zone.strokeStyle });
+ return Object.assign({}, zone, { min: (zone.min * step) + +minValue, max: zone.max * step + +minValue, strokeStyle: zone.strokeStyle });
});
}
diff --git a/src/widget/widgets/label.js b/src/widget/widgets/label.js
index a7431e2..2a29e1f 100644
--- a/src/widget/widgets/label.js
+++ b/src/widget/widgets/label.js
@@ -17,13 +17,13 @@
import React, { Component } from 'react';
-import EditWidgetColorControl from '../edit-widget/edit-widget-color-control';
class WidgetLabel extends Component {
render() {
const style = {
fontSize: this.props.widget.customProperties.textSize + 'px',
- color: EditWidgetColorControl.ColorPalette[this.props.widget.customProperties.fontColor]
+ color: this.props.widget.customProperties.fontColor,
+ opacity: this.props.widget.customProperties.fontColor_opacity,
};
return (
diff --git a/src/widget/widgets/lamp.js b/src/widget/widgets/lamp.js
index c6fd5e6..d43aadf 100644
--- a/src/widget/widgets/lamp.js
+++ b/src/widget/widgets/lamp.js
@@ -17,7 +17,6 @@
import React, { Component } from 'react';
-import EditWidgetColorControl from '../edit-widget/edit-widget-color-control';
class WidgetLamp extends Component {
constructor(props) {
@@ -61,16 +60,21 @@ class WidgetLamp extends Component {
render() {
- let colors = EditWidgetColorControl.ColorPalette;
let color;
+ let opacity;
- if (Number(this.state.value) > Number(this.props.widget.customProperties.threshold))
- color = colors[this.props.widget.customProperties.on_color];
- else
- color = colors[this.props.widget.customProperties.off_color];
+ if (Number(this.state.value) > Number(this.props.widget.customProperties.threshold)){
+ color = this.props.widget.customProperties.on_color;
+ opacity = this.props.widget.customProperties.on_color_opacity;
+ }
+ else{
+ color = this.props.widget.customProperties.off_color;
+ opacity = this.props.widget.customProperties.off_color_opacity;
+ }
let style = {
backgroundColor: color,
+ opacity: opacity
}
return (
diff --git a/src/widget/widgets/line.js b/src/widget/widgets/line.js
index 242122c..94a33df 100644
--- a/src/widget/widgets/line.js
+++ b/src/widget/widgets/line.js
@@ -17,8 +17,6 @@
import React, { Component } from 'react';
-import EditWidgetColorControl from '../edit-widget/edit-widget-color-control';
-
class WidgetLine extends Component {
// WidgetLine is newly created when widget props are changed and saved
constructor(props) {
@@ -45,7 +43,7 @@ class WidgetLine extends Component {
// or from the state (widget in edit mode)
let width = this.props.widget.width;
let height = this.props.widget.height;
-
+
if (this.state.editing) {
width = this.state.width;
height = this.state.height;
@@ -83,7 +81,7 @@ class WidgetLine extends Component {
const lineStyle = {
- stroke: EditWidgetColorControl.ColorPalette[this.props.widget.customProperties.border_color],
+ stroke: '' + this.props.widget.customProperties.border_color,
strokeWidth: '' + this.props.widget.customProperties.border_width + 'px'
};
@@ -93,4 +91,4 @@ class WidgetLine extends Component {
}
}
-export default WidgetLine;
\ No newline at end of file
+export default WidgetLine;