Skip to content

Commit

Permalink
Added Show/ Hide Button to graph creation loop
Browse files Browse the repository at this point in the history
Needed for pmaji#28.
Compatible with modular increase of pairs pmaji#36
  • Loading branch information
theimo1221 authored Feb 18, 2018
1 parent 3dae9e0 commit 564c7ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,14 @@ def refreshTickers():
href="javascript:var k = setTimeout(function() {for (var i = k; i > 0; i--){ clearInterval(i)}},1);"),
html.A(html.Button('Un-freeze all'), href="javascript:location.reload();")
]
for graphId in GRAPH_IDS:
div_container.append(dcc.Graph(id=graphId))
for ticker in TICKERS:
graph= 'live-graph-' + ticker.lower().replace('-', '')
div_container.append(html.Br())
div_container.append(html.Br())
div_container.append(html.A(html.Button('Hide '+ticker),
#Gets Graph Elements and toggles style="display:none"/style="display:"
href='javascript:(function(){if(document.getElementById("'+graph+'").style.display==""){document.getElementById("'+graph+'").style.display="none"}else{document.getElementById("'+graph+'").style.display=""}})()'))
div_container.append(dcc.Graph(id=graph))

div_container.append(dcc.Interval(
id='interval-component',
Expand Down

0 comments on commit 564c7ec

Please sign in to comment.