Remove unused graph file and packages
This commit is contained in:
36
graph.py
36
graph.py
@@ -1,36 +0,0 @@
|
||||
import pygal
|
||||
from pygal.style import Style
|
||||
|
||||
custom_style = Style(
|
||||
background='transparent',
|
||||
plot_background='transparent',
|
||||
foreground='#53E89B',
|
||||
foreground_strong='#53A0E8',
|
||||
foreground_subtle='#630C0D',
|
||||
opacity='.6',
|
||||
opacity_hover='.9',
|
||||
transition='400ms ease-in',
|
||||
colors=('#E853A0', '#E8537A', '#E95355', '#E87653', '#E89B53'))
|
||||
|
||||
|
||||
def generate_graph(x_labels, data, style=custom_style):
|
||||
"""
|
||||
Generate SVG line graph using pygal
|
||||
example usage: generate_graph([1,2,3], [("RPM", [1,2,3]),("Power", [2,4,6])])
|
||||
"""
|
||||
graph = pygal.Line(show_y_guides=False,
|
||||
show_legend=False, style=style)
|
||||
graph.x_labels = x_labels
|
||||
|
||||
for title, values in data:
|
||||
graph.add(title, values)
|
||||
graph_data = graph.render_data_uri()
|
||||
return graph_data
|
||||
|
||||
|
||||
def generate_sparkline_graph(data, style=custom_style):
|
||||
chart = pygal.Line(show_y_guides=False,
|
||||
show_legend=False, style=style)
|
||||
chart.add('', data)
|
||||
|
||||
return chart.render_sparkline(disable_xml_declaration=True)
|
||||
@@ -5,8 +5,6 @@ jinja-partials==0.1.1
|
||||
psycopg2-binary==2.9.3
|
||||
flask-htmx==0.2.0
|
||||
python-dateutil==2.8.2
|
||||
minify-html==0.10.3
|
||||
bidict==0.22.1
|
||||
pygal==3.0.0
|
||||
Flask-SQLAlchemy==3.0.3
|
||||
matplotlib==3.5.2
|
||||
Reference in New Issue
Block a user