-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhelpers.py
More file actions
35 lines (31 loc) · 696 Bytes
/
Copy pathhelpers.py
File metadata and controls
35 lines (31 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import folium
import plotly.express as px
def get_map(lat, lon):
"""
Generates a Folium map with a marker at the current location.
"""
m = folium.Map(
location=[lat, lon],
zoom_start=10,
zoom_control=False,
scrollWheelZoom=False,
dragging=False,
)
folium.Marker([lat, lon]).add_to(m)
return m
def plot_monthly_energy_generated(data):
fig = px.line(
data,
x='time', y='kWh',
color='type',
height=300
)
fig.update_layout(legend=dict(
orientation="h",
entrywidth=70,
yanchor="bottom",
y=1.02,
xanchor="right",
x=1
))
return fig