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
24a0af39
Commit
24a0af39
authored
Jun 02, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Confluence added (test KO).
parent
32783b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
+26
-11
Proxemy.hs
src/Gargantext/Viz/Graph/Proxemy.hs
+26
-4
Tools.hs
src/Gargantext/Viz/Graph/Tools.hs
+0
-7
No files found.
src/Gargantext/Viz/Graph/Proxemy.hs
View file @
24a0af39
...
...
@@ -34,17 +34,39 @@ type We = Bool
similarity_CONF_x_y
::
Graph_Undirected
->
(
Node
,
Node
)
->
Length
->
FalseReflexive
->
We
->
Double
similarity_CONF_x_y
g
(
x
,
y
)
l
r
_w
=
prox_x_y
/
(
prox_x_y
+
lim_SC
)
similarity_CONF_x_y
g
(
x
,
y
)
l
r
we
=
similarity
where
similarity
::
Double
similarity
|
denominator
==
0
=
0
|
otherwise
=
prox_x_y
/
denominator
where
denominator
=
prox_x_y
+
lim_SC
prox_x_y
::
Double
prox_x_y
=
maybe
0
identity
$
Map
.
lookup
y
xline
xline
::
Map
Node
Double
xline
=
prox_markov
g
[
x
]
l
r
filterNeighbors
xline
=
prox_markov
g
[
x
]
l
r
filterNeighbors'
where
filterNeighbors'
=
if
we
then
filterNeighbors
else
rm_edge_neighbors
y
pair_is_edge
::
Bool
pair_is_edge
=
if
we
then
False
else
List
.
elem
y
(
filterNeighbors
g
x
)
lim_SC
::
Double
lim_SC
=
(
degree
g
y
+
1
)
/
(
2
*
(
ecount
g
)
+
(
vcount
g
))
lim_SC
|
count
==
0
=
0
|
otherwise
=
if
pair_is_edge
then
(
degree
g
y
+
1
-
1
)
/
count
else
(
degree
g
y
+
1
)
/
count
where
count
=
if
pair_is_edge
then
(
2
*
(
ecount
g
)
+
(
vcount
g
)
-
2
)
else
(
2
*
(
ecount
g
)
+
(
vcount
g
))
rm_edge_neighbors
::
Node
->
Graph_Undirected
->
Node
->
[
Node
]
rm_edge_neighbors
b
g
a
=
List
.
filter
(
\
x
->
(
x
/=
a
)
||
(
x
/=
b
))
$
filterNeighbors
g
a
-- | TODO do as a Map instead of [Node] ?
prox_markov
::
Graph_Undirected
->
[
Node
]
->
Length
->
FalseReflexive
->
NeighborsFilter
->
Map
Node
Double
...
...
src/Gargantext/Viz/Graph/Tools.hs
View file @
24a0af39
...
...
@@ -78,17 +78,10 @@ data2graph labels coocs distance partitions = Graph nodes edges Nothing
,
edge_id
=
cs
(
show
i
)
}
|
(
i
,
((
s
,
t
),
w
))
<-
zip
([
0
..
]
::
[
Integer
])
(
Map
.
toList
distance
)
]
------------------------------------------------------------------------
data
Layout
=
KamadaKawai
|
ACP
|
ForceAtlas
setCoord''
::
Layout
->
(
Int
,
Node
)
->
Node
setCoord''
ForceAtlas
=
setCoord'
(
\
i
->
(
sin
$
fromIntegral
i
,
cos
$
fromIntegral
i
))
setCoord''
ACP
=
undefined
setCoord''
KamadaKawai
=
undefined
setCoord'
::
(
Int
->
(
Double
,
Double
))
->
(
Int
,
Node
)
->
Node
setCoord'
f
(
i
,
n
)
=
n
{
node_x_coord
=
x
,
node_y_coord
=
y
}
...
...
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