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
141
Issues
141
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
68ff5f8b
Commit
68ff5f8b
authored
Jun 02, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[metrics] adding graph data to node list hyperdata
parent
18ef3d66
Pipeline
#868
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
47 deletions
+7
-47
Metrics.hs
src/Gargantext/API/Metrics.hs
+7
-47
No files found.
src/Gargantext/API/Metrics.hs
View file @
68ff5f8b
...
...
@@ -30,9 +30,16 @@ import Data.Swagger
import
Data.Text
(
Text
)
import
Data.Time
(
UTCTime
)
import
GHC.Generics
(
Generic
)
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
qualified
Data.Map
as
Map
import
qualified
Gargantext.Database.Action.Metrics
as
Metrics
import
Gargantext.API.Ngrams
import
Gargantext.API.Ngrams.NTree
import
Gargantext.Core.Types
(
CorpusId
,
ListId
,
Limit
)
import
Gargantext.Database.Admin.Types.Metrics
(
ChartMetrics
(
..
))
import
Gargantext.Core.Types
(
ListType
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Action.Flow
...
...
@@ -40,53 +47,6 @@ import Gargantext.Database.Prelude
import
Gargantext.Prelude
import
Gargantext.Text.Metrics
(
Scored
(
..
))
import
Gargantext.Viz.Chart
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
qualified
Data.Map
as
Map
import
qualified
Gargantext.Database.Action.Metrics
as
Metrics
data
Metrics
=
Metrics
{
metrics_data
::
[
Metric
]}
deriving
(
Generic
,
Show
)
instance
ToSchema
Metrics
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"metrics_"
)
instance
Arbitrary
Metrics
where
arbitrary
=
Metrics
<$>
arbitrary
data
Metric
=
Metric
{
m_label
::
!
Text
,
m_x
::
!
Double
,
m_y
::
!
Double
,
m_cat
::
!
ListType
}
deriving
(
Generic
,
Show
)
instance
ToSchema
Metric
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"m_"
)
instance
Arbitrary
Metric
where
arbitrary
=
Metric
<$>
arbitrary
<*>
arbitrary
<*>
arbitrary
<*>
arbitrary
deriveJSON
(
unPrefix
"metrics_"
)
''
M
etrics
deriveJSON
(
unPrefix
"m_"
)
''
M
etric
-------------------------------------------------------------
data
ChartMetrics
a
=
ChartMetrics
{
chartMetrics_data
::
a
}
deriving
(
Generic
,
Show
)
instance
(
ToSchema
a
)
=>
ToSchema
(
ChartMetrics
a
)
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"chartMetrics_"
)
instance
(
Arbitrary
a
)
=>
Arbitrary
(
ChartMetrics
a
)
where
arbitrary
=
ChartMetrics
<$>
arbitrary
deriveJSON
(
unPrefix
"chartMetrics_"
)
''
C
hartMetrics
-------------------------------------------------------------
instance
ToSchema
Histo
where
...
...
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