<div dir="ltr">Note that if you just want graphviz to do the layout, but do the rendering yourself, e.g. with diagrams, this is not too hard. This doesn't help with getting rid of the graphviz dependency, but it certainly helps with making nicer-looking graphs or with tweaking the visualization based on arbitrary criteria.  Ivan's graphviz package allows for round-tripping a graph data structure through graphviz, and you get it back with location annotations; you can then draw it however you like.  I actually did this for a couple figures in my dissertation. Perhaps at some point in the near future I will package up the code into a nice module in diagrams-contrib.<div><br></div><div>-Brent</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 11:22 AM, Iavor Diatchki <span dir="ltr"><<a href="mailto:iavor.diatchki@gmail.com" target="_blank">iavor.diatchki@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Yeah, I've seen the crushes on large graphs too---looks like a bug in graphviz, perhaps we should report it.</div><div><br></div><div>I have some code for laying out graphs using a force based algorithm, but graphiz does quite a lot (e.g., supports many different formats), so I don't have any immediate plans to write a render.</div><div><br></div><div>My next task for `graphmod` is to implement `Cabal` support, so that you could easily visualize a package.</div><div><br></div><div>Cheers,</div><div>-Iavor</div><div><br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 1:04 AM, Ivan Lazar Miljenovic <span dir="ltr"><<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 4 October 2014 17:34, Mateusz Kowalczyk <<a href="mailto:fuuzetsu@fuuzetsu.co.uk" target="_blank">fuuzetsu@fuuzetsu.co.uk</a>> wrote:<br>
> On 10/04/2014 01:33 AM, Iavor Diatchki wrote:<br>
>> Hello,<br>
>><br>
>> Good idea!  I made a little web-page with examples and screenshots.  Have a<br>
>> look:<br>
>><br>
>> <a href="https://github.com/yav/graphmod/wiki" target="_blank">https://github.com/yav/graphmod/wiki</a><br>
>><br>
>> Indeed, mutually-recursive modules are not a problem.  There is an example<br>
>> of some mutually-recursive modules in the screen-shot from GHC's<br>
>> type-checker.<br>
>><br>
>> By the way, I also added some support for modules that contains CPP, and<br>
>> improved the layout of the graphs a bit, so the current version is 1.2.5.<br>
>><br>
>> Cheers,<br>
>> -Iavor<br>
>><br>
>><br>
>><br>
><br>
> That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz<br>
> kept segfaulting[2] on the file produced for Yi repository but in the<br>
> end it worked after I added ‘-p’ to graphmod. Also --no-cluster view at [3].<br>
><br>
> Is there any plan for graphmod to do rendering itself, such as to PNG? I<br>
> also wonder if there's any way to highlight cyclic paths, useful when<br>
> trying to get rid of boot files.<br>
<br>
</span>To do self-rendering, you would need to have a haskell implementation<br>
of a graph layout algorithm, and then a way to do the rendering (which<br>
could admittedly be done with digrams).<br>
<div><div><br>
><br>
> [1]: <a href="http://fuuzetsu.co.uk/images/1412407628.png" target="_blank">http://fuuzetsu.co.uk/images/1412407628.png</a><br>
> [2]:<br>
>   libpath/shortest.c:324: triangulation failed<br>
>   libpath/shortest.c:192: source point not in any triangle<br>
>   Error: in routesplines, Pshortestpath failed<br>
>   out of memory<br>
> [3]: <a href="http://fuuzetsu.co.uk/images/1412407805.png" target="_blank">http://fuuzetsu.co.uk/images/1412407805.png</a><br>
><br>
>><br>
>> On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk <<a href="mailto:fuuzetsu@fuuzetsu.co.uk" target="_blank">fuuzetsu@fuuzetsu.co.uk</a>><br>
>> wrote:<br>
>><br>
>>> On 10/03/2014 07:37 PM, Iavor Diatchki wrote:<br>
>>>> Hello,<br>
>>>><br>
>>>> I am pleased to announce a new version of `graphmod`---a program that<br>
>>> helps<br>
>>>> you visualize the import dependencies between the modules in your Haskell<br>
>>>> programs.<br>
>>>><br>
>>>> The new feature in version 1.2.4 is support for pruning the dependency<br>
>>>> graph, which is enabled with the flag -p or --prune-edges.    When this<br>
>>>> option is selected, `graphmod` will ignore imports to modules that are<br>
>>>> already imported by some of the dependencies of the module.<br>
>>>><br>
>>>> For example, consider the following modules:<br>
>>>><br>
>>>>     module A where { import B; import C }<br>
>>>>     module B where { import C }<br>
>>>>     module C where { }<br>
>>>><br>
>>>> When generated with `--prune-edges`, the resulting graph will be:<br>
>>>><br>
>>>>     A -> B -> C<br>
>>>><br>
>>>> Note that there is no edge from `A` to `C`, because `C` is already<br>
>>> imported<br>
>>>> by `B`.<br>
>>>><br>
>>>> Happy hacking,<br>
>>>> -Iavor<br>
>>>><br>
>>>><br>
>>><br>
>>> Hi,<br>
>>><br>
>>> It'd be great if the project page showed an example use and the<br>
>>> generated graph.<br>
>>><br>
>>> Does it work with possibly mutually-importing boot files?<br>
>>><br>
>>><br>
>>> --<br>
>>> Mateusz K.<br>
>>> _______________________________________________<br>
>>> Haskell-Cafe mailing list<br>
>>> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
>>> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
>>><br>
>><br>
><br>
><br>
> --<br>
> Mateusz K.<br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com" target="_blank">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" target="_blank">http://IvanMiljenovic.wordpress.com</a><br>
</font></span><div><div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>