The NETDRAW Procedure

ODS Style Templates

ODS style templates, or styles, control the overall look of your output. An ODS style template consists of a set of style elements. A style element is a collection of style attributes that apply to a particular feature or aspect of the output. You can specify a value for each attribute in a style. See Chapter 21: Statistical Graphics Using ODS in SAS/STAT 12.1 User's Guide, for a thorough discussion of ODS Graphics.

To create your own style or to modify a style for use with ODS Graphics, you need to understand the relationships between style elements and graph features. This information is provided in the ODS Graphics documentation at http://support.sas.com/documentation/onlinedoc/base/ . You can create and modify style templates with the TEMPLATE procedure. For more information, see the section TEMPLATE Procedure: Creating a Style Template in the SAS Output Delivery System: User's Guide. Kuhfeld (2010) also offers detailed information and examples.

PROC NETDRAW Style Template

A predefined ODS style template named NETDRAW is available for the NETDRAW procedure. You can use the template to maintain a consistent appearance in all graphical output produced by the procedure.

To change the current style, specify the STYLE= option in an ODS destination statement. The specified style is applied to all output for that destination until you change or close the destination or start a new SAS session. For example, the following statement specifies that ODS should apply the NETDRAW style template to all HTML output:

ods html style=netdraw;

To disable the use of graphical styles, specify the SAS system option NOGSTYLE.

The parent style template for the NETDRAW style is the DEFAULT style. Table 9.7 lists the style elements (in bold) and corresponding attributes specified in the NETDRAW style. The table also indicates which, if any, PROC NETDRAW options or graphics options (in a GOPTIONS statement) can be used to override the value of a style attribute.

Table 9.7: Style Elements and Attributes in the NETDRAW Style

Element/Attributes

Description

NETDRAW Option

GOPTION

GraphColors

Colors of various graph features

   

gdata1

Noncritical nodes or nodes in the first zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata2

Critical nodes or nodes in the second zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata3

Nodes in the third zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata4

Nodes in the fourth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata5

Nodes in the fifth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata6

Nodes in the sixth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata7

Nodes in the seventh zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata8

Nodes in the eighth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata9

Nodes in the ninth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata10

Nodes in the tenth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata11

Nodes in the eleventh zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gdata12

Nodes in the twelfth zone

PATTERN=, ZONEPAT

CPATTERN=, COLORS=

gaxis

Borderlines

 

COLORS=

greferencelines

Horizontal and vertical reference lines

 

COLORS=

gtext

Text

 

CTEXT=

gtextt

Title

 

CTITLE=

gcdata

Arcs

 

COLORS=

GraphFonts

Fonts for various graph features

   

GraphDataFont

Default

 

FTEXT=

GraphLabelFont

Annotation text

 

FTEXT=

GraphTitleFont

Title text

 

FTITLE=

GraphAxisLines

Attributes related to graph axes

   

Color

GraphColors('gaxis')

CAXIS=

COLORS=

GraphConnectLine

Attributes related to arcs

   

Color

GraphColors('gcdata')

CARCS=, CCRITARCS=

COLORS=

GraphReference

Attributes related to horizontal and vertical reference lines

   

Color

GraphColors('greferencelines')

CREF=, CREFBRK=

COLORS=

GraphDataText

Attributes related to general text

   

Color

GraphColors('gtext')

CTEXT=

CTEXT=

Font

GraphFonts('GraphDataFont')

FONT=

FTEXT=

GraphTitleText

Attributes related to title text

   

Color

GraphColors('gtextt')

 

CTITLE=

Font

GraphFonts('GraphTitleFont')

 

FTITLE=

GraphLabelText

Attributes related to annotation text

   

Color

GraphColors('glabel')

 

CTEXT=

Font

GraphFonts('GraphLabelFont')

 

FTEXT=

GraphDataDefault

Default values for the attributes specified in Table 9.8

   

Color

GraphColors('gdata')

 

COLORS=

GraphBackground

Attributes related to graph background

   

Image

Background image

 

CBACK=


Attributes that you do not override retain the values specified in the style template.

Figure 9.9 demonstrates features of the NETDRAW graphical style. The diagram in the figure is the first output from Example 9.11.

Figure 9.9: NETDRAW Style Template: Example

NETDRAW Style Template: Example


Default Values

If the SAS system option GSTYLE is in effect (this is the default), then the default values of certain PROC NETDRAW options can depend on the current ODS style template. Table 9.8 lists these PROC NETDRAW options and lists the order in which PROC NETDRAW searches for each option’s default value. The order assumes that the GSTYLE system option is in effect; if that is not the case, then the steps that refer to ODS style templates are ignored. Names with arguments indicate style elements and attributes of the current ODS style template. For example, GraphAxisLines('Color') refers to the Color attribute of the GraphAxisLines element.

Table 9.8: PROC NETDRAW Options: Search Orders for Default Values

Option

 

Search Order for Default Value

CARCS=

1.

GraphConnectLine(Color)

 

2.

The fourth color in the COLORS= list in the GOPTIONS statement

CAXIS=

1.

GraphAxisLines(Color)

 

2.

GraphDataDefault(Color)

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CREF=

1.

GraphReference(Color)

 

2.

GraphDataDefault(Color)

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CREFBRK=

1.

GraphReference(Color)

 

2.

GraphDataDefault(Color)

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CTEXT=

1.

The value specified for the CTEXT= option in the GOPTIONS statement

 

2.

GraphDataText(Color)

 

3.

GraphDataDefault(Color)

 

4.

The first color in the COLORS= list in the GOPTIONS statement

FONT=

1.

The value specified for the FTEXT= option in the GOPTIONS statement

 

2.

GraphDataText(Font)

 

3.

The default hardware font for the graphics output device