Bindings to Graphviz for graph visualisation. (http://projects.haskell.org/graphviz/)

#8graphviz-2999.17.0.2 issue when trying to use Clusters in Generalized mode.

Hi,

I worked weeks on inductive graphs to get to visualize them at the end. It went fine with Graphiz except when I try to use Cluster... I tried everything but couldn't get a hint of the cause of my problem. I managed to recreate the problem with inductive Graph examples and the Graphiz example evenOdd Here is below code with execution. I get same result under Windows and Ubuntu... Any help would be appreaciated :

{-# LANGUAGE OverloadedStrings #-}

--import Data.Char

import Data.Graph.Inductive

import Data.GraphViz

import Data.Graph.Inductive.Example

evenOdd :: (Graph gr, Ord el) => gr Int el -> DotGraph Node

evenOdd = setDirectedness graphToDot params

where

params = blankParams { globalAttributes = []

                     , clusterBy        = clustBy

                     , clusterID        = Num . Int

                     , fmtCluster       = clFmt

                     , fmtNode          = const []

                     , fmtEdge          = const []

                     }

clustBy (n,l) = C (n `mod` 2) $ N (n,l)

clFmt m = [GraphAttrs [toLabel $ "n == " ++ show m ++ " (mod 2)"]]

GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help

Loading package ghc-prim ... linking ... done.

Loading package integer-gmp ... linking ... done.

Loading package base ... linking ... done.

Prelude> :cd C:.carre

Prelude> :load "evenodd.hs"

[1 of 1] Compiling Main ( evenodd.hs, interpreted )

Ok, modules loaded: Main.

*Main> dag4

Loading package array-0.5.0.0 ... linking ... done.

Loading package deepseq-1.3.0.2 ... linking ... done.

Loading package containers-0.5.5.1 ... linking ... done.

Loading package transformers-0.3.0.0 ... linking ... done.

Loading package mtl-2.1.3.1 ... linking ... done.

Loading package fgl-5.5.0.1 ... linking ... done.

mkGraph [(1,1),(2,2),(3,3),(4,4)] [(1,2,()),(1,4,()),(2,3,()),(2,4,()),(4,3,())]

*Main> evenOdd dag4

Loading package bytestring-0.10.4.0 ... linking ... done.

Loading package Win32-2.3.0.2 ... linking ... done.

Loading package old-locale-1.0.0.6 ... linking ... done.

Loading package time-1.4.2 ... linking ... done.

Loading package text-1.1.0.0 ... linking ... done.

Loading package stm-2.4.2 ... linking ... done.

Loading package filepath-1.3.0.2 ... linking ... done.

Loading package directory-1.2.1.0 ... linking ... done.

Loading package process-1.2.0.0 ... linking ... done.

Loading package colour-2.3.3 ... linking ... done.

Loading package dlist-0.7.1.1 ... linking ... done.

Loading package polyparse-1.11 ... linking ... done.

Loading package transformers-compat-0.4.0.4 ... linking ... done.

Loading package exceptions-0.8.0.2 ... linking ... done.

Loading package temporary-1.2.0.3 ... linking ... done.

Loading package wl-pprint-text-1.1.0.4 ... linking ... done.

Loading package graphviz-2999.17.0.2 ... linking ... done.

DotGraph {strictGraph = False, directedGraph = True, graphID = Nothing, graphStatements = DotStmts {attrStmts = [], subGraphs = [DotSG {isCluster = Main> ** Exception: Prelude.undefined