math-grads-0.1.6.7: Library containing graph data structures and graph algorithms

Safe HaskellNone
LanguageHaskell2010

Math.Grads.Drawing.Coords

Description

Module providing functions for obtaining coordinates of GenericGraphs on a 2D plane.

Synopsis

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 CoordList e = [Coord e] Source #

Alias for list of Coords.

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.

Minimal complete definition

Nothing

Methods

edgeFixator :: g v e -> EdgeFixator e Source #

Change coordinates and fixate edges that shouldn't take part in sampling.

type EdgeFixator e = CoordMap -> (EdgeList e, CoordMap) Source #

Type alias for function that, given CoordMap of graph, returns modified version of that CoordMap alongside with EdgeList of graph's edges of that shouldn't participate 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.