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=ef3db56f84b2c272401b85524c04ce4609ac7021;p=scpubgit%2Fstemmaweb.git get analysis info into the stexaminer, unstyled as yet --- diff --git a/root/css/stexaminer.css b/root/css/stexaminer.css index 59c523d..92c8037 100644 --- a/root/css/stexaminer.css +++ b/root/css/stexaminer.css @@ -24,7 +24,7 @@ position: relative; top: -15px; } -#stats_template { +.template { display: none; } .genealogical { diff --git a/root/js/stexaminer.js b/root/js/stexaminer.js index aa83fbc..106edf3 100644 --- a/root/js/stexaminer.js +++ b/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/root/src/stexaminer.tt b/root/src/stexaminer.tt index be3f0ad..10c4632 100644 --- a/root/src/stexaminer.tt +++ b/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 %]