visualizer: setValue: handle receiving the whole data array and a single value

This commit is contained in:
jean-emmanuel 2017-10-11 09:03:54 +02:00
parent 49ae398606
commit 721a0997ac

View file

@ -144,9 +144,20 @@ module.exports = class Visualizer extends _plots_base {
setValue(v) {
this.value = v
this.startLoop()
if (Array.isArray(v) && v.length == this.length) {
this.data = v
this.value = v[v.length - 1]
this.startLoop()
} else if (typeof(v) == 'number'){
this.value = v
this.startLoop()
}
}
}