Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import plotly.graph_objects as go
|
| 3 |
import pandas as pd
|
| 4 |
-
from datetime import datetime
|
| 5 |
|
| 6 |
# Configuración de la página
|
| 7 |
st.set_page_config(page_title="Generador de Franjas de Tiempo Apiladas", layout="wide")
|
|
@@ -11,6 +11,11 @@ def hex_to_rgba(hex_color, alpha=1.0):
|
|
| 11 |
hex_color = hex_color.lstrip('#')
|
| 12 |
return f'rgba({int(hex_color[0:2], 16)},{int(hex_color[2:4], 16)},{int(hex_color[4:6], 16)},{alpha})'
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Sidebar para la configuración del gráfico
|
| 15 |
st.sidebar.header("Configuración del Gráfico")
|
| 16 |
|
|
@@ -49,7 +54,7 @@ data = pd.DataFrame(data_list)
|
|
| 49 |
fig = go.Figure()
|
| 50 |
|
| 51 |
# Agregar cada serie de tiempo al gráfico
|
| 52 |
-
colors =
|
| 53 |
|
| 54 |
for i, (y_name, (start_date, end_date)) in enumerate(y_values.items()):
|
| 55 |
start_date = pd.to_datetime(start_date)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import plotly.graph_objects as go
|
| 3 |
import pandas as pd
|
| 4 |
+
from datetime import datetime
|
| 5 |
|
| 6 |
# Configuración de la página
|
| 7 |
st.set_page_config(page_title="Generador de Franjas de Tiempo Apiladas", layout="wide")
|
|
|
|
| 11 |
hex_color = hex_color.lstrip('#')
|
| 12 |
return f'rgba({int(hex_color[0:2], 16)},{int(hex_color[2:4], 16)},{int(hex_color[4:6], 16)},{alpha})'
|
| 13 |
|
| 14 |
+
# Lista de colores predefinidos
|
| 15 |
+
predefined_colors = [
|
| 16 |
+
"#FF5C5C", "#5CCFFF", "#FFA500", "#90EE90", "#9370DB", "#FFD700"
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
# Sidebar para la configuración del gráfico
|
| 20 |
st.sidebar.header("Configuración del Gráfico")
|
| 21 |
|
|
|
|
| 54 |
fig = go.Figure()
|
| 55 |
|
| 56 |
# Agregar cada serie de tiempo al gráfico
|
| 57 |
+
colors = predefined_colors # Lista de colores predefinidos
|
| 58 |
|
| 59 |
for i, (y_name, (start_date, end_date)) in enumerate(y_values.items()):
|
| 60 |
start_date = pd.to_datetime(start_date)
|