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
199
Issues
199
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
c3dc698d
Commit
c3dc698d
authored
Oct 12, 2020
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix digit
parent
0c34e661
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
PhyloExport.hs
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
+11
-8
PhyloTools.hs
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
+6
-0
No files found.
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
View file @
c3dc698d
...
@@ -142,6 +142,7 @@ groupToDotNode fdt g bId =
...
@@ -142,6 +142,7 @@ groupToDotNode fdt g bId =
,
toAttr
"lbl"
(
pack
$
show
(
ngramsToLabel
fdt
(
g
^.
phylo_groupNgrams
)))
,
toAttr
"lbl"
(
pack
$
show
(
ngramsToLabel
fdt
(
g
^.
phylo_groupNgrams
)))
,
toAttr
"foundation"
(
pack
$
show
(
idxToLabel
(
g
^.
phylo_groupNgrams
)))
,
toAttr
"foundation"
(
pack
$
show
(
idxToLabel
(
g
^.
phylo_groupNgrams
)))
,
toAttr
"role"
(
pack
$
show
(
idxToLabel'
((
g
^.
phylo_groupMeta
)
!
"dynamics"
)))
,
toAttr
"role"
(
pack
$
show
(
idxToLabel'
((
g
^.
phylo_groupMeta
)
!
"dynamics"
)))
,
toAttr
"frequence"
(
pack
$
show
(
idxToLabel'
((
g
^.
phylo_groupMeta
)
!
"frequence"
)))
])
])
...
@@ -192,7 +193,7 @@ exportToDot phylo export =
...
@@ -192,7 +193,7 @@ exportToDot phylo export =
,(
toAttr
(
fromStrict
"phyloPeriods"
)
$
pack
$
show
(
length
$
elems
$
phylo
^.
phylo_periods
))
,(
toAttr
(
fromStrict
"phyloPeriods"
)
$
pack
$
show
(
length
$
elems
$
phylo
^.
phylo_periods
))
,(
toAttr
(
fromStrict
"phyloBranches"
)
$
pack
$
show
(
length
$
export
^.
export_branches
))
,(
toAttr
(
fromStrict
"phyloBranches"
)
$
pack
$
show
(
length
$
export
^.
export_branches
))
,(
toAttr
(
fromStrict
"phyloGroups"
)
$
pack
$
show
(
length
$
export
^.
export_groups
))
,(
toAttr
(
fromStrict
"phyloGroups"
)
$
pack
$
show
(
length
$
export
^.
export_groups
))
,(
toAttr
(
fromStrict
"phyloTermsFreq"
)
$
pack
$
show
(
toList
$
_phylo_lastTermFreq
phylo
))
--
,(toAttr (fromStrict "phyloTermsFreq") $ pack $ show (toList $ _phylo_lastTermFreq phylo))
])
])
{-
{-
...
@@ -201,7 +202,7 @@ exportToDot phylo export =
...
@@ -201,7 +202,7 @@ exportToDot phylo export =
-- 2) create a layer for the branches labels -}
-- 2) create a layer for the branches labels -}
subgraph
(
Str
"Branches peaks"
)
$
do
subgraph
(
Str
"Branches peaks"
)
$
do
graphAttrs
[
Rank
SameRank
]
--
graphAttrs [Rank SameRank]
{-
{-
-- 3) group the branches by hierarchy
-- 3) group the branches by hierarchy
-- mapM (\branches ->
-- mapM (\branches ->
...
@@ -368,8 +369,8 @@ inclusion m l i = ( (sum $ map (\j -> conditional m j i) l)
...
@@ -368,8 +369,8 @@ inclusion m l i = ( (sum $ map (\j -> conditional m j i) l)
+
(
sum
$
map
(
\
j
->
conditional
m
i
j
)
l
))
/
(
fromIntegral
$
(
length
l
)
+
1
)
+
(
sum
$
map
(
\
j
->
conditional
m
i
j
)
l
))
/
(
fromIntegral
$
(
length
l
)
+
1
)
ngramsMetrics
::
PhyloExport
->
PhyloExport
ngramsMetrics
::
Phylo
->
Phylo
Export
->
PhyloExport
ngramsMetrics
export
=
ngramsMetrics
phylo
export
=
over
(
export_groups
over
(
export_groups
.
traverse
)
.
traverse
)
(
\
g
->
g
&
phylo_groupMeta
%~
insert
"genericity"
(
\
g
->
g
&
phylo_groupMeta
%~
insert
"genericity"
...
@@ -378,6 +379,8 @@ ngramsMetrics export =
...
@@ -378,6 +379,8 @@ ngramsMetrics export =
(
map
(
\
n
->
specificity
(
g
^.
phylo_groupCooc
)
((
g
^.
phylo_groupNgrams
)
\\
[
n
])
n
)
$
g
^.
phylo_groupNgrams
)
(
map
(
\
n
->
specificity
(
g
^.
phylo_groupCooc
)
((
g
^.
phylo_groupNgrams
)
\\
[
n
])
n
)
$
g
^.
phylo_groupNgrams
)
&
phylo_groupMeta
%~
insert
"inclusion"
&
phylo_groupMeta
%~
insert
"inclusion"
(
map
(
\
n
->
inclusion
(
g
^.
phylo_groupCooc
)
((
g
^.
phylo_groupNgrams
)
\\
[
n
])
n
)
$
g
^.
phylo_groupNgrams
)
(
map
(
\
n
->
inclusion
(
g
^.
phylo_groupCooc
)
((
g
^.
phylo_groupNgrams
)
\\
[
n
])
n
)
$
g
^.
phylo_groupNgrams
)
&
phylo_groupMeta
%~
insert
"frequence"
(
map
(
\
n
->
getInMap
n
(
phylo
^.
phylo_lastTermFreq
))
$
g
^.
phylo_groupNgrams
)
)
export
)
export
...
@@ -397,9 +400,9 @@ branchDating export =
...
@@ -397,9 +400,9 @@ branchDating export =
&
branch_meta
%~
insert
"age"
[
fromIntegral
age
]
&
branch_meta
%~
insert
"age"
[
fromIntegral
age
]
&
branch_meta
%~
insert
"size"
[
fromIntegral
$
length
periods
]
)
export
&
branch_meta
%~
insert
"size"
[
fromIntegral
$
length
periods
]
)
export
processMetrics
::
PhyloExport
->
PhyloExport
processMetrics
::
Phylo
->
Phylo
Export
->
PhyloExport
processMetrics
export
=
ngramsMetrics
processMetrics
phylo
export
=
ngramsMetrics
phylo
$
branchDating
export
$
branchDating
export
-----------------
-----------------
...
@@ -630,7 +633,7 @@ toPhyloExport phylo = exportToDot phylo
...
@@ -630,7 +633,7 @@ toPhyloExport phylo = exportToDot phylo
$
processFilters
(
exportFilter
$
getConfig
phylo
)
(
phyloQuality
$
getConfig
phylo
)
$
processFilters
(
exportFilter
$
getConfig
phylo
)
(
phyloQuality
$
getConfig
phylo
)
$
processSort
(
exportSort
$
getConfig
phylo
)
(
getSeaElevation
phylo
)
$
processSort
(
exportSort
$
getConfig
phylo
)
(
getSeaElevation
phylo
)
$
processLabels
(
exportLabel
$
getConfig
phylo
)
(
getRoots
phylo
)
(
_phylo_lastTermFreq
phylo
)
$
processLabels
(
exportLabel
$
getConfig
phylo
)
(
getRoots
phylo
)
(
_phylo_lastTermFreq
phylo
)
$
processMetrics
export
$
processMetrics
phylo
export
where
where
export
::
PhyloExport
export
::
PhyloExport
export
=
PhyloExport
groups
branches
export
=
PhyloExport
groups
branches
...
...
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
View file @
c3dc698d
...
@@ -69,6 +69,12 @@ truncate' x n = (fromIntegral $ (floor (x * t) :: Int)) / t
...
@@ -69,6 +69,12 @@ truncate' x n = (fromIntegral $ (floor (x * t) :: Int)) / t
t
::
Double
t
::
Double
t
=
10
^
n
t
=
10
^
n
getInMap
::
Int
->
Map
Int
Double
->
Double
getInMap
k
m
=
if
(
member
k
m
)
then
m
!
k
else
0
roundToStr
::
(
PrintfArg
a
,
Floating
a
)
=>
Int
->
a
->
String
roundToStr
::
(
PrintfArg
a
,
Floating
a
)
=>
Int
->
a
->
String
roundToStr
=
printf
"%0.*f"
roundToStr
=
printf
"%0.*f"
...
...
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