[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
Proposed changes
In node-red charts, when new data is received, it automatically appends that to the chart.
However, in ui_vega, it requires sending a new vega spec (with the updated data) to achieve this.
This introduces a severe lag for a complex spec.
In this PR I added a new function to push just the data into a ui_vega node.
This enables adding new data without triggering a full redraw.
How I've done it (at this point) is by sending messages into the node in two forms: templates and data.
Initially, I wanted to differentiate between them using msg.topic, but for some reason, it showed up as undefined.
For now, I've hacked around it by checking if msg.payload.$schema is present in the payload.
Proposed changes
In node-red charts, when new data is received, it automatically appends that to the chart. However, in ui_vega, it requires sending a new vega spec (with the updated data) to achieve this. This introduces a severe lag for a complex spec.
In this PR I added a new function to push just the data into a ui_vega node. This enables adding new data without triggering a full redraw.
How I've done it (at this point) is by sending messages into the node in two forms: templates and data. Initially, I wanted to differentiate between them using
msg.topic
, but for some reason, it showed up as undefined. For now, I've hacked around it by checking ifmsg.payload.$schema
is present in the payload.Any design revisions would be appreciated!
Checklist
grunt
to verify the unit tests pass