Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
purescript-gargantext
Commits
2b96ca23
Commit
2b96ca23
authored
Oct 28, 2021
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
471fbf05
Pipeline
#2032
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
7 deletions
+25
-7
Layout.purs
src/Gargantext/Components/PhyloExplorer/Layout.purs
+2
-3
Types.purs
src/Gargantext/Components/PhyloExplorer/Types.purs
+23
-4
No files found.
src/Gargantext/Components/PhyloExplorer/Layout.purs
View file @
2b96ca23
...
...
@@ -279,14 +279,13 @@ setGlobalDependencies w (PhyloDataSet o)
(freq :: Array Int) <- pure $ w .. "freq"
(terms :: Array GlobalTerm) <- pure $ w .. "terms"
void $ for
o.groups \(Group g) -> do
for_
o.groups \(Group g) -> do
let
f = g.foundation
l = g.label
log2 "FOUNDATION" f
log2 "LABEL" l
log2 "group" g
-- For each entries in group.foundation array,
-- increment consequently the global window.keys array
...
...
src/Gargantext/Components/PhyloExplorer/Types.purs
View file @
2b96ca23
...
...
@@ -161,7 +161,7 @@ parseGroups epoch
, from : parseNodeDate o.strFrom o.from epoch
, gId : o._gvid
, label : stringedArrayToArray o.lbl
, role : stringedArrayToArray
'
o.role
, role : stringedArrayToArray
_
o.role
, size : parseInt o.support
, source : parseSources o.source
, to : parseNodeDate o.strTo o.to epoch
...
...
@@ -187,9 +187,13 @@ instance Show GlobalTerm where show = genericShow
parseInt :: String -> Int
parseInt s = maybe 0 identity $ Int.fromString s
parseInt' :: Number -> Int
parseInt' n = maybe 0 identity $ Int.fromNumber n
parseFloat :: String -> Number
parseFloat s = maybe 0.0 identity $ Number.fromString s
parseSources :: String -> Array String
parseSources
= String.replace (String.Pattern "[") (String.Replacement "")
...
...
@@ -234,15 +238,30 @@ stringedMaybeToNumber s =
s # String.replace (String.Pattern "Just ") (String.Replacement "")
>>> parseFloat
-- | From "\"user | sentiment analysis\"" :: String
-- |
-- | To ["user", "sentiment analysis"] :: Array String
stringedArrayToArray :: String -> Array String
stringedArrayToArray str
= str # String.length
>>> (\length -> String.splitAt (length - 1) str)
>>> (\{
after } -> String.splitAt 1 after
)
>>> (\{ after } -> String.split (String.Pattern "|") after)
>>> (\length
-> String.splitAt (length - 1) str)
>>> (\{
before } -> String.splitAt 1 before
)
>>> (\{ after }
-> String.split (String.Pattern "|") after)
>>> map String.trim
-- | From "\"97 | 257 | 542 | 574 | 577 | 597 | 785\"" :: String
-- |
-- | To [97, 257, 542, 574, 577, 597, 785] :: Array Int
stringedArrayToArray' :: String -> Array Int
stringedArrayToArray'
= stringedArrayToArray
>>> map parseInt
-- | From "\"3.0 | 3.0 | 3.0 | 3.0 | 1.0 | 3.0 | 3.0\"" :: String
-- |
-- | To [3, 3, 3, 3, 1, 3, 3] :: Array Int
stringedArrayToArray_ :: String -> Array Int
stringedArrayToArray_
= stringedArrayToArray
>>> map parseFloat
>>> map parseInt'
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