add some final statistics; try to color anonymous nodes too
[scpubgit/stemmatology.git] / TreeOfTexts / root / js / interaction.js
CommitLineData
81422c40 1var colors = ['#ffeeaa','#afc6e9','#d5fff6','#ffccaa','#ffaaaa','#e5ff80','#e5d5ff','#ffd5e5'];
361134f0 2var row_triggered = false;
ce14597f 3$(document).ready(function() {
4 $('.rowid').click( function() {
361134f0 5 row_triggered = true;
82fd8e05 6 $('ellipse').attr( {stroke:'black', fill:'#fff'} );
ce14597f 7 $(this).parent().nextAll('.clickable').children('span').click();
964be5fa 8 $('tr.active_variant_row').find('td').removeClass( 'active_variant_cell' );
361134f0 9 row_triggered = false;
ce14597f 10 });
11})
82fd8e05 12function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
13 if( !row_triggered ) {
54f0ce46 14 $('ellipse').attr( {stroke:'black', fill:'#fff'} )
82fd8e05 15 };
16 jQuery.each( arr_greynode_ids, function(index,value) {
17 $('.node').children('title').filter( function(index) {
18 return $(this).text() == value;
19 }).siblings('ellipse').each( function( index ) {
0a8f09a9 20 $(this).attr( {stroke:'black', fill:'#444'} );
82fd8e05 21 });
22 });
dbcf12a6 23 jQuery.each( arr_node_ids, function(index,value) {
24 $('.node').children('title').filter( function(index) {
25 return $(this).text() == value;
361134f0 26 }).siblings('ellipse').each( function( index ) {
27 $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
28 });
dbcf12a6 29 });
30}
361134f0 31
32// 8 columns tied to colors, based on td position I guess
33// click on row id: all colors on, remaining (unused) nodes greyed
34// click on cell: those colors on, unused nodes greyed
35// c
36
37//