diff options
Diffstat (limited to 'wqflask')
4 files changed, 14 insertions, 13 deletions
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index 70e21917..630980c7 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -207,7 +207,11 @@ class CorrelationMatrix(object): print("before loop:", self.loadings[0]) for i in range(len(self.trait_list)): loadings_row = [] - for j in range(3): + if len(self.trait_list) > 2: + the_range = 3 + else: + the_range = 2 + for j in range(the_range): position = i + len(self.trait_list)*j loadings_row.append(self.loadings[0][position]) loadings_array.append(loadings_row) diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js index a73eafe4..bcd83889 100644 --- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js @@ -226,10 +226,8 @@ back_to_collections = function() { return $('#collections_holder').colorbox.resize(); }; -$(function() { - console.log("inside get_traits_from_collection"); - $(document).on("click", ".collection_line", collection_click); - $(document).on("click", "#submit", submit_click); - $(document).on("click", ".trait", trait_click); - return $(document).on("click", "#back_to_collections", back_to_collections); -}); +console.log("inside get_traits_from_collection"); +$(".collection_line").on("click", collection_click); +$("#submit").on("click", submit_click); +$(".trait").on("click", trait_click); +$("#back_to_collections").on("click", back_to_collections);
\ No newline at end of file diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index 23e976e9..e38b32a0 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -54,10 +54,6 @@ {% endfor %} </tbody> </table> - - {# if "color_by_trait" in params #} - <script type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script> - {# endif #} </div> </div> @@ -78,6 +74,9 @@ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/DT_bootstrap/DT_bootstrap.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script> + {% if "color_by_trait" in params %} + <script type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script> + {% endif %} <script> $('#trait_table').dataTable( { "buttons": [ diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index cd2aa35e..65dd01e7 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -71,7 +71,7 @@ <th></th> <th align="right" >Factor 1</th> <th align="right" >Factor 2</th> - <th align="right" >Factor 2</th> + {% if trait_list|length > 2 %}<th align="right" >Factor 3</th>{% endif %} <!-- {% for row in loadings_array %} <th>Factor {{ loop.index }}</th> |