plot: receive stringified arrays (issue #130)

This commit is contained in:
jean-emmanuel 2018-01-28 14:00:51 +01:00
parent 3a46d25e9c
commit 3402efe0a6
3 changed files with 25 additions and 9 deletions

View file

@ -145,10 +145,19 @@ module.exports = class _plots_base extends _canvas_base {
setValue(v, options={}) {
this.data = v
this.batchDraw()
if (typeof v == 'string' && v.indexOf('[') == 0) {
v = JSON.parseFlex(v)
}
if (Array.isArray(v)) {
this.data = v
this.batchDraw()
if (options.sync) this.changed(options)
}
if (options.sync) this.changed(options)
}