Skip to content

Commit

Permalink
fix /leaderboard again (temporarily)
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Jan 28, 2025
1 parent e224f6a commit 65e7ab2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 34 deletions.
2 changes: 1 addition & 1 deletion cogs/profiles/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def leaderboard(
).set_caption(f"Leaderboard sorted by {sort} | Page {page_index}"),
buffer,
dpi=200,
table_conversion="html2image",
table_conversion="matplotlib",
)
buffer.seek(0)

Expand Down
72 changes: 39 additions & 33 deletions utils/maths/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,45 @@ def create_table(mogi: Mogi) -> BytesIO:
dfi.export(
df.style.set_table_styles(
[
{
"selector": "table",
"props": [("border", "none")],
},
{
"selector": "th",
"props": [("border", "1px solid rgba(14, 14, 27, 1)")],
},
{
"selector": "td",
"props": [("border", "1px solid rgba(14, 14, 27, 1)")],
},
{
"selector": "tr:nth-child(even)",
"props": [("background-color", "rgba(21, 21, 40, 1)"), ("color", "rgba(202, 202, 227, 1)")],
},
{
"selector": "tr:nth-child(odd)",
"props": [("background-color", "rgba(15, 15, 28, 1)"), ("color", "rgba(202, 202, 227, 1)")],
},
]
).background_gradient(
cmap=colors.LinearSegmentedColormap.from_list(
"",
[
"#E22012",
"#E22012",
"#E22012",
"#CACAE3",
"#22AA3B",
"#22AA3B",
"#22AA3B",
],
{
"selector": "table",
"props": [("border", "none")],
},
{
"selector": "th",
"props": [("border", "1px solid rgba(14, 14, 27, 1)")],
},
{
"selector": "td",
"props": [("border", "1px solid rgba(14, 14, 27, 1)")],
},
{
"selector": "tr:nth-child(even)",
"props": [
("background-color", "rgba(21, 21, 40, 1)"),
("color", "rgba(202, 202, 227, 1)"),
],
},
{
"selector": "tr:nth-child(odd)",
"props": [
("background-color", "rgba(15, 15, 28, 1)"),
("color", "rgba(202, 202, 227, 1)"),
],
},
]
).background_gradient(
cmap=colors.LinearSegmentedColormap.from_list(
"",
[
"#E22012",
"#E22012",
"#E22012",
"#CACAE3",
"#22AA3B",
"#22AA3B",
"#22AA3B",
],
),
vmin=-150,
vmax=150,
Expand Down

0 comments on commit 65e7ab2

Please sign in to comment.