Support for websockets

#1

quick question because i can see it has been answered here and there.
From what i understand, Dash doesnt support websocket yet. where the limitation comes from, is it something plotly is working on?
I am thinking a dashboard connecting websocket of market data feeds and displaying live graphs. thanks

#2

Why do you need web sockets specifically? If you are getting market data you could just use an API with a wrapper such as AlphaVantage & https://github.com/RomelTorres/alpha_vantage

#3

There’s nothing stopping you using a websocket library within your dash app for making connections. Unless you mean for communicating the various Dash API calls?

#4

What i have in mind is a websocket for live market data and showing a grid with live updates. then on each update, a portfolio of options is recalculated and the result is shown in the grid (value and greeks).
Or a graph is updated with price updates.
Websockets are the standard in digital asset exchange now.

#5

django-plotly-dash has a Pipe component that uses websockets to provide push notifications into Dash applications. Documentation here.

This might provide you with what you want already, although just using an Interval component to poll your source will probably turn out to be a better approach as it will remove the need to deal with throttling or otherwise managing the rate of updates.

1 Like
#6

Sorry to revive an old thread, has there been any development progress towards web socket support?

There is even advocacy for it from plot.ly employees:

It seems like switching from Flask to Quart might make the mountain somewhat easier to climb https://gitlab.com/pgjones/quart.

#7

There has not been any progress and this isn’t in the roadmap right now. It might be in the future.