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
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
Grégoire Locqueville
purescript-gargantext
Commits
ef0a389d
Commit
ef0a389d
authored
Apr 21, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] small refactoring
parent
84482911
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+6
-6
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
ef0a389d
...
...
@@ -491,16 +491,16 @@ tree p = R.createElement treeCpt p []
treeCpt :: R.Component TreeProps
treeCpt = R.hooksComponent "G.C.NT.tree" cpt
where
cpt params@{
ngramsTable, ngramsStyle, ngramsEdit, ngramsClick, ngramsDepth: nd
} _ =
cpt params@{
ngramsClick, ngramsDepth, ngramsEdit, ngramsStyle, ngramsTable
} _ =
pure $
H.li { style: {width : "100%"} }
([ H.i { className, style } [] ]
<> [ R2.buff $ tag [ text $ " " <> ngramsTermText n
d
.ngrams ] ]
<> maybe [] edit (ngramsEdit n
d
)
<> [ R2.buff $ tag [ text $ " " <> ngramsTermText n
gramsDepth
.ngrams ] ]
<> maybe [] edit (ngramsEdit n
gramsDepth
)
<> [ forest cs ])
where
tag =
case ngramsClick n
d
of
case ngramsClick n
gramsDepth
of
Just effect ->
a (ngramsStyle <> [onClick $ const effect])
Nothing ->
...
...
@@ -513,10 +513,10 @@ treeCpt = R.hooksComponent "G.C.NT.tree" cpt
className = "glyphicon glyphicon-chevron-" <> if open then "down" else "right"
style = if leaf then {color: "#adb5bd"} else {color: ""}
open = not leaf || false {- TODO -}
cs = ngramsTable ^.. ix n
d
.ngrams <<< _NgramsElement <<< _children <<< folded
cs = ngramsTable ^.. ix n
gramsDepth
.ngrams <<< _NgramsElement <<< _children <<< folded
forest =
let depth = n
d
.depth + 1 in
let depth = n
gramsDepth
.depth + 1 in
H.ul {} <<< map (\ngrams -> tree (params { ngramsDepth = {depth, ngrams} })) <<< List.toUnfoldable
sumOccurrences' :: NgramsTable -> NgramsTerm -> Additive Int
...
...
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