add rudimentary logic for text segmentation in lemmatizer
[scpubgit/stemmaweb.git] / root / js / stexaminer.js
CommitLineData
b8a92065 1var colors = ['#ffeeaa','#afc6e9','#d5fff6','#ffccaa','#ffaaaa','#e5ff80','#e5d5ff','#ffd5e5'];
2var row_triggered = false;
d5514865 3
4function color_row( row ) {
b8a92065 5 row_triggered = true;
f007ac1e 6 $('ellipse').attr( {stroke:'white', fill:'#fff'} );
b8a92065 7 $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} );
8 $('.node').children('text').attr( {stroke:'none', fill:'#000'} );
9 $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7');
d5514865 10 row.parent().nextAll('.clickable').children('span').click();
b8a92065 11 $('td.active_variant_cell').removeClass('active_variant_cell');
12 row_triggered = false;
d5514865 13}
14
b8a92065 15function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
16 if( !row_triggered ) {
17 $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7');
18 $('td.active_variant_cell').removeClass('active_variant_cell');
f007ac1e 19 $('ellipse').attr( {stroke:'white', fill:'#fff'} );
b8a92065 20 $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} );
21 $('.node').children('text').attr( {stroke:'none', fill:'#000'} );
22 };
23 $('tr.active_variant_row').removeClass('active_variant_row')
24 jQuery.each( arr_greynode_ids, function(index,value) {
25 nodes = $('.node').children('title').filter( function(index) {
26 return $(this).text() == value;
27 })
28 nodes.siblings('ellipse, polygon, text').each( function( index ) {
29 $(this).attr( {stroke:'#ddd', fill:'#f8f8f8'} );
30 });
31 });
32 jQuery.each( arr_node_ids, function(index,value) {
33 $('.node').children('title').filter( function(index) {
34 return $(this).text() == value;
35 }).siblings('ellipse').each( function( index ) {
36 $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
37 });
38 });
39}