Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
90af97f8
Commit
90af97f8
authored
Oct 25, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-graph-search-in-groups-not-in-labels
parents
cafa3ccd
2e5c7242
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
12 deletions
+44
-12
package.yaml
package.yaml
+1
-1
Metrics.hs
src/Gargantext/API/Metrics.hs
+1
-1
DocumentUpload.hs
src/Gargantext/API/Node/DocumentUpload.hs
+2
-5
Update.hs
src/Gargantext/API/Node/Update.hs
+35
-4
Chart.hs
src/Gargantext/Core/Viz/Chart.hs
+5
-1
No files found.
package.yaml
View file @
90af97f8
name
:
gargantext
version
:
'
0.0.4.
4
'
version
:
'
0.0.4.
5
'
synopsis
:
Search, map, share
description
:
Please see README.md
category
:
Data
...
...
src/Gargantext/API/Metrics.hs
View file @
90af97f8
...
...
@@ -285,7 +285,7 @@ updatePie cId maybeListId tabType maybeLimit = do
pure
()
updatePie'
::
FlowCmdM
env
err
m
=>
CorpusId
CorpusId
->
Maybe
ListId
->
TabType
->
Maybe
Limit
...
...
src/Gargantext/API/Node/DocumentUpload.hs
View file @
90af97f8
...
...
@@ -42,7 +42,7 @@ instance ToSchema DocumentUpload
instance
FromJSON
DocumentUpload
where
parseJSON
=
genericParseJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
,
fieldLabelModifier
=
unCapitalize
.
dropPrefix
"_du_"
,
omitNothingFields
=
True
}
...
...
@@ -50,7 +50,7 @@ instance FromJSON DocumentUpload
instance
ToJSON
DocumentUpload
where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
,
fieldLabelModifier
=
unCapitalize
.
dropPrefix
"_du_"
,
omitNothingFields
=
True
}
...
...
@@ -81,7 +81,6 @@ documentUpload uId nId doc logStatus = do
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
logStatus
jl
mcId
<-
getClosestParentIdByType'
nId
NodeCorpus
let
cId
=
case
mcId
of
Just
c
->
c
...
...
@@ -89,7 +88,6 @@ documentUpload uId nId doc logStatus = do
(
year
,
month
,
day
)
<-
liftBase
$
getCurrentTime
>>=
return
.
toGregorian
.
utctDay
let
nowS
=
T
.
pack
$
show
year
<>
"-"
<>
show
month
<>
"-"
<>
show
day
let
hd
=
HyperdataDocument
{
_hd_bdd
=
Nothing
,
_hd_doi
=
Nothing
,
_hd_url
=
Nothing
...
...
@@ -109,7 +107,6 @@ documentUpload uId nId doc logStatus = do
,
_hd_publication_minute
=
Nothing
,
_hd_publication_second
=
Nothing
,
_hd_language_iso2
=
Just
$
T
.
pack
$
show
EN
}
_
<-
flowDataText
(
RootId
(
NodeId
uId
))
(
DataNew
[[
hd
]])
(
Multi
EN
)
cId
Nothing
pure
$
jobLogSuccess
jl
src/Gargantext/API/Node/Update.hs
View file @
90af97f8
...
...
@@ -23,17 +23,19 @@ import Data.Swagger
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
qualified
Gargantext.API.Metrics
as
Metrics
import
Gargantext.API.Ngrams.List
(
reIndexWith
)
import
qualified
Gargantext.API.Ngrams.Types
as
NgramsTypes
import
Gargantext.API.Prelude
(
GargServer
,
simuLogs
)
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.
Database.Schema.Ngrams
(
NgramsType
(
NgramsTerms
)
)
import
Gargantext.
Core.Viz.Graph.API
(
recomputeGraph
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
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
qualified
Gargantext.Utils.Aeson
as
GUA
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
...
...
@@ -119,6 +121,35 @@ updateNode _uId nid1 (LinkNodeReq nt nid2) logStatus = do
,
_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
logStatus
JobLog
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
...
...
src/Gargantext/Core/Viz/Chart.hs
View file @
90af97f8
...
...
@@ -69,7 +69,11 @@ chartData cId nt lt = do
(
_total
,
mapTerms
)
<-
countNodesByNgramsWith
(
group
dico
)
<$>
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
))
...
...
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