(plot_file_stream)
| 30 | raise ImportError(str(e)) |
| 31 | |
| 32 | def write_plot_file(plot_file_stream): |
| 33 | plot_file_stream.write('\n'.join(( |
| 34 | '<html>', |
| 35 | '<head>', |
| 36 | '<meta charset="utf-8" />', |
| 37 | '<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>', |
| 38 | '<title>{}</title>'.format(plot_name), |
| 39 | '</head>', |
| 40 | '<body>' |
| 41 | ))) |
| 42 | for fig in figs: |
| 43 | graph_div = plotly_plot( |
| 44 | fig, |
| 45 | output_type='div', |
| 46 | show_link=False, |
| 47 | include_plotlyjs=False |
| 48 | ) |
| 49 | plot_file_stream.write('\n{}\n'.format(graph_div)) |
| 50 | plot_file_stream.write('</body>\n</html>') |
| 51 | |
| 52 | if isinstance(plot_file, str): |
| 53 | with open(fspath(plot_file), 'w') as plot_file_stream: |
no test coverage detected