From da127fff099eb1f51916c9d6b4a4efee54e34c1f Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 28 May 2015 10:46:09 +0200 Subject: reproducible: use the same color for the suite of the builds_age graphs as its used by the builds_per_day graph --- bin/make_graph.py | 10 ++++++++-- bin/reproducible_html_graphs.sh | 12 +++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/make_graph.py b/bin/make_graph.py index 71ebd306..83b833c0 100755 --- a/bin/make_graph.py +++ b/bin/make_graph.py @@ -35,7 +35,7 @@ def main(): "#ce5c00", "#f57900", "#fcaf3e", \ "#a40000", "#cc0000", "#ef2929", \ "#2e3436", "#555753", "#888a85" ))') - else: + elif int(colors) < 39: r('palette(c("#fce94f", "#c4a000", "#eeeeec", "#babdb6", \ "#fcaf3e", "#ce5c00", "#ad7fa8", "#5c3566", \ "#e9b96e", "#8f5902", "#8ae234", "#4e9a06", \ @@ -43,10 +43,16 @@ def main(): "#888a85", "#2e3436", "#75507b", "#cc0000", \ "#ce5c00", "#73d216", "#edd400", "#f57900", \ "#c17d11", "#3465a4", "#666666", "#AAAAAA" ))') + elif int(colors) == 40: + r('palette(c("#4e9a06"))') + elif int(colors) == 41: + r('palette(c("#73d216"))') + elif int(colors) == 42: + r('palette(c("#8ae234"))') r('v <- t[0:nrow(t),0:'+colors+']') # make graph since day 1 r('barplot(t(v),col = 1:'+columns+', main="'+mainlabel+'", xlab="", ylab="'+ylabel+'", space=0, border=NA)') - if int(colors) < 10: + if int(colors) < 10 or int(colors) >= 40: r('legend(x="bottom",legend=colnames(t), ncol=2,fill=1:'+columns+',xjust=0.5,yjust=0,bty="n")') elif int(colors) == 12: r('legend(x="bottom",legend=colnames(t), ncol=4,fill=1:'+columns+',xjust=0.5,yjust=0,bty="n")') diff --git a/bin/reproducible_html_graphs.sh b/bin/reproducible_html_graphs.sh index 08f2653e..d6c11e72 100755 --- a/bin/reproducible_html_graphs.sh +++ b/bin/reproducible_html_graphs.sh @@ -319,13 +319,23 @@ create_png_from_table() { else sqlite3 -init ${INIT} -csv ${PACKAGES_DB} "SELECT ${FIELDS[$1]} from ${TABLE[$1]} ${WHERE_EXTRA} ORDER BY datum" >> ${TABLE[$1]}.csv fi + # this is a gross hack: normally we take the number of colors a table should have... + # for the builds_age table we only want one color, but different ones, so this hack: + COLORS=${COLOR[$1]} + if [ $1 -eq 2 ] ; then + case "$SUITE" in + testing) COLORS=40 ;; + unstable) COLORS=41 ;; + experimental) COLORS=42 ;; + esac + fi # only generate graph if the query returned data if [ $(cat ${TABLE[$1]}.csv | wc -l) -gt 1 ] ; then echo "Updating $2..." DIR=$(dirname $2) mkdir -p $DIR echo "Generating $2." - /srv/jenkins/bin/make_graph.py ${TABLE[$1]}.csv $2 ${COLOR[$1]} "${MAINLABEL[$1]}" "${YLABEL[$1]}" + /srv/jenkins/bin/make_graph.py ${TABLE[$1]}.csv $2 ${COLORS} "${MAINLABEL[$1]}" "${YLABEL[$1]}" mv $2 $BASE/$DIR [ "$DIR" = "." ] || rmdir $(dirname $2) # create empty dummy png if there havent been any results ever -- cgit v1.2.3-70-g09d2