});
});
}
+
+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 = $('<li>').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() );
+};
%]
<script type="text/javascript">
var readingstats = [% reading_statistics %];
-function show_stats( row_index ) {
- var rs = readingstats[row_index];
- var rshtml = $('#stats_template').clone();
- rshtml.find('#statrank').append( rs.id );
- $('#row_statistics').empty();
- $('#row_statistics').append( rshtml.contents() );
-};
</script>
[% END -%]
<h1>Stexaminer</h1>
<li>Total number of variant locations analyzed: [% total %]</li>
<li>Number of fully genealogical locations: [% genealogical %]</li>
<li>Number of readings that conflict with the stemma: [% conflict %]</li>
+ <li>Genealogical reading transitions by relationship type: [% todo %]</li>
</ul>
<p>(Choose a row in the table to display statistics about individual readings.)</p>
</div>
- <div id="stats_template">
- <h3>Statistics for readings at <span id="statrank"></span></h3>
+
+ <div id="stats_template" class="template">
+ <h3>Statistics for readings at <span id="statrank"></span>:</h3>
+ <!-- reading_template will be appended here for each reading -->
+ </div>
+
+ <div id="reading_template" class="template">
+ <div class="reading_statistics">
+ <span class="readinglabel"></span> - copied <span class="reading_copied"></span> times, changed <span class="reading_changed"></span> times<br/>
+ Reading root(s) at <span class="readingroots"></span><br/>
+ <!-- reading_parent_template will be appended here if there are parents -->
+ </div>
</div>
+
+ <div id="reading_parent_template" class="template">
+ <div class="parent_statistics">
+ Reading parent(s):
+ <ul class="reading_parent_list"></ul>
+ </div>
+ </div>
[% PROCESS footer.tt %]