Jeremy Ronquillo | dae1104 | 2018-02-21 09:21:44 -0800 | [diff] [blame] | 1 | # Copyright 2017 Open Networking Foundation (ONF) |
| 2 | # |
| 3 | # Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 4 | # the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 5 | # or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 6 | # |
| 7 | # TestON is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation, either version 2 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # TestON is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 19 | # |
| 20 | |
| 21 | graphTheme <- function(){ |
| 22 | theme( plot.title = element_text( hjust = 0.5, size = 32, face ='bold' ), |
| 23 | axis.text.x = element_text( angle = 0, size = 14 ), |
| 24 | legend.position = "bottom", |
| 25 | legend.text = element_text( size = 22 ), |
| 26 | legend.title = element_blank(), |
| 27 | legend.key.size = unit( 1.5, 'lines' ), |
| 28 | legend.direction = 'horizontal', |
| 29 | plot.subtitle = element_text( size=16, hjust=1.0 ) ) |
| 30 | } |
| 31 | |
| 32 | webColor <- function( color ){ |
| 33 | switch( color, |
| 34 | red = "#FF0000", |
| 35 | redv2 = "#FF6666", # more readable version of red |
| 36 | green = "#33CC33", |
| 37 | blue = "#0033FF", |
| 38 | light_blue = "#3399FF", |
| 39 | black = "#111111", |
Jeremy Ronquillo | b407649 | 2018-05-11 13:04:16 -0700 | [diff] [blame] | 40 | yellow = "#CCCC00", |
Jeremy Ronquillo | dae1104 | 2018-02-21 09:21:44 -0800 | [diff] [blame] | 41 | purple = "#9900FF", |
| 42 | gray = "#CCCCCC", |
Jeremy Ronquillo | b407649 | 2018-05-11 13:04:16 -0700 | [diff] [blame] | 43 | darkerGray = "#666666", |
| 44 | orange = "#FF9900", |
| 45 | magenta = "#FF00FF", |
| 46 | brown = "#993300" |
| 47 | ) |
Jeremy Ronquillo | dae1104 | 2018-02-21 09:21:44 -0800 | [diff] [blame] | 48 | } |
| 49 | |
Jeremy Ronquillo | b407649 | 2018-05-11 13:04:16 -0700 | [diff] [blame] | 50 | wrapLegend <- function( byrow=TRUE ){ |
| 51 | guides( color = guide_legend( nrow = 2, byrow = byrow ) ) |
Jeremy Ronquillo | dae1104 | 2018-02-21 09:21:44 -0800 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | lastUpdatedLabel <- function(){ |
| 55 | paste( "Last Updated: ", format( Sys.time(), format = "%b %d, %Y at %I:%M %p %Z" ), sep="" ) |
| 56 | } |
| 57 | |
| 58 | defaultTextSize <- function(){ |
| 59 | theme_set( theme_grey( base_size = 26 ) ) # set the default text size of the graph. |
| 60 | } |