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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
8d82e5dc
Commit
8d82e5dc
authored
Jun 19, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[list] implement updates for remaining list charts
parent
d1f8ee96
Pipeline
#894
failed with stage
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
249 additions
and
60 deletions
+249
-60
Metrics.hs
src/Gargantext/API/Metrics.hs
+227
-19
Node.hs
src/Gargantext/API/Node.hs
+15
-38
Hyperdata.hs
src/Gargantext/Database/Admin/Types/Hyperdata.hs
+7
-3
No files found.
src/Gargantext/API/Metrics.hs
View file @
8d82e5dc
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Node.hs
View file @
8d82e5dc
...
@@ -34,7 +34,6 @@ import Data.Aeson (FromJSON, ToJSON)
...
@@ -34,7 +34,6 @@ import Data.Aeson (FromJSON, ToJSON)
import
Data.Maybe
import
Data.Maybe
import
Data.Swagger
import
Data.Swagger
import
Data.Text
(
Text
())
import
Data.Text
(
Text
())
import
Data.Time
(
UTCTime
)
import
GHC.Generics
(
Generic
)
import
GHC.Generics
(
Generic
)
import
Servant
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
...
@@ -43,8 +42,7 @@ import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
...
@@ -43,8 +42,7 @@ import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
import
Gargantext.API.Admin.Auth
(
withAccess
,
PathId
(
..
))
import
Gargantext.API.Admin.Auth
(
withAccess
,
PathId
(
..
))
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
import
Gargantext.API.Metrics
import
Gargantext.API.Metrics
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
apiNgramsTableCorpus
,
QueryParamR
)
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
apiNgramsTableCorpus
)
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Gargantext.API.Node.New
import
Gargantext.API.Node.New
import
qualified
Gargantext.API.Node.Share
as
Share
import
qualified
Gargantext.API.Node.Share
as
Share
import
qualified
Gargantext.API.Node.Update
as
Update
import
qualified
Gargantext.API.Node.Update
as
Update
...
@@ -52,9 +50,8 @@ import qualified Gargantext.API.Node.Update as Update
...
@@ -52,9 +50,8 @@ import qualified Gargantext.API.Node.Update as Update
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
,
SearchPairsAPI
,
searchPairs
)
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
,
SearchPairsAPI
,
searchPairs
)
import
Gargantext.API.Table
import
Gargantext.API.Table
import
Gargantext.Core.Types
(
NodeTableResult
)
import
Gargantext.Core.Types
(
NodeTableResult
)
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
,
ListType
)
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Action.Flow.Pairing
(
pairing
)
import
Gargantext.Database.Admin.Types.Metrics
(
ChartMetrics
)
import
Gargantext.Database.Query.Facet
(
FacetDoc
,
OrderBy
(
..
))
import
Gargantext.Database.Query.Facet
(
FacetDoc
,
OrderBy
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node
...
@@ -68,7 +65,6 @@ import Gargantext.Database.Prelude -- (Cmd, CmdM)
...
@@ -68,7 +65,6 @@ import Gargantext.Database.Prelude -- (Cmd, CmdM)
import
Gargantext.Database.Query.Table.NodeNode
import
Gargantext.Database.Query.Table.NodeNode
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Viz.Phylo.API
(
PhyloAPI
,
phyloAPI
)
import
Gargantext.Viz.Phylo.API
(
PhyloAPI
,
phyloAPI
)
import
Gargantext.Viz.Types
import
qualified
Gargantext.Database.Query.Table.Node.Update
as
U
(
update
,
Update
(
..
))
import
qualified
Gargantext.Database.Query.Table.Node.Update
as
U
(
update
,
Update
(
..
))
import
qualified
Gargantext.Database.Action.Delete
as
Action
(
deleteNode
)
import
qualified
Gargantext.Database.Action.Delete
as
Action
(
deleteNode
)
...
@@ -216,20 +212,28 @@ nodeAPI p uId id' = withAccess (Proxy :: Proxy (NodeAPI a)) Proxy uId (PathNode
...
@@ -216,20 +212,28 @@ nodeAPI p uId id' = withAccess (Proxy :: Proxy (NodeAPI a)) Proxy uId (PathNode
:<|>
scatterApi
id'
:<|>
scatterApi
id'
:<|>
chartApi
id'
:<|>
chartApi
id'
:<|>
getPie
id'
:<|>
pieApi
id'
:<|>
getTree
id'
:<|>
treeApi
id'
:<|>
phyloAPI
id'
uId
:<|>
phyloAPI
id'
uId
-- :<|> nodeAddAPI id'
-- :<|> nodeAddAPI id'
-- :<|> postUpload id'
-- :<|> postUpload id'
:<|>
Update
.
api
uId
id'
:<|>
Update
.
api
uId
id'
scatterApi
::
NodeId
->
GargServer
ScatterAPI
scatterApi
::
NodeId
->
GargServer
ScatterAPI
scatterApi
id'
=
getScatter
id'
scatterApi
id'
=
getScatter
id'
:<|>
updateScatter
id'
chartApi
::
NodeId
->
GargServer
ChartApi
chartApi
::
NodeId
->
GargServer
ChartApi
chartApi
id'
=
getChart
id'
chartApi
id'
=
getChart
id'
:<|>
updateChart
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
}
...
@@ -294,33 +298,6 @@ pairWith cId aId lId = do
...
@@ -294,33 +298,6 @@ pairWith cId aId lId = do
pure
r
pure
r
------------------------------------------------------------------------
------------------------------------------------------------------------
type
ChartApi
=
Summary
" Chart API"
:>
QueryParam
"from"
UTCTime
:>
QueryParam
"to"
UTCTime
:>
Get
'[
J
SON
]
(
ChartMetrics
Histo
)
:<|>
Summary
"SepGen IncExc chart update"
:>
QueryParam
"list"
ListId
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParam
"limit"
Int
:>
Post
'[
J
SON
]
()
type
PieApi
=
Summary
" Chart API"
:>
QueryParam
"from"
UTCTime
:>
QueryParam
"to"
UTCTime
:>
QueryParamR
"ngramsType"
TabType
:>
Get
'[
J
SON
]
(
ChartMetrics
Histo
)
type
TreeApi
=
Summary
" Tree API"
:>
QueryParam
"from"
UTCTime
:>
QueryParam
"to"
UTCTime
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"listType"
ListType
:>
Get
'[
J
SON
]
(
ChartMetrics
[
MyTree
])
-- Depending on the Type of the Node, we could post
-- New documents for a corpus
-- New map list terms
-- :<|> "process" :> MultipartForm MultipartData :> Post '[JSON] Text
------------------------------------------------------------------------
------------------------------------------------------------------------
type
TreeAPI
=
QueryParams
"type"
NodeType
:>
Get
'[
J
SON
]
(
Tree
NodeTree
)
type
TreeAPI
=
QueryParams
"type"
NodeType
:>
Get
'[
J
SON
]
(
Tree
NodeTree
)
...
...
src/Gargantext/Database/Admin/Types/Hyperdata.hs
View file @
8d82e5dc
...
@@ -26,7 +26,8 @@ import Protolude hiding (ByteString)
...
@@ -26,7 +26,8 @@ import Protolude hiding (ByteString)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
import
Gargantext.Database.Admin.Types.Metrics
(
ChartMetrics
(
..
))
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Gargantext.Database.Admin.Types.Metrics
(
ChartMetrics
(
..
),
Metrics
)
import
Gargantext.Database.Prelude
(
fromField'
)
import
Gargantext.Database.Prelude
(
fromField'
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Viz.Phylo
(
Phylo
(
..
))
import
Gargantext.Viz.Phylo
(
Phylo
(
..
))
...
@@ -217,8 +218,11 @@ instance Arbitrary HyperdataCorpus where
...
@@ -217,8 +218,11 @@ instance Arbitrary HyperdataCorpus where
------------------------------------------------------------------------
------------------------------------------------------------------------
data
HyperdataList
=
data
HyperdataList
=
HyperdataList
{
hd_list
::
!
(
Maybe
Text
)
HyperdataList
{
hd_chart
::
!
(
Maybe
(
ChartMetrics
Histo
))
,
hd_chart
::
!
(
Maybe
(
ChartMetrics
Histo
))
,
hd_list
::
!
(
Maybe
Text
)
,
hd_pie
::
!
(
Maybe
(
ChartMetrics
Histo
))
,
hd_scatter
::
!
(
Maybe
Metrics
)
,
hd_tree
::
!
(
Maybe
(
ChartMetrics
[
MyTree
]))
}
deriving
(
Show
,
Generic
)
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"hd_"
)
''
H
yperdataList
)
$
(
deriveJSON
(
unPrefix
"hd_"
)
''
H
yperdataList
)
...
...
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