summaryrefslogtreecommitdiff
path: root/lib/Graph/GEXF/Role/Viz/Shape.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-05-21 14:58:09 +0200
committerfranck cuny <franck@lumberjaph.net>2011-05-21 14:58:09 +0200
commit299bd8f8abf422a9715227f1fd6c90ea6b073333 (patch)
tree127afd279e2e7e58c4fe8f47ed32465caffb6d83 /lib/Graph/GEXF/Role/Viz/Shape.pm
parentremove position, this is now a viz element (diff)
downloadgraph-gexf-299bd8f8abf422a9715227f1fd6c90ea6b073333.tar.gz
add new roles to handle all the viz elements
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to '')
-rw-r--r--lib/Graph/GEXF/Role/Viz/Shape.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Graph/GEXF/Role/Viz/Shape.pm b/lib/Graph/GEXF/Role/Viz/Shape.pm
new file mode 100644
index 0000000..f522786
--- /dev/null
+++ b/lib/Graph/GEXF/Role/Viz/Shape.pm
@@ -0,0 +1,28 @@
+package Graph::GEXF::Role::Viz::Shape;
+
+use Moose::Util::TypeConstraints;
+use MooseX::Role::Parameterized;
+
+enum EdgeShape => qw(solid doted dashed double);
+enum NodeShape => qw(disc square triangle diamond);
+
+parameter for => (
+ is => 'ro',
+ required => 1,
+);
+
+role {
+ my $p = shift;
+
+ my $type = lcfirst( $p->for ) . 'Shape';
+
+ has shape => (
+ is => 'rw',
+ isa => $type,
+ );
+};
+
+no Moose::Util::TypeConstraints;
+
+1;
+