Skip to content

Commit

Permalink
Merge pull request #45 from ncbo/docs_and_dashes
Browse files Browse the repository at this point in the history
Update dashboard contents
  • Loading branch information
caufieldjh authored Nov 29, 2022
2 parents 84f40b2 + 9122970 commit 82800b2
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ theme: jekyll-theme-tactile
# TODO: generate stats during each build using the scripts in BioPortal-to-KGX.
# Store the stats on KG-Hub as YAML.
# Retrieve them with the build_site.sh script.
nodecount: 5003226
edgecount: 30733778
nodecount: 4861311
edgecount: 30762617
ontologies:
- id: ABA-AMB
status: OK
Expand Down
7 changes: 7 additions & 0 deletions docs/_includes/fig1.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/_includes/fig2.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/build_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ JEKYLL_CONFIG_HEADER_FILE="_config_header.yml"
JEKYLL_CONFIG_FILE="_config.yml"
GRAPH_STATS_URL="https://kg-hub.berkeleybop.io/kg-bioportal/graph_stats.yaml"
GRAPH_STATS_FILE="graph_stats.yaml"
ONTO_STATUS_URL="https://kg-hub.berkeleybop.io/kg-bioportal/onto_status.yaml"
ONTO_STATUS_FILE="onto_status.yaml"
ONTO_STATUS_URL="https://kg-hub.berkeleybop.io/kg-bioportal/onto_stats.yaml"
ONTO_STATUS_FILE="onto_stats.yaml"

# Retrieve most recent KG-Bioportal general stats
wget -N $GRAPH_STATS_URL
Expand Down
6 changes: 5 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ <h3>KG-Bioportal Overview</h3>
<p>Node Count: {{ site.nodecount }} </p>
<p>Edge Count: {{ site.edgecount }} </p>

{% include fig1.html %}
{% include fig2.html %}
<br>

<h3>KG-Bioportal Status</h3>
<p>The table below lists the presence and status of each ontology in KG-Bioportal.
Node and edge counts are pre-merged contributions from each ontology.</p>
Expand All @@ -30,4 +34,4 @@ <h3>KG-Bioportal Status</h3>
</div>
</div>
</div>
</div>
</div>
28 changes: 18 additions & 10 deletions docs/make_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pandas as pd
import plotly.express as px
import yaml
from plotly.subplots import make_subplots

with open("onto_status.yaml", "r") as infile:
ontos = pd.DataFrame(((yaml.safe_load(infile)))["ontologies"])
Expand All @@ -20,11 +19,16 @@
values="nodecount",
names="id",
title="Nodes used to make KG-Bioportal",
hole=.3
hole=0.3,
)
fig1.update_traces(textposition='inside', textinfo='percent+label')
fig1.update_layout(uniformtext_minsize=14, uniformtext_mode='hide')
fig1.write_html("fig1.html", include_plotlyjs='cdn')
fig1.update_traces(textposition="inside", textinfo="percent+label")
fig1.update_layout(
uniformtext_minsize=14,
uniformtext_mode="hide",
plot_bgcolor="rgba(0, 0, 0, 0)",
paper_bgcolor="rgba(0, 0, 0, 0)",
)
fig1.write_html("_includes/fig1.html", include_plotlyjs="cdn")

# Edge counts across all ontologies, unmerged
ontos.loc[ontos["edgecount"] < 150000, "id"] = "All other ontologies"
Expand All @@ -33,9 +37,13 @@
values="edgecount",
names="id",
title="Edges used to make KG-Bioportal",
hole=.3
hole=0.3,
)
fig2.update_traces(textposition='inside', textinfo='percent+label')
fig2.update_layout(uniformtext_minsize=14, uniformtext_mode='hide')
fig2.write_html("fig2.html", include_plotlyjs='cdn')

fig2.update_traces(textposition="inside", textinfo="percent+label")
fig2.update_layout(
uniformtext_minsize=14,
uniformtext_mode="hide",
plot_bgcolor="rgba(0, 0, 0, 0)",
paper_bgcolor="rgba(0, 0, 0, 0)",
)
fig2.write_html("_includes/fig2.html", include_plotlyjs="cdn")
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def find_version(*file_paths):
'cat-merge',
'click==8.0.4',
'compress_json',
'kaleido',
'kghub-downloader',
'kgx',
'networkx',
Expand Down

0 comments on commit 82800b2

Please sign in to comment.