From: Tara L Andrews Date: Tue, 26 Jun 2012 20:37:25 +0000 (+0200) Subject: get analysis info into the stexaminer, unstyled as yet X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3751a3c2c4eaddfa74f95582716fbddbac48f097;p=scpubgit%2Fstemmatology.git get analysis info into the stexaminer, unstyled as yet --- diff --git a/stemmaweb/root/css/stexaminer.css b/stemmaweb/root/css/stexaminer.css index 59c523d..92c8037 100644 --- a/stemmaweb/root/css/stexaminer.css +++ b/stemmaweb/root/css/stexaminer.css @@ -24,7 +24,7 @@ position: relative; top: -15px; } -#stats_template { +.template { display: none; } .genealogical { diff --git a/stemmaweb/root/js/stexaminer.js b/stemmaweb/root/js/stexaminer.js index aa83fbc..106edf3 100644 --- a/stemmaweb/root/js/stexaminer.js +++ b/stemmaweb/root/js/stexaminer.js @@ -37,3 +37,42 @@ function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) { }); }); } + +function show_stats( row_index ) { + var rs = readingstats[row_index]; + var rshtml = $('#stats_template').clone(); + rshtml.find('#statrank').append( rs.id ); + $.each( rs.readings, function( idx, rdghash ) { + var readinglabel = rdghash.readingid; + if( rdghash.text ) { + readinglabel += ' (' + rdghash.text + ')'; + } + var readingroots = rdghash.independent_occurrence.join( ', ' ); + var rdgstats = $('#reading_template').clone(); + rdgstats.find('.readinglabel').append( readinglabel ); + rdgstats.find('.reading_copied').append( rdghash.followed ); + rdgstats.find('.reading_changed').append( rdghash.not_followed ); + rdgstats.find('.reading_unclear').append( rdghash.follow_unknown ); + rdgstats.find('.readingroots').append( readingroots ); + if( ! $.isEmptyObject( rdghash.reading_parents ) ) { + var parentstats = $('#reading_parent_template').clone(); + $.each( rdghash.reading_parents, function( parentid, pdata ) { + var parentdesc = pdata.label; + if( pdata.relation ) { + parentdesc += ' - variant type ' + pdata.relation.type; + if( pdata.relation.annotation ) { + parentdesc += ' [ ' + pdata.relation.annotation + ' ]'; + } + } else { + parentdesc += ' - no syntactic relation'; + } + var parentitem = $('
  • ').append( parentdesc ); + parentstats.find('.reading_parent_list').append( parentitem ); + }); + rdgstats.find('.reading_statistics').append( parentstats.contents() ); + } + rshtml.append( rdgstats.contents() ); + }); + $('#row_statistics').empty(); + $('#row_statistics').append( rshtml.contents() ); +}; diff --git a/stemmaweb/root/src/stexaminer.tt b/stemmaweb/root/src/stexaminer.tt index be3f0ad..10c4632 100644 --- a/stemmaweb/root/src/stexaminer.tt +++ b/stemmaweb/root/src/stexaminer.tt @@ -5,13 +5,6 @@ %] [% END -%]

    Stexaminer

    @@ -32,12 +25,30 @@ function show_stats( row_index ) {
  • Total number of variant locations analyzed: [% total %]
  • Number of fully genealogical locations: [% genealogical %]
  • Number of readings that conflict with the stemma: [% conflict %]
  • +
  • Genealogical reading transitions by relationship type: [% todo %]
  • (Choose a row in the table to display statistics about individual readings.)

    -
    -

    Statistics for readings at

    + +
    +

    Statistics for readings at :

    + +
    + +
    +
    + - copied times, changed times
    + Reading root(s) at
    + +
    + +
    +
    + Reading parent(s): +
      +
      +
      [% PROCESS footer.tt %]