beginnings of addition of statistical info to stexaminer
[scpubgit/stemmatology.git] / stemmaweb / lib / stemmaweb / Controller / Stexaminer.pm
index 1449ad2..a0f4fcb 100644 (file)
@@ -37,7 +37,7 @@ sub index :Path :Args(1) {
                $c->stash->{text_title} = $tradition->name;
                $c->stash->{template} = 'stexaminer.tt'; 
                # TODO Run the analysis as AJAX from the loaded page.
-               my $t = run_analysis( $tradition );
+               my $t = run_analysis( $tradition, 'exclude_type1' => 1 );
                # Stringify the reading groups
                foreach my $loc ( @{$t->{'variants'}} ) {
                        my $mst = wit_stringify( $loc->{'missing'} );
@@ -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.';