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
9b0d6bb8
Commit
9b0d6bb8
authored
Jan 20, 2022
by
qlobbe
Committed by
Alexandre Delanoë
Feb 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
053fa8bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
WithList.hs
src/Gargantext/Core/Text/Terms/WithList.hs
+2
-2
PhyloExport.hs
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
+7
-5
No files found.
src/Gargantext/Core/Text/Terms/WithList.hs
View file @
9b0d6bb8
...
@@ -59,9 +59,9 @@ replaceTerms pats terms = go 0
...
@@ -59,9 +59,9 @@ replaceTerms pats terms = go 0
buildPatterns
::
TermList
->
Patterns
buildPatterns
::
TermList
->
Patterns
buildPatterns
=
sortWith
(
Down
.
_pat_length
)
.
concatMap
buildPattern
buildPatterns
=
sortWith
(
Down
.
_pat_length
)
.
concatMap
buildPattern
where
where
buildPattern
(
label
,
alts
)
=
map
f
(
label
:
alts
)
buildPattern
(
label
,
alts
)
=
map
f
$
map
(
\
alt
->
filter
(
/=
""
)
alt
)
(
label
:
alts
)
where
where
f
alt
|
""
`
elem
`
alt
=
error
"buildPatterns: ERR1"
f
alt
|
""
`
elem
`
alt
=
error
(
"buildPatterns: ERR1"
<>
show
(
label
))
|
null
alt
=
error
"buildPatterns: ERR2"
|
null
alt
=
error
"buildPatterns: ERR2"
|
otherwise
=
|
otherwise
=
Pattern
(
KMP
.
build
alt
)
(
length
alt
)
label
Pattern
(
KMP
.
build
alt
)
(
length
alt
)
label
...
...
src/Gargantext/Core/Viz/Phylo/PhyloExport.hs
View file @
9b0d6bb8
...
@@ -133,6 +133,7 @@ groupToDotNode fdt g bId =
...
@@ -133,6 +133,7 @@ groupToDotNode fdt g bId =
node
(
groupIdToDotId
$
getGroupId
g
)
node
(
groupIdToDotId
$
getGroupId
g
)
([
FontName
"Arial"
,
Shape
Square
,
penWidth
4
,
toLabel
(
groupToTable
fdt
g
)]
([
FontName
"Arial"
,
Shape
Square
,
penWidth
4
,
toLabel
(
groupToTable
fdt
g
)]
<>
[
toAttr
"nodeType"
"group"
<>
[
toAttr
"nodeType"
"group"
,
toAttr
"gid"
(
groupIdToDotId
$
getGroupId
g
)
,
toAttr
"from"
(
pack
$
show
(
fst
$
g
^.
phylo_groupPeriod
))
,
toAttr
"from"
(
pack
$
show
(
fst
$
g
^.
phylo_groupPeriod
))
,
toAttr
"to"
(
pack
$
show
(
snd
$
g
^.
phylo_groupPeriod
))
,
toAttr
"to"
(
pack
$
show
(
snd
$
g
^.
phylo_groupPeriod
))
,
toAttr
"strFrom"
(
pack
$
show
(
fst
$
g
^.
phylo_groupPeriod'
))
,
toAttr
"strFrom"
(
pack
$
show
(
fst
$
g
^.
phylo_groupPeriod'
))
...
@@ -142,6 +143,7 @@ groupToDotNode fdt g bId =
...
@@ -142,6 +143,7 @@ groupToDotNode fdt g bId =
,
toAttr
"support"
(
pack
$
show
(
g
^.
phylo_groupSupport
))
,
toAttr
"support"
(
pack
$
show
(
g
^.
phylo_groupSupport
))
,
toAttr
"weight"
(
pack
$
show
(
g
^.
phylo_groupWeight
))
,
toAttr
"weight"
(
pack
$
show
(
g
^.
phylo_groupWeight
))
,
toAttr
"source"
(
pack
$
show
(
nub
$
g
^.
phylo_groupSources
))
,
toAttr
"source"
(
pack
$
show
(
nub
$
g
^.
phylo_groupSources
))
,
toAttr
"sourceFull"
(
pack
$
show
(
g
^.
phylo_groupSources
))
,
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"
)))
...
@@ -164,11 +166,11 @@ toDotEdge' source target thr w edgeType = edge source target
...
@@ -164,11 +166,11 @@ toDotEdge' source target thr w edgeType = edge source target
toDotEdge
::
DotId
->
DotId
->
[
Char
]
->
EdgeType
->
Dot
DotId
toDotEdge
::
DotId
->
DotId
->
[
Char
]
->
EdgeType
->
Dot
DotId
toDotEdge
source
target
lbl
edgeType
=
edge
source
target
toDotEdge
source
target
lbl
edgeType
=
edge
source
target
(
case
edgeType
of
(
case
edgeType
of
GroupToGroup
->
[
Width
3
,
penWidth
4
,
Color
[
toWColor
Black
],
Constraint
True
]
<>
[
toAttr
"edgeType"
"link"
,
toAttr
"lbl"
(
pack
lbl
)]
GroupToGroup
->
[
Width
3
,
penWidth
4
,
Color
[
toWColor
Black
],
Constraint
True
]
<>
[
toAttr
"edgeType"
"link"
,
toAttr
"lbl"
(
pack
lbl
)
,
toAttr
"source"
source
,
toAttr
"target"
target
]
GroupToGroupMemory
->
undefined
GroupToGroupMemory
->
undefined
BranchToGroup
->
[
Width
3
,
Color
[
toWColor
Black
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
RightSide
,
DotArrow
)])]
<>
[
toAttr
"edgeType"
"branchLink"
]
BranchToGroup
->
[
Width
3
,
Color
[
toWColor
Black
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
RightSide
,
DotArrow
)])]
<>
[
toAttr
"edgeType"
"branchLink"
]
BranchToBranch
->
[
Width
2
,
Color
[
toWColor
Black
],
Style
[
SItem
Dashed
[]
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
BothSides
,
DotArrow
)])]
BranchToBranch
->
[
Width
2
,
Color
[
toWColor
Black
],
Style
[
SItem
Dashed
[]
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
BothSides
,
DotArrow
)])]
GroupToAncestor
->
[
Width
3
,
Color
[
toWColor
Red
],
Style
[
SItem
Dashed
[]
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
BothSides
,
NoArrow
)]),
PenWidth
4
]
<>
[
toAttr
"edgeType"
"ancestorLink"
,
toAttr
"lbl"
(
pack
lbl
)
]
GroupToAncestor
->
[
Width
3
,
Color
[
toWColor
Red
],
Style
[
SItem
Dashed
[]
],
ArrowHead
(
AType
[(
ArrMod
FilledArrow
BothSides
,
NoArrow
)]),
PenWidth
4
]
<>
[
toAttr
"edgeType"
"ancestorLink"
,
toAttr
"lbl"
(
pack
lbl
)
,
toAttr
"source"
source
,
toAttr
"target"
target
]
PeriodToPeriod
->
[
Width
5
,
Color
[
toWColor
Black
]])
PeriodToPeriod
->
[
Width
5
,
Color
[
toWColor
Black
]])
...
@@ -265,11 +267,11 @@ exportToDot phylo export =
...
@@ -265,11 +267,11 @@ exportToDot phylo export =
)
$
(
toList
.
mergePointers
)
$
export
^.
export_groups
)
$
(
toList
.
mergePointers
)
$
export
^.
export_groups
{- 8-bis) create the edges between the groups -}
{- 8-bis) create the edges between the groups -}
_
<-
mapM
(
\
((
k
,
k'
),
v
)
->
{-
_ <- mapM (\((k,k'),v) ->
toDotEdge' (groupIdToDotId k) (groupIdToDotId k') (show (fst v)) (show (snd v)) GroupToGroupMemory
toDotEdge' (groupIdToDotId k) (groupIdToDotId k') (show (fst v)) (show (snd v)) GroupToGroupMemory
)
$
mergePointersMemory
$
export
^.
export_groups
) $ mergePointersMemory $ export ^. export_groups
-}
_
<-
mapM
(
\
((
k
,
k'
),
v
)
->
_
<-
mapM
(
\
((
k
,
k'
),
v
)
->
toDotEdge
(
groupIdToDotId
k
)
(
groupIdToDotId
k'
)
(
show
v
)
GroupToAncestor
toDotEdge
(
groupIdToDotId
k
)
(
groupIdToDotId
k'
)
(
show
v
)
GroupToAncestor
)
$
mergeAncestors
$
export
^.
export_groups
)
$
mergeAncestors
$
export
^.
export_groups
...
...
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