hgeometry-combinatorial-0.12.0.2: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.PlanarGraph.IO

Description

Converting fromto our JSONYaml representation of the plane graph

Synopsis

Documentation

toAdjRep :: PlanarGraph s w v e f -> Gr (Vtx v e) (Face f) Source #

Transforms the planar graph into a format that can be easily converted into JSON format. For every vertex, the adjacent vertices are given in counter-clockwise order.

See toAdjacencyLists for notes on how we handle self-loops.

running time: \(O(n)\)

fromAdjRep :: proxy s -> Gr (Vtx v e) (Face f) -> PlanarGraph s Primal v e f Source #

Read a planar graph, given in JSON format into a planar graph. The adjacencylists should be in counter clockwise order.

running time: \(O(n)\)

buildGraph :: proxy s -> Gr (Vtx v e) (Face f) -> PlanarGraph s Primal () () () Source #

Builds the graph from the adjacency lists (but ignores all associated data)

reorder :: Vector (i :+ a) -> (i -> Int) -> Vector a Source #

fromAdjacencyLists :: forall s w h. (Foldable h, Functor h) => [(VertexId s w, h (VertexId s w))] -> PlanarGraph s w () () () Source #

Construct a planar graph from a adjacency matrix. For every vertex, all vertices should be given in counter-clockwise order.

pre: No self-loops, and no multi-edges

running time: \(O(n)\).

Orphan instances

(ToJSON v, ToJSON e, ToJSON f) => ToJSON (PlanarGraph s w v e f) Source # 
Instance details

Methods

toJSON :: PlanarGraph s w v e f -> Value #

toEncoding :: PlanarGraph s w v e f -> Encoding #

toJSONList :: [PlanarGraph s w v e f] -> Value #

toEncodingList :: [PlanarGraph s w v e f] -> Encoding #

(FromJSON v, FromJSON e, FromJSON f) => FromJSON (PlanarGraph s 'Primal v e f) Source # 
Instance details