keen / keen-js

https://keen.io/ JavaScript SDKs. Track users and visualise the results. Demo http://keen.github.io/keen-dataviz.js/
MIT License
578 stars 143 forks source link

Automatic updates of visualization / refresh #225

Closed larsbo closed 9 years ago

larsbo commented 9 years ago

I wonder if there is a build-in functionality to automatically refresh a visualization. There is a very tiny section about this topic but it doesn't look up to date or reasonably finished because the used objects count and request were not mentioned anywhere else: https://github.com/keen/keen-js/blob/master/docs/visualization.md#automatic-updates

larsbo commented 9 years ago

Ok, I found the answer on this page: https://github.com/keen/keen-js/blob/master/docs/dataviz.md

You can use the alternative instantiation method based on the Keen.Dataviz object and trigger the query request repeatedly with setInterval.

Is there a chance for a push solution in future? :smile:

dustinlarimer commented 9 years ago

@larsbo glad you found what you were looking for! How would you imagine this push solution working? Open to suggestions!

larsbo commented 9 years ago

I thought of websockets: http://www.html5rocks.com/en/tutorials/websockets/basics/ It has great performance and you can easily achieve real time while saving useless and costly requests.

Another technique would be webRTC: www.html5rocks.com/en/tutorials/webrtc/basics/ I never used this before but it should be even better than WebSockets.

dustinlarimer commented 9 years ago

@larsbo ahh, I hear ya – and yes, that would definitely rock :) In the meantime, perhaps that could make a really nice self-hosted middleware app that batch-and-caches queries and pushes results down through socket.io or something similar. What do you think about that?

larsbo commented 9 years ago

yeah, that's a nice idea :+1: I will consider this for my future work!

BTW: I think the server infrastructure could benefit from a WebSocket/WebRTC implementation, too :-)

dustinlarimer commented 9 years ago

@larsbo I agree, I'll share w/ my team!