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
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
Grégoire Locqueville
haskell-gargantext
Commits
1adc6aaf
Commit
1adc6aaf
authored
May 24, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] PhyloData with more data
parent
ba856c93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
Client.hs
src/Gargantext/API/Client.hs
+4
-4
API.hs
src/Gargantext/Core/Viz/Phylo/API.hs
+24
-4
No files found.
src/Gargantext/API/Client.hs
View file @
1adc6aaf
...
...
@@ -44,6 +44,7 @@ import Gargantext.Core.Types (NodeTableResult)
import
Gargantext.Core.Types.Main
hiding
(
Limit
,
Offset
)
import
Gargantext.Core.Viz.Graph
hiding
(
Node
,
Version
)
import
Gargantext.Core.Viz.Graph.API
import
Gargantext.Core.Viz.Phylo.API
(
PhyloData
)
import
Gargantext.Core.Viz.Types
import
Gargantext.Database.Admin.Types.Metrics
import
Gargantext.Database.Admin.Types.Hyperdata
...
...
@@ -58,7 +59,6 @@ import Servant.Job.Core
import
Servant.Job.Types
import
System.Metrics.Json
(
Sample
,
Value
)
import
qualified
Data.Aeson
as
Aeson
-- * version API
getBackendVersion
::
ClientM
Text
...
...
@@ -143,7 +143,7 @@ getNodePieHash :: Token -> NodeId -> Maybe NodeId -> TabType -> ClientM Text
getNodeTree
::
Token
->
NodeId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
(
HashedResponse
(
ChartMetrics
(
Vector
NgramsTree
)))
postNodeTreeUpdate
::
Token
->
NodeId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
()
getNodeTreeHash
::
Token
->
NodeId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
Text
getNodePhylo
::
Token
->
NodeId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
Aeson
.
Value
getNodePhylo
::
Token
->
NodeId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
PhyloData
putNodePhylo
::
Token
->
NodeId
->
Maybe
NodeId
->
ClientM
NodeId
putNodeMove
::
Token
->
NodeId
->
ParentId
->
ClientM
[
Int
]
...
...
@@ -232,7 +232,7 @@ getCorpusPieHash :: Token -> CorpusId -> Maybe NodeId -> TabType -> ClientM Text
getCorpusTree
::
Token
->
CorpusId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
(
HashedResponse
(
ChartMetrics
(
Vector
NgramsTree
)))
postCorpusTreeUpdate
::
Token
->
CorpusId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
()
getCorpusTreeHash
::
Token
->
CorpusId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
Text
getCorpusPhylo
::
Token
->
CorpusId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
Aeson
.
Value
getCorpusPhylo
::
Token
->
CorpusId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
PhyloData
putCorpusPhylo
::
Token
->
CorpusId
->
Maybe
NodeId
->
ClientM
NodeId
putCorpusMove
::
Token
->
CorpusId
->
ParentId
->
ClientM
[
Int
]
...
...
@@ -326,7 +326,7 @@ getAnnuairePieHash :: Token -> AnnuaireId -> Maybe NodeId -> TabType -> ClientM
getAnnuaireTree
::
Token
->
AnnuaireId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
(
HashedResponse
(
ChartMetrics
(
Vector
NgramsTree
)))
postAnnuaireTreeUpdate
::
Token
->
AnnuaireId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
()
getAnnuaireTreeHash
::
Token
->
AnnuaireId
->
Maybe
NodeId
->
TabType
->
ListType
->
ClientM
Text
getAnnuairePhylo
::
Token
->
AnnuaireId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
Aeson
.
Value
getAnnuairePhylo
::
Token
->
AnnuaireId
->
Maybe
NodeId
->
Maybe
Int
->
Maybe
Int
->
ClientM
PhyloData
putAnnuairePhylo
::
Token
->
AnnuaireId
->
Maybe
NodeId
->
ClientM
NodeId
putAnnuaireMove
::
Token
->
AnnuaireId
->
ParentId
->
ClientM
[
Int
]
...
...
src/Gargantext/Core/Viz/Phylo/API.hs
View file @
1adc6aaf
...
...
@@ -17,6 +17,7 @@ Portability : POSIX
module
Gargantext.Core.Viz.Phylo.API
where
import
GHC.Generics
(
Generic
)
import
Data.Aeson
import
Data.Either
import
Data.Maybe
(
fromMaybe
)
...
...
@@ -30,7 +31,7 @@ import Gargantext.Core.Viz.Phylo.Example (phyloExample)
import
Gargantext.Core.Viz.Phylo.Legacy.LegacyMain
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
-- (PhyloId, ListId, CorpusId, UserId, NodeId(..))
import
Gargantext.Database.Query.Table.Node
(
getClosestParentIdByType
)
import
Gargantext.Database.Query.Table.Node
(
getClosestParentIdByType
,
defaultList
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Prelude
import
Network.HTTP.Media
((
//
),
(
/:
))
...
...
@@ -66,6 +67,17 @@ instance ToSchema SVG where declareNamedSchema _ = declareNamedSchema (Proxy ::
instance
ToSchema
Value
where
declareNamedSchema
_
=
declareNamedSchema
(
Proxy
::
Proxy
TODO
)
------------------------------------------------------------------------
data
PhyloData
=
PhyloData
{
pd_corpusId
::
NodeId
,
pd_listId
::
NodeId
,
pd_data
::
Value
}
deriving
(
Generic
)
instance
FromJSON
PhyloData
instance
ToJSON
PhyloData
instance
ToSchema
PhyloData
type
GetPhylo
=
QueryParam
"listId"
ListId
:>
QueryParam
"level"
Level
:>
QueryParam
"minSizeBranch"
MinSizeBranch
...
...
@@ -84,17 +96,25 @@ type GetPhylo = QueryParam "listId" ListId
:> QueryParam "verbose" Bool
-}
-- :> Get '[SVG] SVG
:>
Get
'[
J
SON
]
Value
:>
Get
'[
J
SON
]
PhyloData
-- | TODO
-- Add real text processing
-- Fix Filter parameters
-- TODO fix parameters to default config that should be in Node
getPhylo
::
PhyloId
->
GargServer
GetPhylo
getPhylo
phyloId
_lId
_level
_minSizeBranch
=
do
getPhylo
phyloId
lId
_level
_minSizeBranch
=
do
corpusId
<-
fromMaybe
(
panic
$
"[G.C.V.Phylo.API] no parent for NodeId "
<>
(
cs
$
show
phyloId
))
<$>
getClosestParentIdByType
phyloId
NodeCorpus
listId
<-
case
lId
of
Nothing
->
defaultList
corpusId
Just
ld
->
pure
ld
theData
<-
getPhyloDataJson
phyloId
-- printDebug "getPhylo" theData
pure
theData
pure
$
PhyloData
corpusId
listId
theData
getPhyloDataJson
::
PhyloId
->
GargNoServer
Value
getPhyloDataJson
phyloId
=
do
...
...
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