visualizer: setValue: handle receiving the whole data array and a single value
This commit is contained in:
parent
49ae398606
commit
721a0997ac
1 changed files with 13 additions and 2 deletions
|
|
@ -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()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue