renderInfo-class            package:graph            R Documentation

_C_l_a_s_s "_r_e_n_d_e_r_I_n_f_o"

_D_e_s_c_r_i_p_t_i_o_n:

     A container class to manage graph rendering attributes.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("renderInfo")' or
     by using the initializer '.renderInfoPrototype'.

_S_l_o_t_s:



     '_p_a_r_s': List of default rendering attributes with two items
          'nodes' and 'edges'. When not set further down the parameter
          hierarchy, these defaults will be used for all nodes/edges in
          the graph. 

     '_n_o_d_e_s': Named list of attributes specific to nodes. 

     '_e_d_g_e_s': Named list of attributes specific to edges. 

     '_g_r_a_p_h': Named list of graph-wide attributes. 


     Each item of 'nodes' and 'edges' can take arbitrary vectors, the
     only restriction is that they have to be of either length 1 or
     length equal to the number of nodes or edges, respectively.

     'pars' and 'graph' can take arbitrary skalars, the latter for both
     edges and nodes.

_M_e_t_h_o_d_s:

     The following are functions rather than methods and build the API
     to control the graphical output of a graph when it is plotted
     using 'renderGraph'. Please see 'graphRendering' for more details.



     _p_a_r_R_e_n_d_e_r_I_n_f_o, _p_a_r_R_e_n_d_e_r_I_n_f_o<- getter and setter for items of slot
          'pars'

     _n_o_d_e_R_e_n_d_e_r_I_n_f_o, _n_o_d_e_R_e_n_d_e_r_I_n_f_o<- getter and setter for items of
          slot 'nodes'

     _e_d_g_e_R_e_n_d_e_r_I_n_f_o, _e_d_g_e_R_e_n_d_e_r_I_n_f_o<- getter and setter for items of
          slot 'edges'

     _g_r_a_p_h_R_e_n_d_e_r_I_n_f_o, _g_r_a_p_h_R_e_n_d_e_r_I_n_f_o<- getter and setter for items of
          slot 'graph'


     The getters all take two arguments: 'g' is a graph object and
     'name' is a character giving the name of one of the item in the
     respective slot. When 'name' is missing this will give you the
     whole list.

     The setters are a bit more complex: 'nodeRenderInfo<-' and
     'edgeRenderInfo<-' can take


     _n_a_m_e_d _l_i_s_t _o_f _n_a_m_e_d _v_e_c_t_o_r_s where the names have to match the node
          or edge names. Items in the vector that don't match a valid
          edge or node name will be silently ignored. For undirected
          edges the order of head nodes and tail nodes in edge names is
          ignored, i.e. 'a~b' is equivalent to code{b~a}

     _n_a_m_e_d _l_i_s_t _o_f _s_k_a_l_a_r_s which will set all the attribute for all
          edges or nodes in the graph 'parRenderInfo<-'{will only take
          a list with items 'nodes', 'edges' and 'graph'. The content
          of these list items can be arbitrary named vectors.}
          'parRenderInfo<-'{takes an arbitrary list}

     Available rendering parameters for nodes are:


     _c_o_l: the color of the line drawn as node border. Defaults to
          'black'.

     _l_t_y: the type of the line drawn as node border. Defaults to
          'solid'. Valid values are the same as for the R's base
          graphic parameter 'lty'.

     _l_w_d: the width of the line drawn as node border. Defaults to '1'.
          Note that the underlying low level plotting functions do not
          support vectorized 'lwd' values. Instead, only the first item
          of the vector will be used. 

     _f_i_l_l: the color used to fill a node. Defaults to 'transparent'.

     _t_e_x_t_C_o_l: the font color used for the node labels. Defaults to
          'black'.

     _f_o_n_t_s_i_z_e:  the font size for the node labels in points. Defaults
          to '14'. Note that the fontsize will be automatically
          adjusted to make sure that all labels fit their respective
          nodes. You may want to increase the node size by supplying
          the appropriate layout parameters to \textit{Graphviz} in
          order to allow for larger fontsizes.

     _c_e_x: Expansion factor to further control the fontsize. As default,
          this parameter is not set, in which case the fontsize will be
          clipped to the node size. This mainly exists to for
          consistency with the base graphic parameters and to override
          the clipping of fontsize to nodesize.

     Available rendering parameters for edges are:


     _c_o_l: the color of the edge line. Defaults to 'black'.

     _l_t_y: the type of the edge line. Defaults to 'solid'. Valid values
          are the same as for the R's base graphic parameter 'lty'.

     _l_w_d: the width of the edge line. Defaults to '1'.

     _t_e_x_t_C_o_l: the font color used for the edge labels. Defaults to
          'black'.

     _f_o_n_t_s_i_z_e: the font size for the edge labels in points. Defaults to
          '14'.

     _c_e_x: Expansion factor to further control the fontsize. This mainly
          exists to be consistent with the base graphic parameters.

_A_u_t_h_o_r(_s):

     Deepayan Sarkar, Florian Hahne

_E_x_a_m_p_l_e_s:

     g <- randomGraph(letters[1:4], 1:3, p=0.8)
     nodeRenderInfo(g) <- list(fill=c("a"="red", "b"="green"))
     edgeRenderInfo(g) <- list(lwd=3)
     edgeRenderInfo(g) <- list(lty=3, col="red")
     parRenderInfo(g) <- list(edges=list(lwd=2, lty="dashed"),
     nodes=list(col="gray", fill="gray"))
     nodeRenderInfo(g)
     edgeRenderInfo(g, "lwd")
     edgeRenderInfo(g, c("lwd", "col"))
     parRenderInfo(g)

