Commit 0cbd5099 authored by Alp Mestanogullari's avatar Alp Mestanogullari

start integrating infomap

parent fa6cdcd5
Pipeline #2915 failed with stage
in 12 minutes and 16 seconds
......@@ -220,6 +220,7 @@ library
Gargantext.Core.Viz.Graph.FGL
Gargantext.Core.Viz.Graph.GEXF
Gargantext.Core.Viz.Graph.Legend
Gargantext.Core.Viz.Graph.Tools.Infomap
Gargantext.Core.Viz.Graph.Types
Gargantext.Core.Viz.Graph.Utils
Gargantext.Core.Viz.LegacyPhylo
......@@ -392,6 +393,7 @@ library
, hashable
, haskell-igraph
, hlcm
, hsinfomap
, hsparql
, hstatistics
, http-api-data
......
......@@ -179,6 +179,7 @@ library:
- hashable
- haskell-igraph
- hlcm
- hsinfomap
- hsparql
- hstatistics
- http-api-data
......
......@@ -30,6 +30,7 @@ import Gargantext.Core.Viz.Graph
import Gargantext.Core.Viz.Graph.Bridgeness (bridgeness, Partitions, ToComId(..))
import Gargantext.Core.Viz.Graph.Index (createIndices, toIndex, map2mat, mat2map, Index, MatrixShape(..))
import Gargantext.Core.Viz.Graph.Tools.IGraph (mkGraphUfromEdges, spinglass)
import Gargantext.Core.Viz.Graph.Tools.Infomap (infomap)
import Gargantext.Core.Viz.Graph.Utils (edgesFilter)
import Gargantext.Prelude
import Graph.Types (ClusterNode)
......@@ -47,7 +48,7 @@ import qualified IGraph as Igraph
import qualified IGraph.Algorithms.Layout as Layout
data PartitionMethod = Spinglass | Confluence
data PartitionMethod = Spinglass | Confluence | Infomap
deriving (Generic, Eq, Ord, Enum, Bounded, Show)
instance FromJSON PartitionMethod
instance ToJSON PartitionMethod
......@@ -93,6 +94,8 @@ cooc2graphWith :: PartitionMethod
-> IO Graph
cooc2graphWith Spinglass = cooc2graphWith' (spinglass 1)
cooc2graphWith Confluence= cooc2graphWith' (\x -> pure $ BAC.defaultClustering x)
cooc2graphWith Infomap = cooc2graphWith' (infomap "--silent --two-level -N2")
-- TODO: change these options, or make them configurable in UI?
cooc2graphWith' :: ToComId a
......
......@@ -98,6 +98,8 @@ extra-deps:
#- git: https://github.com/kaizhang/haskell-igraph.git
- git: https://github.com/alpmestan/haskell-igraph.git
commit: 9f55eb36639c8e0965c8bc539a57738869f33e9a
- git: https://gitlab.iscpif.fr/gargantext/haskell-infomap.git
commit: 76b795c1eaca37f43418d07da9fbdf5f4e7d8f5c
# Accelerate Linear Algebra and specific instances
# (UndecidableInstances for newer GHC version)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment