Skip to content

Commit

Permalink
Merge branch 'main' into deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tnaccarato committed Aug 15, 2024
2 parents 543ec9c + 70436b5 commit d9a6d6f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 20 deletions.
4 changes: 4 additions & 0 deletions vis_phewas/static/mainapp/js/sidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ function updateSidebarContents(tab) {
sidePanelContent.innerHTML =
document.getElementById("help-panel").innerHTML;
}
else if (tab === "tools"){
sidePanelContent.innerHTML =
document.getElementById("tools-panel").innerHTML;
}
}
6 changes: 5 additions & 1 deletion vis_phewas/templates/mainapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,22 @@
<div id="options-tab" class="tab options" onclick="toggleSidePanel('options')">
Options
</div>
<div id="tools-tab" class="tab tools" onclick="toggleSidePanel('tools')">Tools</div>
<div id="help-tab" class="tab help" onclick="toggleSidePanel('help')">Help</div>
</div>

<!-- Hidden content panels -->
<div id="options-panel" style="display: none">
{% include "mainapp/tools.html" %}
{% include "mainapp/options.html" %}
</div>

<div id="help-panel" style="display: none">
{% include "mainapp/help.html" %}
</div>

<div id="tools-panel" style="display: none">
{% include "mainapp/tools.html" %}

<script src="{% static 'mainapp/js/sidePanel.js' %}"></script>
<script type="module" src="{% static 'mainapp/js/bundle.js' %}"></script>

Expand Down
19 changes: 19 additions & 0 deletions vis_phewas/templates/mainapp/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% load static %}
<script src={% static 'mainapp/js/som.js' %}></script>
<div class="panel options_panel">
<h3>Options</h3>
<h4>Resolution</h4>
<div class="resolutionSwitchContainer">
<span class="switch-label-left">2 digit</span>
<label class="switch">
<input
type="checkbox"
id="show-subtypes-switch"
onclick="updateShowSubtypes()"
/>
<span class="slider round"></span>
</label>
<span class="switch-label-right">4 digit</span>
</div>
</div>

19 changes: 2 additions & 17 deletions vis_phewas/templates/mainapp/tools.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
{% load static %}
<script src={% static 'mainapp/js/som.js' %}></script>
<div class="panel options_panel">
<h3>Tools</h3>
<h4>Resolution</h4>
<div class="resolutionSwitchContainer">
<span class="switch-label-left">2 digit</span>
<label class="switch">
<input
type="checkbox"
id="show-subtypes-switch"
onclick="updateShowSubtypes()"
/>
<span class="slider round"></span>
</label>
<span class="switch-label-right">4 digit</span>
</div>

<div class="panel tools_panel">
<div id="som_options" style="align-items: center; display: flex; flex-direction: column">
<h4>Generate SOM for Disease Clustering</h4>
<h4>Generate Self Organising Map</h4>
<button class="button btn btn-info dataAction" onclick="generateSOM('', 'disease', 5)" style="color: white; margin-bottom: 1%">Generate Disease SOM</button>
<button class="button btn btn-info dataAction" onclick="generateSOM('', 'allele', 7)" style="color: white;">Generate Allele SOM</button>
</div>
Expand Down
10 changes: 8 additions & 2 deletions vis_phewas/templates/som/som_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ <h2 style="align-self: center">Filter by Disease Category</h2>
<div class="checkbox-container">
{% for category in categories %}
<input type="checkbox" id="{{ category }}" name="filters" value="{{ category }}"
{% if category in cleaned_filters %} checked {% endif %}>
{% if not cleaned_filters %}
checked
{% else %}
{% if category in cleaned_filters %} checked {% endif %}
{% endif %}
>
<!-- Check the checkbox if it is in the selected filters -->
<label for="{{ category }}">{{ category }}</label>
{% endfor %}
Expand All @@ -58,7 +63,8 @@ <h2 style="align-self: center">Filter by Disease Category</h2>
</button>
<!-- Add a button to download the cluster results CSV -->
<button class="btn btn-info dataAction" type="button">
<a style="text-decoration: none;color: whitesmoke;text-shadow: 1px 0 3px black;" href="{{ csv_path }}" download="cluster_results.csv">Download Cluster Results CSV</a>
<a style="text-decoration: none;color: whitesmoke;text-shadow: 1px 0 3px black;"
href="{{ csv_path }}" download="cluster_results.csv">Download Cluster Results CSV</a>
</button>
</div>
</form>
Expand Down

0 comments on commit d9a6d6f

Please sign in to comment.