Changeset 345
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/File.cc
r343 r345 60 60 { 61 61 return std::string("file"); 62 }63 64 65 std::string File::output_dir(void) const66 {67 return std::string();68 62 } 69 63 -
trunk/lib/Node.cc
r343 r345 169 169 const SVNlog& log) const 170 170 { 171 os << "<h 4>Author Summary</h4>";171 os << "<h3>Author Summary</h3>"; 172 172 os << "<table class=\"listings\">\n"; 173 173 os << "<thead>"; … … 200 200 color="dark"; 201 201 os << "<tr class=\"" << color << "\"><td>"; 202 if (dir()) 203 if (local_path().empty()) 204 os << anchor(*i+"/"+line_type+"/index.html" 205 ,*i, level_+2, "View statistics for "+*i); 206 else 207 os << anchor(*i+"/"+line_type+"/"+local_path()+"/index.html" 208 ,*i, level_+2, "View statistics for "+*i); 209 else 210 os << anchor(*i+"/"+line_type+"/"+local_path()+".html" 211 ,*i, level_+2, "View statistics for "+*i); 202 os << anchor(*i+"/"+line_type+output_path() 203 ,*i, level_+2, "View statistics for "+*i); 212 204 os << "</td><td>" << stats_.lines(*i) 213 205 << "</td><td>" << stats_.code(*i) -
trunk/lib/Stats.cc
r265 r345 162 162 163 163 164 std::string Stats::plot(const std::string& filename, 165 const std::string& linetype) const 164 void Stats::plot_init(const std::string& filename) const 166 165 { 167 166 GnuplotFE* gp=GnuplotFE::instance(); … … 173 172 gp->command("set key left Left reverse"); 174 173 gp->command("set multiplot"); 174 } 175 176 std::string Stats::plot(const std::string& filename, 177 const std::string& linetype) const 178 { 179 plot_init(filename); 180 GnuplotFE* gp=GnuplotFE::instance(); 175 181 const Map_* stat=NULL; 176 182 if (linetype=="total") … … 216 222 217 223 224 void Stats::plot_summary(const std::string& filename) const 225 { 226 plot_init(filename); 227 GnuplotFE* gp=GnuplotFE::instance(); 228 std::vector<u_int> total=accumulated(total_); 229 double yrange_max=1.03*total.back()+1; 230 gp->yrange(yrange_max); 231 std::stringstream ss; 232 233 ss.str(""); 234 std::vector<u_int> x=accumulated(code_); 235 ss << x.back() << " code"; 236 gp->command("set key height 2"); 237 gp->linetitle(ss.str()); 238 gp->linestyle("steps 2"); 239 gp->plot(x); 240 241 ss.str(""); 242 x=accumulated(comments_); 243 ss << x.back() << " comment"; 244 gp->command("set key height 4"); 245 gp->linetitle(ss.str()); 246 gp->linestyle("steps 3"); 247 gp->plot(x); 248 249 ss.str(""); 250 x=accumulated(empty_); 251 ss << x.back() << " other"; 252 gp->command("set key height 6"); 253 gp->linetitle(ss.str()); 254 gp->linestyle("steps 4"); 255 gp->plot(x); 256 257 ss.str(""); 258 ss << total.back() << " total"; 259 gp->command("set key height 0"); 260 gp->linetitle(ss.str()); 261 gp->linestyle("steps 1"); 262 gp->plot(total); 263 264 gp->command("unset multiplot"); 265 gp->yrange(); 266 267 } 268 269 218 270 Stats& Stats::operator+=(const Stats& other) 219 271 { -
trunk/lib/Stats.h
r244 r345 92 92 inline u_int last_changed_rev(void) const { return last_changed_rev_; } 93 93 94 void parse(const std::string&);95 96 ///97 /// Create statistics graph.98 ///99 std::string plot(const std::string&, const std::string&) const;100 101 ///102 /// @brief Clear all statistics103 ///104 inline void reset(void)105 {106 code_.clear(); comments_.clear(); empty_.clear(); total_.clear();107 authors_.clear();}108 109 ///110 ///111 ///112 inline u_int revision(void) const { return revision_; }113 114 94 /// 115 95 /// … … 122 102 inline u_int lines(const std::string& user) const 123 103 { return accumulated(total_, user).back(); } 104 105 void parse(const std::string&); 106 107 /// 108 /// Create statistics graph. 109 /// 110 std::string plot(const std::string&, const std::string&) const; 111 112 /// 113 /// Create statistics graph. 114 /// 115 void plot_init(const std::string& output) const; 116 117 /// 118 /// Summary plot for the first page 119 /// 120 void plot_summary(const std::string& output) const; 121 122 /// 123 /// @brief Clear all statistics 124 /// 125 inline void reset(void) 126 { 127 code_.clear(); comments_.clear(); empty_.clear(); total_.clear(); 128 authors_.clear(); 129 } 130 131 /// 132 /// 133 /// 134 inline u_int revision(void) const { return revision_; } 124 135 125 136 /// -
trunk/lib/first_page.cc
r317 r345 69 69 latest_commit.push_back(log.latest_commit(*i)); 70 70 71 print_summary_plot(os, stats); 71 72 print_general_information(os, log, authors.size(), url); 72 73 sort(latest_commit.begin(), latest_commit.end(), GreaterRevision()); … … 204 205 205 206 207 void print_summary_plot(std::ostream& os, const Stats& stats) 208 { 209 std::string name("summary_plot.png"); 210 stats.plot_summary(name); 211 os << "<div class=\"main\">\n"; 212 os << "<img src='" << name << "' alt='[plot]'>"; 213 os << "</div>"; 214 } 215 206 216 }} // end of namespace svndigest and namespace theplu -
trunk/lib/first_page.h
r312 r345 54 54 void print_recent_logs(std::ostream&, const SVNlog& log); 55 55 56 void print_summary_plot(std::ostream&, const Stats& stats); 57 56 58 }} // end of namespace svndigest end of namespace theplu 57 59
Note: See TracChangeset
for help on using the changeset viewer.