A reference to a two dimensional array holding the names (and implicit
positions) of the nodes in your state graph. If you want to leave a blank
space in the diagram, include the empty string as the name of a node you
want to omit.
This is six nodes labeled A-E arranged in two rows with three nodes in each row. The middle node of the second row is omitted.
|$start_list||A reference to an array listing the start state edge(s). Each arrow should be of the form: col,row,head_direction tail_direction. The entry $node_array->[col][row] must be defined. The directions can be any of N, S, E, or W representing compass points on the centers of the sides of the nodes box. N is the top center, S is the bottom center, etc. The head_direction is the one the arrow points to. 0,0,N N is a common start edge.|
|$accept_list||A reference to an array listing the accepting states in your graph. Each entry in the array should be an ordered pair col,row. The entry $node_array->[col][row] must be defined. The only affect of a node being in the accept list is to make a doubled box around its name.|
A reference to a hash. Each key in the hash is an edge label. The
corresponding value is a list of edges. Each edge is a string with
two or three parts. The first two parts are positions and are required.
The third element is optional. It controls curving edges. If absent
the edge is straight. If present it may match /Counter.*/ for
counterclockwise, or anything else for clockwise. Trying some examples will
make more sense than what I might write.
The positions are of the same form as starting edges: col,row,direction. The tail is listed first, then the head. If you must include a self referencing edge, use exactly the same entry for tail and head. Currently this makes a small circle at that point. Self reference circles have no arrow head.
The first edge connects the south side of the node at 0,0 to the north side of the node at 0,1 with an arc curved in the counter-clockwise direction. The second edge connects the west side of the node at 0,1 to the east side of the node at 1,1. The third edge is a self reference drawn on the north side of node 1,1.
This method can be called any time after the constructor. It returns a string containing the svg for your state graph. You can print that, or parse it with standard XML techniques.
Self reference edges are just circles, they dont have arrows.
There is no way to control the placement of labels.
Only one letter labels look good.
Resizing (changing the class constants) is unreliable.
Phil Crow <email@example.com<gt>
Copyright 2003 by Phil Crow. All rights reserved. This is free software. You may modify and/or redistribute it under the same terms as Perl 5.8.0.
|perl v5.20.3||STATE (3)||2003-06-03|