Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module providing functions for obtaining coordinates of GenericGraph
s on
a 2D plane.
Synopsis
- type Coord e = (GraphEdge e, (V2 Float, V2 Float))
- type CoordList e = [Coord e]
- type CoordMap = Map Int (Float, Float)
- class Graph g => Drawable g v e where
- edgeFixator :: g v e -> EdgeFixator e
- type EdgeFixator e = CoordMap -> (EdgeList e, CoordMap)
- bondLength :: Float
- getCoordsForGraph :: (Ord v, Ord e, Eq e, Drawable GenericGraph v e) => StdGen -> GenericGraph v e -> Maybe CoordMap
Documentation
type Coord e = (GraphEdge e, (V2 Float, V2 Float)) Source #
Coord
is pair that containts graph's edge and coordinates of vertices that
are incident to it.
type CoordMap = Map Int (Float, Float) Source #
Map that matches indexes of vertices to coordinates of these vertices.
class Graph g => Drawable g v e where Source #
Type class that defines whether graph can be drawn or not.
Nothing
edgeFixator :: g v e -> EdgeFixator e Source #
Change coordinates and fixate edges that shouldn't take part in sampling.
bondLength :: Float Source #
This constant is used to determine length of one edge when graph is drawn.
getCoordsForGraph :: (Ord v, Ord e, Eq e, Drawable GenericGraph v e) => StdGen -> GenericGraph v e -> Maybe CoordMap Source #
Given StdGen
returns CoordMap
, which keys correspond to indices of
vertices of given GenericGraph
. Works only for simple planar graphs. If graph
is neither simple nor planar, returns Nothing. This function is best used for
graphs that can be represented as systems of conjugated cycles and paths between
them. If graph contains too complex conjugated cycles, function will return Nothing.