Improve package updates barplot with least updated
This commit is contained in:
parent
43d2bac7ad
commit
bc6c9d1002
1 changed files with 23 additions and 14 deletions
37
popcorn.py
37
popcorn.py
|
|
@ -227,21 +227,30 @@ def _(df_lazy: pl.LazyFrame):
|
|||
@app.cell
|
||||
def _(df_pkg_lazy: pl.LazyFrame):
|
||||
DISPLAY_TOP = 20
|
||||
df_top_pkg_dl = (
|
||||
df_pkg_lazy.group_by("package")
|
||||
.agg(pl.col("downloads").sum())
|
||||
.sort("downloads", descending=True)
|
||||
.head(DISPLAY_TOP)
|
||||
.collect()
|
||||
)
|
||||
df_pkg_dl = df_pkg_lazy.group_by("package").agg(pl.col("downloads").sum()).collect()
|
||||
|
||||
(
|
||||
lp.ggplot(df_top_pkg_dl, lp.aes("package", "downloads"))
|
||||
+ lp.geom_bar(stat="identity")
|
||||
+ lp.labs(
|
||||
title="Top packages",
|
||||
caption="Daily number of unique providers for package update statistics opting in to popcorn.",
|
||||
)
|
||||
lp.gggrid(
|
||||
[
|
||||
lp.ggplot(
|
||||
df_pkg_dl.sort("downloads", descending=True).head(DISPLAY_TOP),
|
||||
lp.aes("package", "downloads"),
|
||||
)
|
||||
+ lp.geom_bar(stat="identity")
|
||||
+ lp.labs(
|
||||
title="Top packages",
|
||||
caption="Most updated packages over all time",
|
||||
),
|
||||
lp.ggplot(
|
||||
df_pkg_dl.sort("downloads", descending=False).head(DISPLAY_TOP),
|
||||
lp.aes("package", "downloads"),
|
||||
)
|
||||
+ lp.geom_bar(stat="identity")
|
||||
+ lp.labs(
|
||||
title="Rarest packages",
|
||||
caption="Least updated packages over all time",
|
||||
),
|
||||
],
|
||||
ncol=1,
|
||||
)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue