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
686f7f12
Commit
686f7f12
authored
Jul 09, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PHYLO] backend POST/GET ok.
parent
d5ce52fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
API.hs
src/Gargantext/Viz/Phylo/API.hs
+8
-7
Main.hs
src/Gargantext/Viz/Phylo/Main.hs
+1
-3
No files found.
src/Gargantext/Viz/Phylo/API.hs
View file @
686f7f12
...
@@ -80,7 +80,7 @@ instance MimeRender SVG SVG where
...
@@ -80,7 +80,7 @@ instance MimeRender SVG SVG where
type
GetPhylo
=
QueryParam
"listId"
ListId
type
GetPhylo
=
QueryParam
"listId"
ListId
:>
QueryParam
"level"
Level
:>
QueryParam
"level"
Level
:>
QueryParam
"minSizeBranch"
MinSizeBranch
:>
QueryParam
"minSizeBranch"
MinSizeBranch
:>
QueryParam
"filiation"
Filiation
{-
:> QueryParam "filiation" Filiation
:> QueryParam "childs" Bool
:> QueryParam "childs" Bool
:> QueryParam "depth" Level
:> QueryParam "depth" Level
:> QueryParam "metrics" [Metric]
:> QueryParam "metrics" [Metric]
...
@@ -93,15 +93,16 @@ type GetPhylo = QueryParam "listId" ListId
...
@@ -93,15 +93,16 @@ type GetPhylo = QueryParam "listId" ListId
:> QueryParam "export" ExportMode
:> QueryParam "export" ExportMode
:> QueryParam "display" DisplayMode
:> QueryParam "display" DisplayMode
:> QueryParam "verbose" Bool
:> QueryParam "verbose" Bool
-}
:>
Get
'[
S
VG
]
SVG
:>
Get
'[
S
VG
]
SVG
-- | TODO
-- | TODO
-- Add real text processing
-- Add real text processing
-- Fix Filter parameters
-- Fix Filter parameters
getPhylo
::
PhyloId
->
GargServer
GetPhylo
getPhylo
::
PhyloId
->
GargServer
GetPhylo
getPhylo
phId
_lId
l
msb
_f
_b
_l'
_ms
_x
_y
_z
_ts
_s
_o
_e
_d
_b'
=
do
--getPhylo phId _lId l msb _f _b _l' _ms _x _y _z _ts _s _o _e _d _b' = do
getPhylo
phId
_lId
l
msb
=
do
phNode
<-
getNodePhylo
phId
phNode
<-
getNodePhylo
phId
let
let
level
=
maybe
1
identity
l
level
=
maybe
1
identity
l
branc
=
maybe
2
identity
msb
branc
=
maybe
2
identity
msb
...
@@ -111,19 +112,19 @@ getPhylo phId _lId l msb _f _b _l' _ms _x _y _z _ts _s _o _e _d _b' = do
...
@@ -111,19 +112,19 @@ getPhylo phId _lId l msb _f _b _l' _ms _x _y _z _ts _s _o _e _d _b' = do
pure
(
SVG
p
)
pure
(
SVG
p
)
------------------------------------------------------------------------
------------------------------------------------------------------------
type
PostPhylo
=
QueryParam
"listId"
ListId
type
PostPhylo
=
QueryParam
"listId"
ListId
:>
ReqBody
'[
J
SON
]
PhyloQueryBuild
--
:> ReqBody '[JSON] PhyloQueryBuild
:>
(
Post
'[
J
SON
]
NodeId
)
:>
(
Post
'[
J
SON
]
NodeId
)
postPhylo
::
CorpusId
->
UserId
->
GargServer
PostPhylo
postPhylo
::
CorpusId
->
UserId
->
GargServer
PostPhylo
postPhylo
n
userId
_lId
_q
=
do
postPhylo
n
userId
_lId
=
do
-- TODO get Reader settings
-- TODO get Reader settings
-- s <- ask
-- s <- ask
let
let
-- _vrs = Just ("1" :: Text)
-- _vrs = Just ("1" :: Text)
-- _sft = Just (Software "Gargantext" "4")
-- _sft = Just (Software "Gargantext" "4")
-- _prm = initPhyloParam vrs sft (Just q)
-- _prm = initPhyloParam vrs sft (Just q)
ph
<-
flowPhylo
n
ph
y
<-
flowPhylo
n
pId
<-
insertNodes
[
nodePhyloW
(
Just
"Phylo"
)
(
Just
$
HyperdataPhylo
Nothing
(
Just
ph
))
n
userId
]
pId
<-
insertNodes
[
nodePhyloW
(
Just
"Phylo"
)
(
Just
$
HyperdataPhylo
Nothing
(
Just
ph
y
))
n
userId
]
pure
$
NodeId
(
fromIntegral
pId
)
pure
$
NodeId
(
fromIntegral
pId
)
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
src/Gargantext/Viz/Phylo/Main.hs
View file @
686f7f12
...
@@ -18,7 +18,6 @@ Portability : POSIX
...
@@ -18,7 +18,6 @@ Portability : POSIX
module
Gargantext.Viz.Phylo.Main
module
Gargantext.Viz.Phylo.Main
where
where
import
Control.Monad.IO.Class
(
liftIO
)
import
Data.GraphViz
import
Data.GraphViz
import
Data.Maybe
import
Data.Maybe
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
...
@@ -38,7 +37,6 @@ import Gargantext.Viz.Phylo.LevelMaker
...
@@ -38,7 +37,6 @@ import Gargantext.Viz.Phylo.LevelMaker
import
Gargantext.Viz.Phylo.Tools
import
Gargantext.Viz.Phylo.Tools
import
Gargantext.Viz.Phylo.View.Export
import
Gargantext.Viz.Phylo.View.Export
import
Gargantext.Viz.Phylo.View.ViewMaker
-- TODO Just Maker is fine
import
Gargantext.Viz.Phylo.View.ViewMaker
-- TODO Just Maker is fine
import
Servant
import
qualified
Data.ByteString
as
DB
import
qualified
Data.ByteString
as
DB
import
qualified
Data.List
as
List
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Map
as
Map
...
@@ -64,7 +62,7 @@ flowPhylo cId = do
...
@@ -64,7 +62,7 @@ flowPhylo cId = do
patterns
=
buildPatterns
termList
patterns
=
buildPatterns
termList
-- | To filter the Ngrams of a document based on the termList
-- | To filter the Ngrams of a document based on the termList
filterTerms
::
Patterns
->
(
Date
,
Text
)
->
(
Date
,
[
Text
])
filterTerms
::
Patterns
->
(
Date
,
Text
)
->
(
Date
,
[
Text
])
filterTerms
patterns
(
y
,
d
)
=
(
y
,
termsInText
patterns
d
)
filterTerms
patterns
'
(
y
,
d
)
=
(
y
,
termsInText
patterns'
d
)
where
where
--------------------------------------
--------------------------------------
termsInText
::
Patterns
->
Text
->
[
Text
]
termsInText
::
Patterns
->
Text
->
[
Text
]
...
...
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