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
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
Christian Merten
haskell-gargantext
Commits
fa7344cb
Commit
fa7344cb
authored
Oct 13, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP]
parent
3676c91f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Bridgeness.hs
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
+5
-3
No files found.
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
View file @
fa7344cb
...
...
@@ -21,7 +21,7 @@ module Gargantext.Core.Viz.Graph.Bridgeness -- (bridgeness)
import
Data.List
(
concat
,
sortOn
)
import
Data.Map
(
Map
,
fromListWith
,
lookup
,
toList
,
mapWithKey
,
elems
)
import
Data.Maybe
(
catMaybes
,
fromMaybe
)
import
Data.Maybe
(
catMaybes
{-, fromMaybe-}
)
import
Data.Set
(
Set
)
import
Gargantext.Prelude
import
Graph.Types
(
ClusterNode
(
..
))
...
...
@@ -66,13 +66,15 @@ bridgeness2 c m = Map.fromList
where
toKeep
::
Map
NodeId
(
Set
NodeId
)
!
toKeep
=
Map
.
fromListWith
(
<>
)
$
map
(
\
((
k1
,
k2
),
_v
)
->
if
k1
>
k2
$
map
(
\
((
k1
,
k2
),
_v
)
->
if
k1
>
k2
then
(
k1
,
Set
.
singleton
k2
)
else
(
k2
,
Set
.
singleton
k1
)
)
$
List
.
take
n
$
List
.
sortOn
(
Down
.
snd
)
$
Map
.
toList
c
$
catMaybes
$
map
(
\
ks
->
(,)
<$>
Just
ks
<*>
Map
.
lookup
ks
c
)
$
Map
.
keys
m
!
m'
=
Map
.
toList
m
n
::
Int
...
...
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