Attached is a patch that allows the user of sqlt-graph to choose what
type of arrowhead should be drawn on directed edges.

(I usually draw 'crow'-style heads on database diagrams, so that is
the motivation for making it configurable).


  Best wishes,

   Adam

-- 
                                                          Adam Sjøgren
                                                    [EMAIL PROTECTED]

diff -rup SQL-Translator-0.07.orig/bin/sqlt-graph SQL-Translator-0.07/bin/sqlt-graph
--- SQL-Translator-0.07.orig/bin/sqlt-graph	2006-10-19 13:56:37.000000000 +0200
+++ SQL-Translator-0.07/bin/sqlt-graph	2006-10-19 13:56:37.000000000 +0200
@@ -39,6 +39,11 @@ sqlt-graph - Automatically create a grap
                        "ellipse," "circle," "egg," "triangle," "box," 
                        "diamond," "trapezium," "parallelogram," "house," 
                        "hexagon," "octagon," default "record")
+    -e|--edge-arrowhead Shape of the head of the edges ("none",
+                        "normal", "inv", "dot", "odot", "invdot",
+                        "invodot", "tee", "empty", "invempty", "open",
+                        "halfopen", "diamond", "odiamond", "box",
+                        "obox", "crow", default "normal")
     -o|--output        Output file name (default STDOUT)
     -t|--output-type   Output file type ("canon", "text," "ps," "hpgl,"
                        "pcl," "mif," "pic," "gd," "gd2," "gif," "jpeg,"
@@ -100,8 +105,8 @@ $VERSION = sprintf "%d.%02d", q$Revision
 # Get arguments.
 #
 my ( 
-    $layout, $node_shape, $out_file, $output_type, $db_driver, $add_color, 
-    $natural_join, $join_pk_only, $skip_fields, $show_datatypes,
+    $layout, $node_shape, $edge_arrowhead, $out_file, $output_type, $db_driver,
+    $add_color, $natural_join, $join_pk_only, $skip_fields, $show_datatypes,
     $show_sizes, $show_constraints, $debug, $help, $height, $width,
     $no_fields
 );
@@ -111,6 +116,7 @@ GetOptions(
     'o|output:s'       => \$out_file,
     'l|layout:s'       => \$layout,
     'n|node-shape:s'   => \$node_shape,
+    'e|edge-arrowhead:s' => \$edge_arrowhead,
     't|output-type:s'  => \$output_type,
     'height:f'         => \$height,
     'width:f'          => \$width,
@@ -139,6 +145,7 @@ my $translator           =  SQL::Transla
         out_file         => $out_file,
         layout           => $layout,
         node_shape       => $node_shape,
+        edge_arrowhead   => $edge_arrowhead,
         output_type      => $output_type,
         add_color        => $add_color,
         natural_join     => $natural_join,
diff -rup SQL-Translator-0.07.orig/lib/SQL/Translator/Producer/GraphViz.pm SQL-Translator-0.07/lib/SQL/Translator/Producer/GraphViz.pm
--- SQL-Translator-0.07.orig/lib/SQL/Translator/Producer/GraphViz.pm	2006-10-19 13:56:05.000000000 +0200
+++ SQL-Translator-0.07/lib/SQL/Translator/Producer/GraphViz.pm	2006-10-19 13:56:05.000000000 +0200
@@ -72,6 +72,13 @@ one of 'record', 'plaintext', 'ellipse',
 'triangle', 'box', 'diamond', 'trapezium', 'parallelogram',
 'house', 'hexagon', or 'octagon'
 
+=item * edge_arrowhead (DEFAULT: 'normal')
+
+sets the type of arrowhead used on the all the edges the graph; this
+can be one of 'none', 'normal', 'inv', 'dot', 'odot', 'invdot',
+'invodot', 'tee', 'empty', 'invempty', 'open', 'halfopen', 'diamond',
+'odiamond', 'box', 'obox', or 'crow'
+
 =item * output_type (DEFAULT: 'png')
 
 sets the file type of the output graphic; possible values are
@@ -216,6 +223,7 @@ sub produce {
     my $out_file         = $args->{'out_file'}    || '';
     my $layout           = $args->{'layout'}      || 'dot';
     my $node_shape       = $args->{'node_shape'}  || 'record';
+    my $edge_arrowhead   = $args->{'edge_arrowhead'} || 'normal';
     my $output_type      = $args->{'output_type'} || 'png';
     my $width            = defined $args->{'width'} 
                            ? $args->{'width'} : 8.5;
@@ -263,6 +271,9 @@ sub produce {
             shape     => $node_shape, 
             style     => 'filled', 
             fillcolor => 'white' 
+        },
+        edge          => {
+            arrowhead => $edge_arrowhead
         }
     );
     $args{'width'}  = $width  if $width;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-- 
sqlfairy-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers

Reply via email to