[419] | 1 | This directory contains a few examples of using jgraph to draw figures.
|
---|
| 2 | They range from relatively simple to quite complex.
|
---|
| 3 |
|
---|
| 4 | I can't claim that jgraph is a better way to draw pictures than normal
|
---|
| 5 | WYSIWYG editors like MacDraw or xfig or idraw. However, it has a few
|
---|
| 6 | advantages. First, because of jgraph's string justification and rotation
|
---|
| 7 | commands, jgraph plots text more reliably than other tools. Since you
|
---|
| 8 | must specify exact points with jgraph, arrows are guaranteed to go to
|
---|
| 9 | the right places and so on. Although it's more cumbersome, it is also
|
---|
| 10 | more precise.
|
---|
| 11 |
|
---|
| 12 | Second, because jgraph is essentially a programming language, it makes
|
---|
| 13 | it easier to use tools like awk and nawk and sed to draw pictures which
|
---|
| 14 | have iterative structure. This is a failing of most WYSIWYG editors.
|
---|
| 15 | Drawing a picture like those in tree.awk would be quite difficult and
|
---|
| 16 | tedious in your standard WYSIWYG editor.
|
---|
| 17 |
|
---|
| 18 | The files are: from simplest to most complex:
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | ---- Straight jgraph files
|
---|
| 23 |
|
---|
| 24 | mlti.jgr -- A graph plotting a simple multicomputer incterconnection
|
---|
| 25 | timeline.jgr -- A graph plotting a time line of three computers
|
---|
| 26 | sending messages to one another
|
---|
| 27 | wedmap.jgr -- A map made with jgraph
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | ---- Jgraph mixed with awk/nawk/sh
|
---|
| 32 |
|
---|
| 33 | tree.awk -- This is an nawk file which will create a jgraph for any
|
---|
| 34 | m-level n-ary tree, where m and n are specified in the
|
---|
| 35 | command line arguments
|
---|
| 36 |
|
---|
| 37 | grtoj.sh -- This is a shell script mixed with nawk written by Adam
|
---|
| 38 | Buchsbaum at Princeton which is a jgraph preprocessor
|
---|
| 39 | for drawing graphs (the kind with nodes and edges, not
|
---|
| 40 | the kind with points and hash marks). He hasn't written
|
---|
| 41 | up a man page for it, but you can see how much of it works
|
---|
| 42 | with the example file grex.gtj.
|
---|
| 43 |
|
---|
| 44 | diskarray.jgr -- This is a jgraph file which shows a very neat mixture
|
---|
| 45 | of jgraph and awk. First, there is the file convert.awk,
|
---|
| 46 | which takes a jgraph file, and converts it into an awk
|
---|
| 47 | file. This awk file takes as input a pair of x and y
|
---|
| 48 | coordinates on the command line arguments, and then
|
---|
| 49 | produces the jgraph to plot the original jgraph file
|
---|
| 50 | at those coordinates in the new jgraph file. In this
|
---|
| 51 | file, disk.jgr is plotted 6 times to make a disk array.
|
---|
| 52 |
|
---|
| 53 | ckpov.jgr -- This is a similar jgraph file, which uses the more complex
|
---|
| 54 | file srm.jgr, depicting a computer screen to make a nice
|
---|
| 55 | picture.
|
---|
| 56 |
|
---|
| 57 | seq.jgr
|
---|
| 58 | conc.jgr
|
---|
| 59 | cow.jgr
|
---|
| 60 | cll.jgr
|
---|
| 61 | alg.jgr -- These are all files which comprise alg.jgr. Note that
|
---|
| 62 | they are standalone pictures. Alg.jgr simply plots all
|
---|
| 63 | of them together. Thus they show a neat way that jgraph
|
---|
| 64 | makes it easy to not duplicate work when duplicating pictures.
|
---|
| 65 |
|
---|