Jackodb / Visualization

Visualization using DASH/Plot.ly
0 stars 0 forks source link

Dynamic chart #8

Open Jackodb opened 5 years ago

Jackodb commented 5 years ago

Create a dynamic function that inserts data into the existing bar chart (adds data to stacked part). In an ideal scenario, it would be realtime: Dash Core Components

Jackodb commented 5 years ago

This source is useful for automatically updating the chart with data from Bitshares instance: https://dash.plot.ly/live-updates

Jackodb commented 5 years ago

Currently working on making it dynamic with user input data: https://dash.plot.ly/getting-started-part-2 https://www.youtube.com/watch?v=wv2MXJIdKRY Probably only need to update the input lists (df.Price, df.Current etc.) by appending using user input

Next step is the second comment (look above):

Jackodb commented 5 years ago

https://dash.plot.ly/state

https://pythonprogramming.net/live-graphs-data-visualization-application-dash-python-tutorial/

Jackodb commented 5 years ago

VALUES ALSO GET SUBMITTED ON PAGE REFRESH: https://github.com/plotly/dash/issues/162

  if not input1 == '': # This seems to partially prevent the above problem
        current.append(input1)
        mountain.append(input2)
Jackodb commented 5 years ago

Current script does not update the chart because data gets appended to the list while you want to add/deduct the order size at a specific price. So, for example, an order gets filled of your initial setup and you add a new order at price X. The bar that represents price X needs to increase with Y amount (where Y amount is order size).

"The bar" in the above sentence represents 'current'!!

DONE!

Jackodb commented 5 years ago

Both initial and current bar height increase while you only want current bar height to increase. This could be solved by this small script:

current_dict[input_price] += float(input2)
initial_dict[input_price] -= float(input2)