Add top updated packages barplot
This commit is contained in:
parent
4984289f69
commit
43d2bac7ad
1 changed files with 23 additions and 1 deletions
24
popcorn.py
24
popcorn.py
|
|
@ -210,7 +210,7 @@ def _(df_pkg_lazy: pl.LazyFrame):
|
||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _(df_lazy:pl.LazyFrame):
|
def _(df_lazy: pl.LazyFrame):
|
||||||
df_unique_downloads = df_lazy.select(["date", "UniqueInstalls"]).collect()
|
df_unique_downloads = df_lazy.select(["date", "UniqueInstalls"]).collect()
|
||||||
(
|
(
|
||||||
lp.ggplot(df_unique_downloads, lp.aes("date", "UniqueInstalls"))
|
lp.ggplot(df_unique_downloads, lp.aes("date", "UniqueInstalls"))
|
||||||
|
|
@ -224,6 +224,28 @@ def _(df_lazy:pl.LazyFrame):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@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()
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
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.",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
@app.cell
|
@app.cell
|
||||||
def _():
|
def _():
|
||||||
mo.md(
|
mo.md(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue