NetDraw is free and may be freely distributed. For more
information about the program, contact its author, Steve Borgatti, at steve@analytictech.com
.
NetDraw is a program for drawing networks. It uses (or will use)
several different algorithms for laying out nodes in 2-dimensional space (3D
will come later). Netdraw reads UCINET system files, UCINET DL text files, and Pajek text files (.net,
.clu and .vec). It can save data to Pajek and to Mage. It can save diagrams as
EMF, WMF, BMP and JPG files. It can also print directly from the program at high
resolution (much better than printing document containing embedded
graphics).
The program has a number of useful features, including:
Multiple Relations.
You can read in multiple relations on the same nodes, and switch between them
(or combine them) easily.
Valued Relations.
If you read in valued data, you can sequentially “step” through different
levels of dichotomization, effectively selecting only strong ties, only weak
ties, etc. In addition, you have the option of letting the thickness of lines
correspond to strength of ties.
Node Attributes.
The program makes it convenient to read in multiple node attributes for use in
setting colors and sizes of nodes (as well as rims, labels, etc.). In addition,
the program makes it easy to turn on and off groups of nodes defined by a
variable, such as males or members of a given organization. [In addition, there
are buttons for deleting isolates and pendants.]
Analysis. A
limited set of analytical procedures are included, such as the identification of
isolates, components, k-cores, cut-points and bi-components (blocks).
2-mode Data.
NetDraw can read 2-mode data, such as the Davis, Gardner and Gardner data and
automatically create a bipartite representation of it.
Saving Pictures.
Network diagrams can be saved as bitmaps (.bmp), jpegs (.jpg), windows metafiles
(.wmf) and enhanced metafiles (.emf). In addition, the program exports to Pajek
and Mage.
Printing. There
is a Print button. This is very good for creating publication-quality diagrams
because the results utilize the full resolution of the printer. (When you save
an image like a bitmap to disk and insert into a document and then print that,
the image resolution is no better than your screen’s.)
Appearance Options.
A full range of options is implemented, including the ability to change sizes
and colors of nodes, node-rims, labels, lines and background. Different node
shapes are not yet implemented. You can also rotate, flip, shift, resize and
zoom configurations.
Layout. Two
basic kinds of layouts are implemented at present: a circle and an MDS/ spring
embedding based on geodesic distance. The MDS includes options for exaggerating
clustering, biasing toward equal-length edges, and turning on/off
node-repulsion.
Documentation
There is no documentation yet, nor online help. But the
whole idea of the program is that it should be easy to figure out. For those
users who do not use UCINET or Pajek, however, here is some documention on
the DL text file format for reading data in.
The DL
protocol is a flexible language for describing data and itself encompasses a
number of different formats. Three of these formats – nodelist, edgelist and
fullmatrix – are described here. A sample nodelist file called borg4cent.txt
is provided with the program.
Nodelist Format
This is usually the most efficient format. Just create a text file using any
word processor (make sure to remember to save as text). Enter the data in the
following format:
dl
n = 50
format = nodelist
data:
1 7 8 2
3 19 21 49 6
2 6
…
The "DL" at the top is required and identifies the type of file.
The "n=50" tells program to expect up to 50 distinct nodes. The
"format = nodelist" tells the program to expect the node list format
(as opposed to edge list and full matrix). The word "data:" (don't
forget the colon) marks the end of information about the data and the beginning
of the data itself.
The first line of the data ("1 7 8 2") says that person 1 has ties
to three people, who are 7, 8 and 2. The ordering of the people is arbitrary and
makes no difference. The second line, "3 19 21 49 6" says that person
3 has ties to four people, who are 19, 21, 49 and 6.
Important note: each value is separated by a space (or tab). Each value is a
"sequential" ID number. By "sequential" I mean that the
numbers run from 1 to n. You can't have arbitrary ID numbers like
"1001" or non-numeric IDs like "BOS007" or "Steve"
unless you add the words "Labels embedded" some time before the
"data:" statement, as follows:
dl
n = 50
labels embedded
format = nodelist
data:
binlad geobus tonblai kenski
bilste jeabar stebor judcla jandoe
kenski jandoe
…
These names or labels must be less than 20 characters long and should not
contain spaces or punctuation (as in "osama bin laden") unless they
are enclosed in full quotes.
A sample data file called borg4cent.txt using nodelist format is provided
with the program.
Edgelist Format
This format requires more typing but is convenient when entering data as one
encounters it, such as when pulling links between people from newspaper
articles. Again, create a text file using any word processor (make sure to
remember to save as text). Enter the data in the following format:
dl
n = 50
format = edgelist
data:
1 7
1 8
1 2
3 19
…
Note that "nodelist" has been replaced by "edgelist" in
the format statement. Then, after "data:", the data are in pairs,
separated by spaces or tabs. The first line ("1 7") says that persons
1 and 7 have a tie. The second line says that persons 1 and 8 have a tie. The
ordering of nodes within in a pair, and of pairs within the file, is immaterial.
As with the nodelist format, you can also use non-sequential, non-numeric IDs
as long as you add the words "Labels embedded" some time before the
"data:" statement, as follows:
dl
n = 50
labels embedded
format = edgelist
data:
binlad geobus
binlad tonblai
binlad kenski
bilste jeabar
…
FullMatrix Format
This format works well for small datasets that contain a lot of ties. Again,
create a text file using any word processor or with Excel (making sure to
remember to save as text). Enter the data in the following format:
dl
n = 5
format = fullmatrix
data:
0 0 1 0 0
0 0 0 1 1
1 0 0 1 0
0 1 1 0 0
0 1 0 0 0
Here, the format statement reads "format=fullmatrix". Then, after
"data:", the data are in the form of a person-by-person table. Since
n=5, there are 5 rows and 5 columns. The first row has values 0, 0, 1, 0, 0,
indicating that person one has ties only with the third person. In contrast, the
second row of the table shows that person 2 has ties with person 4 and person 5.
Note that this format does not have id codes at all: people are identified by
their position in the table. The third row corresponds to the third person. The
fourth column corresponds to the fourth person, and so on.
However, non-numeric labels can be added with "labels embedded"
statement as follows:
dl
n = 5
labels embedded
format = fullmatrix
data:
Bill Jan Jim Sue Zoe
Bill 0 0 1 0 0
Jan 0 0 0 1 1
Jim 1 0 0 1 0
Sue 0 1 1 0 0
Zoe 0 1 0 0 0
Typing the data is the hardest part. Once you do that, the rest is easy.
VNA Data Format
The VNA data format allows the user to store not only
network data but also attributes of the nodes, along with information about how
to display them (color, size, etc.). A key feature of VNA attribute data is that
textual data is permitted. In other words, instead of using numeric codes, the
gender variable can have values like “male” and “female”.
VNA files are ordinary text files. They consist of
sections “star sections”. Not every file has to have every section, and sections
can be in any order. At the moment, there are 4 possible star sections (soon to
be 6). They are:
*node data
*node properties
*tie data
*tie properties
A description of each follows. At the end of this document
is a complete VNA file.
Node data
The Node Data section contains variables that describe the
actors in a network. Here is an example:
*Node data
ID, gender, role, betweenness
"HOLLY" "female" "participant" "78.33333588"
"BRAZEY" "female" "participant" "0"
"CAROL" "female" "participant" "1.333333373"
"PAM" "female" "participant" "32.5"
"PAT" "female" "participant" "39.5"
"JENNIE" "female" "participant" "6.333333492"
"PAULINE" "female" "participant" "12.5"
"ANN" "female" "participant" "0.5"
"MICHAEL" "male" "participant" "58.83333206"
"BILL" "male" "participant" "0"
"LEE" "male" "participant" "5"
"DON" "male" "participant" "16.33333397"
"JOHN" "male" "participant" "0"
"HARRY" "male" "participant" "2.333333254"
"GERY" "male" "instructor" "54.66666794"
"STEVE" "male" "instructor" "16.83333397"
"BERT" "male" "instructor" "13.66666698"
"RUSS" "male" "instructor" "47.33333206"
|
The first
line (“*node data”) identifies the section as containing node data.
The line
following “*node data” is a list of variable names. The first variable is
assumed to be a unique identifier. It can be numeric or text, as long as each
node has a distinct value. If any value (for any variable) contains spaces or
other extraneous punctuation, it should be enclosed in full quotes, as in:
“John
Barrymore”
Following
the line of variable names is the actual data corresponding to those variables.
All following lines are assumed to be node data until a new star command is read
or the end of the file is reached.
Node
Properties
The node
properties section, which is often omitted, is very similar to the node
data section, except that the variables all refer to display characteristics of
the nodes, such as size, color, and shape. Here is an example:
*Node properties
ID x y color shape size shortlabel
"HOLLY" 1160 271 255 1 10 HOLLY
"BRAZEY" 1214 577 255 1 10 BRAZEY
"CAROL" 671 612 255 1 10 CAROL
"PAM" 985 127 255 1 10 PAM
"PAT" 802 402 255 1 10 PAT
"JENNIE" 729 187 255 1 10 JENNIE
"PAULINE" 69 590 255 1 10 PAULINE
"ANN" 877 818 255 1 10 ANN
"MICHAEL" 182 224 255 1 10 MICHAEL
"BILL" 380 137 255 1 10 BILL
"LEE" 617 44 255 1 10 LEE
"DON" 281 656 255 1 10 DON
"JOHN" 617 839 255 1 10 JOHN
"HARRY" 382 410 255 1 10 HARRY
"GERY" 1051 706 255 1 10 GERY
"STEVE" 64 394 255 1 10 STEVE
"BERT" 348 812 255 1 10 BERT
"RUSS" 1176 426 255 1 10 RUSS
|
As
before, the first line (“*node properties”) identifies the section as containing
node properties. The line following “*node properties” is a list of variable
names. Aside from the first variable, which must be ID, all the other variables
can be in any order, and none of them have to be there at all. But if they are
present, they must be named exactly as shown in the example. Variable “X” is the
horizontal coordinate of a node. Variable “Y” is the vertical coordinate (the
0,0 point is the top left corner of the drawing area). Variable “Color” is the
color of the node (in hexadecimal). Variable “Shape” is the shape of the node
(circle, square, up-triangle, etc.). Variable “Size” is the size of the nodes in
points. Finally, (not shown in the example), the variable “Shortlabel” gives the
label for each node (if not given, the program uses the ID code).
Following the line of variable names is the actual data corresponding to those
variables.
Tie
Data
The Tie
Data section contains dyadic data – the presence/absence or strength of tie
among pairs of nodes on one or more relations. Here is an example:
*Tie data
from to isfriend strength_of_tie
"HOLLY" "PAM" 1 1
"HOLLY" "PAT" 3 3
"HOLLY" "DON" 2 2
"BRAZEY" "LEE" 1 1
"BRAZEY" "STEVE" 2 2
"BRAZEY" "BERT" 3 3
"CAROL" "PAM" 1 1
"CAROL" "PAT" 2 2
"CAROL" "PAULINE" 3 3
"PAM" "JENNIE" 3 3
"PAM" "PAULINE" 1 1
"PAM" "ANN" 2 2
"PAT" "HOLLY" 2 2
"PAT" "CAROL" 3 3
"PAT" "JENNIE" 1 1
"JENNIE" "PAM" 3 3
"JENNIE" "PAT" 1 1
"JENNIE" "ANN" 2 2
"PAULINE" "CAROL" 3 3
"PAULINE" "PAM" 1 1
"PAULINE" "PAT" 2 2
"ANN" "PAM" 2 2
"ANN" "JENNIE" 1 1
"ANN" "PAULINE" 3 3
"MICHAEL" "HOLLY" 3 3
"MICHAEL" "DON" 1 1
"MICHAEL" "HARRY" 2 2
"BILL" "MICHAEL" 1 1
"BILL" "DON" 2 2
"BILL" "HARRY" 3 3
"LEE" "BRAZEY" 3 3
"LEE" "STEVE" 1 1
"LEE" "BERT" 2 2
"DON" "HOLLY" 2 2
"DON" "MICHAEL" 1 1
"DON" "HARRY" 3 3
"JOHN" "PAULINE" 1 1
"JOHN" "GERY" 2 2
"JOHN" "RUSS" 3 3
"HARRY" "HOLLY" 2 2
"HARRY" "MICHAEL" 1 1
"HARRY" "DON" 3 3
"GERY" "MICHAEL" 3 3
"GERY" "STEVE" 2 2
"GERY" "RUSS" 1 1
"STEVE" "LEE" 2 2
"STEVE" "BERT" 1 1
"STEVE" "RUSS" 3 3
"BERT" "LEE" 2 2
"BERT" "STEVE" 1 1
"BERT" "RUSS" 3 3
"RUSS" "GERY" 1 1
"RUSS" "STEVE" 3 3
"RUSS" "BERT" 2 2
"HOLLY" "BRAZEY" 7 7
"HOLLY" "CAROL" 17 17
"HOLLY" "JENNIE" 13 13
"HOLLY" "PAULINE" 8 8
"HOLLY" "ANN" 6 6
"HOLLY" "MICHAEL" 4 4
"HOLLY" "BILL" 12 12
"HOLLY" "LEE" 15 15
"HOLLY" "JOHN" 14 14
"HOLLY" "HARRY" 5 5
"HOLLY" "GERY" 16 16
"HOLLY" "STEVE" 11 11
"HOLLY" "BERT" 9 9
"HOLLY" "RUSS" 10 10
"BRAZEY" "HOLLY" 4 4
"BRAZEY" "CAROL" 8 8
"BRAZEY" "PAM" 5 5
"BRAZEY" "PAT" 10 10
"BRAZEY" "JENNIE" 9 9
"BRAZEY" "PAULINE" 7 7
"BRAZEY" "ANN" 6 6
"BRAZEY" "MICHAEL" 15 15
"BRAZEY" "BILL" 17 17
"BRAZEY" "DON" 11 11
"BRAZEY" "JOHN" 13 13
"BRAZEY" "HARRY" 16 16
"BRAZEY" "GERY" 14 14
"BRAZEY" "RUSS" 12 12
"CAROL" "HOLLY" 16 16
"CAROL" "BRAZEY" 10 10
"CAROL" "JENNIE" 4 4
"CAROL" "ANN" 11 11
"CAROL" "MICHAEL" 7 7
"CAROL" "BILL" 17 17
"CAROL" "LEE" 13 13
"CAROL" "DON" 14 14
"CAROL" "JOHN" 5 5
"CAROL" "HARRY" 15 15
"CAROL" "GERY" 12 12
"CAROL" "STEVE" 6 6
"CAROL" "BERT" 8 8
"CAROL" "RUSS" 9 9
"PAM" "HOLLY" 4 4
"PAM" "BRAZEY" 7 7
"PAM" "CAROL" 5 5
"PAM" "PAT" 6 6
"PAM" "MICHAEL" 9 9
"PAM" "BILL" 16 16
"PAM" "LEE" 13 13
"PAM" "DON" 10 10
"PAM" "JOHN" 8 8
"PAM" "HARRY" 11 11
"PAM" "GERY" 15 15
"PAM" "STEVE" 14 14
"PAM" "BERT" 12 12
"PAM" "RUSS" 17 17
"PAT" "BRAZEY" 6 6
"PAT" "PAM" 13 13
"PAT" "PAULINE" 5 5
"PAT" "ANN" 4 4
"PAT" "MICHAEL" 14 14
"PAT" "BILL" 17 17
"PAT" "LEE" 9 9
"PAT" "DON" 15 15
"PAT" "JOHN" 12 12
"PAT" "HARRY" 16 16
"PAT" "GERY" 10 10
"PAT" "STEVE" 8 8
"PAT" "BERT" 7 7
"PAT" "RUSS" 11 11
"JENNIE" "HOLLY" 9 9
"JENNIE" "BRAZEY" 8 8
"JENNIE" "CAROL" 5 5
"JENNIE" "PAULINE" 4 4
"JENNIE" "MICHAEL" 14 14
"JENNIE" "BILL" 17 17
"JENNIE" "LEE" 12 12
"JENNIE" "DON" 11 11
"JENNIE" "JOHN" 16 16
"JENNIE" "HARRY" 15 15
"JENNIE" "GERY" 13 13
"JENNIE" "STEVE" 6 6
"JENNIE" "BERT" 7 7
"JENNIE" "RUSS" 10 10
"PAULINE" "HOLLY" 10 10
"PAULINE" "BRAZEY" 6 6
"PAULINE" "JENNIE" 5 5
"PAULINE" "ANN" 4 4
"PAULINE" "MICHAEL" 13 13
"PAULINE" "BILL" 15 15
"PAULINE" "LEE" 11 11
"PAULINE" "DON" 16 16
"PAULINE" "JOHN" 8 8
"PAULINE" "HARRY" 17 17
"PAULINE" "GERY" 14 14
"PAULINE" "STEVE" 9 9
"PAULINE" "BERT" 7 7
"PAULINE" "RUSS" 12 12
"ANN" "HOLLY" 5 5
"ANN" "BRAZEY" 8 8
"ANN" "CAROL" 4 4
"ANN" "PAT" 7 7
"ANN" "MICHAEL" 9 9
"ANN" "BILL" 15 15
"ANN" "LEE" 14 14
"ANN" "DON" 12 12
"ANN" "JOHN" 6 6
"ANN" "HARRY" 10 10
"ANN" "GERY" 16 16
"ANN" "STEVE" 11 11
"ANN" "BERT" 13 13
"ANN" "RUSS" 17 17
"MICHAEL" "BRAZEY" 15 15
"MICHAEL" "CAROL" 5 5
"MICHAEL" "PAM" 6 6
"MICHAEL" "PAT" 7 7
"MICHAEL" "JENNIE" 13 13
"MICHAEL" "PAULINE" 11 11
"MICHAEL" "ANN" 10 10
"MICHAEL" "BILL" 14 14
"MICHAEL" "LEE" 17 17
"MICHAEL" "JOHN" 12 12
"MICHAEL" "GERY" 4 4
"MICHAEL" "STEVE" 9 9
"MICHAEL" "BERT" 8 8
"MICHAEL" "RUSS" 16 16
"BILL" "HOLLY" 8 8
"BILL" "BRAZEY" 9 9
"BILL" "CAROL" 14 14
"BILL" "PAM" 15 15
"BILL" "PAT" 11 11
"BILL" "JENNIE" 17 17
"BILL" "PAULINE" 13 13
"BILL" "ANN" 16 16
"BILL" "LEE" 10 10
"BILL" "JOHN" 12 12
"BILL" "GERY" 7 7
"BILL" "STEVE" 5 5
"BILL" "BERT" 6 6
"BILL" "RUSS" 4 4
"LEE" "HOLLY" 10 10
"LEE" "CAROL" 6 6
"LEE" "PAM" 13 13
"LEE" "PAT" 4 4
"LEE" "JENNIE" 14 14
"LEE" "PAULINE" 15 15
"LEE" "ANN" 17 17
"LEE" "MICHAEL" 11 11
"LEE" "BILL" 16 16
"LEE" "DON" 9 9
"LEE" "JOHN" 8 8
"LEE" "HARRY" 7 7
"LEE" "GERY" 12 12
"LEE" "RUSS" 5 5
"DON" "BRAZEY" 13 13
"DON" "CAROL" 15 15
"DON" "PAM" 5 5
"DON" "PAT" 6 6
"DON" "JENNIE" 7 7
"DON" "PAULINE" 8 8
"DON" "ANN" 12 12
"DON" "BILL" 17 17
"DON" "LEE" 10 10
"DON" "JOHN" 14 14
"DON" "GERY" 4 4
"DON" "STEVE" 11 11
"DON" "BERT" 9 9
"DON" "RUSS" 16 16
"JOHN" "HOLLY" 16 16
"JOHN" "BRAZEY" 5 5
"JOHN" "CAROL" 4 4
"JOHN" "PAM" 8 8
"JOHN" "PAT" 12 12
"JOHN" "JENNIE" 14 14
"JOHN" "ANN" 9 9
"JOHN" "MICHAEL" 10 10
"JOHN" "BILL" 13 13
"JOHN" "LEE" 17 17
"JOHN" "DON" 11 11
"JOHN" "HARRY" 7 7
"JOHN" "STEVE" 6 6
"JOHN" "BERT" 15 15
"HARRY" "BRAZEY" 16 16
"HARRY" "CAROL" 15 15
"HARRY" "PAM" 10 10
"HARRY" "PAT" 11 11
"HARRY" "JENNIE" 17 17
"HARRY" "PAULINE" 14 14
"HARRY" "ANN" 8 8
"HARRY" "BILL" 5 5
"HARRY" "LEE" 6 6
"HARRY" "JOHN" 4 4
"HARRY" "GERY" 9 9
"HARRY" "STEVE" 7 7
"HARRY" "BERT" 12 12
"HARRY" "RUSS" 13 13
"GERY" "HOLLY" 13 13
"GERY" "BRAZEY" 6 6
"GERY" "CAROL" 9 9
"GERY" "PAM" 14 14
"GERY" "PAT" 11 11
"GERY" "JENNIE" 15 15
"GERY" "PAULINE" 12 12
"GERY" "ANN" 16 16
"GERY" "BILL" 17 17
"GERY" "LEE" 8 8
"GERY" "DON" 7 7
"GERY" "JOHN" 5 5
"GERY" "HARRY" 10 10
"GERY" "BERT" 4 4
"STEVE" "HOLLY" 14 14
"STEVE" "BRAZEY" 5 5
"STEVE" "CAROL" 6 6
"STEVE" "PAM" 15 15
"STEVE" "PAT" 9 9
"STEVE" "JENNIE" 11 11
"STEVE" "PAULINE" 8 8
"STEVE" "ANN" 13 13
"STEVE" "MICHAEL" 12 12
"STEVE" "BILL" 17 17
"STEVE" "DON" 7 7
"STEVE" "JOHN" 10 10
"STEVE" "HARRY" 16 16
"STEVE" "GERY" 4 4
"BERT" "HOLLY" 5 5
"BERT" "BRAZEY" 4 4
"BERT" "CAROL" 10 10
"BERT" "PAM" 7 7
"BERT" "PAT" 15 15
"BERT" "JENNIE" 11 11
"BERT" "PAULINE" 8 8
"BERT" "ANN" 9 9
"BERT" "MICHAEL" 14 14
"BERT" "BILL" 13 13
"BERT" "DON" 12 12
"BERT" "JOHN" 17 17
"BERT" "HARRY" 16 16
"BERT" "GERY" 6 6
"RUSS" "HOLLY" 4 4
"RUSS" "BRAZEY" 8 8
"RUSS" "CAROL" 9 9
"RUSS" "PAM" 15 15
"RUSS" "PAT" 13 13
"RUSS" "JENNIE" 7 7
"RUSS" "PAULINE" 17 17
"RUSS" "ANN" 16 16
"RUSS" "MICHAEL" 12 12
"RUSS" "BILL" 11 11
"RUSS" "LEE" 5 5
"RUSS" "DON" 10 10
"RUSS" "JOHN" 6 6
"RUSS" "HARRY" 14 14 |
The
second line contains the list of dyadic variables (relations), except that the
first two variables are necessarily called “from” and “to” and identify the
nodes that are tied. In this example, there are two relations (called “isfriend”
and “strength_of_tie”).
Following the variable names are the actual ties. A data line such as “Holly
Pam 1 1” indicates that Holly talks to Pam and their relationship has strength
1. Values of zero are assumed to indicate the absence of a tie on a given
relation.
Putting
it all together
Not all
possible sections need to be in a given file – just one will do. Here is an
example of a file with all sections: