Changeset 864


Ignore:
Timestamp:
Nov 20, 2009, 9:12:30 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #97. All plots generated. Now its time to go for publication quality plots.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r847 r864  
    22
    33/*
    4   Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2009 Peter Johansson
     4  Copyright (C) 2005, 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
    65
    76  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    3938#include <list>
    4039#include <map>
     40#include <sstream>
    4141
    4242#include <cerrno> // Needed to check error state below.
     
    180180                   local_path()+"/index.html", stats_type);
    181181    path_anchor(os);
    182     os << "<p class=\"plot\">\n<img src='";
     182
     183    std::stringstream ss;
    183184    for (size_t i=0; i<level_; ++i)
    184       os << "../";
    185     os << "../../../";
     185      ss << "../";
     186    ss << "../../../";
    186187    if (user=="all")
    187       os << stats.plot(imagedir+"/index.png", line_type);
     188      ss << stats.plot(imagedir+"/index.svg", line_type);
    188189    else
    189       os << imagedir << "/index.png";
    190     os << "' alt='[plot]' /></p>\n";
     190      os << imagedir << "/index.svg";
     191    os << "<p class=\"plot\">\n";
     192    os << "<object data='" << ss.str() << "' type='image/svg+xml' width='600'\n"
     193       << "<embed src='" << ss.str() << "' type='image/svg+xml' width='600' />\n"
     194       << "</object>\n";
     195    os << "</p>\n";
     196
    191197    os << "<h3>File Summary";
    192198    if (user!="all")
  • trunk/lib/File.cc

    r858 r864  
    4141#include <stdexcept>
    4242#include <string>
     43#include <sstream>
    4344#include <sys/stat.h>
    4445
     
    363364    std::string outpath = stats_type+"/"+user+"/"+line_type+"/"+lpath;
    364365    std::string imagefile = stats_type+"/"+"images/"+line_type+"/"+
    365       lpath+".png";
     366      lpath+".svg";
    366367    std::string html_name(outpath + ".html");
    367368    std::ofstream os(html_name.c_str());
     
    369370                 stats_type);
    370371    path_anchor(os);
    371     os << "<p class=\"plot\">\n<img src='";
     372
     373    std::stringstream ss;
    372374    for (size_t i=0; i<level_; ++i)
    373       os << "../";
    374     os << "../../../";
     375      ss << "../";
     376    ss << "../../../";
    375377    if (user=="all")
    376       os << stats_[stats_type].plot(imagefile,line_type);
     378      ss << stats_[stats_type].plot(imagefile,line_type);
    377379    else
    378       os << imagefile;
    379     os << "' alt='[plot]' />\n</p>";
     380      ss << imagefile;
     381    os << "<p class=\"plot\">\n";
     382    os << "<object data='" << ss.str() << "' type='image/svg+xml' width='600'\n"
     383       << "<embed src='" << ss.str() << "' type='image/svg+xml' width='600' />\n"
     384       << "</object>\n";
     385    os << "</p>\n";
    380386
    381387    print_author_summary(os, stats_[stats_type], line_type, log);
  • trunk/lib/Stats.cc

    r863 r864  
    352352                          const std::string& linetype) const
    353353  {
    354     return filename;
    355354    assert(total_stats().size());
    356355    Graph gp(filename);
     
    401400      ss << "steps " << --plotno+2;
    402401//      gp->linestyle(ss.str());
    403 //      gp->plot(i->second);
     402      // the RGB values below must be replaced ... seg fault will happen!
     403      gp.current_colour(25*plotno,255-25*plotno,75);
     404      gp.plot(i->second);
    404405    }
    405406    ss.str("");
     
    407408//    gp->command("set key height 0");
    408409//    gp->linetitle(ss.str());
    409 //    gp->linestyle("steps 1");
    410 //    gp->plot(total);
     410    gp.current_colour(255,0,0);
     411    gp.plot(total);
    411412
    412413    return filename;
Note: See TracChangeset for help on using the changeset viewer.