Meta::Grapher::Moose - Produce graphs showing meta-information about classes and roles


version 1.03


From the shell:

   foo@bar:~/package$ --package='My::Package::Name' --output='diagram.png'

Or from code:

    my $grapher = Meta::Grapher::Moose->new(
        package  => 'My::Package::Name',
        renderer => Meta::Grapher::Moose::Renderer::Plantuml->new(
            output => 'diagram.png',


STOP: The most common usage for this module is to use the command line program. You should read the documentation for to see how that works.

This module allows you to create graphs of your Moose classes showing a directed graph of the parent classes and roles that your class consumes recursively. In short, it can visually answer the questions like "Why did I end up consuming that role" and, with the right renderer backend, "Where did that method come from?"

Example Output

With the GraphViz renderer (no methods/attributes):

And with the PlantUML renderer:


This class accepts the following attributes:


The name of package that we should render a graph for.

String. Required.


Since every Moose class and role normally has a meta() method it is omitted from every class for brevity; Enabling this option causes it to be rendered.


The standard new() constructor is omitted from every class for brevity; Enabling this option causes it to be rendered.


The DESTROY() method that Moose installs is omitted from every class for brevity; Enabling this option causes it to be rendered.


The Moose::Object base class is normally omitted from the diagram for brevity. Enabling this option causes it be rendered.


The renderer instance you want to use to create the graph.

Something that consumes Meta::Grapher::Moose::Role::Renderer. Required, should be passed as the renderer argument (without the leading underscore.)


This class provides the following methods:


Builds the graph from the source code and tells the renderer to render it.


Bugs may be submitted through the RT bug tracker (or

I am also usually active on IRC as 'drolsky' on irc://


If you'd like to thank me for the work I've done on this module, please consider making a "donation" to me via PayPal. I spend a lot of free time creating free software, and would appreciate any support you'd care to offer.

Please note that I am not suggesting that you must do this in order for me to continue working on this particular software. I will continue to do so, inasmuch as I have in the past, for as long as it interests me.

Similarly, a donation made in this way will probably not make me work on this software much more, unless I get so many donations that I can consider working on free software full time (let's all have a chuckle at that together).

To donate, log into PayPal and send money to, or use the button at


Dave Rolsky <>


Mark Fowler <>


This software is Copyright (c) 2016 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)