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
Grégoire Locqueville
haskell-gargantext
Commits
8b6fdb1b
Verified
Commit
8b6fdb1b
authored
Feb 16, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] some more imports refactoring
parent
d68e6080
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
120 additions
and
113 deletions
+120
-113
gargantext.cabal
gargantext.cabal
+1
-1
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+6
-8
Update.hs
src/Gargantext/API/Node/Update.hs
+1
-2
MaxClique.hs
src/Gargantext/Core/Methods/Graph/MaxClique.hs
+3
-2
Chart.hs
src/Gargantext/Core/Viz/Chart.hs
+1
-1
Graph.hs
src/Gargantext/Core/Viz/Graph.hs
+9
-5
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+4
-4
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+25
-50
IGraph.hs
src/Gargantext/Core/Viz/Graph/Tools/IGraph.hs
+29
-28
Types.hs
src/Gargantext/Core/Viz/Graph/Types.hs
+24
-0
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+1
-2
Utils.hs
src/Gargantext/Database/Action/Flow/Utils.hs
+4
-8
Clustering.hs
test/Test/Graph/Clustering.hs
+0
-1
PaginationCorpus.hs
test/Test/Ngrams/Query/PaginationCorpus.hs
+12
-1
No files found.
gargantext.cabal
View file @
8b6fdb1b
...
...
@@ -160,7 +160,6 @@ library
Gargantext.Core.Types.Phylo
Gargantext.Core.Utils
Gargantext.Core.Utils.Prefix
Gargantext.Core.Viz.Graph
Gargantext.Core.Viz.Graph.Index
Gargantext.Core.Viz.Graph.Tools
Gargantext.Core.Viz.Graph.Tools.IGraph
...
...
@@ -327,6 +326,7 @@ library
Gargantext.Core.Utils.DateUtils
Gargantext.Core.Viz
Gargantext.Core.Viz.Chart
Gargantext.Core.Viz.Graph
Gargantext.Core.Viz.Graph.API
Gargantext.Core.Viz.Graph.Bridgeness
Gargantext.Core.Viz.Graph.FGL
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
8b6fdb1b
...
...
@@ -47,7 +47,6 @@ import Gargantext.Core.NodeStory (ArchiveList, HasNodeStory, NodeListStory, a_hi
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
)
import
Gargantext.Database.Action.Metrics.NgramsByContext
(
getOccByNgramsOnlyFast
)
import
Gargantext.Database.Query.Table.Ngrams
qualified
as
TableNgrams
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Prelude
hiding
((
%
))
import
Gargantext.Prelude.Clock
(
hasTime
,
getTime
)
...
...
@@ -68,7 +67,7 @@ getRepo listIds = do
getNodeStory
::
HasNodeStory
env
err
m
=>
ListId
->
m
ArchiveList
=>
ListId
->
m
ArchiveList
getNodeStory
l
=
do
f
<-
getNodeListStory
liftBase
$
f
l
...
...
@@ -118,10 +117,10 @@ getListNgrams nodeIds ngramsType = listNgramsFromRepo nodeIds ngramsType
<$>
getRepo
nodeIds
getTermsWith
::
(
HasNodeStory
env
err
m
,
Eq
a
,
Hashable
a
)
=>
(
NgramsTerm
->
a
)
->
[
ListId
]
->
NgramsType
->
Set
ListType
->
m
(
HashMap
a
[
a
])
getTermsWith
::
(
HasNodeStory
env
err
m
,
Hashable
a
)
=>
(
NgramsTerm
->
a
)
->
[
ListId
]
->
NgramsType
->
Set
ListType
->
m
(
HashMap
a
[
a
])
getTermsWith
f
ls
ngt
lts
=
HM
.
fromListWith
(
<>
)
<$>
map
toTreeWith
<$>
HM
.
toList
...
...
@@ -256,8 +255,7 @@ dumpJsonTableMap fpath nodeId ngramsType = do
-- | Helper function to set scores on an `NgramsTable`.
setNgramsTableScores
::
forall
env
err
m
t
.
(
Each
t
t
NgramsElement
NgramsElement
,
HasNodeStory
env
err
m
,
HasNodeError
err
)
,
HasNodeStory
env
err
m
)
=>
NodeId
->
ListId
->
TableNgrams
.
NgramsType
...
...
src/Gargantext/API/Node/Update.hs
View file @
8b6fdb1b
...
...
@@ -31,8 +31,7 @@ import Gargantext.Core.Methods.Similarities (GraphMetric(..))
import
Gargantext.Core.NodeStory
(
HasNodeStory
)
import
Gargantext.Core.Types.Main
(
ListType
(
..
))
import
Gargantext.Core.Viz.Graph.API
(
recomputeGraph
)
import
Gargantext.Core.Viz.Graph.Tools
(
PartitionMethod
(
..
),
BridgenessMethod
(
..
))
import
Gargantext.Core.Viz.Graph.Types
(
Strength
)
import
Gargantext.Core.Viz.Graph.Types
(
PartitionMethod
(
..
),
BridgenessMethod
(
..
),
Strength
)
import
Gargantext.Core.Viz.Phylo
(
PhyloSubConfigAPI
(
..
),
subConfigAPI2config
)
import
Gargantext.Core.Viz.Phylo.API.Tools
(
flowPhyloAPI
)
import
Gargantext.Database.Action.Flow
(
reIndexWith
)
...
...
src/Gargantext/Core/Methods/Graph/MaxClique.hs
View file @
8b6fdb1b
...
...
@@ -50,7 +50,7 @@ def fast_maximal_cliques(g):
module
Gargantext.Core.Methods.Graph.MaxClique
where
where
import
Data.Graph.Inductive
hiding
(
Graph
,
neighbors
,
subgraph
,
(
&
))
import
Data.List
(
nub
)
...
...
@@ -59,7 +59,8 @@ import Data.Set (fromList, isSubsetOf)
import
Gargantext.Core.Methods.Similarities
(
Similarity
)
import
Gargantext.Core.Viz.Graph.FGL
(
Graph_Undirected
,
degree
,
neighbors
,
mkGraphUfromEdges
)
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
)
import
Gargantext.Core.Viz.Graph.Tools
(
cooc2graph'
,
cooc2graph''
,
Threshold
)
import
Gargantext.Core.Viz.Graph.Tools
(
cooc2graph'
,
cooc2graph''
)
import
Gargantext.Core.Viz.Graph.Types
(
Threshold
)
import
Gargantext.Core.Viz.Phylo
import
Gargantext.Prelude
...
...
src/Gargantext/Core/Viz/Chart.hs
View file @
8b6fdb1b
...
...
@@ -17,6 +17,7 @@ module Gargantext.Core.Viz.Chart
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.List
qualified
as
List
import
Data.Map.Strict
(
toList
)
import
Data.Set
qualified
as
Set
import
Data.Vector
qualified
as
V
import
Gargantext.API.Ngrams.NgramsTree
import
Gargantext.API.Ngrams.Tools
...
...
@@ -34,7 +35,6 @@ import Gargantext.Database.Query.Table.NodeContext (selectDocsDates)
import
Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
hiding
(
toList
)
import
qualified
Data.Set
as
Set
histoData
::
CorpusId
->
DBCmd
err
Histo
...
...
src/Gargantext/Core/Viz/Graph.hs
View file @
8b6fdb1b
...
...
@@ -9,18 +9,22 @@ Portability : POSIX
-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Core.Viz.Graph
where
(
-- REPL utilities
graphV3ToGraph
,
graphV3ToGraphWithFiles
,
mergeGraphNgrams
,
readGraphFromJson
)
where
import
Data.Aeson
qualified
as
DA
import
Data.ByteString.Lazy
as
DBL
(
readFile
,
writeFile
)
import
Data.HashMap.Strict
(
HashMap
,
lookup
)
import
Data.Text
qualified
as
Text
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
),
NgramsRepoElement
(
..
),
mSetToList
)
import
Gargantext.Core.Viz.Graph.Types
import
Gargantext.Database.Admin.Types.Hyperdata.Prelude
import
Gargantext.Core.Viz.Graph.Types
(
Attributes
(
..
),
AttributesV3
(
..
),
Edge
(
..
),
EdgeV3
(
..
),
Graph
(
..
),
GraphV3
(
..
),
Node
(
..
),
NodeV3
(
..
),
graph_nodes
)
import
Gargantext.Database.Admin.Types.Hyperdata.Prelude
(
set
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Prelude
import
Text.Read
qualified
as
Text
...
...
src/Gargantext/Core/Viz/Graph/API.hs
View file @
8b6fdb1b
...
...
@@ -16,7 +16,7 @@ Portability : POSIX
{-# LANGUAGE TypeOperators #-}
module
Gargantext.Core.Viz.Graph.API
where
where
import
Control.Lens
(
set
,
(
^.
),
_Just
,
(
^?
),
at
)
import
Data.Aeson
...
...
@@ -31,9 +31,9 @@ import Gargantext.API.Prelude (GargM, GargServer)
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
),
GraphMetric
(
..
),
withMetric
)
import
Gargantext.Core.NodeStory
(
HasNodeStory
,
NodeListStory
,
a_version
,
unNodeStory
)
import
Gargantext.Core.Types.Main
(
ListType
(
MapTerm
))
import
Gargantext.Core.Viz.Graph.GEXF
()
import
Gargantext.Core.Viz.Graph.Tools
-- (cooc2grap
h)
import
Gargantext.Core.Viz.Graph.Types
(
Graph
,
GraphMetadata
(
..
),
HyperdataGraph
(
..
),
HyperdataGraphAPI
(
..
),
LegendField
(
..
),
ListForGraph
(
..
),
MultiPartite
(
..
),
Partite
(
..
),
Strength
(
Strong
),
hyperdataGraph
,
gm_edgesStrength
,
gm_list
,
gm_metric
,
gm_startForceAtlas
,
graph_metadata
,
hyperdataCamera
,
lfg_version
)
import
Gargantext.Core.Viz.Graph.GEXF
()
-- MimeRender instances
import
Gargantext.Core.Viz.Graph.Tools
(
cooc2graphWit
h
)
import
Gargantext.Core.Viz.Graph.Types
(
BridgenessMethod
(
..
),
Graph
,
GraphMetadata
(
..
),
HyperdataGraph
(
..
),
HyperdataGraphAPI
(
..
),
LegendField
(
..
),
ListForGraph
(
..
),
MultiPartite
(
..
),
Partite
(
..
),
PartitionMethod
(
..
),
Strength
(
Strong
),
hyperdataGraph
,
gm_edgesStrength
,
gm_list
,
gm_metric
,
gm_startForceAtlas
,
graph_metadata
,
hyperdataCamera
,
lfg_version
)
import
Gargantext.Database.Action.Metrics.NgramsByContext
(
getContextsByNgramsOnlyUser
)
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
import
Gargantext.Database.Admin.Config
(
userMaster
)
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
8b6fdb1b
...
...
@@ -14,61 +14,41 @@ Portability : POSIX
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
module
Gargantext.Core.Viz.Graph.Tools
where
(
cooc2graph'
,
cooc2graph''
,
cooc2graphWith
,
doSimilarityMap
)
where
import
Data.Aeson
import
Data.HashMap.Strict
(
HashMap
)
import
Data.HashMap.Strict
qualified
as
HashMap
import
Data.HashSet
qualified
as
HashSet
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
import
Data.Set
qualified
as
Set
import
Data.Swagger
hiding
(
items
)
import
Data.Text
qualified
as
Text
import
Data.Vector.Storable
qualified
as
Vec
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
),
measure
)
import
Gargantext.Core.Statistics
import
Gargantext.Core.Statistics
(
Dimension
(
..
),
pcaReduceTo
)
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Bridgeness
(
..
),
Partitions
,
nodeId2comId
,
{-recursiveClustering,-}
recursiveClustering'
,
setNodes2clusterNodes
)
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
,
map2mat
,
mat2map
,
Index
,
MatrixShape
(
..
))
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
mkGraphUfromEdges
,
spinglass
,
spinglass'
)
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
spinglass
,
spinglass'
)
import
Gargantext.Core.Viz.Graph.Tools.Infomap
(
infomap
)
import
Gargantext.Core.Viz.Graph.Types
(
Attributes
(
..
),
Edge
(
..
),
Graph
(
..
),
MultiPartite
(
..
),
Node
(
..
),
Partite
(
..
),
Strength
(
..
)
)
import
Gargantext.Core.Viz.Graph.Types
(
Attributes
(
..
),
BridgenessMethod
(
..
),
Edge
(
..
),
Graph
(
..
),
Layout
(
..
),
MultiPartite
(
..
),
Node
(
..
),
Occurrences
,
Partite
(
..
),
PartitionMethod
(
..
),
Strength
(
..
),
Threshold
)
import
Gargantext.Core.Viz.Graph.Utils
(
edgesFilter
,
nodesFilter
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Prelude
import
Graph.BAC.ProxemyOptim
qualified
as
BAC
import
Graph.Types
(
ClusterNode
)
import
IGraph
qualified
as
Igraph
import
IGraph.Algorithms.Layout
qualified
as
Layout
import
IGraph.Random
-- (Gen(..))
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
data
PartitionMethod
=
Spinglass
|
Confluence
|
Infomap
deriving
(
Generic
,
Eq
,
Ord
,
Enum
,
Bounded
,
Show
)
instance
FromJSON
PartitionMethod
instance
ToJSON
PartitionMethod
instance
ToSchema
PartitionMethod
instance
Arbitrary
PartitionMethod
where
arbitrary
=
elements
[
minBound
..
maxBound
]
data
BridgenessMethod
=
BridgenessMethod_Basic
|
BridgenessMethod_Advanced
deriving
(
Generic
,
Eq
,
Ord
,
Enum
,
Bounded
,
Show
)
instance
FromJSON
BridgenessMethod
instance
ToJSON
BridgenessMethod
instance
ToSchema
BridgenessMethod
instance
Arbitrary
BridgenessMethod
where
arbitrary
=
elements
[
minBound
..
maxBound
]
-------------------------------------------------------------
defaultClustering
::
Map
(
Int
,
Int
)
Double
->
IO
[
ClusterNode
]
-- defaultClustering x = pure $ BAC.defaultClustering x
defaultClustering
x
=
spinglass
1
x
--
defaultClustering :: Map (Int, Int) Double -> IO [ClusterNode]
--
--
defaultClustering x = pure $ BAC.defaultClustering x
--
defaultClustering x = spinglass 1 x
-------------------------------------------------------------
type
Threshold
=
Double
cooc2graph'
::
Ord
t
=>
Similarity
->
Double
...
...
@@ -156,8 +136,6 @@ cooc2graphWith' _doPartitions _bridgenessMethod multi similarity@Distributional
type
Reverse
=
Bool
doSimilarityMap
::
Similarity
->
Threshold
->
Strength
...
...
@@ -220,7 +198,6 @@ doSimilarityMap distriType threshold strength myCooc = (distanceMap, toIndex ti
----------------------------------------------------------
-- | From data to Graph
type
Occurrences
=
Int
nodeTypeWith
::
MultiPartite
->
NgramsTerm
->
NgramsType
nodeTypeWith
(
MultiPartite
(
Partite
s1
t1
)
(
Partite
_s2
t2
))
t
=
...
...
@@ -283,13 +260,11 @@ data2graph multi labels' occurences bridge conf partitions =
------------------------------------------------------------------------
data
Layout
=
KamadaKawai
|
ACP
|
ForceAtlas
setCoord'
::
(
Int
->
(
Double
,
Double
))
->
(
Int
,
Node
)
->
Node
setCoord'
f
(
i
,
n
)
=
n
{
node_x_coord
=
x
,
node_y_coord
=
y
}
where
(
x
,
y
)
=
f
i
-- setCoord' :: (Int -> (Double, Double)) -> (Int, Node) -> Node
-- setCoord' f (i,n) = n { node_x_coord = x, node_y_coord = y }
-- where
-- (x,y) = f i
-- | ACP
...
...
@@ -334,16 +309,16 @@ getCoord ACP labels m n = to2d $ maybe (panic "Graph.Tools no coordinate") ident
toVec
n'
ns'
m''
=
(
n'
,
Vec
.
fromList
$
map
(
\
n''
->
maybe
0
identity
$
Map
.
lookup
(
n'
,
n''
)
m''
)
ns'
)
------------------------------------------------------------------------
-- | KamadaKawai Layout
-- TODO TEST: check labels, nodeId and coordinates
layout
::
Map
(
Int
,
Int
)
Double
->
Int
->
Gen
->
(
Double
,
Double
)
layout
m
n
gen
=
maybe
(
panic
""
)
identity
$
Map
.
lookup
n
$
coord
where
coord
::
(
Map
Int
(
Double
,
Double
))
coord
=
Map
.
fromList
$
List
.
zip
(
Igraph
.
nodes
g
)
$
(
Layout
.
layout
g
p
gen
)
--p = Layout.defaultLGL
p
=
Layout
.
kamadaKawai
g
=
mkGraphUfromEdges
$
map
fst
$
List
.
filter
(
\
e
->
snd
e
>
0
)
$
Map
.
toList
m
--
--
| KamadaKawai Layout
--
--
TODO TEST: check labels, nodeId and coordinates
--
layout :: Map (Int, Int) Double -> Int -> Gen -> (Double, Double)
--
layout m n gen = maybe (panic "") identity $ Map.lookup n $ coord
--
where
--
coord :: (Map Int (Double,Double))
--
coord = Map.fromList $ List.zip (Igraph.nodes g) $ (Layout.layout g p gen)
--
--p = Layout.defaultLGL
--
p = Layout.kamadaKawai
--
g = mkGraphUfromEdges $ map fst $ List.filter (\e -> snd e > 0) $ Map.toList m
-----------------------------------------------------------------------------
-- MISC Tools
...
...
src/Gargantext/Core/Viz/Graph/Tools/IGraph.hs
View file @
8b6fdb1b
...
...
@@ -13,50 +13,51 @@ Reference:
-}
module
Gargantext.Core.Viz.Graph.Tools.IGraph
where
import
Data.Serialize
(
spinglass
,
spinglass'
)
where
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
import
Data.Serialize
(
Serialize
)
import
Data.Set
qualified
as
Set
import
Data.Singletons
(
SingI
)
import
Gargantext.Core.Viz.Graph.Index
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
)
import
Gargantext.Prelude
import
Graph.Types
(
ClusterNode
(
..
))
import
IGraph
hiding
(
mkGraph
,
neighbors
,
edges
,
nodes
,
Node
,
Graph
)
import
Protolude
import
Gargantext.Prelude
(
saveAsFileDebug
)
import
qualified
Data.List
as
List
import
qualified
Data.Map.Strict
as
Map
import
qualified
IGraph
as
IG
import
qualified
IGraph.Algorithms.Clique
as
IG
import
qualified
IGraph.Algorithms.Community
as
IG
import
qualified
IGraph.Algorithms.Structure
as
IG
import
qualified
IGraph.Random
as
IG
import
qualified
Data.Set
as
Set
import
IGraph
qualified
as
IG
import
IGraph.Algorithms.Community
qualified
as
IG
import
IGraph.Algorithms.Structure
qualified
as
IG
import
IGraph.Random
qualified
as
IG
-- import IGraph.Algorithms.Clique qualified as IG
------------------------------------------------------------------
-- | Main Types
type
Graph_Undirected
=
IG
.
Graph
'U
()
()
type
Graph_Directed
=
IG
.
Graph
'D
()
()
--
type Graph_Directed = IG.Graph 'D () ()
type
Node
=
IG
.
Node
type
Graph
=
IG
.
Graph
--
type Node = IG.Node
--
type Graph = IG.Graph
------------------------------------------------------------------
-- | Main Graph management Functions
neighbors
::
IG
.
Graph
d
v
e
->
IG
.
Node
->
[
IG
.
Node
]
neighbors
=
IG
.
neighbors
--
neighbors :: IG.Graph d v e -> IG.Node -> [IG.Node]
--
neighbors = IG.neighbors
edges
::
IG
.
Graph
d
v
e
->
[
Edge
]
edges
=
IG
.
edges
--
edges :: IG.Graph d v e -> [Edge]
--
edges = IG.edges
nodes
::
IG
.
Graph
d
v
e
->
[
IG
.
Node
]
nodes
=
IG
.
nodes
--
nodes :: IG.Graph d v e -> [IG.Node]
--
nodes = IG.nodes
------------------------------------------------------------------
-- | Partitions
maximalCliques
::
IG
.
Graph
d
v
e
->
[[
Int
]]
maximalCliques
g
=
IG
.
maximalCliques
g
(
min'
,
max'
)
where
min'
=
0
max'
=
0
--
maximalCliques :: IG.Graph d v e -> [[Int]]
--
maximalCliques g = IG.maximalCliques g (min',max')
--
where
--
min' = 0
--
max' = 0
------------------------------------------------------------------
type
Seed
=
Int
...
...
src/Gargantext/Core/Viz/Graph/Types.hs
View file @
8b6fdb1b
...
...
@@ -246,6 +246,30 @@ instance FromField HyperdataGraphAPI
data
PartitionMethod
=
Spinglass
|
Confluence
|
Infomap
deriving
(
Generic
,
Eq
,
Ord
,
Enum
,
Bounded
,
Show
)
instance
FromJSON
PartitionMethod
instance
ToJSON
PartitionMethod
instance
ToSchema
PartitionMethod
instance
Arbitrary
PartitionMethod
where
arbitrary
=
elements
[
minBound
..
maxBound
]
data
BridgenessMethod
=
BridgenessMethod_Basic
|
BridgenessMethod_Advanced
deriving
(
Generic
,
Eq
,
Ord
,
Enum
,
Bounded
,
Show
)
instance
FromJSON
BridgenessMethod
instance
ToJSON
BridgenessMethod
instance
ToSchema
BridgenessMethod
instance
Arbitrary
BridgenessMethod
where
arbitrary
=
elements
[
minBound
..
maxBound
]
data
Layout
=
KamadaKawai
|
ACP
|
ForceAtlas
type
Occurrences
=
Int
type
Threshold
=
Double
type
Reverse
=
Bool
---------------------- defaults
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
8b6fdb1b
...
...
@@ -282,8 +282,7 @@ addDocumentsToHyperCorpus ncs mb_hyper la corpusId docs = do
------------------------------------------------------------------------
flowCorpusUser
::
(
HasNodeError
err
,
HasValidationError
err
flowCorpusUser
::
(
HasValidationError
err
,
HasNLPServer
env
,
HasTreeError
err
,
HasNodeStory
env
err
m
...
...
src/Gargantext/Database/Action/Flow/Utils.hs
View file @
8b6fdb1b
...
...
@@ -73,7 +73,8 @@ import Gargantext.Prelude
import
Gargantext.Prelude.Crypto.Hash
(
Hash
)
createNodes
::
(
DbCmd'
env
err
m
,
HasNodeError
err
createNodes
::
(
DbCmd'
env
err
m
,
HasNodeError
err
,
MkCorpus
c
)
=>
User
...
...
@@ -156,9 +157,7 @@ docNgrams lang nt ts doc =
-- TODO Type NodeDocumentUnicised
insertDocs
::
(
DbCmd'
env
err
m
-- , FlowCorpus a
,
FlowInsertDB
a
,
HasNodeError
err
)
=>
UserId
->
CorpusId
...
...
@@ -210,8 +209,7 @@ insertMasterDocs ncs c lang hs = do
buildSocialList
::
(
HasNodeError
err
,
HasValidationError
err
buildSocialList
::
(
HasValidationError
err
,
HasNLPServer
env
,
HasTreeError
err
,
HasNodeStory
env
err
m
...
...
@@ -294,9 +292,7 @@ toInserted =
documentIdWithNgrams
::
HasNodeError
err
=>
(
a
->
DBCmd
err
(
HashMap
.
HashMap
b
(
Map
NgramsType
Int
,
TermsCount
)))
documentIdWithNgrams
::
(
a
->
DBCmd
err
(
HashMap
.
HashMap
b
(
Map
NgramsType
Int
,
TermsCount
)))
->
[
Indexed
NodeId
a
]
->
DBCmd
err
[
DocumentIdWithNgrams
a
b
]
documentIdWithNgrams
f
=
traverse
toDocumentIdWithNgrams
...
...
test/Test/Graph/Clustering.hs
View file @
8b6fdb1b
...
...
@@ -17,7 +17,6 @@ import Data.HashMap.Strict qualified as HashMap
import
Data.List
qualified
as
List
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
))
-- import Gargantext.Core.Viz.Graph
import
Gargantext.Core.Viz.Graph.Tools
(
doSimilarityMap
)
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
spinglass
)
import
Gargantext.Core.Viz.Graph.Types
...
...
test/Test/Ngrams/Query/PaginationCorpus.hs
View file @
8b6fdb1b
{-|
Module : Test.Ngrams.Query.PaginationCorpus
Description : Tests
Copyright : (c) CNRS, 2024-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE ScopedTypeVariables #-}
module
Test.Ngrams.Query.PaginationCorpus
where
import
Prelude
import
Data.Aeson
import
Data.Map.Strict
(
Map
)
import
Gargantext.API.Ngrams
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types.Main
import
Gargantext.Database.Admin.Types.Node
...
...
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