From: Joris van Zundert Date: Mon, 3 Oct 2011 21:26:29 +0000 (+0200) Subject: Tried to implement node coloring. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=361134f0a5a2dfd13f13ca39a1496ad15ffc0dd6;p=scpubgit%2Fstemmatology.git Tried to implement node coloring. --- diff --git a/TreeOfTexts/root/js/interaction.js b/TreeOfTexts/root/js/interaction.js index 2bda2a7..29a8cff 100644 --- a/TreeOfTexts/root/js/interaction.js +++ b/TreeOfTexts/root/js/interaction.js @@ -1,13 +1,27 @@ +var colors = ['#ffeeaa','#afc6e9','#d5fff6','#e5d5ff','#ffaaaa','#e5ff80','#ffccaa','#ffd5e5']; +var row_triggered = false; $(document).ready(function() { $('.rowid').click( function() { - $('ellipse').attr( {stroke:'black', fill:'#ccc'} ); + row_triggered = true; + $('ellipse').attr( {stroke:'black', fill:'#eee'} ); $(this).parent().nextAll('.clickable').children('span').click(); + row_triggered = false; }); }) -function color_nodes( arr_node_ids ) { +function color_nodes( column_index, arr_node_ids ) { + if( !row_triggered ) { $('ellipse').attr( {stroke:'black', fill:'#eee'} ) }; jQuery.each( arr_node_ids, function(index,value) { $('.node').children('title').filter( function(index) { return $(this).text() == value; - }).siblings('ellipse').attr( {stroke:'red', fill:'yellow'} );; + }).siblings('ellipse').each( function( index ) { + $(this).attr( {stroke:'black', fill:colors[column_index-1]} ); + }); }); } + +// 8 columns tied to colors, based on td position I guess +// click on row id: all colors on, remaining (unused) nodes greyed +// click on cell: those colors on, unused nodes greyed +// c + +// \ No newline at end of file diff --git a/TreeOfTexts/root/src/index.tt b/TreeOfTexts/root/src/index.tt index 24b31e8..39c7a0f 100644 --- a/TreeOfTexts/root/src/index.tt +++ b/TreeOfTexts/root/src/index.tt @@ -26,7 +26,7 @@ [% row.id %] [% FOREACH reading IN row.readings -%] - [% reading.text %] + [% reading.text %] [% END -%] [% FILTER repeat( row.empty ) -%]