cyclotron icon indicating copy to clipboard operation
cyclotron copied to clipboard

Updating data inside the widgets

Open kedwards opened this issue 6 years ago • 3 comments

Is there any additional documentation for updating widget data. I have been using the json data source and querying a middle-ware API, the middle-ware is connecting to a WebSocket to get information when available.

I cannot seem to use the API to update the widget data, any help would be appreciated!

kedwards avatar Sep 17 '19 20:09 kedwards

I'm not sure if I understand your question entirely. If you create a Data Source with refresh configured and and a Widget using that Data Source, it should automatically update the Widget each time the Data Source loads new data.

This is a polling approach requiring the JSON Data Source to periodically re-query your API. There isn't a generic web socket Data Source available currently.

Does that help?

baumandm avatar Sep 17 '19 20:09 baumandm

A little, let me rephrase:

I am using the JSON data source and cyclotron is querying and updating just fine.. but how can I update the widget with a push via the API

kedwards avatar Sep 17 '19 23:09 kedwards

Ah so that's not currently built-in. It would be feasible to create a new WebSocket Data Source or use the JavaScript Data Source to connect to an endpoint and listen for events, but I don't have any examples.

baumandm avatar Sep 19 '19 04:09 baumandm