Graphalyze 0.2 → 0.3
raw patch · 4 files changed
+33/−7 lines, 4 files
Files
- Data/Graph/Analysis.hs +13/−1
- Data/Graph/Analysis/Algorithms/Directed.hs +2/−3
- Graphalyze.cabal +4/−3
- TODO +14/−0
Data/Graph/Analysis.hs view
@@ -18,12 +18,14 @@ module Data.Graph.Analysis.Types, module Data.Graph.Analysis.Utils, module Data.Graph.Analysis.Algorithms,+ module Data.Graph.Analysis.Visualisation, module Data.Graph.Analysis.Reporting, module Data.Graph.Inductive.Graph, -- * Importing data ImportParams(..), defaultParams, importData,+ manipulateNodes, -- * Result analysis -- $analfuncts lengthAnalysis,@@ -33,18 +35,20 @@ import Data.Graph.Analysis.Utils import Data.Graph.Analysis.Types import Data.Graph.Analysis.Algorithms+import Data.Graph.Analysis.Visualisation import Data.Graph.Analysis.Reporting import Data.Graph.Inductive.Graph import Data.List import Data.Maybe import qualified Data.Map as M+import Control.Arrow(second) -- ----------------------------------------------------------------------------- -- | The library version. version :: String-version = "0.2"+version = "0.3" {- | This represents the information that's being passed in that we want@@ -107,6 +111,14 @@ setDirection = if (directed params) then id else undir -- Construct the graph. dGraph = setDirection $ mkGraph lNodes graphEdges++-- | Apply a function to the nodes after processing.+-- This might be useful in circumstances where you want to+-- reduce the data type used to a simpler one, etc.+manipulateNodes :: (a -> b) -> GraphData a -> GraphData b+manipulateNodes f gd = gd { graph = nmap f (graph gd)+ , wantedRoots = map (second f) (wantedRoots gd)+ } -- -----------------------------------------------------------------------------
Data/Graph/Analysis/Algorithms/Directed.hs view
@@ -27,7 +27,6 @@ import Data.Graph.Analysis.Types import Data.Graph.Analysis.Utils-import Data.Graph.Analysis.Algorithms.Common import Data.Graph.Inductive.Graph @@ -138,8 +137,8 @@ cycles, etc. Depending on the context, it could be interpreted as the part of the graph where all the "work" is done. -}-coreOf :: (DynGraph g, Eq a, Eq b) => g a b -> [g a b]-coreOf = componentsOf . fixPointGraphs stripEnds+coreOf :: (DynGraph g, Eq a, Eq b) => g a b -> g a b+coreOf = fixPointGraphs stripEnds where stripEnds gr' = delNodes roots . delNodes leaves $ gr' where
Graphalyze.cabal view
@@ -1,5 +1,5 @@ Name: Graphalyze-Version: 0.2+Version: 0.3 Synopsis: Graph-Theoretic Analysis library. Description: A library to use graph theory to analyse the relationships inherent in discrete data.@@ -9,6 +9,7 @@ Copyright: (c) Ivan Lazar Miljenovic Author: Ivan Lazar Miljenovic Maintainer: Ivan.Miljenovic@gmail.com+Extra-Source-Files: TODO Cabal-Version: >= 1.2 Build-Type: Simple Tested-With: GHC==6.8.3@@ -23,7 +24,7 @@ else Build-Depends: base < 3 - Build-Depends: bktrees, fgl, graphviz >= 2008.9.20, pandoc+ Build-Depends: bktrees, fgl, graphviz >= 2008.9.20, pandoc Exposed-Modules: Data.Graph.Analysis Data.Graph.Analysis.Types@@ -39,4 +40,4 @@ Ghc-Options: -Wall Ghc-Prof-Options: -auto-all - }+}
+ TODO view
@@ -0,0 +1,14 @@+TODO for Graphalyze+===================++* Report framework+ * Extend the report framework+ * Explore options for generating multiple files+ * Differentiate between "large" and "small" images+ * The pandoc code (especially elements) is a bit of a mess... can it be cleaned up?++* Analysis stuff+ * Default graph -> alg -> report element stuff++* Write a README+