Org Chart?

Events happening in the community are now at Drupal community events on www.drupal.org.
mtndan's picture

Hi folks,

We're interested in the possibility of autogenerating an org chart with svg (or flash). We are currently using Visio to automatically create org charts from Active Directory data. This then is saved as awful visio html and manually uploaded to our site.

We have Drupal talking to Active Directory now, and would love to take the step of using Drupal to create the org chart dynamically.

Anyone tried this, or have ideas?

Comments

Graphviz->Dot->SVG->files/orgchart.svg

tarvid's picture

Active Directory->query

Should be fairly easy to do on the fly (I don't do Active Directory)

query ->php script->dot input file

dot input is very simple.

e.g. orgchart.dot
digraph orgchart {
a->{b c d}
b-> {e f}
c -> {g h i}
d-> {j}
e-> {k l}
}

mash query output into left and right parts.

Many options on formatting.

dot ->SVG

dot orgchart.dot -Tsvg -o orgchart.svg

dot svg example

Huh

very cool!

mtndan's picture

Tarvid,

Couple questions:

  1. Could you provide the source or a step-by-step for how you did that?

  2. Does svg allow for elements and/or the text within them to be hyperlinked? For example, we'd want to display only the top 2 levels of the org chart on the first page, then when you click you can drill down to deeper levels.

  3. Are you available for some paid consulting?

--
Dan Katz
Solutions Architect, Acquia

Yes on all three counts.

tarvid's picture
  1. I've posted some notes at http://ls.net/software/crossplatform/graphviz and attached the dot input file which generated the graph along with the cli

  2. dot and svg support hyperlinks, you will find one or two in the graph. I've been mulling a sed script which would modify the input to make a set of instructions for building a Drupal site for a specific domain

  3. I.m hungry, perhaps not ravenously, but I like Drupal

thanks

mtndan's picture

Great, I'll pm you next week with the requirements.

Active Directory is just LDAP. We're currently using the ldap modules to authenticate so the drupal-directory link is already there

--
Dan Katz
Solutions Architect, Acquia

tarvid

SamRose's picture

Thanks for info.

I've worked with Graphviz in the past. You mention above that you were thinking about Query -> php script -> dot input file

if I am reading this right, I am wondering how you go about generating these dot files? are you using PEAR::Image_GraphViz or something similar?

Sam Rose
Social Synergy
Blog

dot files

tarvid's picture

assuming your input looks like {name, parent, ...} the dot file can be as simple as

digraph orgchart {
name(root)
name(i)->parent(i)
...
}

PEAR::Image_GraphViz would generate a dot file for you but I am not sure it is as smart as dot and may just get in the way. My preference is the syntax which is closest to the semantics. I can't imagine anything closer than the dot language itself.

name(root) is the special node at the top of the graph which has no other node leading to it. For an organization chart, the name of the organization would just create a node above the top.

name(i)->parent(i) is an edge

a name referenced in an edge but not independently established is automatically made into a node

There are lots of options including shape, label and URL which can be set per element (node or edge) or set for a group.

Dot is an amazingly simple but elegant tool. I wonder where she has been all my life.

using shell scripts and PHP to generate AD Orgcharts

parkview's picture

Hi,

Yes I have created a few stand alone scripts (unix shell, PHP to generate dot file that where fed into Graphviz), to generate org charts. The problem I found with using Microsoft Active Directory was that it wasn't as up todate as we thought it was. In then end I re-wrote parts of it, so that it would pull the data from our HR/Payroll (MS SQL) DB. I ended up with GIF, SVG and PDF files that displayed our org chart. Our organisation has around 340 staff spread over 4-5 levels of management.

Consulting and Business

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: