color theme

This commit is contained in:
2026-01-22 20:51:57 +01:00
parent dbcade215b
commit 0e1126563e
2 changed files with 33 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
import plotly.graph_objects as go
import polars as pl
from theme import ColorPalette
def plot_average_scores_with_counts(
@@ -9,7 +10,7 @@ def plot_average_scores_with_counts(
title: str = "General Impression (1-10)<br>Per Voice with Number of Participants Who Rated It",
x_label: str = "Stimuli",
y_label: str = "Average General Impression Rating (1-10)",
color: str = "#0077B6",
color: str = ColorPalette.PRIMARY,
height: int = 500,
width: int = 1000,
) -> go.Figure:
@@ -74,16 +75,16 @@ def plot_average_scores_with_counts(
yaxis_title=y_label,
height=height,
width=width,
plot_bgcolor='white',
plot_bgcolor=ColorPalette.BACKGROUND,
xaxis=dict(
showgrid=True,
gridcolor='lightgray',
gridcolor=ColorPalette.GRID,
tickangle=-45
),
yaxis=dict(
range=[0, 10],
showgrid=True,
gridcolor='lightgray'
gridcolor=ColorPalette.GRID
),
font=dict(size=11)
)
@@ -96,7 +97,7 @@ def plot_top3_ranking_distribution(
title: str = "Top 3 Rankings Distribution<br>Count of 1st, 2nd, and 3rd Place Votes per Voice",
x_label: str = "Voices",
y_label: str = "Number of Mentions in Top 3",
height: int = 600,
height: int = 500,
width: int = 1000,
) -> go.Figure:
"""
@@ -161,7 +162,7 @@ def plot_top3_ranking_distribution(
name='Rank 1 (1st Choice)',
x=labels,
y=stats_df['Rank 1'],
marker_color='#004C6D', # Dark Blue
marker_color=ColorPalette.RANK_1,
hovertemplate='<b>%{x}</b><br>Rank 1: %{y}<extra></extra>'
))
@@ -169,7 +170,7 @@ def plot_top3_ranking_distribution(
name='Rank 2 (2nd Choice)',
x=labels,
y=stats_df['Rank 2'],
marker_color='#008493', # Teal
marker_color=ColorPalette.RANK_2,
hovertemplate='<b>%{x}</b><br>Rank 2: %{y}<extra></extra>'
))
@@ -177,7 +178,7 @@ def plot_top3_ranking_distribution(
name='Rank 3 (3rd Choice)',
x=labels,
y=stats_df['Rank 3'],
marker_color='#5AAE95', # Sea Green
marker_color=ColorPalette.RANK_3,
hovertemplate='<b>%{x}</b><br>Rank 3: %{y}<extra></extra>'
))
@@ -188,15 +189,15 @@ def plot_top3_ranking_distribution(
yaxis_title=y_label,
height=height,
width=width,
plot_bgcolor='white',
plot_bgcolor=ColorPalette.BACKGROUND,
xaxis=dict(
showgrid=True,
gridcolor='lightgray',
gridcolor=ColorPalette.GRID,
tickangle=-45
),
yaxis=dict(
showgrid=True,
gridcolor='lightgray'
gridcolor=ColorPalette.GRID
),
legend=dict(
orientation="h",