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
ed2c6313
Verified
Commit
ed2c6313
authored
Jan 23, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] some refactoring of Core.Viz.Graph
parent
ce1cc37a
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
318 additions
and
274 deletions
+318
-274
gargantext.cabal
gargantext.cabal
+3
-2
Context.hs
src/Gargantext/API/GraphQL/Context.hs
+1
-1
Update.hs
src/Gargantext/API/Node/Update.hs
+1
-1
Viz.hs
src/Gargantext/Core/Viz.hs
+0
-1
Graph.hs
src/Gargantext/Core/Viz/Graph.hs
+2
-230
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+1
-1
GEXF.hs
src/Gargantext/Core/Viz/Graph/GEXF.hs
+5
-6
PatriciaTreeTypes.hs
src/Gargantext/Core/Viz/Graph/PatriciaTreeTypes.hs
+32
-0
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+3
-3
Types.hs
src/Gargantext/Core/Viz/Graph/Types.hs
+265
-20
Hyperdata.hs
src/Gargantext/Database/Admin/Types/Hyperdata.hs
+3
-2
Default.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs
+1
-1
Prelude.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Prelude.hs
+1
-6
No files found.
gargantext.cabal
View file @
ed2c6313
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.3
5.1
.
-- This file has been generated from package.yaml by hpack version 0.3
4.7
.
--
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.6.9.1
version:
0.0.6.9.1
synopsis: Search, map, share
description: Please see README.md
category: Data
...
...
@@ -232,6 +232,7 @@ library
Gargantext.Core.Viz.Graph.FGL
Gargantext.Core.Viz.Graph.GEXF
Gargantext.Core.Viz.Graph.Legend
Gargantext.Core.Viz.Graph.PatriciaTreeTypes
Gargantext.Core.Viz.Graph.Tools.Infomap
Gargantext.Core.Viz.Graph.Types
Gargantext.Core.Viz.Graph.Utils
...
...
src/Gargantext/API/GraphQL/Context.hs
View file @
ed2c6313
...
...
@@ -184,7 +184,7 @@ toHyperdataRowDocumentGQL hyperdata =
,
hrd_uniqId
=
_hr_uniqId
,
hrd_uniqIdBdd
=
_hr_uniqIdBdd
}
HyperdataRowContact
_
_
_
->
Nothing
HyperdataRowContact
{
}
->
Nothing
updateNodeContextCategory
::
(
HasConnectionPool
env
,
HasConfig
env
,
HasMail
env
,
HasSettings
env
)
=>
NodeContextCategoryMArgs
->
GqlM'
e
env
[
Int
]
...
...
src/Gargantext/API/Node/Update.hs
View file @
ed2c6313
...
...
@@ -29,9 +29,9 @@ import Gargantext.API.Ngrams.List (reIndexWith)
import
Gargantext.API.Prelude
(
GargM
,
GargError
,
simuLogs
)
import
Gargantext.Core.Methods.Similarities
(
GraphMetric
(
..
))
import
Gargantext.Core.Types.Main
(
ListType
(
..
))
import
Gargantext.Core.Viz.Graph
(
Strength
)
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.Phylo
(
PhyloSubConfig
(
..
),
subConfig2config
)
import
Gargantext.Core.Viz.Phylo.API.Tools
(
flowPhyloAPI
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
...
...
src/Gargantext/Core/Viz.hs
View file @
ed2c6313
...
...
@@ -14,4 +14,3 @@ Vizualisation of text stats
module
Gargantext.Core.Viz
where
src/Gargantext/Core/Viz/Graph.hs
View file @
ed2c6313
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Viz/Graph/API.hs
View file @
ed2c6313
...
...
@@ -30,9 +30,9 @@ import Gargantext.API.Prelude
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
),
GraphMetric
(
..
),
withMetric
)
import
Gargantext.Core.NodeStory
import
Gargantext.Core.Types.Main
import
Gargantext.Core.Viz.Graph
import
Gargantext.Core.Viz.Graph.GEXF
()
import
Gargantext.Core.Viz.Graph.Tools
-- (cooc2graph)
import
Gargantext.Core.Viz.Graph.Types
import
Gargantext.Database.Action.Metrics.NgramsByContext
(
getContextsByNgramsOnlyUser
)
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
...
...
src/Gargantext/Core/Viz/Graph/GEXF.hs
View file @
ed2c6313
...
...
@@ -19,18 +19,17 @@ module Gargantext.Core.Viz.Graph.GEXF
where
import
Gargantext.Prelude
import
Gargantext.Core.Viz.Graph
import
qualified
Data.HashMap.Lazy
as
HashMap
import
qualified
Gargantext.Prelude
as
P
import
qualified
Gargantext.Core.Viz.Graph
as
G
import
qualified
Gargantext.Core.Viz.Graph
.Types
as
G
import
qualified
Xmlbf
as
Xmlbf
import
Prelude
(
error
)
-- Converts to GEXF format
-- See https://gephi.org/gexf/format/
instance
Xmlbf
.
ToXml
Graph
where
toXml
(
Graph
{
_graph_nodes
=
graphNodes
,
_graph_edges
=
graphEdges
})
=
root
graphNodes
graphEdges
instance
Xmlbf
.
ToXml
G
.
G
raph
where
toXml
(
G
.
G
raph
{
_graph_nodes
=
graphNodes
,
_graph_edges
=
graphEdges
})
=
root
graphNodes
graphEdges
where
root
::
[
G
.
Node
]
->
[
G
.
Edge
]
->
[
Xmlbf
.
Node
]
root
gn
ge
=
...
...
@@ -77,5 +76,5 @@ instance Xmlbf.ToXml Graph where
-- just to be able to derive a client for the entire gargantext API,
-- we however want to avoid sollicitating this instance
instance
Xmlbf
.
FromXml
Graph
where
instance
Xmlbf
.
FromXml
G
.
G
raph
where
fromXml
=
error
"FromXml Graph: not defined, just a placeholder"
src/Gargantext/Core/Viz/Graph/PatriciaTreeTypes.hs
0 → 100644
View file @
ed2c6313
{-| Module : Gargantext.Core.Viz.Graph.PatriciaTreeTypes
Description :
Copyright : (c) CNRS, Alexandre Delanoë
License : AGPL + CECILL v3
Maintainer : contact@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Core.Viz.Graph.PatriciaTreeTypes
where
import
qualified
Data.Graph.Inductive.PatriciaTree
as
DGIP
-- import Data.IntMap (IntMap)
-- import qualified Eigen.Matrix as DenseMatrix
-- import Eigen.SparseMatrix (SparseMatrix)
--import qualified Data.Matrix.Sparse.Static as Sparse
-- import qualified Data.Vector.Unboxed as VU
-- import qualified Numeric.LinearAlgebra.Static as Dense
import
Protolude
hiding
(
sum
,
natVal
)
-- | Main Types use in this libray
type
Dict
=
IntMap
-- | Use the optimized version of Graph
type
Graph
a
b
=
DGIP
.
Gr
a
b
-- | Type for Matrix computation optimizations (with Eigen)
-- type MatrixD n = Dense.L n n
-- type MatrixS n = Sparse.Matrix n n Double
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
ed2c6313
...
...
@@ -25,11 +25,11 @@ import Gargantext.API.Ngrams.Types (NgramsTerm(..))
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
),
measure
)
import
Gargantext.Core.Methods.Similarities.Conditional
(
conditional
)
import
Gargantext.Core.Statistics
import
Gargantext.Core.Viz.Graph
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Bridgeness
(
..
),
Partitions
,
nodeId2comId
)
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
,
map2mat
,
mat2map
,
Index
,
MatrixShape
(
..
))
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
mkGraphUfromEdges
,
spinglass
)
import
Gargantext.Core.Viz.Graph.Tools.Infomap
(
infomap
)
import
Gargantext.Core.Viz.Graph.Types
(
Attributes
(
..
),
Edge
(
..
),
Graph
(
..
),
MultiPartite
(
..
),
Node
(
..
),
Partite
(
..
),
Strength
(
..
))
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
..
))
import
Gargantext.Core.Viz.Graph.Utils
(
edgesFilter
,
nodesFilter
)
import
Gargantext.Prelude
...
...
@@ -242,6 +242,7 @@ data2graph multi labels' occurences bridge conf partitions =
(
bridge'
,
toKeep
)
=
nodesFilter
(
\
v
->
v
>
1
)
bridge
edges
=
[
Edge
{
edge_source
=
cs
(
show
s
)
,
edge_hidden
=
Nothing
,
edge_target
=
cs
(
show
t
)
,
edge_weight
=
weight
,
edge_confluence
=
maybe
0
identity
$
Map
.
lookup
(
s
,
t
)
conf
...
...
@@ -340,7 +341,7 @@ cooc2graph'' distance threshold myCooc = neighbourMap
-- Quentin
filterByNeighbours
::
Double
->
Map
(
Index
,
Index
)
Double
->
Map
(
Index
,
Index
)
Double
filterByNeighbours
threshold
distanceMap
=
filteredMap
where
where
indexes
::
[
Index
]
indexes
=
List
.
nub
$
List
.
concat
$
map
(
\
(
idx
,
idx'
)
->
[
idx
,
idx'
]
)
$
Map
.
keys
distanceMap
filteredMap
::
Map
(
Index
,
Index
)
Double
...
...
@@ -354,4 +355,3 @@ filterByNeighbours threshold distanceMap = filteredMap
$
Map
.
filterWithKey
(
\
(
from
,
_
)
_
->
idx
==
from
)
distanceMap
in
List
.
take
(
round
threshold
)
selected
)
indexes
src/Gargantext/Core/Viz/Graph/Types.hs
View file @
ed2c6313
This diff is collapsed.
Click to expand it.
src/Gargantext/Database/Admin/Types/Hyperdata.hs
View file @
ed2c6313
...
...
@@ -10,6 +10,7 @@ Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module
Gargantext.Database.Admin.Types.Hyperdata
(
module
Gargantext
.
Database
.
Admin
.
Types
.
Hyperdata
.
Any
...
...
@@ -26,7 +27,7 @@ module Gargantext.Database.Admin.Types.Hyperdata
,
module
Gargantext
.
Database
.
Admin
.
Types
.
Hyperdata
.
Texts
,
module
Gargantext
.
Database
.
Admin
.
Types
.
Hyperdata
.
Phylo
,
module
Gargantext
.
Database
.
Admin
.
Types
.
Hyperdata
.
User
,
module
Gargantext
.
Core
.
Viz
.
Graph
,
module
Gargantext
.
Core
.
Viz
.
Graph
.
Types
)
where
...
...
@@ -44,4 +45,4 @@ import Gargantext.Database.Admin.Types.Hyperdata.Prelude (Hyperdata)
import
Gargantext.Database.Admin.Types.Hyperdata.Texts
import
Gargantext.Database.Admin.Types.Hyperdata.Phylo
import
Gargantext.Database.Admin.Types.Hyperdata.User
import
Gargantext.Core.Viz.Graph
(
HyperdataGraph
(
..
),
defaultHyperdataGraph
)
import
Gargantext.Core.Viz.Graph
.Types
(
HyperdataGraph
(
..
),
defaultHyperdataGraph
)
src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs
View file @
ed2c6313
...
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Admin.Types.Hyperdata.Prelude
data
DefaultHyperdata
=
DefaultUser
HyperdataUser
DefaultUser
HyperdataUser
|
DefaultContact
HyperdataContact
|
DefaultCorpus
HyperdataCorpus
...
...
src/Gargantext/Database/Admin/Types/Hyperdata/Prelude.hs
View file @
ed2c6313
...
...
@@ -11,7 +11,7 @@ Portability : POSIX
module
Gargantext.Database.Admin.Types.Hyperdata.Prelude
(
module
Control
.
Lens
(
module
Control
.
Lens
,
module
Data
.
Aeson
,
module
Data
.
Aeson
.
TH
,
module
Data
.
Aeson
.
Types
...
...
@@ -66,8 +66,3 @@ data Chart =
instance
ToJSON
Chart
instance
FromJSON
Chart
instance
ToSchema
Chart
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