Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
154
Issues
154
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
c08d6972
Commit
c08d6972
authored
Mar 14, 2019
by
Alexandre Delanoë
Committed by
Quentin Lobbé
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PHYLO] cLouvain in IO Monad fix.
parent
044f740c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+1
-1
Cluster.hs
src/Gargantext/Viz/Phylo/Aggregates/Cluster.hs
+2
-2
Clustering.hs
src/Gargantext/Viz/Phylo/Metrics/Clustering.hs
+14
-13
No files found.
src/Gargantext/Viz/Phylo.hs
View file @
c08d6972
...
...
@@ -131,7 +131,7 @@ data PhyloGroup =
,
_phylo_groupLevelParents
::
[
Pointer
]
,
_phylo_groupLevelChilds
::
[
Pointer
]
}
deriving
(
Generic
,
Show
,
Eq
)
deriving
(
Generic
,
Show
,
Eq
,
Ord
)
data
PhyloBranch
=
PhyloBranch
{
_phylo_branchId
::
(
Level
,
Int
)
...
...
src/Gargantext/Viz/Phylo/Aggregates/Cluster.hs
View file @
c08d6972
...
...
@@ -37,7 +37,7 @@ import qualified Data.Set as Set
-- | To apply a Clustering method to a PhyloGraph
graphToClusters
::
(
Clustering
,[
Double
])
->
PhyloGraph
->
[[
PhyloGroup
]]
graphToClusters
(
clust
,
param
)
(
nodes
,
edges
)
=
case
clust
of
Louvain
->
louvain
(
nodes
,
edges
)
Louvain
->
undefined
--
louvain (nodes,edges)
RelatedComponents
->
relatedComp
0
(
head
nodes
)
(
tail
nodes
,
edges
)
[]
[]
...
...
@@ -49,4 +49,4 @@ phyloToClusters lvl (prox,param) (clus,param') p = Map.fromList
in
if
null
(
fst
graph
)
then
[]
else
graphToClusters
(
clus
,
param'
)
graph
)
(
getPhyloPeriods
p
))
\ No newline at end of file
(
getPhyloPeriods
p
))
src/Gargantext/Viz/Phylo/Metrics/Clustering.hs
View file @
c08d6972
...
...
@@ -59,19 +59,20 @@ relatedComp idx curr (nodes,edges) next memo
--------------------------------------
{-
louvain :: (PhyloNodes,PhyloEdges) -> [Cluster]
louvain (nodes,edges) = undefined
-}
-- louvain :: (PhyloNodes,PhyloEdges) -> [Cluster]
-- louvain (nodes,edges) = map (\community -> map (\node -> nodes !! (l_node_id node)) community)
-- $ groupBy (l_community_id)
-- $ cLouvain
-- $ mapKeys (\(x,y) -> (idx x, idx y))
-- $ fromList edges
-- where
-- --------------------------------------
-- idx :: PhyloGroup -> Int
-- idx e = case elemIndex e nodes of
-- Nothing -> panic "[ERR][Gargantext.Viz.Phylo.Metrics.Clustering] a node is missing"
-- Just i -> i
-- --------------------------------------
\ No newline at end of file
louvain
::
(
PhyloNodes
,
PhyloEdges
)
->
IO
[[
PhyloGroup
]]
louvain
(
nodes
,
edges
)
=
map
(
\
community
->
map
(
\
node
->
nodes
!!
(
l_node_id
node
))
community
)
<$>
groupBy
(
\
a
b
->
(
l_community_id
a
)
==
(
l_community_id
b
))
<$>
(
cLouvain
$
mapKeys
(
\
(
x
,
y
)
->
(
idx
x
,
idx
y
))
$
fromList
edges
)
where
--------------------------------------
idx
::
PhyloGroup
->
Int
idx
e
=
case
elemIndex
e
nodes
of
Nothing
->
panic
"[ERR][Gargantext.Viz.Phylo.Metrics.Clustering] a node is missing"
Just
i
->
i
--------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment