mirror of
https://github.com/Sosokker/Packaged-Food-Explorer.git
synced 2025-12-20 05:34:05 +01:00
change plotter.py structure, move df reader to app
This commit is contained in:
parent
050ef73984
commit
349e08d2e4
@ -1,15 +1,9 @@
|
|||||||
import tkinter as tk
|
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
import plotly.io as pio
|
import plotly.io as pio
|
||||||
import tempfile
|
import tempfile
|
||||||
import sqlite3
|
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
class plotter:
|
class plotter:
|
||||||
def __init__(self) -> None:
|
|
||||||
self.df = pd.read_sql_query("SELECT * FROM food_data", sqlite3.connect(r'D:\Food-Nutrient-Viewer-Tkinter\Essential\data\food_data.db'))
|
|
||||||
|
|
||||||
def nutrient_plotter(self, df, row_index, nutrient_indices, chart_type, popup=True, to_html_str=False):
|
def nutrient_plotter(self, df, row_index, nutrient_indices, chart_type, popup=True, to_html_str=False):
|
||||||
"""
|
"""
|
||||||
Generate and display a Plotly graph of nutrient values for a specific row in a DataFrame.
|
Generate and display a Plotly graph of nutrient values for a specific row in a DataFrame.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user