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
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
cb1136b4
Commit
cb1136b4
authored
Sep 11, 2019
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export done
parent
bba0632d
Pipeline
#569
failed with stage
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
222 additions
and
30 deletions
+222
-30
AdaptativePhylo.hs
src/Gargantext/Viz/AdaptativePhylo.hs
+4
-3
PhyloExample.hs
src/Gargantext/Viz/Phylo/PhyloExample.hs
+10
-1
PhyloExport.hs
src/Gargantext/Viz/Phylo/PhyloExport.hs
+194
-24
PhyloMaker.hs
src/Gargantext/Viz/Phylo/PhyloMaker.hs
+2
-1
PhyloTools.hs
src/Gargantext/Viz/Phylo/PhyloTools.hs
+12
-1
No files found.
src/Gargantext/Viz/AdaptativePhylo.hs
View file @
cb1136b4
...
...
@@ -105,8 +105,8 @@ defaultConfig =
,
outputPath
=
""
,
corpusParser
=
Csv
1000
,
phyloName
=
pack
"Default Phylo"
,
phyloLevel
=
2
,
phyloProximity
=
WeightedLogJaccard
10
0
0.
2
,
phyloLevel
=
1
,
phyloProximity
=
WeightedLogJaccard
10
0
0.
1
,
timeUnit
=
Year
3
1
5
,
contextualUnit
=
Fis
2
4
,
exportLabel
=
[
BranchLabel
MostInclusive
2
,
GroupLabel
MostEmergentInclusive
2
]
...
...
@@ -311,6 +311,8 @@ data PhyloFis = PhyloFis
type
DotId
=
TextLazy
.
Text
data
EdgeType
=
GroupToGroup
|
BranchToGroup
|
BranchToBranch
|
PeriodToPeriod
deriving
(
Show
,
Generic
,
Eq
)
data
Filter
=
ByBranchSize
{
_branch_size
::
Double
}
deriving
(
Show
,
Generic
,
Eq
)
data
Order
=
Asc
|
Desc
deriving
(
Show
,
Generic
,
Eq
)
...
...
@@ -333,7 +335,6 @@ data PhyloBranch =
{
_branch_id
::
PhyloBranchId
,
_branch_label
::
Text
,
_branch_meta
::
Map
Text
[
Double
]
,
_branch_cluster
::
[
Int
]
}
deriving
(
Generic
,
Show
)
data
PhyloExport
=
...
...
src/Gargantext/Viz/Phylo/PhyloExample.hs
View file @
cb1136b4
...
...
@@ -29,13 +29,22 @@ import Gargantext.Text.Terms.Mono (monoTexts)
import
Gargantext.Viz.AdaptativePhylo
import
Gargantext.Viz.Phylo.PhyloTools
import
Gargantext.Viz.Phylo.PhyloMaker
import
Gargantext.Viz.Phylo.PhyloExport
import
Gargantext.Viz.Phylo.TemporalMatching
(
temporalMatching
)
import
Control.Lens
import
Data.GraphViz.Types.Generalised
(
DotGraph
)
import
qualified
Data.Vector
as
Vector
phyloExport
::
IO
()
phyloExport
=
dotToFile
"/home/qlobbe/data/phylo/output/cesar_cleopatre_V2.dot"
phyloDot
phyloDot
::
DotGraph
DotId
phyloDot
=
toPhyloExport
phylo1
-----------------------------------------------
-- | STEP 3 | -- Build the Level 1 of the Phylo
-----------------------------------------------
...
...
@@ -82,7 +91,7 @@ nbDocsByYear = docsToTimeScaleNb docs
config
::
Config
config
=
defaultConfig
{
phyloName
=
"Cesar et Cleopatre"
,
exportFilter
=
[
ByBranchSize
2
]
,
exportFilter
=
[
ByBranchSize
0
]
,
contextualUnit
=
Fis
0
0
}
...
...
src/Gargantext/Viz/Phylo/PhyloExport.hs
View file @
cb1136b4
This diff is collapsed.
Click to expand it.
src/Gargantext/Viz/Phylo/PhyloMaker.hs
View file @
cb1136b4
...
...
@@ -46,7 +46,8 @@ toPhylo docs lst conf = phylo1
where
--------------------------------------
phylo1
::
Phylo
phylo1
=
toPhylo1
docs
phyloBase
phylo1
=
temporalMatching
$
toPhylo1
docs
phyloBase
--------------------------------------
phyloBase
::
Phylo
phyloBase
=
toPhyloBase
docs
lst
conf
...
...
src/Gargantext/Viz/Phylo/PhyloTools.hs
View file @
cb1136b4
...
...
@@ -17,7 +17,7 @@ Portability : POSIX
module
Gargantext.Viz.Phylo.PhyloTools
where
import
Data.Vector
(
Vector
,
elemIndex
)
import
Data.List
(
sort
,
concat
,
null
,
union
,
(
++
),
tails
,
sortOn
,
nub
,
init
)
import
Data.List
(
sort
,
concat
,
null
,
union
,
(
++
),
tails
,
sortOn
,
nub
,
init
,
tail
)
import
Data.Set
(
Set
,
size
)
import
Data.Map
(
Map
,
elems
,
fromList
,
unionWith
,
keys
,
member
,
(
!
),
filterWithKey
)
import
Data.String
(
String
)
...
...
@@ -284,6 +284,17 @@ getThresholdStep proxi = case proxi of
-- | Branch | --
----------------
intersectInit
::
Eq
a
=>
[
a
]
->
[
a
]
->
[
a
]
->
[
a
]
intersectInit
acc
lst
lst'
=
if
(
null
lst
)
||
(
null
lst'
)
then
acc
else
if
(
head'
"intersectInit"
lst
)
==
(
head'
"intersectInit"
lst'
)
then
intersectInit
(
acc
++
[
head'
"intersectInit"
lst
])
(
tail
lst
)
(
tail
lst'
)
else
acc
branchIdsToProximity
::
PhyloBranchId
->
PhyloBranchId
->
Double
->
Double
->
Double
branchIdsToProximity
id
id'
thrInit
thrStep
=
thrInit
+
thrStep
*
(
fromIntegral
$
length
$
intersectInit
[]
(
snd
id
)
(
snd
id'
))
ngramsInBranches
::
[[
PhyloGroup
]]
->
[
Int
]
ngramsInBranches
branches
=
nub
$
foldl
(
\
acc
g
->
acc
++
(
g
^.
phylo_groupNgrams
))
[]
$
concat
branches
...
...
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