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
23dc7d37
Commit
23dc7d37
authored
Sep 22, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Metrics] small refactoring
parent
4b985c58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Metrics.hs
src/Gargantext/API/Metrics.hs
+4
-3
No files found.
src/Gargantext/API/Metrics.hs
View file @
23dc7d37
...
...
@@ -39,7 +39,7 @@ import Gargantext.Database.Query.Table.Node.Error (HasNodeError)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Gargantext.Core.Text.Metrics
(
Scored
(
..
))
import
Gargantext.Core.Text.Metrics
(
Scored
(
..
)
,
{-normalizeGlobal,-}
normalizeLocal
)
import
Gargantext.Core.Viz.Chart
import
Gargantext.Core.Viz.Types
import
qualified
Gargantext.Database.Action.Metrics
as
Metrics
...
...
@@ -106,8 +106,9 @@ updateScatter' cId maybeListId tabType maybeLimit = do
(
ngs'
,
scores
)
<-
Metrics
.
getMetrics
cId
maybeListId
tabType
maybeLimit
let
metrics
=
map
(
\
(
Scored
t
s1
s2
)
->
Metric
t
(
log'
5
s1
)
(
log'
2
s2
)
(
listType
t
ngs'
))
scores
log'
n
x
=
1
+
(
if
x
<=
0
then
0
else
log
$
(
10
^
(
n
::
Int
))
*
x
)
metrics
=
map
(
\
(
Scored
t
s1
s2
)
->
Metric
t
s1
s2
(
listType
t
ngs'
))
-- $ normalizeGlobal
$
map
normalizeLocal
scores
listType
t
m
=
maybe
(
panic
errorMsg
)
fst
$
Map
.
lookup
t
m
errorMsg
=
"API.Node.metrics: key absent"
...
...
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