GraphViz2::Abstract::Util::Constants - Constants used by GraphViz2::Abstract::*
GraphViz2::Abstract::*
version 0.001000
In the GraphViz documentation, there are a few default values which are used multiple times, and the following constants refer to them in one way or another.
EMPTY_STRING
This simply returns an empty string, and is not likely to change.
""
FALSE
Where the specification shows false as a default value, this module instead returns the string false
false
This is because under the hood, GraphViz2 doesn't support values for attributes other than defined ones.
So its assumed that GraphViz, under the hood, interprets the string "false" the same as the boolean condition "false";
TRUE
Where the specification shows true as a default value, this module instead returns the string true
true
Its assumed that GraphViz, under the hood, interprets the string "true" the same as the boolean condition "true", for similar reasons false is.
NONE
In the GraphViz docs, a few items have a default value specified as:
<none>
This item was confusing in the specification, and it wasn't clear if it was some sort of magic string, or what.
Internally, we use a special value, a reference to a string "none" to represent this default.
For instance:
my $v = Edge->new()->target(); ok( ref $v, 'target returned a ref' ); is( ref $v, 'SCALAR', 'target returned a scalar ref' ); is( ${ $v }, 'none', 'target returned a scalar ref of "none"' );
However, because its not known how to canonicalize such forms, those values are presently not returned by either as_hash methods.
as_hash
So as a result:
my $v = Edge->new( color => \"none" )->as_hash()
Will emit an empty hash. ( Despite "none" being different from the default ).
Also:
my $v = Edge->new( color => \"none" )->as_canon_hash()
Will not emit a value for color in its output, which may have the undesirable effect of reverting to the default, black once rendered.
color
black
UNKNOWN
On the GraphViz documentations, there were quite a few fields where the defaults were simply not specified, or their values were cryptic.
Internally, those fields have the default value of \"unknown"
\"unknown"
Like "none", those fields with those values will not be emitted during hash production.
"none"
Kent Fredric <kentfredric@gmail.com>
This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install GraphViz2::Abstract::Util::Constants, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GraphViz2::Abstract::Util::Constants
CPAN shell
perl -MCPAN -e shell install GraphViz2::Abstract::Util::Constants
For more information on module installation, please visit the detailed CPAN module installation guide.