packages feed

graph-rewriting-layout 0.4.5 → 0.5.8

raw patch · 11 files changed

Files

+ AUTHORS view
@@ -0,0 +1,2 @@+Jan Rochel+Chas Leichner (Google Inc.)
GraphRewriting/Layout/Coulomb.hs view
@@ -1,14 +1,17 @@+{-# LANGUAGE UnicodeSyntax, FlexibleContexts #-} module GraphRewriting.Layout.Coulomb where  import Data.View+import Data.Functor () import GraphRewriting.Graph.Types import GraphRewriting.Graph.Read+import GraphRewriting.Pattern () import GraphRewriting.Layout.Position import GraphRewriting.Layout.Force   coulombForce ∷ View Position n ⇒ Node -> WithGraph n Force coulombForce node = do- 	n ← examineNode position node- 	ns ← mapM (examineNode position) =<< readNodeList+ 	n ← examine position <$> readNode node+ 	ns ← fmap (map $ examine position) (mapM readNode =<< readNodeList)  	return $ fsum [repulsion n' n | n' ← ns]
GraphRewriting/Layout/Geometry.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UnicodeSyntax #-} module GraphRewriting.Layout.Geometry where  import Data.Vector.V2
GraphRewriting/Layout/Gravitation.hs view
@@ -1,9 +1,11 @@+{-# LANGUAGE UnicodeSyntax, FlexibleContexts #-} module GraphRewriting.Layout.Gravitation where  import Data.View import Data.Vector.Class-import Data.Vector.V2-import Control.Monad+import Data.Vector.V2 ()+import Data.Functor ()+import GraphRewriting.Pattern () import GraphRewriting.Graph.Types import GraphRewriting.Graph.Read import GraphRewriting.Layout.Position@@ -11,10 +13,10 @@   centralGravitation ∷ View Position n ⇒ Node → WithGraph n Force-centralGravitation = liftM (attraction $ vpromote 0) . examineNode position+centralGravitation = fmap (attraction (vpromote 0) . examine position) . readNode  gravitation ∷ View Position n ⇒ Node -> Rewrite n Force gravitation node = do- 	n ← examineNode position node- 	ns ← mapM (examineNode position) =<< readNodeList+ 	n ← examine position <$> readNode node+ 	ns ← fmap (map $ examine position) (mapM readNode =<< readNodeList)  	return $ fsum [attraction n' n | n' ← ns]
GraphRewriting/Layout/PortSpec.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UnicodeSyntax, FlexibleContexts #-} module GraphRewriting.Layout.PortSpec 	(module GraphRewriting.Layout.PortSpec, 	 module GraphRewriting.Layout.Position,
GraphRewriting/Layout/Position.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UnicodeSyntax #-} module GraphRewriting.Layout.Position 	(module GraphRewriting.Layout.Position, 	 module Data.Vector.V2,
GraphRewriting/Layout/RotPortSpec.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UnicodeSyntax, FlexibleContexts #-} module GraphRewriting.Layout.RotPortSpec 	(module GraphRewriting.Layout.RotPortSpec, 	 module GraphRewriting.Layout.Position,@@ -15,6 +16,7 @@ import GraphRewriting.Layout.Rotation import GraphRewriting.Layout.PortSpec import GraphRewriting.Layout.Geometry+import GraphRewriting.Pattern () import Data.Vector.V2 import Data.View import Control.Monad
GraphRewriting/Layout/Rotation.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UnicodeSyntax #-} module GraphRewriting.Layout.Rotation 	(module GraphRewriting.Layout.Rotation, 	 module Data.View)
GraphRewriting/Layout/SpringEmbedder.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} module GraphRewriting.Layout.SpringEmbedder where  import GraphRewriting.Graph
GraphRewriting/Layout/Wrapper.hs view
@@ -1,5 +1,6 @@+{-# LANGUAGE UnicodeSyntax, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-} module GraphRewriting.Layout.Wrapper-	(Wrapper, wrapGraph, wrappee, updateWrappee,+	(Wrapper (..), wrapGraph, wrappee, updateWrappee, 	 module Data.View, 	 module GraphRewriting.Graph.Types, 	 module GraphRewriting.Layout.Position,@@ -23,23 +24,19 @@ -- | Wraps a value of type @w@, augmenting it with layout information data Wrapper w = Wrapper {wRot ∷ Rotation, wPos ∷ Position, wrappee ∷ w} -instance View w (Wrapper w) where-	inspect = wrappee-	update = updateWrappee+instance View v n ⇒ View v (Wrapper n) where+	inspect = inspect . wrappee+	adjust f w = w {wrappee = adjust f $ wrappee w} -instance View Rotation (Wrapper n) where+instance PortSpec n ⇒ PortSpec (Wrapper n) where portSpec = portSpec . wrappee++instance {-# OVERLAPPING #-} View Rotation (Wrapper n) where 	inspect = wRot 	update v w = w {wRot = v} -instance PortSpec n ⇒ PortSpec (Wrapper n) where portSpec = portSpec . wrappee--instance View Position (Wrapper n) where+instance {-# OVERLAPPING #-} View Position (Wrapper n) where 	inspect = wPos 	update v w = w {wPos = v}--instance View [Port] n ⇒ View [Port] (Wrapper n) where-	inspect = inspect . wrappee-	adjust f w = w {wrappee = adjust f $ wrappee w}  updateWrappee v n = n {wrappee = v} 
graph-rewriting-layout.cabal view
@@ -1,24 +1,26 @@ Name:          graph-rewriting-layout-Version:       0.4.5+Version:       0.5.8 Copyright:     (c) 2010, Jan Rochel License:       BSD3 License-File:  LICENSE Author:        Jan Rochel Maintainer:    jan@rochel.info Homepage:      http://rochel.info/#graph-rewriting-Stability:     beta+Bug-Reports:   https://github.com/jrochel/graph-rewriting/issues Build-Type:    Simple Synopsis:      Force-directed node placement intended for incremental graph drawing-Description:   Defines basic methods for force-directed node displacement that can be combined into an incremental graph-drawing procedure.+Description:   Defines basic methods for force-directed node displacement that can be combined into an incremental graph-drawing procedure. See graph-rewriting-ski package for an example. Category:      Graphs, Graphics-Cabal-Version: >= 1.6+Cabal-Version: >= 1.10+Extra-Source-Files: AUTHORS  Library+  Default-Language: Haskell2010   Build-Depends:-    base >= 4 && < 4.5,+    base >= 4.8 && < 5,     base-unicode-symbols >= 0.2 && < 0.3,-    graph-rewriting >= 0.5 && < 0.7,-    AC-Vector >= 2.3 && < 2.4+    graph-rewriting >= 0.7.8 && < 0.9,+    AC-Vector >= 2.4.0 && < 2.5.0   Exposed-Modules:     GraphRewriting.Layout.Position     GraphRewriting.Layout.PortSpec@@ -31,10 +33,11 @@   Other-Modules:     GraphRewriting.Layout.Force     GraphRewriting.Layout.Geometry-  Extensions:+  Default-Extensions:     UnicodeSyntax+  Other-Extensions:     FlexibleInstances     FlexibleContexts     MultiParamTypeClasses     TypeSynonymInstances-  GHC-Options: -fno-warn-duplicate-exports+  GHC-Options:    -fno-warn-duplicate-exports -fwarn-unused-binds -fwarn-unused-imports -fwarn-unused-do-bind -fwarn-wrong-do-bind -fwarn-unrecognised-pragmas -fno-warn-tabs