Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
3bf1b44c
Commit
3bf1b44c
authored
Mar 08, 2019
by
Quentin Lobbé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the clustering up to level 2 and more
parent
a4815b58
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
75 deletions
+130
-75
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+8
-1
Example.hs
src/Gargantext/Viz/Phylo/Example.hs
+107
-73
Tools.hs
src/Gargantext/Viz/Phylo/Tools.hs
+15
-1
No files found.
src/Gargantext/Viz/Phylo.hs
View file @
3bf1b44c
...
...
@@ -189,7 +189,14 @@ data PhyloError = LevelDoesNotExist
deriving
(
Show
)
data
Proximity
=
WeightedLogJaccard
|
Other
type
PhyloGraph
=
(
PhyloNodes
,
PhyloEdges
)
type
PhyloNodes
=
[
PhyloGroup
]
type
PhyloEdges
=
[(((
PhyloGroup
,
PhyloGroup
)),
Double
)]
data
Proximity
=
WeightedLogJaccard
|
Hamming
|
FromPairs
data
Clustering
=
Louvain
|
RelatedComponents
data
PairTo
=
Childs
|
Parents
...
...
src/Gargantext/Viz/Phylo/Example.hs
View file @
3bf1b44c
This diff is collapsed.
Click to expand it.
src/Gargantext/Viz/Phylo/Tools.hs
View file @
3bf1b44c
...
...
@@ -18,7 +18,7 @@ module Gargantext.Viz.Phylo.Tools
where
import
Control.Lens
hiding
(
both
,
Level
)
import
Data.List
(
filter
,
intersect
,
(
++
),
sort
,
null
,
head
,
tail
,
last
,
tails
)
import
Data.List
(
filter
,
intersect
,
(
++
),
sort
,
null
,
head
,
tail
,
last
,
tails
,
delete
,
nub
)
import
Data.Map
(
Map
,
mapKeys
,
member
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
...
...
@@ -117,6 +117,11 @@ filterNestedSets h l l'
|
otherwise
=
filterNestedSets
(
head
l
)
(
tail
l
)
(
h
:
l'
)
-- | To filter some PhyloEdges with a given threshold
filterPhyloEdges
::
Double
->
PhyloEdges
->
PhyloEdges
filterPhyloEdges
thr
edges
=
filter
(
\
((
s
,
t
),
w
)
->
w
>
thr
)
edges
-- | To get the PhyloGroups Childs of a PhyloGroup
getGroupChilds
::
PhyloGroup
->
Phylo
->
[
PhyloGroup
]
getGroupChilds
g
p
=
getGroupsFromIds
(
map
fst
$
_phylo_groupPeriodChilds
g
)
p
...
...
@@ -222,6 +227,15 @@ getLevelLinkValue dir link = case dir of
_
->
panic
"[ERR][Viz.Phylo.Tools.getLevelLinkValue] Wrong direction"
-- | To get the neighbours (directed/undirected) of a PhyloGroup from a list of PhyloEdges
getNeighbours
::
Bool
->
PhyloGroup
->
PhyloEdges
->
[
PhyloGroup
]
getNeighbours
directed
g
e
=
case
directed
of
True
->
map
(
\
((
s
,
t
),
w
)
->
t
)
$
filter
(
\
((
s
,
t
),
w
)
->
s
==
g
)
e
False
->
map
(
\
((
s
,
t
),
w
)
->
head
$
delete
g
$
nub
[
s
,
t
,
g
])
$
filter
(
\
((
s
,
t
),
w
)
->
s
==
g
||
t
==
g
)
e
-- | To get the Branches of a Phylo
getPhyloBranches
::
Phylo
->
[
PhyloBranch
]
getPhyloBranches
=
_phylo_branches
...
...
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