Mid change in details templates

This commit is contained in:
lwark
2024-06-20 07:46:46 -05:00
parent 12e552800a
commit 337112a27d
20 changed files with 575 additions and 300 deletions

View File

@@ -6,12 +6,13 @@ import plotly.express as px
import pandas as pd
from plotly.graph_objects import Figure
import logging
from backend.excel import get_unique_values_in_df_column
from tools import Settings
# from backend.excel import get_unique_values_in_df_column
from tools import Settings, get_unique_values_in_df_column
from frontend.widgets.functions import select_save_file
logger = logging.getLogger(f"submissions.{__name__}")
def create_charts(ctx:Settings, df:pd.DataFrame, ytitle:str|None=None) -> Figure:
"""
Constructs figures based on parsed pandas dataframe.
@@ -217,7 +218,7 @@ def construct_html(figure:Figure) -> str:
str: html string
"""
html = '<html><body>'
if figure != None:
if figure is not None:
html += plotly.offline.plot(figure, output_type='div', include_plotlyjs='cdn')#, image = 'png', auto_open=True, image_filename='plot_image')
else:
html += "<h1>No data was retrieved for the given parameters.</h1>"