Background
We're developing an automated graph drawing framework for TikZ with LuaTeX. The TeX interface on the pgf layer is nearly done, the next step will be the TikZ Layer. The maker of TikZ, Till Tantau, gives us a lot of help, but he has very little time.
The most work is done, but some little sugar is missing. The algorithms work, passing the nodes to lua and shipping them out back later works, with edges too. As I'm proceeding with the pgf layer, I got a problem with passing arguments to macros.
Problem
Some graph drawing algorithms need options like the root node of a tree or in which style the nodes should be arranged. Saving the options after \node[options] is no problem, but how to implement such an option handling by myself? I've read the particular pgfkeys section of the TikZ manual and done a lot of googeling, but not found yet what I need.
The idea is something like this (it's very simplified for showing what I want!)
We have some interface functions on the TeX level to select algorithms and so on.
\def\pgfgdsetalgorithm...{..call some lua functions here..}
Some algorithms, say the tree drawing algorithm, needs an explicit root node. The call could now be something like this
\pgfgdsetalgorithm[rootnode=nodexy]{treedrawing}
After the examples I've read I now know it's very comfortable for users to use the options, but very hard to implement them.
Does anyone got a simple example or maybe a good tutorial so I can proceed?
Thanks in advance!