aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js5
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html12
2 files changed, 17 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index f3f38541..7fb718cd 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -796,6 +796,11 @@ export_sample_table_data = function() {
};
$('.export_format').change(function() {
+ if (this.value == "csv"){
+ $('#export_code').css("display", "block")
+ } else{
+ $('#export_code').css("display", "none")
+ }
$('input[name=export_format]').val( this.value );
$('.export_format').val( this.value );
});
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index c3052866..ddc58784 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -13,6 +13,18 @@
<input type="button" class="btn btn-success reset" value="Reset">
</div>
</div>
+ <div id="export_code" style="width: 600px; display: none;">
+ <pre style="padding-top: 0px; padding-bottom: 0px; height: 150px;">
+ <code>
+# read into R
+trait <- read.csv("{{ this_trait.display_name}}.csv", header = TRUE, comment.char = "#")
+
+# read into python
+import pandas as pd
+trait = pd.read_csv("{{ this_trait.display_name}}.csv", header = 0, comment = "#")
+ </code>
+ </pre>
+ </div>
{% set outer_loop = loop %}
<div class="sample_group" style="width:{{ trait_table_width }};">
<div style="position: relative;">