Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,11 +55,11 @@ if use_multiple_colors:
|
|
| 55 |
num_colors = len(y_values.split(","))
|
| 56 |
colors = [hex_to_rgba(st.sidebar.color_picker(f"Color {i+1}", predefined_colors[i % len(predefined_colors)], key=f"color_{i}"), alpha=0.3)
|
| 57 |
for i in range(num_colors)]
|
| 58 |
-
border_colors = [hex_to_rgba(
|
| 59 |
for i in range(num_colors)]
|
| 60 |
else:
|
| 61 |
color = hex_to_rgba(st.sidebar.color_picker("Color del Gráfico", "#24CBA0", key="single_color"), alpha=0.3)
|
| 62 |
-
border_color = hex_to_rgba(
|
| 63 |
|
| 64 |
# Procesar valores
|
| 65 |
x = x_values.split(",")
|
|
@@ -97,7 +97,7 @@ else:
|
|
| 97 |
elif chart_type == "Barras":
|
| 98 |
fig = px.bar(data, x="X", y="Y", title="Gráfico de Barras", hover_name="Nombre" if names else None)
|
| 99 |
if not use_multiple_colors:
|
| 100 |
-
fig.update_traces(marker_color=color, marker_line_color=border_color, marker_line_width=
|
| 101 |
fig.update_layout(bargap=0.2) # Ajustar el espacio entre las barras
|
| 102 |
elif chart_type == "Dispersión":
|
| 103 |
fig = px.scatter(data, x="X", y="Y", title="Gráfico de Dispersión", hover_name="Nombre" if names else None)
|
|
@@ -125,7 +125,7 @@ else:
|
|
| 125 |
|
| 126 |
# Aplicar múltiples colores si se seleccionó la opción
|
| 127 |
if use_multiple_colors and chart_type != "Pastel":
|
| 128 |
-
fig.update_traces(marker_color=colors, marker_line_color=border_colors, marker_line_width=
|
| 129 |
elif use_multiple_colors and chart_type == "Pastel":
|
| 130 |
fig.update_traces(marker=dict(colors=colors))
|
| 131 |
|
|
|
|
| 55 |
num_colors = len(y_values.split(","))
|
| 56 |
colors = [hex_to_rgba(st.sidebar.color_picker(f"Color {i+1}", predefined_colors[i % len(predefined_colors)], key=f"color_{i}"), alpha=0.3)
|
| 57 |
for i in range(num_colors)]
|
| 58 |
+
border_colors = [hex_to_rgba(predefined_colors[i % len(predefined_colors)], alpha=0.6)
|
| 59 |
for i in range(num_colors)]
|
| 60 |
else:
|
| 61 |
color = hex_to_rgba(st.sidebar.color_picker("Color del Gráfico", "#24CBA0", key="single_color"), alpha=0.3)
|
| 62 |
+
border_color = hex_to_rgba(color, alpha=0.6)
|
| 63 |
|
| 64 |
# Procesar valores
|
| 65 |
x = x_values.split(",")
|
|
|
|
| 97 |
elif chart_type == "Barras":
|
| 98 |
fig = px.bar(data, x="X", y="Y", title="Gráfico de Barras", hover_name="Nombre" if names else None)
|
| 99 |
if not use_multiple_colors:
|
| 100 |
+
fig.update_traces(marker_color=color, marker_line_color=border_color, marker_line_width=0.3)
|
| 101 |
fig.update_layout(bargap=0.2) # Ajustar el espacio entre las barras
|
| 102 |
elif chart_type == "Dispersión":
|
| 103 |
fig = px.scatter(data, x="X", y="Y", title="Gráfico de Dispersión", hover_name="Nombre" if names else None)
|
|
|
|
| 125 |
|
| 126 |
# Aplicar múltiples colores si se seleccionó la opción
|
| 127 |
if use_multiple_colors and chart_type != "Pastel":
|
| 128 |
+
fig.update_traces(marker_color=colors, marker_line_color=border_colors, marker_line_width=0.3)
|
| 129 |
elif use_multiple_colors and chart_type == "Pastel":
|
| 130 |
fig.update_traces(marker=dict(colors=colors))
|
| 131 |
|