From: Tara L Andrews Date: Fri, 6 Apr 2012 22:55:15 +0000 (+0200) Subject: beginnings of addition of statistical info to stexaminer X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23306161bf2eb441cd5a087d5e630e2b9ece733a;p=scpubgit%2Fstemmatology.git beginnings of addition of statistical info to stexaminer --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm index cb9990f..a0f4fcb 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm @@ -47,10 +47,13 @@ sub index :Path :Args(1) { $rhash->{'group'} = $gst; } } + # Values for TT rendering $c->stash->{variants} = $t->{'variants'}; $c->stash->{total} = $t->{'variant_count'}; $c->stash->{genealogical} = $t->{'genealogical_count'}; - $c->stash->{conflict} = $t->{'conflict_count'}; + $c->stash->{conflict} = $t->{'conflict_count'}; + # Also make a JSON stash of the data for the statistics tables + $c->stash->{reading_statistics} = to_json( $t->{'variants'} ); } else { $c->stash->{error} = 'Tradition ' . $tradition->name . 'has no stemma for analysis.'; diff --git a/stemmaweb/root/css/stexaminer.css b/stemmaweb/root/css/stexaminer.css index 9efbc54..59c523d 100644 --- a/stemmaweb/root/css/stexaminer.css +++ b/stemmaweb/root/css/stexaminer.css @@ -8,17 +8,25 @@ } #stemma_graph { height: 450px; + clear: both; float: left; width: 700px; text-align: center; border: 1px #c6dcf1 solid; } +#row_statistics { + float: left; + padding: 30px; +} #statistics { font-style: italic; margin-bottom: 25px; position: relative; top: -15px; } +#stats_template { + display: none; +} .genealogical { background: #88ffaa; } diff --git a/stemmaweb/root/js/stexaminer.js b/stemmaweb/root/js/stexaminer.js index 8645109..aa83fbc 100644 --- a/stemmaweb/root/js/stexaminer.js +++ b/stemmaweb/root/js/stexaminer.js @@ -1,18 +1,17 @@ var colors = ['#ffeeaa','#afc6e9','#d5fff6','#ffccaa','#ffaaaa','#e5ff80','#e5d5ff','#ffd5e5']; var row_triggered = false; -$(document).ready(function() { - $('.rowid').click( function() { + +function color_row( row ) { row_triggered = true; $('ellipse').attr( {stroke:'white', fill:'#fff'} ); $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} ); $('.node').children('text').attr( {stroke:'none', fill:'#000'} ); $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7'); - $(this).parent().nextAll('.clickable').children('span').click(); + row.parent().nextAll('.clickable').children('span').click(); $('td.active_variant_cell').removeClass('active_variant_cell'); row_triggered = false; - }); - $('svg').width('485px'); -}) +} + function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) { if( !row_triggered ) { $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7'); diff --git a/stemmaweb/root/src/stexaminer.tt b/stemmaweb/root/src/stexaminer.tt index 9a30643..be3f0ad 100644 --- a/stemmaweb/root/src/stexaminer.tt +++ b/stemmaweb/root/src/stexaminer.tt @@ -1,13 +1,21 @@ -[% PROCESS header.tt +[% WRAPPER header.tt pagetitle = "Stexaminer - $text_title" applicationjs = c.uri_for('/js/stexaminer.js') applicationstyle = c.uri_for('/css/stexaminer.css') %] + +[% END -%]

Stexaminer

[% text_title %]

-
-

Analyzed [% total %] variant locations, of which [% genealogical %] entirely followed the stemma. [% conflict %] readings conflicted with the stemma.

-
[% FOREACH row IN variants -%] @@ -18,6 +26,19 @@
[% svg %]
+
+

Aggregate text statistics

+
    +
  • Total number of variant locations analyzed: [% total %]
  • +
  • Number of fully genealogical locations: [% genealogical %]
  • +
  • Number of readings that conflict with the stemma: [% conflict %]
  • +
+

(Choose a row in the table to display statistics about individual readings.)

+
+
+

Statistics for readings at

+
+ [% PROCESS footer.tt %] @@ -25,7 +46,7 @@ [% SET rowclass = 'class="genealogical"' IF row.genealogical -%] [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%] - + [% FOREACH reading IN row.readings -%] [% SET cellclass = 'clickable conflict' IF reading.conflict -%] [% SET cellclass = 'clickable' IF !reading.conflict -%]
[% row.id %][% row.id %]