diff --git a/src/styles/widgets.css b/src/styles/widgets.css
index 102a311..78996ab 100644
--- a/src/styles/widgets.css
+++ b/src/styles/widgets.css
@@ -181,6 +181,22 @@ span.signal-unit::after {
font-style: normal;
}
+span.signal-scale {
+ color: grey;
+ font-style: italic;
+ font-weight: 200;
+}
+
+span.signal-scale::before {
+ content: '(x';
+ font-style: italic;
+}
+
+span.signal-scale::after {
+ content: ')';
+ font-style: italic;
+}
+
/* End Plots */
.single-value-widget {
diff --git a/src/widget/widget-plot/plot-legend.js b/src/widget/widget-plot/plot-legend.js
index 5ac618c..75add6d 100644
--- a/src/widget/widget-plot/plot-legend.js
+++ b/src/widget/widget-plot/plot-legend.js
@@ -19,17 +19,39 @@ import React from 'react';
import { scaleOrdinal} from 'd3-scale';
import {schemeCategory10} from 'd3-scale-chromatic'
+function Legend(props){
+ const signal = props.sig;
+ const hasScalingFactor = (signal.scalingFactor !== 1);
+
+
+ if(hasScalingFactor){
+ return (
+
diff --git a/src/widget/widgets/value.js b/src/widget/widgets/value.js
index 482a94f..22a1629 100644
--- a/src/widget/widgets/value.js
+++ b/src/widget/widgets/value.js
@@ -24,7 +24,8 @@ class WidgetValue extends Component {
this.state = {
value: '',
- unit: ''
+ unit: '',
+ scalingFactor: 1.0
};
}
@@ -54,13 +55,16 @@ class WidgetValue extends Component {
// Update unit (assuming there is exactly one signal for this widget)
let unit = '';
+ let scalingFactor = ''
if (signal !== undefined) {
unit = signal[0].unit;
+ scalingFactor = signal[0].scalingFactor
}
return {
value: value,
unit: unit,
+ scalingFactor: scalingFactor
};
}
@@ -72,6 +76,7 @@ class WidgetValue extends Component {
let value_to_render = Number(this.state.value);
let value_width = this.props.widget.customProperties.textSize*(Math.abs(value_to_render) < 1000 ? (5):(8));
let unit_width = this.props.widget.customProperties.textSize*(this.state.unit.length + 0.7);
+ const showScalingFactor = (this.state.scalingFactor !== 1);
return (
{this.props.widget.name}
@@ -79,6 +84,10 @@ class WidgetValue extends Component {
{this.props.widget.customProperties.showUnit &&
[{this.state.unit}]
}
+ {showScalingFactor &&
+ {this.state.scalingFactor} span>
+ }
+
);
}