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
c81b315a
Commit
c81b315a
authored
Jul 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Adding legend box (WIP)
parent
5cff20a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
30 deletions
+44
-30
Legend.purs
src/Gargantext/Components/GraphExplorer/Legend.purs
+6
-1
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+33
-22
Types.purs
src/Gargantext/Components/GraphExplorer/Types.purs
+5
-7
No files found.
src/Gargantext/Components/GraphExplorer/Legend.purs
View file @
c81b315a
...
@@ -23,6 +23,11 @@ legendCpt = R.hooksComponent "Legend" cpt
...
@@ -23,6 +23,11 @@ legendCpt = R.hooksComponent "Legend" cpt
entry :: Legend -> R.Element
entry :: Legend -> R.Element
entry (Legend {id_, label}) =
entry (Legend {id_, label}) =
RH.p {}
RH.p {}
[ RH.span { style: { width: 10, height: 10, backgroundColor: intColor id_, display: "inline-block" } } []
[ RH.span { style: { width : 10
, height: 10
, backgroundColor: intColor id_
, display: "inline-block"
}
} []
, RH.text $ " " <> label
, RH.text $ " " <> label
]
]
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
c81b315a
...
@@ -14,7 +14,8 @@ import Data.Tuple.Nested ((/\))
...
@@ -14,7 +14,8 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Legend as Legend
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.Nodes.Corpus.Graph.Tabs (tabs) as CGT
import Gargantext.Components.Nodes.Corpus.Graph.Tabs (tabs) as CGT
import Gargantext.Components.RandomText (words)
import Gargantext.Components.RandomText (words)
...
@@ -30,16 +31,16 @@ import Reactix as R
...
@@ -30,16 +31,16 @@ import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as RH
type Props =
type Props =
( frontends :: Frontends
( frontends
:: Frontends
, graph :: SigmaxT.SGraph
, graph
:: SigmaxT.SGraph
, graphId :: Int
, graphId
:: Int
, graphVersion :: R.State Int
, graphVersion
:: R.State Int
, metaData :: GET.MetaData
, metaData
:: GET.MetaData
, removedNodeIds :: R.State SigmaxT.NodeIds
, removedNodeIds
:: R.State SigmaxT.NodeIds
, selectedNodeIds :: R.State SigmaxT.NodeIds
, selectedNodeIds :: R.State SigmaxT.NodeIds
, session :: Session
, session
:: Session
, showSidePanel :: GET.SidePanelState
, showSidePanel
:: GET.SidePanelState
, treeReload :: R.State Int
, treeReload
:: R.State Int
)
)
sidebar :: Record Props -> R.Element
sidebar :: Record Props -> R.Element
...
@@ -52,9 +53,8 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -52,9 +53,8 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
pure $ RH.div {} []
pure $ RH.div {} []
cpt {showSidePanel: GET.InitialClosed} _children = do
cpt {showSidePanel: GET.InitialClosed} _children = do
pure $ RH.div {} []
pure $ RH.div {} []
cpt props _children = do
cpt props
@{metaData}
_children = do
let nodesMap = SigmaxT.nodesGraphMap props.graph
let nodesMap = SigmaxT.nodesGraphMap props.graph
pure $
pure $
RH.div { id: "sp-container" }
RH.div { id: "sp-container" }
[ RH.div {}
[ RH.div {}
...
@@ -70,15 +70,31 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -70,15 +70,31 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
removeButton "Remove candidate" CandidateTerm props nodesMap
removeButton "Remove candidate" CandidateTerm props nodesMap
, removeButton "Remove stop" StopTerm props nodesMap
, removeButton "Remove stop" StopTerm props nodesMap
]
]
, RH.li { className: "nav-item" }
[ RH.a { id: "home-tab"
, className: "nav-link active"
, data: {toggle: "tab"}
, href: "#legend"
, role: "tab"
, aria: {controls: "legend", selected: "true"}
}
[ RH.text "Legend" ]
, let (GET.MetaData {legend}) = metaData
in Legend.legend { items: Seq.fromFoldable legend}
]
, RH.li { className: "nav-item" }
, RH.li { className: "nav-item" }
[ RH.a { id: "home-tab"
[ RH.a { id: "home-tab"
, className: "nav-link active"
, className: "nav-link active"
, data: {toggle: "tab"}
, data: {toggle: "tab"}
, href: "#
home
"
, href: "#
nodes
"
, role: "tab"
, role: "tab"
, aria: {controls: "
home", selected: "tru
e"}
, aria: {controls: "
nodes", selected: "fals
e"}
}
}
[ RH.text "Neighbours" ]
[ RH.text "Nodes" ]
, RH.div { className: "col-md-12", id: "query" }
[ query props.frontends props.metaData props.session nodesMap props.selectedNodeIds]
]
]
]
]
, RH.div { className: "tab-content", id: "myTabContent" }
, RH.div { className: "tab-content", id: "myTabContent" }
...
@@ -95,10 +111,6 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -95,10 +111,6 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
]
]
]
]
-}
-}
, RH.div { className: "col-md-12", id: "query" }
[
query props.frontends props.metaData props.session nodesMap props.selectedNodeIds
]
]
]
]
]
]
]
...
@@ -126,7 +138,7 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
...
@@ -126,7 +138,7 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
, session: props.session
, session: props.session
, termList: rType
, termList: rType
, treeReload: props.treeReload }
, treeReload: props.treeReload }
snd props.removedNodeIds $ const $ fst props.selectedNodeIds
snd props.removedNodeIds
$ const $ fst props.selectedNodeIds
snd props.selectedNodeIds $ const SigmaxT.emptyNodeIds
snd props.selectedNodeIds $ const SigmaxT.emptyNodeIds
...
@@ -148,8 +160,7 @@ neighbourBadges graph (selectedNodeIds /\ _) = SigmaxT.neighbours graph selected
...
@@ -148,8 +160,7 @@ neighbourBadges graph (selectedNodeIds /\ _) = SigmaxT.neighbours graph selected
selectedNodes = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
selectedNodes = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
type DeleteNodes =
type DeleteNodes =
(
( graphId :: Int
graphId :: Int
, metaData :: GET.MetaData
, metaData :: GET.MetaData
, nodes :: Array (Record SigmaxT.Node)
, nodes :: Array (Record SigmaxT.Node)
, session :: Session
, session :: Session
...
...
src/Gargantext/Components/GraphExplorer/Types.purs
View file @
c81b315a
...
@@ -58,14 +58,12 @@ derive instance newtypeGraphData :: Newtype GraphData _
...
@@ -58,14 +58,12 @@ derive instance newtypeGraphData :: Newtype GraphData _
newtype MetaData = MetaData
newtype MetaData = MetaData
{
{ title :: String
title :: String
, legend :: Array Legend
, legend :: Array Legend
, corpusId :: Array Int
, corpusId :: Array Int
, list :: {
, list :: { listId :: ListId
listId :: ListId
, version :: Version
, version :: Version
}
}
}
}
getLegend :: GraphData -> Maybe (Array Legend)
getLegend :: GraphData -> Maybe (Array Legend)
...
...
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