Remove exception handling for Plotly output (#69)

At some point in Plotly 3.x, the offline graph output was changed to produce
two script tags instead of the initial one. With Plotly 4.x, that change was
reverted and the output now always has only a single script tag again.
This commit is contained in:
Christopher C. Wells 2020-02-14 11:02:07 -08:00 committed by Christopher Charbonneau Wells
parent d4291712bd
commit f0d763d374
1 changed files with 1 additions and 7 deletions

View File

@ -79,15 +79,9 @@ def rangeselector_date():
def split_graph_output(output): def split_graph_output(output):
""" """
Split out of a Plotly graph in to html and javascript. Split out of a Plotly graph in to html and javascript.
This function accounts for two output formats from different Plotly
versions: one with a single <script> tag and one with two <script> tags.
:param output: a string of html and javascript comprising the graph. :param output: a string of html and javascript comprising the graph.
:returns: a tuple of the the graph's html and javascript. :returns: a tuple of the the graph's html and javascript.
""" """
try:
html, js_graph, js_listener = output.split('<script')
js = js_graph + '<script' + js_listener
except ValueError:
html, js = output.split('<script') html, js = output.split('<script')
js = '<script' + js js = '<script' + js
return html, js return html, js