Skip to content

Commit

Permalink
Cleanup names
Browse files Browse the repository at this point in the history
  • Loading branch information
ddxv committed Oct 14, 2024
1 parent 83a37cc commit dc20346
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
16 changes: 14 additions & 2 deletions backend/api_app/controllers/companies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from typing import Self

import numpy as np
import pandas as pd
from litestar import Controller, get
from litestar.exceptions import NotFoundException
Expand Down Expand Up @@ -89,11 +90,22 @@ def get_overviews(category: str | None = None) -> CompaniesOverview:
top_sdk_df = top_df[top_df["tag_source"] == "sdk"].copy()
top_adstxt_df = top_df[top_df["tag_source"] == "app_ads"].copy()

top_sdk_df["company_title"] = np.where(
top_sdk_df["company_name"].isna(),
top_sdk_df["company_domain"],
top_sdk_df["company_name"],
)
top_adstxt_df["company_title"] = np.where(
top_adstxt_df["company_name"].isna(),
top_adstxt_df["company_domain"],
top_adstxt_df["company_name"],
)

top_sdk_df = top_sdk_df.rename(
columns={"company_domain": "group", "app_count": "value"},
columns={"company_title": "group", "app_count": "value"},
).sort_values(by=["value"], ascending=True)
top_adstxt_df = top_adstxt_df.rename(
columns={"company_domain": "group", "app_count": "value"},
columns={"company_title": "group", "app_count": "value"},
).sort_values(by=["value"], ascending=True)

category_overview = make_category_uniques(df=overview_df)
Expand Down
15 changes: 10 additions & 5 deletions frontend/src/lib/CompaniesOverviewTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@
<td class="table-cell-fit">
{index + 1}
</td>
<td class="table-cell-fit">
{row.company_name}
({row.company_domain})
</td>

{#if row.company_name}
<td class="table-cell-fit">
{row.company_name}
({row.company_domain})
</td>
{:else}
<td class="table-cell-fit">
{row.company_domain}
</td>
{/if}
<td class="table-cell-fit">
{row.app_count}
</td>
Expand Down

0 comments on commit dc20346

Please sign in to comment.