Second round of code cleanup.

This commit is contained in:
lwark
2024-10-30 07:34:39 -05:00
parent 1f83b61c81
commit ba1b3e5cf3
19 changed files with 176 additions and 110 deletions

View File

@@ -2,12 +2,13 @@
Contains all operations for creating charts, graphs and visual effects.
'''
from PyQt6.QtWidgets import QWidget
import plotly
import plotly, logging
from plotly.graph_objects import Figure
from plotly.graph_objs import FigureWidget
import pandas as pd
from frontend.widgets.functions import select_save_file
logger = logging.getLogger(f"submissions.{__name__}")
class CustomFigure(Figure):
@@ -40,16 +41,12 @@ class CustomFigure(Figure):
"""
Creates final html code from plotly
Args:
figure (Figure): input figure
Returns:
str: html string
"""
html = '<html><body>'
if self is not None:
html += plotly.offline.plot(self, output_type='div',
include_plotlyjs='cdn') #, image = 'png', auto_open=True, image_filename='plot_image')
html += plotly.offline.plot(self, output_type='div', include_plotlyjs='cdn')
else:
html += "<h1>No data was retrieved for the given parameters.</h1>"
html += '</body></html>'