node-red-ui-nodes icon indicating copy to clipboard operation
node-red-ui-nodes copied to clipboard

[node-red-node-ui-vega] Append Data into a Vega Chart

Open yasithdev opened this issue 4 years ago • 2 comments

  • [ ] 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.

Any design revisions would be appreciated!

Checklist

  • [x] I have read the contribution guidelines
  • [ ] For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • [ ] I have run grunt to verify the unit tests pass
  • [ ] I have added suitable unit tests to cover the new/changed functionality

yasithdev avatar May 25 '21 00:05 yasithdev

Hello all, any update on this? Please let me know if you suggest any modifications.

yasithdev avatar Jul 02 '21 02:07 yasithdev

@HiroyasuNishiyama - this looks ok to me - but you guys are the main creators and users of this. OK with you ?

dceejay avatar Jul 02 '21 08:07 dceejay