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
2e3c3122
Commit
2e3c3122
authored
Jun 02, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[metrics] add missing G.D.A.T.Metrics module
parent
68ff5f8b
Pipeline
#869
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
Metrics.hs
src/Gargantext/Database/Admin/Types/Metrics.hs
+57
-0
No files found.
src/Gargantext/Database/Admin/Types/Metrics.hs
0 → 100644
View file @
2e3c3122
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Admin.Types.Metrics
where
import
Control.Lens
hiding
(
elements
,
(
&
))
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
import
GHC.Generics
(
Generic
)
import
Data.Text
(
Text
,
unpack
)
import
Test.QuickCheck.Arbitrary
import
Gargantext.Core.Types
(
ListType
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
----------------------------------------------------------------------------
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
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