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
3ee4bc3e
Commit
3ee4bc3e
authored
Dec 02, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GraphExplorer] Node selection.
parent
857f6c39
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
14 deletions
+30
-14
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+1
-1
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+11
-13
Maybe.purs
src/Gargantext/Data/Maybe.purs
+18
-0
No files found.
src/Gargantext/Components/GraphExplorer.purs
View file @
3ee4bc3e
...
@@ -11,7 +11,7 @@ import Data.Sequence as Seq
...
@@ -11,7 +11,7 @@ import Data.Sequence as Seq
import Data.Set as Set
import Data.Set as Set
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
--
import DOM.Simple.Console (log2)
import DOM.Simple.Types (Element)
import DOM.Simple.Types (Element)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
3ee4bc3e
...
@@ -11,6 +11,7 @@ import Data.Tuple.Nested((/\))
...
@@ -11,6 +11,7 @@ import Data.Tuple.Nested((/\))
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as RH
import Gargantext.Data.Maybe (catMaybes)
import Gargantext.Components.RandomText (words)
import Gargantext.Components.RandomText (words)
import Gargantext.Components.Nodes.Corpus.Graph.Tabs as GT
import Gargantext.Components.Nodes.Corpus.Graph.Tabs as GT
import Gargantext.Components.Graph as Graph
import Gargantext.Components.Graph as Graph
...
@@ -54,11 +55,11 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -54,11 +55,11 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
, href: "#home"
, href: "#home"
, role: "tab"
, role: "tab"
, aria: {controls: "home", selected: "true"}}
, aria: {controls: "home", selected: "true"}}
[ RH.text "
Neighbour
s" ] ] ]
[ RH.text "
Selected node
s" ] ] ]
, RH.div { className: "tab-content", id: "myTabContent" }
, RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
(badge <$> badges) ] ]
(badge <$> badges
props.selectedNodeIds nodesMap
) ] ]
, RH.div { className: "col-md-12", id: "horizontal-checkbox" }
{-
, RH.div { className: "col-md-12", id: "horizontal-checkbox" }
[ RH.ul {}
[ RH.ul {}
[ checkbox "Pubs"
[ checkbox "Pubs"
, checkbox "Projects"
, checkbox "Projects"
...
@@ -66,6 +67,7 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -66,6 +67,7 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
, checkbox "Others"
, checkbox "Others"
]
]
]
]
-}
, RH.div { className: "col-md-12", id: "query" }
, RH.div { className: "col-md-12", id: "query" }
[
[
query props.frontends props.metaData props.session nodesMap props.selectedNodeIds
query props.frontends props.metaData props.session nodesMap props.selectedNodeIds
...
@@ -82,16 +84,10 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -82,16 +84,10 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
, className: "checkbox"
, className: "checkbox"
, checked: true
, checked: true
, title: "Mark as completed" } ]
, title: "Mark as completed" } ]
badges =
badges (selectedNodeIds /\ _) nodesMap = map (\n -> n.label)
[ "objects"
$ catMaybes
, "evaluation"
$ map (\n -> Map.lookup n nodesMap)
, "dynamics"
$ Set.toUnfoldable selectedNodeIds
, "virtual environments"
, "virtual reality"
, "performance analysis"
, "software engineering"
, "complex systems"
, "wireless communications" ]
query _ _ _ _ (selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} []
query _ _ _ _ (selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} []
query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
...
@@ -108,3 +104,5 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -108,3 +104,5 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
, listId: metaData.listId
, listId: metaData.listId
, corpusLabel: metaData.title
, corpusLabel: metaData.title
}
}
src/Gargantext/Data/Maybe.purs
0 → 100644
View file @
3ee4bc3e
module Gargantext.Data.Maybe where
import Prelude (bind, flip, identity, (<<<))
import Data.Maybe
mapMaybe :: forall a b. (a -> Maybe b) -> Array a -> Array b
mapMaybe f = concatMap (maybe [] singleton <<< f)
catMaybes :: forall a. Array (Maybe a) -> Array a
catMaybes = mapMaybe identity
concatMap :: forall a b. (a -> Array b) -> Array a -> Array b
concatMap = flip bind
singleton :: forall a. a -> Array a
singleton a = [a]
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