Changeset 855
- Timestamp:
- Nov 19, 2009, 2:56:28 PM (14 years ago)
- Location:
- branches/replacing_gnuplot
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/replacing_gnuplot/bin/Makefile.am
r845 r855 31 31 LDADD = $(top_builddir)/lib/libsvndigest.a \ 32 32 $(top_builddir)/lib/yat/libyat.a $(SVNDIGEST_LIBS) 33 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) 33 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS) 34 34 35 35 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS) -
branches/replacing_gnuplot/bin/svndigest.cc
r845 r855 27 27 #include "Directory.h" 28 28 #include "first_page.h" 29 #include "GnuplotFE.h"30 29 #include "html_utility.h" 31 30 #include "rmdirhier.h" … … 179 178 dates.push_back(iter->date()); 180 179 } 181 GnuplotFE::instance()->set_dates(dates);180 // GnuplotFE::instance()->set_dates(dates); 182 181 } 183 182 if (chdir(option->targetdir().c_str()) ) { … … 190 189 exit(-1); 191 190 } 192 GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/"193 +tree->name()+"'");191 // GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/" 192 // +tree->name()+"'"); 194 193 print_css("svndigest.css"); 195 194 print_main_page(tree->name(), tree->log(), stats, tree->url()); -
branches/replacing_gnuplot/lib/Graph.cc
r788 r855 25 25 namespace svndigest { 26 26 27 Graph::Graph(void) 27 std::vector<std::string> Graph::xticks_; 28 29 Graph::Graph(const std::string& filename) 30 { 31 pls_.sdev("svg"); 32 pls_.sfnam((filename+".svg").c_str()); 33 pls_.init(); 34 pls_.adv(0); 35 pls_.scolbg(0,100,0); 36 pls_.rgb(255,0,0); 37 pls_.vsta(); 38 } 39 40 Graph::~Graph(void) 28 41 { 29 42 } 30 43 44 bool Graph::date_xticks(void) 45 { 46 return xticks_.size() != 0; 47 } 48 49 50 void Graph::plot(const std::vector<unsigned int>& x) 51 { 52 pls_.wind(0, x.size(), 0, x.back()); 53 pls_.box("bcnstd", 100, 5, "bcnstv", 100, 5); 54 for (unsigned int i=1; i<x.size(); ++i) { 55 pls_.join(i-1,x[i-1],i-1,x[i]); 56 pls_.join(i-1,x[i],i,x[i]); 57 } 58 } 59 60 61 const std::vector<std::string>& Graph::xticks(void) 62 { 63 return xticks_; 64 } 65 66 67 double Graph::yrange(double ymax) 68 { 69 return ymax; 70 } 71 31 72 }} // end of namespace svndigest and namespace theplu -
branches/replacing_gnuplot/lib/Graph.h
r789 r855 26 26 #include <vector> 27 27 28 #include <plplot/plstream.h> 29 28 30 namespace theplu { 29 31 namespace svndigest { … … 36 38 \brief Constructor 37 39 */ 38 Graph(void); 40 Graph(const std::string& filename); 41 42 /** 43 \brief Destructor 44 */ 45 ~Graph(void); 39 46 40 47 static bool date_xticks(void); 48 49 void plot(const std::vector<unsigned int>&); 50 41 51 static const std::vector<std::string>& xticks(void); 52 53 double yrange(double ymax=0.0); 54 55 private: 56 plstream pls_; 57 static std::vector<std::string> xticks_; 42 58 }; 43 59 -
branches/replacing_gnuplot/lib/Stats.cc
r845 r855 25 25 26 26 #include "Functor.h" 27 #include "G nuplotFE.h"27 #include "Graph.h" 28 28 #include "SVNblame.h" 29 29 #include "SVNinfo.h" … … 352 352 const std::string& linetype) const 353 353 { 354 return filename; 354 355 assert(total_stats().size()); 355 plot_init(filename); 356 GnuplotFE* gp=GnuplotFE::instance(); 356 Graph gp(filename); 357 357 const Author2Vector* stat=NULL; 358 358 if (linetype=="total") … … 369 369 std::vector<unsigned int> total=get_vector(*stat, "all"); 370 370 double yrange_max=1.03*total.back()+1; 371 gp ->yrange(yrange_max);371 gp.yrange(yrange_max); 372 372 373 373 typedef std::vector<std::pair<std::string, std::vector<unsigned int> > > vec_type; … … 393 393 ss.str(""); 394 394 ss << "set key height " << 2*plotno; 395 gp->command(ss.str());395 // gp->command(ss.str()); 396 396 ss.str(""); 397 397 ss << get_back(*stat, i->first) << " " << i->first; 398 gp ->yrange(yrange_max);399 gp->linetitle(ss.str());398 gp.yrange(yrange_max); 399 // gp->linetitle(ss.str()); 400 400 ss.str(""); 401 401 ss << "steps " << --plotno+2; 402 gp->linestyle(ss.str());403 gp->plot(i->second);402 // gp->linestyle(ss.str()); 403 // gp->plot(i->second); 404 404 } 405 405 ss.str(""); 406 406 ss << get_back(*stat, "all") << " total"; 407 gp->command("set key height 0"); 408 gp->linetitle(ss.str()); 409 gp->linestyle("steps 1"); 410 gp->plot(total); 411 412 gp->command("unset multiplot"); 413 gp->yrange(); 407 // gp->command("set key height 0"); 408 // gp->linetitle(ss.str()); 409 // gp->linestyle("steps 1"); 410 // gp->plot(total); 411 412 // gp->command("unset multiplot"); 414 413 415 414 return filename; … … 417 416 418 417 419 void Stats::plot_init(const std::string& filename) const420 {421 GnuplotFE* gp=GnuplotFE::instance();422 gp->command("set term png");423 gp->command("set output '"+filename+"'");424 gp->command("set xtics nomirror");425 gp->command("set ytics nomirror");426 gp->command("set key default");427 gp->command("set key left Left reverse");428 gp->command("set multiplot");429 }430 431 432 418 void Stats::plot_summary(const std::string& filename) const 433 419 { 434 plot_init(filename); 435 GnuplotFE* gp=GnuplotFE::instance(); 420 Graph gp(filename); 436 421 std::vector<unsigned int> total = get_vector(total_stats(), "all"); 437 422 double yrange_max=1.03*total.back()+1; 438 gp ->yrange(yrange_max);423 gp.yrange(yrange_max); 439 424 std::stringstream ss; 440 425 … … 442 427 std::vector<unsigned int> x(get_vector(code_stats(), "all")); 443 428 ss << x.back() << " code"; 444 gp->command("set key height 2");445 gp->linetitle(ss.str());446 gp->linestyle("steps 2");447 gp->plot(x);429 // gp->command("set key height 2"); 430 // gp->linetitle(ss.str()); 431 // gp->linestyle("steps 2"); 432 // gp->plot(x); 448 433 449 434 ss.str(""); 450 435 x = get_vector(comment_or_copy_stats(), "all"); 451 436 ss << x.back() << " comment"; 452 gp->command("set key height 4");453 gp->linetitle(ss.str());454 gp->linestyle("steps 3");455 gp->plot(x);437 // gp->command("set key height 4"); 438 // gp->linetitle(ss.str()); 439 // gp->linestyle("steps 3"); 440 // gp->plot(x); 456 441 457 442 ss.str(""); 458 443 x = get_vector(other_stats(), "all"); 459 444 ss << x.back() << " other"; 460 gp->command("set key height 6");461 gp->linetitle(ss.str());462 gp->linestyle("steps 4");463 gp->plot(x);445 // gp->command("set key height 6"); 446 // gp->linetitle(ss.str()); 447 // gp->linestyle("steps 4"); 448 // gp->plot(x); 464 449 465 450 ss.str(""); 466 451 ss << total.back() << " total"; 467 gp->command("set key height 0"); 468 gp->linetitle(ss.str()); 469 gp->linestyle("steps 1"); 470 gp->plot(total); 471 472 gp->command("unset multiplot"); 473 gp->yrange(); 452 // gp->command("set key height 0"); 453 // gp->linetitle(ss.str()); 454 // gp->linestyle("steps 1"); 455 gp.plot(total); 456 457 // gp->command("unset multiplot"); 474 458 } 475 459 -
branches/replacing_gnuplot/lib/Stats.h
r784 r855 192 192 Author2Vector& map); 193 193 194 ///195 /// Init statistics graph.196 ///197 void plot_init(const std::string& output) const;198 199 194 std::set<std::string> authors_; 200 195 -
branches/replacing_gnuplot/lib/first_page.cc
r784 r855 226 226 void print_summary_plot(std::ostream& os, const Stats& stats) 227 227 { 228 std::string name("summary_plot .png");228 std::string name("summary_plot"); 229 229 stats.plot_summary(name); 230 230 os << "<div class=\"main\">\n";
Note: See TracChangeset
for help on using the changeset viewer.