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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
d23d746c
Commit
d23d746c
authored
Feb 27, 2024
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Discrimination nub on relatedComponents
parent
b48af3e4
Pipeline
#5660
failed with stages
in 89 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
PhyloTools.hs
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
+6
-5
No files found.
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
View file @
d23d746c
...
...
@@ -16,18 +16,19 @@ Portability : POSIX
module
Gargantext.Core.Viz.Phylo.PhyloTools
where
import
Control.Lens
hiding
(
Level
)
import
Data.
List
(
union
,
nub
,
init
,
tail
,
partition
,
nubBy
,
(
!!
))
import
Data.
Discrimination
qualified
as
D
import
Data.List
qualified
as
List
import
Data.List
(
union
,
nub
,
init
,
tail
,
partition
,
nubBy
,
(
!!
))
import
Data.Map
(
elems
,
empty
,
fromList
,
findWithDefault
,
unionWith
,
keys
,
member
,
(
!
),
filterWithKey
,
fromListWith
,
restrictKeys
)
import
Data.Map
qualified
as
Map
import
Data.Maybe
(
fromJust
)
import
Data.Set
(
disjoint
)
import
Data.Set
qualified
as
Set
import
Data.String
(
String
)
import
Data.Text
(
unpack
)
import
Data.Text
qualified
as
Text
import
Data.
Vector
(
Vector
,
elemIndex
)
import
Data.
Text
(
unpack
)
import
Data.Vector
qualified
as
Vector
import
Data.Vector
(
Vector
,
elemIndex
)
import
Gargantext.Core.Viz.Phylo
import
Gargantext.Prelude
hiding
(
empty
)
import
Prelude
(
read
)
...
...
@@ -693,13 +694,13 @@ groupsToBranches' groups =
in
map
(
\
g
->
g
&
phylo_groupBranchId
%~
(
\
(
lvl
,
_
)
->
(
lvl
,
bId
)))
groups'
)
graph
relatedComponents
::
Ord
a
=>
[[
a
]]
->
[[
a
]]
relatedComponents
::
(
D
.
Grouping
a
,
Ord
a
)
=>
[[
a
]]
->
[[
a
]]
relatedComponents
graph
=
foldl'
(
\
branches
groups
->
if
(
null
branches
)
then
branches
++
[
groups
]
else
let
branchPart
=
partition
(
\
branch
->
disjoint
(
Set
.
fromList
branch
)
(
Set
.
fromList
groups
))
branches
in
(
fst
branchPart
)
++
[
nub
$
concat
$
(
snd
branchPart
)
++
[
groups
]])
[]
graph
in
(
fst
branchPart
)
++
[
D
.
nub
$
concat
$
(
snd
branchPart
)
++
[
groups
]])
[]
graph
toRelatedComponents
::
[
PhyloGroup
]
->
[((
PhyloGroup
,
PhyloGroup
),
Double
)]
->
[[
PhyloGroup
]]
...
...
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