Visualizing LINQ with GraphViz

by Pezi 17. January 2014 21:01

After my talk last night, several people expressed an interest in the script I was using to draw the LINQ expression trees. I have uploaded here on github.

This is just a script I use in development. It doesn't visualize every node by a long shot, and does a fair bit of name replacing to make some of the very long generic type names readable.  You will need GraphViz installed to use this script.  You might need to point the function that does the generation at the location where you've installed it.  

You can use it like this from FSI :

#load "GraphViz.fsx"
|> Observable.add GraphViz.toGraph

Now, whenever you evaluate a query expression, it will pop up a bunch of images with whatever your machine uses to view SVG files, like this rather lovely one below.  Have fun.

edit; this will spam your temp directory with svg files!


Add comment

  • Comment
  • Preview