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
f9d09a80
Commit
f9d09a80
authored
Jul 26, 2019
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some addings linked to the memiescape
parent
ed3e51b0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
6 deletions
+18
-6
Main.hs
bin/gargantext-phylo/Main.hs
+1
-1
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+1
-1
Example.hs
src/Gargantext/Viz/Phylo/Example.hs
+1
-1
Export.hs
src/Gargantext/Viz/Phylo/View/Export.hs
+8
-3
Metrics.hs
src/Gargantext/Viz/Phylo/View/Metrics.hs
+7
-0
No files found.
bin/gargantext-phylo/Main.hs
View file @
f9d09a80
...
@@ -216,7 +216,7 @@ main = do
...
@@ -216,7 +216,7 @@ main = do
(
reBranchThr
conf
)
(
reBranchNth
conf
)
(
phyloLevel
conf
)
(
reBranchThr
conf
)
(
reBranchNth
conf
)
(
phyloLevel
conf
)
(
RelatedComponents
$
RCParams
$
WeightedLogJaccard
$
WLJParams
(
clusterTh
conf
)
(
clusterSens
conf
))
(
RelatedComponents
$
RCParams
$
WeightedLogJaccard
$
WLJParams
(
clusterTh
conf
)
(
clusterSens
conf
))
let
queryView
=
PhyloQueryView
(
viewLevel
conf
)
Merge
False
1
[
BranchAge
,
BranchBirth
]
[
SizeBranch
$
SBParams
(
minSizeBranch
conf
)]
[
GroupLabelIncDyn
,
BranchPeakInc
]
(
Just
(
ByBranchBirth
,
Asc
))
Json
Flat
True
let
queryView
=
PhyloQueryView
(
viewLevel
conf
)
Merge
False
1
[
BranchAge
,
BranchBirth
,
BranchGroups
]
[
SizeBranch
$
SBParams
(
minSizeBranch
conf
)]
[
GroupLabelIncDyn
,
BranchPeakInc
]
(
Just
(
ByBranchBirth
,
Asc
))
Json
Flat
True
let
phylo
=
toPhylo
query
corpus
termList
fis'
let
phylo
=
toPhylo
query
corpus
termList
fis'
...
...
src/Gargantext/Viz/Phylo.hs
View file @
f9d09a80
...
@@ -309,7 +309,7 @@ data SBParams = SBParams
...
@@ -309,7 +309,7 @@ data SBParams = SBParams
-- | Metric constructors
-- | Metric constructors
data
Metric
=
BranchAge
|
BranchBirth
deriving
(
Generic
,
Show
,
Eq
,
Read
)
data
Metric
=
BranchAge
|
BranchBirth
|
BranchGroups
deriving
(
Generic
,
Show
,
Eq
,
Read
)
----------------
----------------
...
...
src/Gargantext/Viz/Phylo/Example.hs
View file @
f9d09a80
...
@@ -83,7 +83,7 @@ queryViewEx = "level=3"
...
@@ -83,7 +83,7 @@ queryViewEx = "level=3"
phyloQueryView
::
PhyloQueryView
phyloQueryView
::
PhyloQueryView
phyloQueryView
=
PhyloQueryView
2
Merge
False
2
[
BranchAge
,
BranchBirth
]
[]
[
BranchPeakInc
,
GroupLabelIncDyn
]
(
Just
(
ByBranchBirth
,
Asc
))
Json
Flat
True
phyloQueryView
=
PhyloQueryView
2
Merge
False
2
[
BranchAge
,
BranchBirth
,
BranchGroups
]
[]
[
BranchPeakInc
,
GroupLabelIncDyn
]
(
Just
(
ByBranchBirth
,
Asc
))
Json
Flat
True
--------------------------------------------------
--------------------------------------------------
...
...
src/Gargantext/Viz/Phylo/View/Export.hs
View file @
f9d09a80
...
@@ -124,7 +124,8 @@ toDotLabel lbl = StrLabel $ fromStrict lbl
...
@@ -124,7 +124,8 @@ toDotLabel lbl = StrLabel $ fromStrict lbl
setPeakDotNode
::
PhyloBranch
->
Dot
DotId
setPeakDotNode
::
PhyloBranch
->
Dot
DotId
setPeakDotNode
pb
=
node
(
toBranchDotId
$
pb
^.
pb_id
)
setPeakDotNode
pb
=
node
(
toBranchDotId
$
pb
^.
pb_id
)
([
FillColor
[
toWColor
CornSilk
],
FontName
"Arial"
,
FontSize
40
,
Shape
Egg
,
Style
[
SItem
Bold
[]
],
Label
(
toDotLabel
$
pb
^.
pb_peak
)]
([
FillColor
[
toWColor
CornSilk
],
FontName
"Arial"
,
FontSize
40
,
Shape
Egg
,
Style
[
SItem
Bold
[]
],
Label
(
toDotLabel
$
pb
^.
pb_peak
)]
<>
(
setAttrFromMetrics
$
pb
^.
pb_metrics
))
<>
(
setAttrFromMetrics
$
pb
^.
pb_metrics
)
<>
[
setAttr
"nodeType"
"peak"
])
-- | To set a Peak Edge
-- | To set a Peak Edge
...
@@ -186,7 +187,8 @@ setHtmlTable pn = H.Table H.HTable
...
@@ -186,7 +187,8 @@ setHtmlTable pn = H.Table H.HTable
-- | To set a Node
-- | To set a Node
setDotNode
::
PhyloNode
->
Dot
DotId
setDotNode
::
PhyloNode
->
Dot
DotId
setDotNode
pn
=
node
(
toNodeDotId
$
pn
^.
pn_id
)
setDotNode
pn
=
node
(
toNodeDotId
$
pn
^.
pn_id
)
([
FontName
"Arial"
,
Shape
Square
,
toLabel
(
setHtmlTable
pn
)])
([
FontName
"Arial"
,
Shape
Square
,
toLabel
(
setHtmlTable
pn
)]
<>
[
setAttr
"nodeType"
"group"
])
-- | To set an Edge
-- | To set an Edge
...
@@ -235,7 +237,10 @@ viewToDot pv = digraph ((Str . fromStrict) $ pv ^. pv_title)
...
@@ -235,7 +237,10 @@ viewToDot pv = digraph ((Str . fromStrict) $ pv ^. pv_title)
-- set the period label
-- set the period label
node
(
toPeriodDotId
prd
)
[
Shape
Square
,
FontSize
50
,
Label
(
toPeriodDotLabel
prd
)]
node
(
toPeriodDotId
prd
)
([
Shape
Square
,
FontSize
50
,
Label
(
toPeriodDotLabel
prd
)]
<>
[
setAttr
"nodeType"
"period"
,
setAttr
"from"
(
fromStrict
$
T
.
pack
$
(
show
$
fst
prd
)),
setAttr
"to"
(
fromStrict
$
T
.
pack
$
(
show
$
snd
prd
))])
mapM
setDotNode
$
filterNodesByPeriod
prd
$
filterNodesByLevel
(
pv
^.
pv_level
)
(
pv
^.
pv_nodes
)
mapM
setDotNode
$
filterNodesByPeriod
prd
$
filterNodesByLevel
(
pv
^.
pv_level
)
(
pv
^.
pv_nodes
)
...
...
src/Gargantext/Viz/Phylo/View/Metrics.hs
View file @
f9d09a80
...
@@ -36,6 +36,12 @@ addBranchMetrics id lbl val v = over (pv_branches
...
@@ -36,6 +36,12 @@ addBranchMetrics id lbl val v = over (pv_branches
else
b
)
v
else
b
)
v
branchGroups
::
PhyloView
->
PhyloView
branchGroups
v
=
foldl
(
\
v'
(
bId
,
nb
)
->
addBranchMetrics
bId
"nbGroups"
nb
v'
)
v
$
map
(
\
(
bId
,
ns
)
->
(
bId
,
fromIntegral
$
length
ns
))
$
getNodesByBranches
v
-- | To get the age (in year) of all the branches of a PhyloView
-- | To get the age (in year) of all the branches of a PhyloView
branchAge
::
PhyloView
->
PhyloView
branchAge
::
PhyloView
->
PhyloView
branchAge
v
=
foldl
(
\
v'
b
->
let
bId
=
(
fst
.
(
head'
"branchAge"
))
b
branchAge
v
=
foldl
(
\
v'
b
->
let
bId
=
(
fst
.
(
head'
"branchAge"
))
b
...
@@ -63,6 +69,7 @@ processMetrics :: [Metric] -> Phylo -> PhyloView -> PhyloView
...
@@ -63,6 +69,7 @@ processMetrics :: [Metric] -> Phylo -> PhyloView -> PhyloView
processMetrics
ms
_p
v
=
foldl
(
\
v'
m
->
case
m
of
processMetrics
ms
_p
v
=
foldl
(
\
v'
m
->
case
m
of
BranchAge
->
branchAge
v'
BranchAge
->
branchAge
v'
BranchBirth
->
branchBirth
v'
BranchBirth
->
branchBirth
v'
BranchGroups
->
branchGroups
v'
-- _ -> panic "[ERR][Viz.Phylo.Example.processMetrics] metric not found"
-- _ -> panic "[ERR][Viz.Phylo.Example.processMetrics] metric not found"
)
v
ms
)
v
ms
...
...
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