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
2a3bd023
Commit
2a3bd023
authored
Jun 29, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
[FIX MERGE]
parents
4a5fdbd6
e088850c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
73 deletions
+155
-73
package.yaml
package.yaml
+1
-0
Metrics.hs
src/Gargantext/API/Metrics.hs
+146
-46
Node.hs
src/Gargantext/API/Node.hs
+1
-17
API.hs
src/Gargantext/Viz/Graph/API.hs
+7
-10
No files found.
package.yaml
View file @
2a3bd023
...
@@ -34,6 +34,7 @@ library:
...
@@ -34,6 +34,7 @@ library:
-
-Wunused-binds
-
-Wunused-binds
-
-Wunused-imports
-
-Wunused-imports
-
-Werror
-
-Werror
-
-freduction-depth=300
exposed-modules
:
exposed-modules
:
-
Gargantext
-
Gargantext
-
Gargantext.API
-
Gargantext.API
...
...
src/Gargantext/API/Metrics.hs
View file @
2a3bd023
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Node.hs
View file @
2a3bd023
...
@@ -82,7 +82,7 @@ type NodesAPI = Delete '[JSON] Int
...
@@ -82,7 +82,7 @@ type NodesAPI = Delete '[JSON] Int
-- Be careful: really delete nodes
-- Be careful: really delete nodes
-- Access by admin only
-- Access by admin only
nodesAPI
::
[
NodeId
]
->
GargServer
NodesAPI
nodesAPI
::
[
NodeId
]
->
GargServer
NodesAPI
nodesAPI
ids
=
deleteNodes
id
s
nodesAPI
=
deleteNode
s
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | TODO-ACCESS: access by admin only.
-- | TODO-ACCESS: access by admin only.
...
@@ -222,22 +222,6 @@ nodeAPI p uId id' = withAccess (Proxy :: Proxy (NodeAPI a)) Proxy uId (PathNode
...
@@ -222,22 +222,6 @@ nodeAPI p uId id' = withAccess (Proxy :: Proxy (NodeAPI a)) Proxy uId (PathNode
-- :<|> nodeAddAPI id'
-- :<|> nodeAddAPI id'
-- :<|> postUpload id'
-- :<|> postUpload id'
scatterApi
::
NodeId
->
GargServer
ScatterAPI
scatterApi
id'
=
getScatter
id'
:<|>
updateScatter
id'
chartApi
::
NodeId
->
GargServer
ChartApi
chartApi
id'
=
getChart
id'
:<|>
updateChart
id'
pieApi
::
NodeId
->
GargServer
PieApi
pieApi
id'
=
getPie
id'
:<|>
updatePie
id'
treeApi
::
NodeId
->
GargServer
TreeApi
treeApi
id'
=
getTree
id'
:<|>
updateTree
id'
------------------------------------------------------------------------
------------------------------------------------------------------------
data
RenameNode
=
RenameNode
{
r_name
::
Text
}
data
RenameNode
=
RenameNode
{
r_name
::
Text
}
deriving
(
Generic
)
deriving
(
Generic
)
...
...
src/Gargantext/Viz/Graph/API.hs
View file @
2a3bd023
...
@@ -86,15 +86,13 @@ getGraph _uId nId = do
...
@@ -86,15 +86,13 @@ getGraph _uId nId = do
$
nodeGraph
^.
node_parentId
$
nodeGraph
^.
node_parentId
-- TODO Distance in Graph params
-- TODO Distance in Graph params
g
<-
case
graph
of
case
graph
of
Nothing
->
do
Nothing
->
do
graph'
<-
computeGraph
cId
Conditional
NgramsTerms
repo
graph'
<-
computeGraph
cId
Conditional
NgramsTerms
repo
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph'
)
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph'
)
pure
$
trace
"[G.V.G.API] Graph empty, computing"
$
graph'
pure
$
trace
"[G.V.G.API] Graph empty, computing"
graph'
Just
graph'
->
pure
$
trace
"[G.V.G.API] Graph exists, returning"
$
graph'
Just
graph'
->
pure
$
trace
"[G.V.G.API] Graph exists, returning"
graph'
pure
g
recomputeGraph
::
UserId
->
NodeId
->
Distance
->
GargNoServer
Graph
recomputeGraph
::
UserId
->
NodeId
->
Distance
->
GargNoServer
Graph
...
@@ -113,19 +111,18 @@ recomputeGraph _uId nId d = do
...
@@ -113,19 +111,18 @@ recomputeGraph _uId nId d = do
identity
identity
$
nodeGraph
^.
node_parentId
$
nodeGraph
^.
node_parentId
g
<-
case
graph
of
case
graph
of
Nothing
->
do
Nothing
->
do
graph'
<-
computeGraph
cId
d
NgramsTerms
repo
graph'
<-
computeGraph
cId
d
NgramsTerms
repo
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph'
)
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph'
)
pure
$
trace
"[G.V.G.API.recomputeGraph] Graph empty, computed"
$
graph'
pure
$
trace
"[G.V.G.API.recomputeGraph] Graph empty, computed"
graph'
Just
graph'
->
if
listVersion
==
Just
v
Just
graph'
->
if
listVersion
==
Just
v
then
pure
graph'
then
pure
graph'
else
do
else
do
graph''
<-
computeGraph
cId
d
NgramsTerms
repo
graph''
<-
computeGraph
cId
d
NgramsTerms
repo
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph''
)
_
<-
updateHyperdata
nId
(
HyperdataGraph
$
Just
graph''
)
pure
$
trace
"[G.V.G.API] Graph exists, recomputing"
$
graph''
pure
$
trace
"[G.V.G.API] Graph exists, recomputing"
graph''
pure
g
-- TODO use Database Monad only here ?
-- TODO use Database Monad only here ?
...
@@ -224,7 +221,7 @@ getGraphGexf :: UserId
...
@@ -224,7 +221,7 @@ getGraphGexf :: UserId
->
GargNoServer
(
Headers
'[
S
ervant
.
Header
"Content-Disposition"
Text
]
Graph
)
->
GargNoServer
(
Headers
'[
S
ervant
.
Header
"Content-Disposition"
Text
]
Graph
)
getGraphGexf
uId
nId
=
do
getGraphGexf
uId
nId
=
do
graph
<-
getGraph
uId
nId
graph
<-
getGraph
uId
nId
pure
$
addHeader
(
concat
[
"attachment; filename=graph.gexf"
])
graph
pure
$
addHeader
"attachment; filename=graph.gexf"
graph
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