

- #Simplemind topic box shapes pro#
- #Simplemind topic box shapes code#
- #Simplemind topic box shapes plus#
Some searches shown this error was found in old versions and disappeared in more recent versions. Problem: with latest Graphviz, I have errors (or rather, warnings, as the final diagram is generated), both in the original graph and the one I wrote (by hand). I found a Perl program doing precisely that, in a mailing list, but I just can't find it back! I copied the sample dot file and studied it, since I don't know much of this declarative syntax and I wanted to learn a bit more.
#Simplemind topic box shapes plus#
Plus it can output the graphs in lot of formats, including vector ones. The advice to use Graphviz is good: you can generate the dot file and it will do the hard work of measuring strings, doing the layout, etc. I didn't draw the connection lines, I didn't saw it as necessary. cairo.surface_write_to_png(ctxSurface, outfile) dirToList)Ĭtx:select_font_face("Sans", CAIRO.FONT_SLANT_NORMAL, CAIRO.FONT_WEIGHT_NORMAL)įunction DisplayDirectory(dirToList, offsetX)ĭisplayDirectory(v, offsetX + offsetIncrementX)ĭisplayDirectory(dirListing, initialOffsetX) outputTypeĬtxSurface = cairo.SvgSurface(outfile, width, height)ĬtxSurface = cairo.ImageSurface(CAIRO.FORMAT_RGB24, width, height)įunction DisplayFile(file, bIsDir, offsetX)Ĭtx:select_font_face("Sans", CAIRO.FONT_SLANT_NORMAL, CAIRO.FONT_WEIGHT_BOLD)Ĭtx:new_sub_path() - Position independent of latest move_toĬtx:arc(offsetX - iconOffset, offsetY - offsetIncrementY/3, offsetIncrementY/3, 0, TWO_PI)Ĭtx:restore() - Restore original settingsĬtx:show_text("Directory tree of ". Local height = offsetIncrementY * (fileNb + 1) + titleHeight Local dirListing = ListDirectory(dirToList) file)ĭirListing = ListDirectory(dirToList. Local fileAttr = lfs.attributes(dirToList. Local dirToList = arg or "C:/PrgCmdLine/tcc"ĭirToList = string.gsub(dirToList, "()$", "%1/") ~ local dirToList = arg or "C:/PrgCmdLine/Tecgraf" ~ local dirToList = arg or "C:/PrgCmdLine/Graphviz" Or it shouldn't be too hard to generate the SVG directly, I used Lua to generate SVG in the past. Not really a problem if you compress it after, to have a. Well, at least, it guarantees accurate rending even on systems without the font. Problem with the latter: Cairo generates it at low level, drawing the letters instead of using SVG's text capability.

You can easily switch between PNG rendering and SVG one. Then, knowing the number of files, creating the canvas to fit (at least vertically) and drawing the names. So I made this version, first walking the directory tree, storing it in a Lua table. Inconvenience: I have to specify the image size beforehand, so listings are likely to be cut off. I made a first version drawing file names as I walked the tree.
#Simplemind topic box shapes pro#
Lfs and LuaCairo are both cross-platform, so it should work on other systems (tested on French WinXP Pro SP3). I love these little challenges, as they allow me to explore APIs I wanted to dig for quite some time.

I scripted it with Lua, using lfs to walk the directories.
#Simplemind topic box shapes code#
So it is a code - writing question, and I believe belongs to SO.Īs promised, here is my Cairo version. So any scripting language or library is ok. I am sorry that this question was removed as not belonging to SO. SVG being HTML5 substandard, would even allow painless inclusion into online documentation. If I had time, I'd write a Visio Extension or may be some command line that produces SVG. It is very surprising that there is no better tool for it. I then printed out the file to console again and screen grabbed it.īefore screen grabbing I had to modify foreground color to black and background color to white, to look better and save ink in a document should that be printed. For example if a subfolder contained 20 similarly typed files that individually were not important to the point I was making, I left just two and replaced the rest with one. I both screen grabbed the result (for short folders) AND for longer folders I redirected to a text file, which I then edited. I had to explan where files (in particular resources and configuration files) reside. The question was related to a documentation sub project. The tool may be commercial but preferably free. The tool must run on Windows, but preferably cross-platform. Given a file tree - a directory with directories in it etc, how would you write a script to create a diagram of the file-tree as a graphic file that I can embed in a word processor document.
