Skip to content

Commit

Permalink
fix stats on homepage causing error
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Nov 27, 2024
1 parent e0d367f commit a2691ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
9 changes: 4 additions & 5 deletions webapp/grebi_ui/src/frontends/ebi/pages/EbiHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { MenuItem, Select } from "@mui/material";
import { get } from "../../../app/api";
import EbiHeader from "../EbiHeader";
import SearchBox from "../../../components/SearchBox";
import Stats from "../../../model/Stats";

export default function EbiHomePage() {

document.title = "EMBL-EBI Knowledge Graph";

let [stats, setStats] = useState<Stats|null>(null);
let [stats, setStats] = useState<any|null>(null);
let [subgraphs, setSubgraphs] = useState<string[]|null>(null);
let [subgraph, setSubgraph] = useState<string|null>(null);

Expand Down Expand Up @@ -73,7 +72,7 @@ export default function EbiHomePage() {
</div>
<div className="md:text-right">

{stats ? (
{stats && subgraph && stats[subgraph] ? (
<div className="text-neutral-black text-sm">
{/* <div className="mb-2 text-sm italic">
Updated&nbsp;
Expand All @@ -82,8 +81,8 @@ export default function EbiHomePage() {
)}
</div> */}
<p>
<i>{stats.num_nodes.toLocaleString()} nodes</i><br/>
<i>{stats.num_edges.toLocaleString()} edges</i>
<i>{stats[subgraph].num_nodes.toLocaleString()} nodes</i><br/>
<i>{stats[subgraph].num_edges.toLocaleString()} edges</i>
</p>
</div>
) : (
Expand Down
5 changes: 0 additions & 5 deletions webapp/grebi_ui/src/model/Stats.ts

This file was deleted.

0 comments on commit a2691ec

Please sign in to comment.