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
a6664284
Commit
a6664284
authored
Apr 09, 2019
by
James Laver
Committed by
Alexandre Delanoë
Apr 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer required G.C.Annotated.AnnotatedRun
parent
e4c0f234
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
70 deletions
+0
-70
AnnotatedRun.purs
src/Gargantext/Components/Annotated/AnnotatedRun.purs
+0
-70
No files found.
src/Gargantext/Components/Annotated/AnnotatedRun.purs
deleted
100644 → 0
View file @
e4c0f234
-- | The AnnotatedRun Component renders an ngram run with appropriate
-- | highlighting and tooltip
module Gargantext.Components.Annotated.AnnotatedRun where
import Prelude hiding (div)
import Data.Maybe (Maybe(..))
import Data.Unit (Unit, unit)
import Data.Array as A
import Data.Lens (Lens', Prism', over, view)
import Data.List (List, mapWithIndex, toUnfoldable, sortBy)
import Data.Ordering (Ordering(..))
import Data.String.Common (joinWith)
import Data.String.CodeUnits as CU
import Data.String.Regex as Regex
import Data.Tuple (Tuple(..))
import React (ReactElement)
import React.DOM (span, text)
import React.DOM.Props (Props, className, title, style, onClick)
import Thermite ( PerformAction, Render, Spec
, _render, modifyState, focus
, simpleSpec, withState)
import Gargantext.Types (Term(..), TermList(..), termListName)
import Gargantext.Utils.Reactil (wrap)
-- TODO: Support multiple lists (see the large quantities of commented out code)
-- names :: forall f. Foldable f, => f String -> Array String
-- names = map \(OccurrenceList o) -> o.name
-- tooltip :: Array String -> Maybe String
-- tooltip = help . A.fromFoldable
-- where help [] = Nothing
-- help names = Just $ prelude <> joinWith ", " names
-- where prelude = "Occurs in " <> (show $ A.length names) <> " lists: "
-- wrapColour :: Colour -> ReactElement -> ReactElement
-- wrapColour colour = wrap $ div [color (show colour), opacity "0.8"]
newtype Run = Run { text :: String, list :: Maybe TermList } -- lists :: Array TermList }
-- TODO: Context Menu
-- | A Blank Run is not part an n-gram, but it does have a context menu
renderBlank :: String -> ReactElement
renderBlank = (wrap $ span [className "run run-blank"]) <<< text
-- TODO: Context Menu
renderHilite :: String -> TermList -> ReactElement
renderHilite txt list = span [className "run run-pretty", title tooltip] [text txt]
-- (wrap wrapping) $ foldl wrapColour head r.lists
where tooltip = "Occurs in the " <> termListName list
-- lists = names r.lists
-- head = span [className "run run-pretty", title (tooltip lists)] [text r.text]
-- wrapping = span [className "run run-pretty"]
render :: Run -> ReactElement
render (Run r)
| Just l <- r.list = renderHilite r.text l
| otherwise = renderBlank r.text
data Action = AddTerm Term | RemoveTerm Term
termStyle :: TermList -> Props
termStyle GraphTerm = style {color: "green"}
termStyle StopTerm = style {color: "red", textDecoration : "line-through"}
termStyle CandidateTerm = style {color: "black"}
-- annotatedRun ::
-- Spec Unit Run Action
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