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
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
3774aa22
Commit
3774aa22
authored
Jan 07, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Type graph version is list version.
parent
e6298f58
Pipeline
#672
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
Graph.hs
src/Gargantext/Viz/Graph.hs
+1
-1
API.hs
src/Gargantext/Viz/Graph/API.hs
+5
-6
No files found.
src/Gargantext/Viz/Graph.hs
View file @
3774aa22
...
@@ -100,7 +100,7 @@ data GraphMetadata = GraphMetadata { _gm_title :: Text -- title of the grap
...
@@ -100,7 +100,7 @@ data GraphMetadata = GraphMetadata { _gm_title :: Text -- title of the grap
,
_gm_corpusId
::
[
NodeId
]
-- we can map with different corpus
,
_gm_corpusId
::
[
NodeId
]
-- we can map with different corpus
,
_gm_legend
::
[
LegendField
]
-- legend of the Graph
,
_gm_legend
::
[
LegendField
]
-- legend of the Graph
,
_gm_list
::
ListForGraph
,
_gm_list
::
ListForGraph
,
_gm_version
::
Int
--
, _gm_version :: Int
}
}
deriving
(
Show
,
Generic
)
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"_gm_"
)
''
G
raphMetadata
)
$
(
deriveJSON
(
unPrefix
"_gm_"
)
''
G
raphMetadata
)
...
...
src/Gargantext/Viz/Graph/API.hs
View file @
3774aa22
...
@@ -65,10 +65,11 @@ getGraph :: UserId -> NodeId -> GargServer (Get '[JSON] Graph)
...
@@ -65,10 +65,11 @@ getGraph :: UserId -> NodeId -> GargServer (Get '[JSON] Graph)
getGraph
uId
nId
=
do
getGraph
uId
nId
=
do
nodeGraph
<-
getNodeWith
nId
HyperdataGraph
nodeGraph
<-
getNodeWith
nId
HyperdataGraph
let
graph
=
nodeGraph
^.
node_hyperdata
.
hyperdataGraph
let
graph
=
nodeGraph
^.
node_hyperdata
.
hyperdataGraph
let
graph
Version
=
graph
^?
_Just
let
list
Version
=
graph
^?
_Just
.
graph_metadata
.
graph_metadata
.
_Just
.
_Just
.
gm_version
.
gm_list
.
lfg_version
v
<-
currentVersion
v
<-
currentVersion
nodeUser
<-
getNodeWith
(
NodeId
uId
)
HyperdataUser
nodeUser
<-
getNodeWith
(
NodeId
uId
)
HyperdataUser
...
@@ -85,7 +86,7 @@ getGraph uId nId = do
...
@@ -85,7 +86,7 @@ getGraph uId nId = do
_
<-
insertGraph
cId
uId'
(
HyperdataGraph
$
Just
graph'
)
_
<-
insertGraph
cId
uId'
(
HyperdataGraph
$
Just
graph'
)
pure
graph'
pure
graph'
Just
graph'
->
if
graph
Version
==
Just
v
Just
graph'
->
if
list
Version
==
Just
v
then
pure
graph'
then
pure
graph'
else
do
else
do
graph''
<-
computeGraph
cId
NgramsTerms
v
graph''
<-
computeGraph
cId
NgramsTerms
v
...
@@ -98,14 +99,12 @@ getGraph uId nId = do
...
@@ -98,14 +99,12 @@ getGraph uId nId = do
computeGraph
::
CorpusId
->
NgramsType
->
Int
->
GargServer
(
Get
'[
J
SON
]
Graph
)
computeGraph
::
CorpusId
->
NgramsType
->
Int
->
GargServer
(
Get
'[
J
SON
]
Graph
)
computeGraph
cId
nt
v
=
do
computeGraph
cId
nt
v
=
do
lId
<-
defaultList
cId
lId
<-
defaultList
cId
v'
<-
currentVersion
let
metadata
=
GraphMetadata
"Title"
[
cId
]
let
metadata
=
GraphMetadata
"Title"
[
cId
]
[
LegendField
1
"#FFF"
"Cluster"
[
LegendField
1
"#FFF"
"Cluster"
,
LegendField
2
"#FFF"
"Cluster"
,
LegendField
2
"#FFF"
"Cluster"
]
]
(
ListForGraph
lId
v'
)
(
ListForGraph
lId
v
)
v
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
lIds
<-
selectNodesWithUsername
NodeList
userMaster
lIds
<-
selectNodesWithUsername
NodeList
userMaster
...
...
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