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
147
Issues
147
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
e21d93ed
Commit
e21d93ed
authored
Apr 23, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT][Chart][TreeMap]
parent
6fb2db8d
Pipeline
#365
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
18 deletions
+7
-18
Metrics.hs
src/Gargantext/API/Metrics.hs
+1
-6
Node.hs
src/Gargantext/API/Node.hs
+2
-1
Chart.hs
src/Gargantext/Viz/Chart.hs
+4
-11
No files found.
src/Gargantext/API/Metrics.hs
View file @
e21d93ed
...
...
@@ -90,11 +90,6 @@ instance Arbitrary Histo
]
deriveJSON
(
unPrefix
"histo_"
)
''
H
isto
instance
ToSchema
(
TreeChartMetrics
)
instance
Arbitrary
(
TreeChartMetrics
)
where
arbitrary
=
TreeChartMetrics
<$>
arbitrary
instance
ToSchema
MyTree
instance
Arbitrary
MyTree
...
...
@@ -116,7 +111,7 @@ getPie cId _start _end tt = do
p
<-
pieData
cId
(
ngramsTypeFromTabType
tt
)
GraphTerm
pure
(
ChartMetrics
p
)
getTree
::
FlowCmdM
env
err
m
=>
CorpusId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
TabType
->
ListType
->
m
(
ChartMetrics
TreeChartMetrics
)
getTree
::
FlowCmdM
env
err
m
=>
CorpusId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
TabType
->
ListType
->
m
(
ChartMetrics
[
MyTree
]
)
getTree
cId
_start
_end
tt
lt
=
do
p
<-
treeData
cId
(
ngramsTypeFromTabType
tt
)
lt
pure
(
ChartMetrics
p
)
...
...
src/Gargantext/API/Node.hs
View file @
e21d93ed
...
...
@@ -61,6 +61,7 @@ import Gargantext.Prelude
import
Gargantext.Text.Metrics
(
Scored
(
..
))
import
Gargantext.Viz.Phylo.API
(
PhyloAPI
,
phyloAPI
)
import
Gargantext.Viz.Chart
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
...
...
@@ -280,7 +281,7 @@ type TreeApi = Summary " Tree API"
:>
QueryParam
"to"
UTCTime
:>
QueryParamR
"ngramsType"
TabType
:>
QueryParamR
"listType"
ListType
:>
Get
'[
J
SON
]
(
ChartMetrics
TreeChartMetrics
)
:>
Get
'[
J
SON
]
(
ChartMetrics
[
MyTree
]
)
...
...
src/Gargantext/Viz/Chart.hs
View file @
e21d93ed
...
...
@@ -22,10 +22,8 @@ module Gargantext.Viz.Chart
import
Data.Text
(
Text
)
import
Data.List
(
unzip
,
sortOn
)
import
Data.Map
(
toList
)
import
Data.Aeson.TH
(
deriveJSON
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Prelude
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Schema.NodeNode
(
selectDocsDates
)
import
Gargantext.Database.Utils
import
Gargantext.Database.Types.Node
(
CorpusId
)
...
...
@@ -85,16 +83,11 @@ pieData cId nt lt = do
pure
(
Histo
dates
(
map
round
count
))
data
TreeChartMetrics
=
TreeChartMetrics
{
_tcm_data
::
[
MyTree
]
}
deriving
(
Generic
,
Show
)
deriveJSON
(
unPrefix
"_tcm_"
)
''
T
reeChartMetrics
treeData
::
FlowCmdM
env
err
m
=>
CorpusId
->
NgramsType
->
ListType
->
m
TreeChartMetrics
->
m
[
MyTree
]
treeData
cId
nt
lt
=
do
ls
<-
map
(
_node_id
)
<$>
getListsWithParentId
cId
ts
<-
mapTermListRoot
ls
nt
...
...
@@ -106,12 +99,12 @@ treeData cId nt lt = do
cs'
<-
getNodesByNgramsOnlyUser
cId
nt
terms
m
<-
getListNgrams
ls
nt
pure
$
TreeChartMetrics
$
toTree
lt
cs'
m
pure
$
toTree
lt
cs'
m
treeData'
::
FlowCmdM
env
ServantErr
m
=>
CorpusId
->
NgramsType
->
ListType
->
m
TreeChartMetrics
->
m
[
MyTree
]
treeData'
cId
nt
lt
=
do
ls
<-
map
(
_node_id
)
<$>
getListsWithParentId
cId
ts
<-
mapTermListRoot
ls
nt
...
...
@@ -123,7 +116,7 @@ treeData' cId nt lt = do
cs'
<-
getNodesByNgramsOnlyUser
cId
nt
terms
m
<-
getListNgrams
ls
nt
pure
$
TreeChartMetrics
$
toTree
lt
cs'
m
pure
$
toTree
lt
cs'
m
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