-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | planar graph embedding into a plane -- -- A library realizes one of the graph visualization process's steps - -- graph embedding into a plane. The job of the step is such to order -- nodes' edges that there are capabilities to draw them without any -- intersections. @package gbu @version 0.1 -- | additional functions for the graph structure defined in fgl library module Data.Graph.InductivePlus -- | the function updates a label of v node in the graph g setVLabel :: (Node, a) -> a -> Gr a b -> Gr a b -- | the function updates a label of v node in the graph g setVLabel' :: Node -> a -> Gr a b -> Gr a b -- | the function extracts a label of v node from the graph g getVLabel :: Node -> Gr a b -> a setELabel :: (Node, Node, a) -> a -> Gr b a -> Gr b a -- | the function version of setELabel for an undirected graph getELabel :: (Node, Node) -> Gr a b -> b isEdge :: (Node, Node) -> Gr a b -> Bool -- | the function merges two graphs. E.i. if first graph hasn't got vertex -- v but second one has got it then the node is inserted into first graph -- with same label. Edges are processed too. mergeTwoGraphs :: Gr a b -> Gr a b -> Gr a b -- | it finds and returns the path consiting of edges from first node to -- second one. If the path doesn't exist then the function returns the -- empty list. findPaths :: Node -> Node -> Gr a b -> [Path] instance (Eq a, Eq b) => Eq (Gr a b) -- | Graph embedding algorithm is based on one of a graph planarity testing -- which described in the book "Graph Drawing. Algorithms for the -- Visualization of Graphs". Its authors are Giuseppe Di Battista, Peter -- Eades, Roberto Tamassia and Ioannis G. Tollis. module Data.Graph.Embedding -- | The embedGraph function embeds a planar biconnected undirected -- graph into a plane. Edge's label of an embedded graph is a position of -- the edge in its source node. -- -- In undirected graph each edge is presented a pair of directed edges. -- Therefore it's enough each edge keeps only its position in the source -- node. embedGraph :: Gr a b -> Gr a Int -- | The embedDiGraph function embeds a planar directed graph into a -- plane. The source graph must be biconnected if throw off edges' -- directions and also any two nodes v and w can have either edge (v,w) -- or (w,v) but not both. -- -- Edge's label of an embedded graph consists of a pair integers. First -- element is a position of the edge in its source node and second one is -- a position of the edge in its destination node. embedDiGraph :: Gr a b -> Gr a (Int, Int) instance Show Piece instance Eq Piece instance Show Side instance Eq Side instance Show C instance Eq C instance Show OldC instance Eq OldC instance Show EdgeLabel instance Eq EdgeLabel instance Ord Piece instance Ord EdgeLabel