Graph-Easy

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

  * Parser/VGC:
    + attributes like "node.color:" are valid for all following nodes only
  * as_graphviz():
    + suppress style and peripheries for borderwidth == 0

2007-11-19 v0.60 Tels 2700 tests
  * Base:
    + prepend 'Warning: ' to warnings
  * Graph::Easy:
    + add add_anon_node()
    + _class_styles(): allow extra class names in overlay (for SVG)
    + fix typo in SYNOPSIS (thanx skim!)
  * Graph::Easy::Node:
    + set attributes for origin/offset properly, too, so that get_attribute()
      works for these (Thanx Amanda B Hickman!)
    + allow numbers on custom attributes so "infoname1" in VCG works correctly
  * Parser:
    + warn on nodes with offset, but no origin (Thanx Amanda B Hickman!)
  * Parser/VCG:
    + allow "layoutalgorithm" (Thanx Sid Touati for the report!)
    + handle 'classname 1: "foo"' correctly (Thanx Sid Touati again!)

CHANGES  view on Meta::CPAN

  * as_html(): put the "empty-cells" definition inside table.graph
  * as_html(): create links on graph label (caption) if requested
  * as_html(): include the graph label into the table, this looks more
		consistent than the <caption>, which placed it floating above
		or below the graph
  * as_html(): repaired the output of group cells (see t/fun/0131.txt)
  * as_ascii(): do not draw border for nodes with "shape: none;"
  * as_graphviz(): nodes with shape none work now correctly
  * as_graphviz(): color of edge labels falls back to edge color if no
		   label-color is specified (was formerly rendered black)
  * _css_styles(): inplement $overlay support (add custom attributes) and
                   skip the border-attribute generation if it matches $skip
		   (both fixes are mainly for SVG output)
  * setting attributes on Edges/Nodes/Groups invalidates a former layout

2005-09-23 v0.30 Tels 1114 tests - Draw, draw, draw, draw the corners...
  * ascii.t could fail on very slow machines
  * fix pod/t. and pod_cov.t when the Pod::Test modules are not installed
  * fix as_ascii_html() to end with "</pre>"
  * as_html(): do not combine non-empty cells

lib/Graph/Easy.pm  view on Meta::CPAN

  for my $g (ord_values ( $self->{groups} ))
    {
    if (ref($g))
      {
      delete $g->{nodes};
      delete $g->{edges};
      }
    }
  }

# Attribute overlay for HTML output:

my $html_att = {
  node => {
    borderstyle => 'solid',
    borderwidth => '1px',
    bordercolor => '#000000',
    align => 'center',
    padding => '0.2em',
    'padding-left' => '0.3em',
    'padding-right' => '0.3em',

lib/Graph/Easy.pm  view on Meta::CPAN


sub _class_styles
  {
  # Create the style sheet with the class lists. This is used by both
  # css() and as_svg(). $skip is a qr// object that returns true for
  # attribute names to be skipped (e.g. excluded), and $map is a
  # HASH that contains mapping for attribute names for the output.
  # "$base" is the basename for classes (either "table.graph$id" if
  # not defined, or whatever you pass in, like "" for svg).
  # $indent is a left-indenting spacer like "  ".
  # $overlay contains a HASH with attribute-value pairs to set as defaults.

  my ($self, $skip, $map, $base, $indent, $overlay) = @_;

  my $a = $self->{att};

  $indent = '' unless defined $indent;
  my $indent2 = $indent x 2; $indent2 = '  ' if $indent2 eq '';

  my $class_list = { edge => {}, node => {}, group => {} };
  if (defined $overlay)
    {
    $a = {};

    # make a copy from $self->{att} to $a:

    for my $class (sort keys %{$self->{att}})
      {
      my $ac = $self->{att}->{$class};
      $a->{$class} = {};
      my $acc = $a->{$class};
      for my $k (sort keys %$ac)
        {
        $acc->{$k} = $ac->{$k};
        }
      }

    # add the extra keys
    for my $class (sort keys %$overlay)
      {
      my $oc = $overlay->{$class};
      # create the hash if it doesn't exist yet
      $a->{$class} = {} unless ref $a->{$class};
      my $acc = $a->{$class};
      for my $k (sort keys %$oc)
        {
        $acc->{$k} = $oc->{$k} unless exists $acc->{$k};
        }
      $class_list->{$class} = {};
      }
    }

lib/Graph/Easy/As_ascii.pm  view on Meta::CPAN

  # make a copy so that we can modify it
  my $g = $self->{graph}->{_ascii_style} || 0;
  my $s = [ @{ $border_styles->[ $g ]->{$style} } ];

  die ("Unknown $type border style '$style'") if @$s == 0;

  my $shape = 'rect';
  $shape = $self->attribute('shape') unless $self->isa_cell();
  return $s unless $shape eq 'rounded';

  # if shape: rounded, overlay the rounded edge pieces
  splice (@$s, 0, 4, @$rounded_edges)
    if $style =~ /^(solid|dotted|dashed|dot-dash|dot-dot-dash)\z/;

  # '####' => ' ### '
  splice (@$s, 0, 4, (' ', ' ', ' ', ' '))
    if $g == 0 || $style =~ /^(bold|wide|broad|double|double-dash|bold-dash)\z/;

  $s;
  }



( run in 0.693 second using v1.01-cache-2.11-cpan-49f99fa48dc )