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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
32f76c93
Commit
32f76c93
authored
May 25, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Adding Graph type for the REST api.
parent
03f5859a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
7 deletions
+71
-7
package.yaml
package.yaml
+1
-0
Graph.hs
src/Gargantext/Viz/Graph.hs
+60
-0
Conditional.hs
src/Gargantext/Viz/Graph/Distances/Conditional.hs
+2
-2
Distributional.hs
src/Gargantext/Viz/Graph/Distances/Distributional.hs
+2
-2
Matrice.hs
src/Gargantext/Viz/Graph/Distances/Matrice.hs
+4
-1
Utils.hs
src/Gargantext/Viz/Graph/Utils.hs
+1
-1
stack.yaml
stack.yaml
+1
-1
No files found.
package.yaml
View file @
32f76c93
...
...
@@ -29,6 +29,7 @@ library:
-
Gargantext.Text.Search
-
Gargantext.Text.Parsers.CSV
-
Gargantext.API
-
Gargantext.Viz.Graph.Distances.Matrice
dependencies
:
-
QuickCheck
-
accelerate
...
...
src/Gargantext/Viz/Graph.hs
0 → 100644
View file @
32f76c93
{-|
Module : Gargantext.Viz.Graph
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
module
Gargantext.Viz.Graph
where
import
GHC.Generics
(
Generic
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Text
(
Text
)
import
Gargantext.Prelude
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
-----------------------------------------------------------
data
TypeNode
=
Terms
|
Unknown
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
""
)
''
T
ypeNode
)
data
Attributes
=
Attributes
{
clust_default
::
Int
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
""
)
''
A
ttributes
)
data
Node
=
Node
{
n_size
::
Int
,
n_type
::
TypeNode
,
n_id
::
Text
,
n_label
::
Text
,
n_attributes
::
Attributes
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"n_"
)
''
N
ode
)
data
Edge
=
Edge
{
e_source
::
Int
,
e_target
::
Int
,
e_weight
::
Double
,
e_id
::
Int
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"e_"
)
''
E
dge
)
data
Graph
=
Graph
{
g_nodes
::
[
Node
]
,
g_edges
::
[
Edge
]
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"g_"
)
''
G
raph
)
-----------------------------------------------------------
src/Gargantext/Graph/Distances/Conditional.hs
→
src/Gargantext/
Viz/
Graph/Distances/Conditional.hs
View file @
32f76c93
...
...
@@ -14,7 +14,7 @@ Motivation and definition of the @Conditional@ distance.
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Strict #-}
module
Gargantext.Graph.Distances.Conditional
module
Gargantext.
Viz.
Graph.Distances.Conditional
where
import
Data.Matrix
hiding
(
identity
)
...
...
@@ -33,7 +33,7 @@ import Data.Vector (Vector)
import
qualified
Data.Vector
as
V
import
Gargantext.Prelude
import
Gargantext.Graph.Utils
import
Gargantext.
Viz.
Graph.Utils
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
src/Gargantext/Graph/Distances/Distributional.hs
→
src/Gargantext/
Viz/
Graph/Distances/Distributional.hs
View file @
32f76c93
...
...
@@ -16,7 +16,7 @@ Motivation and definition of the @Distributional@ distance.
{-# LANGUAGE Strict #-}
module
Gargantext.Graph.Distances.Distributional
module
Gargantext.
Viz.
Graph.Distances.Distributional
where
import
Data.Matrix
hiding
(
identity
)
...
...
@@ -32,7 +32,7 @@ import Data.Vector (Vector)
import
qualified
Data.Vector
as
V
import
Gargantext.Prelude
import
Gargantext.Graph.Utils
import
Gargantext.
Viz.
Graph.Utils
distributional
::
(
Floating
a
,
Ord
a
)
=>
Matrix
a
->
[((
Int
,
Int
),
a
)]
...
...
src/Gargantext/Graph/Distances/Matrice.hs
→
src/Gargantext/
Viz/
Graph/Distances/Matrice.hs
View file @
32f76c93
...
...
@@ -14,7 +14,7 @@ Motivation and definition of the @Conditional@ distance.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module
Gargantext.Graph.Distances.Matrice
module
Gargantext.
Viz.
Graph.Distances.Matrice
where
import
Data.Array.Accelerate.Data.Bits
...
...
@@ -77,6 +77,9 @@ conditional m = (run $ ie (use m), run $ sg (use m))
n
::
Exp
Double
n
=
P
.
fromIntegral
r
--miniMax m = fold minimum $ fold maximum m
...
...
src/Gargantext/Graph/Utils.hs
→
src/Gargantext/
Viz/
Graph/Utils.hs
View file @
32f76c93
...
...
@@ -14,7 +14,7 @@ Portability : POSIX
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Strict #-}
module
Gargantext.Graph.Utils
module
Gargantext.
Viz.
Graph.Utils
where
import
Data.Matrix
hiding
(
identity
)
...
...
stack.yaml
View file @
32f76c93
...
...
@@ -3,7 +3,7 @@ extra-package-dbs: []
packages
:
-
.
-
servant-job
#- '/home/alexandre/local/logiciels/haskell/
accelerate/accelerate
'
#- '/home/alexandre/local/logiciels/haskell/
myCode/louvain
'
allow-newer
:
true
extra-deps
:
...
...
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