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
195
Issues
195
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
e6298f58
Commit
e6298f58
authored
Jan 07, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Version number of List in Graph Type
parent
6e9a3233
Pipeline
#4655
failed with stage
in 9 minutes and 23 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
Graph.hs
src/Gargantext/Viz/Graph.hs
+15
-3
API.hs
src/Gargantext/Viz/Graph/API.hs
+2
-1
No files found.
src/Gargantext/Viz/Graph.hs
View file @
e6298f58
...
@@ -83,12 +83,24 @@ instance ToSchema LegendField where
...
@@ -83,12 +83,24 @@ instance ToSchema LegendField where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_lf_"
)
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_lf_"
)
makeLenses
''
L
egendField
makeLenses
''
L
egendField
---------------------------------------------------------------
type
Version
=
Int
data
ListForGraph
=
ListForGraph
{
_lfg_listId
::
ListId
,
_lfg_version
::
Version
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"_lfg_"
)
''
L
istForGraph
)
instance
ToSchema
ListForGraph
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_lfg_"
)
makeLenses
''
L
istForGraph
--
--
data
GraphMetadata
=
GraphMetadata
{
_gm_title
::
Text
-- title of the graph
data
GraphMetadata
=
GraphMetadata
{
_gm_title
::
Text
-- title of the graph
,
_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
Id
::
ListId
,
_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 @
e6298f58
...
@@ -98,12 +98,13 @@ getGraph uId nId = do
...
@@ -98,12 +98,13 @@ 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"
]
]
lId
(
ListForGraph
lId
v'
)
v
v
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
...
...
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