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
ddabb912
Commit
ddabb912
authored
Oct 15, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[charts] sources chart sorted in ascending order
Also, add "Advanced" endpoint for node list update to update charts.
parent
2aeacb2a
Pipeline
#1975
failed with stage
in 10 minutes and 22 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
Metrics.hs
src/Gargantext/API/Metrics.hs
+1
-1
Update.hs
src/Gargantext/API/Node/Update.hs
+35
-4
Chart.hs
src/Gargantext/Core/Viz/Chart.hs
+5
-1
No files found.
src/Gargantext/API/Metrics.hs
View file @
ddabb912
...
@@ -285,7 +285,7 @@ updatePie cId maybeListId tabType maybeLimit = do
...
@@ -285,7 +285,7 @@ updatePie cId maybeListId tabType maybeLimit = do
pure
()
pure
()
updatePie'
::
FlowCmdM
env
err
m
=>
updatePie'
::
FlowCmdM
env
err
m
=>
CorpusId
CorpusId
->
Maybe
ListId
->
Maybe
ListId
->
TabType
->
TabType
->
Maybe
Limit
->
Maybe
Limit
...
...
src/Gargantext/API/Node/Update.hs
View file @
ddabb912
...
@@ -23,17 +23,19 @@ import Data.Swagger
...
@@ -23,17 +23,19 @@ import Data.Swagger
import
GHC.Generics
(
Generic
)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
qualified
Gargantext.API.Metrics
as
Metrics
import
Gargantext.API.Ngrams.List
(
reIndexWith
)
import
Gargantext.API.Ngrams.List
(
reIndexWith
)
import
qualified
Gargantext.API.Ngrams.Types
as
NgramsTypes
import
Gargantext.API.Prelude
(
GargServer
,
simuLogs
)
import
Gargantext.API.Prelude
(
GargServer
,
simuLogs
)
import
Gargantext.Core.Methods.Distances
(
GraphMetric
(
..
))
import
Gargantext.Core.Methods.Distances
(
GraphMetric
(
..
))
import
Gargantext.Core.Viz.Graph.API
(
recomputeGraph
)
import
Gargantext.Database.Query.Table.Node
(
getNode
)
import
Gargantext.Database.Schema.Node
(
node_parent_id
)
import
Gargantext.Core.Types.Main
(
ListType
(
..
))
import
Gargantext.Core.Types.Main
(
ListType
(
..
))
import
Gargantext.
Database.Schema.Ngrams
(
NgramsType
(
NgramsTerms
)
)
import
Gargantext.
Core.Viz.Graph.API
(
recomputeGraph
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Query.Table.Node
(
getNode
)
import
Gargantext.Database.Schema.Node
(
node_parent_id
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
(
NgramsTerms
))
import
Gargantext.Prelude
(
Ord
,
Eq
,
(
<$>
),
(
$
),
liftBase
,
(
.
),
printDebug
,
pure
,
show
,
cs
,
(
<>
),
panic
)
import
Gargantext.Prelude
(
Ord
,
Eq
,
(
<$>
),
(
$
),
liftBase
,
(
.
),
printDebug
,
pure
,
show
,
cs
,
(
<>
),
panic
)
import
qualified
Gargantext.Utils.Aeson
as
GUA
import
qualified
Gargantext.Utils.Aeson
as
GUA
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
...
@@ -119,6 +121,35 @@ updateNode _uId nid1 (LinkNodeReq nt nid2) logStatus = do
...
@@ -119,6 +121,35 @@ updateNode _uId nid1 (LinkNodeReq nt nid2) logStatus = do
,
_scst_events
=
Just
[]
,
_scst_events
=
Just
[]
}
}
-- | `Advanced` to update graphs
updateNode
_uId
lId
(
UpdateNodeParamsList
Advanced
)
logStatus
=
do
logStatus
JobLog
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
2
,
_scst_events
=
Just
[]
}
corpusId
<-
view
node_parent_id
<$>
getNode
lId
logStatus
JobLog
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
_
<-
case
corpusId
of
Just
cId
->
do
_
<-
Metrics
.
updatePie'
cId
(
Just
lId
)
NgramsTypes
.
Authors
Nothing
_
<-
Metrics
.
updateTree'
cId
(
Just
lId
)
NgramsTypes
.
Institutes
MapTerm
_
<-
Metrics
.
updatePie'
cId
(
Just
lId
)
NgramsTypes
.
Sources
Nothing
pure
()
Nothing
->
pure
()
pure
JobLog
{
_scst_succeeded
=
Just
3
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_events
=
Just
[]
}
updateNode
_uId
lId
(
UpdateNodeParamsList
_mode
)
logStatus
=
do
updateNode
_uId
lId
(
UpdateNodeParamsList
_mode
)
logStatus
=
do
logStatus
JobLog
{
_scst_succeeded
=
Just
1
logStatus
JobLog
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
...
...
src/Gargantext/Core/Viz/Chart.hs
View file @
ddabb912
...
@@ -69,7 +69,11 @@ chartData cId nt lt = do
...
@@ -69,7 +69,11 @@ chartData cId nt lt = do
(
_total
,
mapTerms
)
<-
countNodesByNgramsWith
(
group
dico
)
(
_total
,
mapTerms
)
<-
countNodesByNgramsWith
(
group
dico
)
<$>
getNodesByNgramsOnlyUser
cId
(
ls'
<>
ls
)
nt
terms
<$>
getNodesByNgramsOnlyUser
cId
(
ls'
<>
ls
)
nt
terms
let
(
dates
,
count
)
=
V
.
unzip
$
fmap
(
\
(
NgramsTerm
t
,(
d
,
_
))
->
(
t
,
d
))
$
V
.
fromList
$
HashMap
.
toList
mapTerms
let
(
dates
,
count
)
=
V
.
unzip
$
V
.
fromList
$
List
.
sortOn
snd
$
(
\
(
NgramsTerm
t
,(
d
,
_
))
->
(
t
,
d
))
<$>
HashMap
.
toList
mapTerms
pure
(
Histo
dates
(
round
<$>
count
))
pure
(
Histo
dates
(
round
<$>
count
))
...
...
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