blob: 820c538cbcb079e94a1d50af982eb7e2bf1c894b [file] [log] [blame]
Jeremy Ronquillodae11042018-02-21 09:21:44 -08001# 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
21graphTheme <- 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
32webColor <- 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 Ronquillob4076492018-05-11 13:04:16 -070040 yellow = "#CCCC00",
Jeremy Ronquillodae11042018-02-21 09:21:44 -080041 purple = "#9900FF",
42 gray = "#CCCCCC",
Jeremy Ronquillob4076492018-05-11 13:04:16 -070043 darkerGray = "#666666",
44 orange = "#FF9900",
45 magenta = "#FF00FF",
46 brown = "#993300"
47 )
Jeremy Ronquillodae11042018-02-21 09:21:44 -080048}
49
Jeremy Ronquillob4076492018-05-11 13:04:16 -070050wrapLegend <- function( byrow=TRUE ){
51 guides( color = guide_legend( nrow = 2, byrow = byrow ) )
Jeremy Ronquillodae11042018-02-21 09:21:44 -080052}
53
54lastUpdatedLabel <- function(){
55 paste( "Last Updated: ", format( Sys.time(), format = "%b %d, %Y at %I:%M %p %Z" ), sep="" )
56}
57
58defaultTextSize <- function(){
59 theme_set( theme_grey( base_size = 26 ) ) # set the default text size of the graph.
60}