Skip to content

Commit

Permalink
Added page stars and worked on spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ddxv committed Oct 25, 2023
1 parent 73004ad commit d23d489
Show file tree
Hide file tree
Showing 7 changed files with 847 additions and 185 deletions.
9 changes: 8 additions & 1 deletion backend/api_app/controllers/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ async def get_app_detail(self, store_id: str) -> AppDetail:
app_dict = app_df.to_dict(orient="records")[0]
store_app = app_dict["id"]
app_hist = get_app_history(store_app)
app_dict["history_table"] = app_hist.to_html()
app_dict["histogram"] = (
app_hist.sort_values(["id"]).tail(1)["histogram"].values[0]
)
app_dict["history_table"] = (
app_hist.drop(["id", "store_app"], axis=1)
.style.format(precision=3, thousands=".", decimal=",")
.to_html(index=None, classes="pretty-table")
)

return app_dict

Expand Down
1 change: 1 addition & 0 deletions backend/dbcon/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def clean_app_df(df: pd.DataFrame) -> pd.DataFrame:
df["store"] = df["store"].replace({1: "Google Play", 2: "Apple App Store"})
string_nums = ["installs", "review_count", "rating_count"]
for col in string_nums:
df[f"{col}_num"] = df[col]
df[col] = df[col].apply(
lambda x: "N/A" if (x is None or np.isnan(x)) else "{:,.0f}".format(x)
)
Expand Down
Loading

0 comments on commit d23d489

Please sign in to comment.