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
Julien Moutinho
haskell-gargantext
Commits
f9c5e6da
Commit
f9c5e6da
authored
Jan 21, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] ok but empty.
parent
f1e97bd1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
28 deletions
+23
-28
Node.hs
src/Gargantext/API/Node.hs
+16
-22
Flow.hs
src/Gargantext/Database/Flow.hs
+1
-1
Count.hs
src/Gargantext/Database/Metrics/Count.hs
+5
-4
TFICF.hs
src/Gargantext/Database/Metrics/TFICF.hs
+1
-0
Flow.hs
src/Gargantext/Text/Flow.hs
+0
-1
No files found.
src/Gargantext/API/Node.hs
View file @
f9c5e6da
...
...
@@ -250,34 +250,28 @@ type ChartApi = Summary " Chart API"
type
GraphAPI
=
Get
'[
J
SON
]
Graph
graphAPI
::
NodeId
->
GargServer
GraphAPI
graphAPI
cId
=
undefined
graphAPI
nId
=
do
--graphAPI' :: NodeId -> GargServer GraphAPI
graphAPI'
::
NodeId
->
Cmd
err
Graph
-- GargServer GraphAPI
graphAPI'
cId
=
do
nodeGraph
<-
getNode
cId
HyperdataGraph
nodeGraph
<-
getNode
nId
HyperdataGraph
let
title
=
"IMT - Scientific publications - 1982-2017 - English"
let
metadata
=
GraphMetadata
title
[
maybe
0
identity
$
_node_parentId
nodeGraph
]
[
LegendField
6
"#FFF"
"Data processing"
,
LegendField
7
"#FFF"
"Networks
"
,
LegendField
1
"#FFF"
"Material science
"
,
LegendField
5
"#FFF"
"Energy / Environment
"
]
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
lId
<-
defaultList
cId
let
metadata
=
GraphMetadata
title
[
maybe
0
identity
$
_node_parentId
nodeGraph
]
[
LegendField
6
"#FFF"
"Data processing
"
,
LegendField
7
"#FFF"
"Networks
"
,
LegendField
1
"#FFF"
"Material science
"
,
LegendField
5
"#FFF"
"Energy / Environment"
]
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
cooc
<-
getCoocByDocDev
cId
lId
graph
<-
set
graph_metadata
(
Just
metadata
)
myCooc
<-
getCoocByDocDev
nId
<$>
defaultList
(
maybe
(
panic
"no parentId"
)
identity
$
_node_parentId
nodeGraph
)
myCooc'
<-
myCooc
--{-
liftIO
$
set
graph_metadata
(
Just
metadata
)
<$>
cooc2graph
myCooc'
-- <$> maybe defaultGraph identity
<$>
cooc2graph
cooc
{-
<$> readGraphFromJson "purescript-gargantext/dist/examples/imtNew.json"
-}
-- <$> readGraphFromJson "purescript-gargantext/dist/examples/imtNew.json"
pure
graph
-- t <- textFlow (Mono EN) (Contexts contextText)
-- liftIO $ liftIO $ pure $ maybe t identity maybeGraph
-- TODO what do we get about the node? to replace contextText
...
...
src/Gargantext/Database/Flow.hs
View file @
f9c5e6da
...
...
@@ -105,7 +105,7 @@ flowCorpus' :: HasNodeError err
flowCorpus'
NodeCorpus
hyperdataDocuments
(
ids
,
masterUserId
,
masterCorpusId
,
userId
,
userCorpusId
)
=
do
--------------------------------------------------
-- List Ngrams Flow
userListId
<-
flowListUser
userId
userCorpusId
300
userListId
<-
flowListUser
userId
userCorpusId
300
0
printDebug
"Working on User ListId : "
userListId
let
documentsWithId
=
mergeData
(
toInserted
ids
)
(
toInsert
hyperdataDocuments
)
...
...
src/Gargantext/Database/Metrics/Count.hs
View file @
f9c5e6da
...
...
@@ -11,9 +11,10 @@ Count Ngrams by Context
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
module
Gargantext.Database.Metrics.Count
where
...
...
@@ -30,7 +31,7 @@ import Gargantext.Database.Types.Node (ListId, CorpusId)
import
Gargantext.Database.Types.Node
(
NodeId
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsId
,
NgramsType
(
..
),
ngramsTypeId
,
Ngrams
(
..
),
NgramsIndexed
(
..
),
ngrams
,
ngramsTerms
)
getCoocByDocDev
::
HasNodeError
err
=>
CorpusId
->
ListId
->
Cmd
err
(
Map
([
Text
],
[
Text
])
Coocs
)
getCoocByDocDev
::
HasNodeError
err
=>
CorpusId
->
ListId
->
Cmd
err
(
Map
([
Text
],
[
Text
])
Int
)
getCoocByDocDev
cId
lId
=
coocOn
(
\
n
->
[
view
(
ngrams
.
ngramsTerms
)
n
])
<$>
getNgramsByDoc
cId
lId
getCoocByDoc
::
CorpusId
->
ListId
->
Cmd
err
(
Map
(
NgramsIndexed
,
NgramsIndexed
)
Coocs
)
...
...
src/Gargantext/Database/Metrics/TFICF.hs
View file @
f9c5e6da
...
...
@@ -14,6 +14,7 @@ TFICF, generalization of TFIDF
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
module
Gargantext.Database.Metrics.TFICF
where
...
...
src/Gargantext/Text/Flow.hs
View file @
f9c5e6da
...
...
@@ -35,7 +35,6 @@ import Database.PostgreSQL.Simple (Connection)
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Utils
(
Cmd
,
mkCmd
)
import
Gargantext.Core
(
Lang
)
import
Gargantext.Prelude
...
...
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