get analysis info into the stexaminer, unstyled as yet
[scpubgit/stemmatology.git] / stemmaweb / root / src / stexaminer.tt
index d74d93d..10c4632 100644 (file)
@@ -1,37 +1,70 @@
-[% BLOCK js %]
-    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
-    <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
-    <script type="text/javascript" src="js/interaction.js"></script>
-[% END %]
+[% WRAPPER header.tt
+       pagetitle = "Stexaminer - $text_title"
+       applicationjs = c.uri_for('/js/stexaminer.js')
+       applicationstyle = c.uri_for('/css/stexaminer.css')
+%]
+<script type="text/javascript">
+var readingstats = [% reading_statistics %];
+</script>
+[% END -%]
+    <h1>Stexaminer</h1>
+    <h2>[% text_title %]</h2>
+    <div id="variants_table">
+      <table>
+[% FOREACH row IN variants -%]
+[% INCLUDE variantrow %]
+[% END -%]
+     </table>
+    </div>
+    <div id="stemma_graph">
+      [% svg %]
+    </div>
+    <div id="row_statistics">
+      <h3>Aggregate text statistics</h3>
+      <ul>
+       <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" 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 %]
+    
 
 [% BLOCK variantrow -%]
 [% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
 [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
         <tr [% rowclass %]>
-          <th><span class="rowid">[% row.id %]</span></th>
+          <th><span class="rowid" onclick="color_row($(this));show_stats($(this).parent().parent().index())">[% row.id %]</span></th>
 [% FOREACH reading IN row.readings -%]
 [% SET cellclass = 'clickable conflict' IF reading.conflict -%]
 [% SET cellclass = 'clickable' IF !reading.conflict -%]
-          <td class="[% cellclass %]"><span onclick="color_nodes($(this).parent().index(), [% reading.group %], [% reading.missing %]);$(this).parents('tr').addClass('active_variant_row');$(this).parent().addClass('active_variant_cell cellb'+($(this).parent().index()-1))">[% reading.text %]</span></td>
+          <td class="[% cellclass %]"><span onclick="color_nodes($(this).parent().index(), [% reading.group %], [% row.missing %]);$(this).parents('tr').addClass('active_variant_row');$(this).parent().addClass('active_variant_cell cellb'+($(this).parent().index()-1))">[% reading.text %]</span></td>
 [% END -%]
 [% FILTER repeat( row.empty ) -%]
           <td/>
 [% END -%]
         </tr>
 [% END -%]
-    <h1>Stexaminer</h1>
-    <h2>[% text_title %]</h2>
-    <div id="statistics">
-      <p>Analyzed [% total %] variant locations, of which [% genealogical %] entirely followed the stemma.  [% conflict %] readings conflicted with the stemma.</p>
-    </div>
-    <div id="svg_graph">
-      [% svg %]
-    </div>
-    <div id="variants_table">
-      <table>
-[% FOREACH row IN variants -%]
-[% INCLUDE variantrow %]
-[% END -%]
-     </table>
-    </div>
-