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
88b73a01
Commit
88b73a01
authored
Apr 10, 2019
by
James Laver
Committed by
Alexandre Delanoë
Apr 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wire in ngram highlighting
parent
d85c07c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
AnnotatedField.purs
src/Gargantext/Components/Annotated/AnnotatedField.purs
+4
-8
No files found.
src/Gargantext/Components/Annotated/AnnotatedField.purs
View file @
88b73a01
...
@@ -29,7 +29,7 @@ import Thermite ( PerformAction, Render, Spec
...
@@ -29,7 +29,7 @@ import Thermite ( PerformAction, Render, Spec
, _render, modifyState, focus, focusState
, _render, modifyState, focus, focusState
, simpleSpec, withState)
, simpleSpec, withState)
import Gargantext.Types (TermList(..))
import Gargantext.Types (TermList(..))
import Gargantext.Components.NgramsTable (NgramsTable, termStyle)
import Gargantext.Components.NgramsTable (NgramsTable
(..), highlightNgrams
, termStyle)
import Gargantext.Utils.React (WithChildren)
import Gargantext.Utils.React (WithChildren)
import Gargantext.Utils.Selection (getSelection, toString)
import Gargantext.Utils.Selection (getSelection, toString)
import React.SyntheticEvent (SyntheticMouseEvent, pageX, pageY)
import React.SyntheticEvent (SyntheticMouseEvent, pageX, pageY)
...
@@ -77,18 +77,14 @@ annotatedFieldClass = createClass "AnnotatedField" spec compile
...
@@ -77,18 +77,14 @@ annotatedFieldClass = createClass "AnnotatedField" spec compile
compile :: Props -> State
compile :: Props -> State
compile {text, ngrams} = { runs: runs text, contextMenu: { visible: false } }
compile {text, ngrams} = { runs: runs text, contextMenu: { visible: false } }
where runs (Just txt) = hi
lite
ngrams txt
where runs (Just txt) = hi
ghlight
ngrams txt
runs _ = Nil
runs _ = Nil
-- highlightNgrams :: NgramsTable -> String -> Array (Tuple String (Maybe TermList))
-- highlightNgrams :: NgramsTable -> String -> Array (Tuple String (Maybe TermList))
-- TODO HOOK IN string search
-- TODO HOOK IN string search
hilite :: NgramsTable -> String -> List Run
highlight :: NgramsTable -> String -> List Run
hilite _ _ = List.fromFoldable
highlight n t = List.fromFoldable $ highlightNgrams n t
[ Tuple "Hello" (Just CandidateTerm)
, Tuple " " Nothing
, Tuple "World" (Just CandidateTerm) ]
-- hilite = map tupleRun <<< highlightNgrams
contextMenuHandler :: (Action -> Effect Unit) -> SyntheticMouseEvent -> Effect Unit
contextMenuHandler :: (Action -> Effect Unit) -> SyntheticMouseEvent -> Effect Unit
contextMenuHandler d e =
contextMenuHandler d e =
...
...
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