Spaces:
Sleeping
Sleeping
Update charts.py
Browse files9 unmodified lines1011121314151617185 unmodified lines2425262728293031104 unmodified lines1361371381391401411424 unmodified lines147148149150151152153122 unmodified lines27627727827928028128228328428528670 unmodified lines35735835936036136236382 unmodified lines44644744844945045145244 unmodified lines49749849950050150250350446 unmodified lines5515525535545555565575585595 unmodified lines5655665675685699 unmodified lines# Shared theme β Light ProfessionalDARK_BG = "#f4f7fb" # used as bar border / contrast edgeCARD_BG = "#ffffff"BORDER = "#dde3ed"TEXT_MAIN = "#1e293b"TEXT_DIM = "#7b7b7b" # Flat GreyPRIMARY = "#269ccc" # Optimism BlueALGAE = "#9ed2c5" # Blue Algae5 unmodified linesBLUE = "#2563eb"PLOTLY_LAYOUT = dict(paper_bgcolor="rgba(255,255,255,0)",plot_bgcolor="rgba(255,255,255,0)",font=dict(family="'DM Sans', 'Nunito', sans-serif", color=TEXT_MAIN, size=12),margin=dict(l=20, r=20, t=40, b=20),)104 unmodified lines),text=[f"{w:.0f}" for w in weights],textposition="inside",textfont=dict(size=10, color="#ffffff", family="'DM Sans', sans-serif"),hovertemplate="<b>%{y}</b><br>Weight: %{text}<extra></extra>",))fig.update_layout(4 unmodified linesshowgrid=True, gridwidth=1),xaxis=dict(showticklabels=False, gridcolor=BORDER, showgrid=False),bargap=0.3,plot_bgcolor="rgba(248,250,252,0.6)",)return fig122 unmodified linesorientation="h",y=1.12,font=dict(size=11),bgcolor="rgba(255,255,255,0)",),bargap=0.22,bargroupgap=0.06,plot_bgcolor="rgba(248,250,252,0.6)",)return fig70 unmodified linesticksuffix="%",),bargap=0.38,plot_bgcolor="rgba(248,250,252,0.6)",)return fig82 unmodified linesticksuffix="%",),bargap=0.38,plot_bgcolor="rgba(248,250,252,0.6)",)return fig44 unmodified linesyaxis=dict(title="Compound score", gridcolor=BORDER, range=[-1.1, 1.1],showgrid=True, gridwidth=1),legend=dict(orientation="h", y=1.12, font=dict(size=11),bgcolor="rgba(255,255,255,0.8)", bordercolor=BORDER, borderwidth=1),plot_bgcolor="rgba(248,250,252,0.6)",)return fig46 unmodified linesxaxis=dict(title="β Negatively Engagement | Positively Engagement β", gridcolor=BORDER,zeroline=True, zerolinecolor=BORDER, zerolinewidth=2),yaxis=dict(tickfont=dict(size=10)),legend=dict(orientation="h", y=1.1, bgcolor="rgba(255,255,255,0.8)",bordercolor=BORDER, borderwidth=1),plot_bgcolor="rgba(248,250,252,0.6)",)return fig5 unmodified linesfig.add_annotation(text="No data available", x=0.5, y=0.5, showarrow=False,font=dict(size=14, color=TEXT_DIM))fig.update_layout(**PLOTLY_LAYOUT, title=dict(text=title, x=0), height=250,plot_bgcolor="rgba(248,250,252,0.6)")return fig9 unmodified lines1011121314151617185 unmodified lines2425262728293031104 unmodified lines1361371381391401411424 unmodified lines147148149150151152153122 unmodified lines27627727827928028128228328428528670 unmodified lines35735835936036136236382 unmodified lines44644744844945045145244 unmodified lines49749849950050150250350446 unmodified lines5515525535545555565575585595 unmodified lines5655665675685699 unmodified lines# Shared theme β Light ProfessionalDARK_BG = "#f4f7fb" # used as bar border / contrast edgeCARD_BG = "#f4deb4"BORDER = "#dde3ed"TEXT_MAIN = "#b09561"TEXT_DIM = "#7b7b7b" # Flat GreyPRIMARY = "#269ccc" # Optimism BlueALGAE = "#9ed2c5" # Blue Algae5 unmodified linesBLUE = "#2563eb"PLOTLY_LAYOUT = dict(paper_bgcolor="rgba(244,222,180,0)",plot_bgcolor="rgba(244,222,180,0)",font=dict(family="'DM Sans', 'Nunito', sans-serif", color=TEXT_MAIN, size=12),margin=dict(l=20, r=20, t=40, b=20),)104 unmodified lines),text=[f"{w:.0f}" for w in weights],textposition="inside",textfont=dict(size=10, color="#f4deb4", family="'DM Sans', sans-serif"),hovertemplate="<b>%{y}</b><br>Weight: %{text}<extra></extra>",))fig.update_layout(4 unmodified linesshowgrid=True, gridwidth=1),xaxis=dict(showticklabels=False, gridcolor=BORDER, showgrid=False),bargap=0.3,plot_bgcolor="rgba(212,193,162,0.6)",)return fig122 unmodified linesorientation="h",y=1.12,font=dict(size=11),bgcolor="rgba(244,222,180,0)",),bargap=0.22,bargroupgap=0.06,plot_bgcolor="rgba(212,193,162,0.6)",)return fig70 unmodified linesticksuffix="%",),bargap=0.38,plot_bgcolor="rgba(212,193,162,0.6)",)return fig82 unmodified linesticksuffix="%",),bargap=0.38,plot_bgcolor="rgba(212,193,162,0.6)",)return fig44 unmodified linesyaxis=dict(title="Compound score", gridcolor=BORDER, range=[-1.1, 1.1],showgrid=True, gridwidth=1),legend=dict(orientation="h", y=1.12, font=dict(size=11),bgcolor="rgba(244,222,180,0.8)", bordercolor=BORDER, borderwidth=1),plot_bgcolor="rgba(212,193,162,0.6)",)return fig46 unmodified linesxaxis=dict(title="β Negatively Engagement | Positively Engagement β", gridcolor=BORDER,zeroline=True, zerolinecolor=BORDER, zerolinewidth=2),yaxis=dict(tickfont=dict(size=10)),legend=dict(orientation="h", y=1.1, bgcolor="rgba(244,222,180,0.8)",bordercolor=BORDER, borderwidth=1),plot_bgcolor="rgba(244,222,180,0.6)",)return fig5 unmodified linesfig.add_annotation(text="No data available", x=0.5, y=0.5, showarrow=False,font=dict(size=14, color=TEXT_DIM))fig.update_layout(**PLOTLY_LAYOUT, title=dict(text=title, x=0), height=250,plot_bgcolor="rgba(212,193,162,0.6)")return fig
charts.py+15-15