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
b7409d1b
Commit
b7409d1b
authored
Mar 21, 2019
by
Quentin Lobbé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the Metrics and the Filters
parent
f5ebe987
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
90 deletions
+192
-90
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+13
-9
Example.hs
src/Gargantext/Viz/Phylo/Example.hs
+145
-77
Tools.hs
src/Gargantext/Viz/Phylo/Tools.hs
+34
-4
No files found.
src/Gargantext/Viz/Phylo.hs
View file @
b7409d1b
...
...
@@ -199,13 +199,14 @@ data PairTo = Childs | Parents
-- | PhyloView | --
data
EdgeType
=
Ascendant
|
Descendant
|
Complete
deriving
(
Show
)
data
Filiation
=
Ascendant
|
Descendant
|
Complete
deriving
(
Show
)
data
EdgeType
=
PeriodEdge
|
LevelEdge
deriving
(
Show
)
data
PhyloView
=
PhyloView
{
_phylo_viewParam
::
PhyloParam
,
_phylo_viewLabel
::
Text
,
_phylo_viewDescription
::
Text
,
_phylo_view
EdgeType
::
EdgeType
,
_phylo_view
Filiation
::
Filiation
,
_phylo_viewMeta
::
Map
Text
Double
,
_phylo_viewBranches
::
[
PhyloBranch
]
,
_phylo_viewNodes
::
[
PhyloNode
]
...
...
@@ -223,12 +224,14 @@ data PhyloBranch = PhyloBranch
data
PhyloEdge
=
PhyloEdge
{
_phylo_edgeSource
::
PhyloGroupId
,
_phylo_edgeTarget
::
PhyloGroupId
,
_phylo_edgeType
::
EdgeType
,
_phylo_edgeWeight
::
Weight
}
deriving
(
Show
)
data
PhyloNode
=
PhyloNode
{
_phylo_nodeId
::
PhyloGroupId
,
_phylo_nodeBranchId
::
Maybe
PhyloBranchId
,
_phylo_nodeLabel
::
Text
,
_phylo_nodeNgramsIdx
::
[
Int
]
,
_phylo_nodeNgrams
::
Maybe
[
Ngrams
]
...
...
@@ -239,7 +242,7 @@ data PhyloNode = PhyloNode
-- | PhyloQuery | --
data
Filter
=
LonelyBranch
Filter
data
Filter
=
LonelyBranch
data
Metric
=
BranchAge
data
Tagger
=
BranchLabelFreq
|
GroupLabelCooc
|
GroupDynamics
...
...
@@ -247,16 +250,13 @@ data Tagger = BranchLabelFreq | GroupLabelCooc | GroupDynamics
data
Sort
=
ByBranchAge
data
Order
=
Asc
|
Desc
data
QueryParam
=
Qp1
Int
|
Qp2
Text
|
Qp3
Bool
deriving
(
Eq
,
Ord
)
data
DisplayMode
=
Flat
|
Nested
-- | A query filter seen as : prefix && ((filter params)(clause))
data
QueryFilter
=
QueryFilter
{
_query_filter
::
Filter
,
_query_params
::
[
QueryParam
]
,
_query_clause
::
(
QueryParam
->
Bool
)
,
_query_params
::
[
Double
]
}
...
...
@@ -264,8 +264,8 @@ data QueryFilter = QueryFilter
data
PhyloQuery
=
PhyloQuery
{
_query_lvl
::
Level
-- Does the PhyloGraph contain ascendant, descendant or
both (filiation) edges
?
,
_query_
edgeType
::
EdgeType
-- Does the PhyloGraph contain ascendant, descendant or
a complete Filiation
?
,
_query_
filiation
::
Filiation
-- Does the PhyloGraph contain some levelChilds ? How deep must it go ?
,
_query_childs
::
Bool
...
...
@@ -300,6 +300,10 @@ makeLenses ''PhyloLevel
makeLenses
''
P
hyloPeriod
makeLenses
''
P
hyloView
makeLenses
''
P
hyloQuery
makeLenses
''
P
hyloBranch
makeLenses
''
P
hyloNode
makeLenses
''
P
hyloEdge
makeLenses
''
Q
ueryFilter
-- | JSON instances
$
(
deriveJSON
(
unPrefix
"_phylo_"
)
''
P
hylo
)
...
...
src/Gargantext/Viz/Phylo/Example.hs
View file @
b7409d1b
This diff is collapsed.
Click to expand it.
src/Gargantext/Viz/Phylo/Tools.hs
View file @
b7409d1b
...
...
@@ -140,7 +140,7 @@ getGroupBranchId = _phylo_groupBranchId
-- | To get the PhyloGroups Childs of a PhyloGroup
getGroupChilds
::
PhyloGroup
->
Phylo
->
[
PhyloGroup
]
getGroupChilds
g
p
=
getGroupsFromIds
(
map
fst
$
_phylo_groupPeriodChilds
g
)
p
getGroupChilds
g
p
=
getGroupsFromIds
(
getGroupPeriodChildsId
g
)
p
-- | To get the id of a PhyloGroup
...
...
@@ -158,14 +158,24 @@ getGroupLevel :: PhyloGroup -> Int
getGroupLevel
=
snd
.
fst
.
getGroupId
-- | To get the level child pointers of a PhyloGroup
getGroupLevelChilds
::
PhyloGroup
->
[
Pointer
]
getGroupLevelChilds
=
_phylo_groupLevelChilds
-- | To get the PhyloGroups Level Childs Ids of a PhyloGroup
getGroupLevelChildsId
::
PhyloGroup
->
[
PhyloGroupId
]
getGroupLevelChildsId
g
=
map
fst
$
_phylo_groupLevelChilds
g
getGroupLevelChildsId
g
=
map
fst
$
getGroupLevelChilds
g
-- | To get the level parent pointers of a PhyloGroup
getGroupLevelParents
::
PhyloGroup
->
[
Pointer
]
getGroupLevelParents
=
_phylo_groupLevelParents
-- | To get the PhyloGroups Level Parents Ids of a PhyloGroup
getGroupLevelParentsId
::
PhyloGroup
->
[
PhyloGroupId
]
getGroupLevelParentsId
g
=
map
fst
$
_phylo_g
roupLevelParents
g
getGroupLevelParentsId
g
=
map
fst
$
getG
roupLevelParents
g
-- | To get the Ngrams of a PhyloGroup
...
...
@@ -180,7 +190,7 @@ getGroupPairs g p = (getGroupChilds g p) ++ (getGroupParents g p)
-- | To get the PhyloGroups Parents of a PhyloGroup
getGroupParents
::
PhyloGroup
->
Phylo
->
[
PhyloGroup
]
getGroupParents
g
p
=
getGroupsFromIds
(
map
fst
$
_phylo_groupPeriodParents
g
)
p
getGroupParents
g
p
=
getGroupsFromIds
(
getGroupPeriodParentsId
g
)
p
-- | To get the period out of the id of a PhyloGroup
...
...
@@ -188,6 +198,26 @@ getGroupPeriod :: PhyloGroup -> (Date,Date)
getGroupPeriod
=
fst
.
fst
.
getGroupId
-- | To get the period child pointers of a PhyloGroup
getGroupPeriodChilds
::
PhyloGroup
->
[
Pointer
]
getGroupPeriodChilds
=
_phylo_groupPeriodChilds
-- | To get the PhyloGroups Period Parents Ids of a PhyloGroup
getGroupPeriodChildsId
::
PhyloGroup
->
[
PhyloGroupId
]
getGroupPeriodChildsId
g
=
map
fst
$
getGroupPeriodChilds
g
-- | To get the period parent pointers of a PhyloGroup
getGroupPeriodParents
::
PhyloGroup
->
[
Pointer
]
getGroupPeriodParents
=
_phylo_groupPeriodParents
-- | To get the PhyloGroups Period Parents Ids of a PhyloGroup
getGroupPeriodParentsId
::
PhyloGroup
->
[
PhyloGroupId
]
getGroupPeriodParentsId
g
=
map
fst
$
getGroupPeriodParents
g
-- | To get all the PhyloGroup of a Phylo
getGroups
::
Phylo
->
[
PhyloGroup
]
getGroups
=
view
(
phylo_periods
...
...
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