Added a lot of files for styling.
[scpubgit/stemmatology.git] / TreeOfTexts / root / js / interaction.js
CommitLineData
361134f0 1var colors = ['#ffeeaa','#afc6e9','#d5fff6','#e5d5ff','#ffaaaa','#e5ff80','#ffccaa','#ffd5e5'];
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();
361134f0 8 row_triggered = false;
ce14597f 9 });
10})
82fd8e05 11function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
12 if( !row_triggered ) {
54f0ce46 13 $('ellipse').attr( {stroke:'black', fill:'#fff'} )
82fd8e05 14 };
15 jQuery.each( arr_greynode_ids, function(index,value) {
16 $('.node').children('title').filter( function(index) {
17 return $(this).text() == value;
18 }).siblings('ellipse').each( function( index ) {
19 $(this).attr( {stroke:'black', fill:'#eee'} );
20 });
21 });
dbcf12a6 22 jQuery.each( arr_node_ids, function(index,value) {
23 $('.node').children('title').filter( function(index) {
24 return $(this).text() == value;
361134f0 25 }).siblings('ellipse').each( function( index ) {
26 $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
27 });
dbcf12a6 28 });
29}
361134f0 30
31// 8 columns tied to colors, based on td position I guess
32// click on row id: all colors on, remaining (unused) nodes greyed
33// click on cell: those colors on, unused nodes greyed
34// c
35
36//