Matt:
Hello, I was looking for a perl package to draw corporate org charts like:
[this was done manually for illustration purposes. I can send PNGs upon request]
Gary
Home Owner
|
+------------------+------------------+
| |
Tex Dudley
VP Backyard VP Frontyard
| |
+-----+-----+ +---------+---------+
| | | |
Ophelia Cinnamon Jax Maisie
Gate Watcher Deck Sitter Bay Window Watcher Door Watcher
I first looked at yours, which would produce something more like:
Gary
+-- Dudley
| +-- Jax
| +-- Maisie
+-- Tex
+-- Cinnamon
+-- Ophelia
So, I sat down one weekend and wrote one myself. (Actually took almost a
week of spare time to get it _working_, but...).
The primary difference I needed was to have a manager centered above his/her
subordinates. In addition I wanted to be able to put arbitrary text in
the boxes so that a title could be included, etc.
I then picked up a book on submitting modules to the CPAN (_Writing Perl
Modules for CPAN_ by Sam Tregar) and followed the guidelines there and
tried to register the module namespace as "GD::OrgChart". I did
upload it, however, so it is available at:
http://search.cpan.org/author/GALGIER/GD-OrgChart-0.01/
I have since then received some feedback and the latest is:
_brian_d_foy wrote:
> That sounds likw Image::OrgChart is a subset of GD::OrgChart. can
> the two of you get together to make one module that does both?
So, here I am.
The primary differences I see between our modules are:
Image::OrgChart GD::OrgChart
--------------- ------------
One line per box Multiple lines per box
Drawn along left edge Drawn with subordinates centered below
No limit on drawing depth Simple maxdepth argument
Only can use GD built-in fonts Only can use GD truetype fonts
The box is as it is A call-back is available to augment
Sorts the input Draws it as presented
Also, the "tree" as submitted to your module uses a different structure
from mine.
Do you want to work on combining these two modules?
Personally I see the following issues:
1) Your data structure won't support my needs. I want to allow
the user to store arbitrary data in the structure in addition
to the node names. We would need two different sets of method
calls.
2) The algorithm to draw your chart has different needs as to calculations
of spacing, box size, etc. from mine. Again, this would need two
different sets of methods.
Do you have any comments or suggestions?
--
Gary Algier, WB2FWZ gaa at ulticom.com +1 856 787 2758
Ulticom Inc., 1020 Briggs Rd, Mt. Laurel, NJ 08054 Fax:+1 856 866 2033