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
7fe038e4
Commit
7fe038e4
authored
Apr 18, 2022
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
f4c47bfd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
50 additions
and
173 deletions
+50
-173
ControlsToggleButton.purs
...antext/Components/GraphExplorer/ControlsToggleButton.purs
+0
-31
Layout.purs
src/Gargantext/Components/GraphExplorer/Layout.purs
+1
-1
Legend.purs
src/Gargantext/Components/GraphExplorer/Sidebar/Legend.purs
+2
-2
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar/Sidebar.purs
+30
-34
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+0
-68
Buttons.purs
src/Gargantext/Components/GraphExplorer/Toolbar/Buttons.purs
+3
-23
Controls.purs
...Gargantext/Components/GraphExplorer/Toolbar/Controls.purs
+5
-5
RangeControl.purs
...antext/Components/GraphExplorer/Toolbar/RangeControl.purs
+2
-2
SlideButton.purs
...gantext/Components/GraphExplorer/Toolbar/SlideButton.purs
+2
-2
Search.purs
src/Gargantext/Components/GraphExplorer/Topbar/Search.purs
+4
-4
TopBar.purs
src/Gargantext/Components/GraphExplorer/Topbar/TopBar.purs
+1
-1
No files found.
src/Gargantext/Components/GraphExplorer/ControlsToggleButton.purs
deleted
100644 → 0
View file @
f4c47bfd
module Gargantext.Components.GraphExplorer.ControlsToggleButton
( Props, controlsToggleButton, controlsToggleButtonCpt
) where
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.ControlsToggleButton"
type Props = ( state :: T.Box Boolean )
controlsToggleButton :: R2.Leaf Props
controlsToggleButton = R2.leafComponent controlsToggleButtonCpt
controlsToggleButtonCpt :: R.Component Props
controlsToggleButtonCpt = here.component "controlsToggleButton" cpt
where
cpt { state } _ = do
open' <- T.useLive T.unequal state
pure $
H.button
{ className: "btn btn-primary", on: {click: \_ -> T.modify_ not state } }
[ H.text (text open') ]
text true = "Hide Controls"
text false = "Show Controls"
src/Gargantext/Components/GraphExplorer/Layout.purs
View file @
7fe038e4
...
@@ -15,7 +15,7 @@ import Data.Tuple (Tuple(..))
...
@@ -15,7 +15,7 @@ import Data.Tuple (Tuple(..))
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.GraphExplorer.Resources as Graph
import Gargantext.Components.GraphExplorer.Resources as Graph
import Gargantext.Components.GraphExplorer.Controls as Controls
import Gargantext.Components.GraphExplorer.
Toolbar.
Controls as Controls
import Gargantext.Components.GraphExplorer.Sidebar as GES
import Gargantext.Components.GraphExplorer.Sidebar as GES
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.TopBar as GETB
import Gargantext.Components.GraphExplorer.TopBar as GETB
...
...
src/Gargantext/Components/GraphExplorer/Legend.purs
→
src/Gargantext/Components/GraphExplorer/
Sidebar/
Legend.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.Legend
module Gargantext.Components.GraphExplorer.
Sidebar.
Legend
( Props, legend
( Props, legend
) where
) where
...
@@ -13,7 +13,7 @@ import Gargantext.Components.GraphExplorer.Types (Legend(..), intColor)
...
@@ -13,7 +13,7 @@ import Gargantext.Components.GraphExplorer.Types (Legend(..), intColor)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Legend"
here = R2.here "Gargantext.Components.GraphExplorer.
Sidebar.
Legend"
type Props = ( items :: Seq Legend )
type Props = ( items :: Seq Legend )
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
→
src/Gargantext/Components/GraphExplorer/Sidebar
/Sidebar
.purs
View file @
7fe038e4
...
@@ -23,7 +23,7 @@ import Effect.Class (liftEffect)
...
@@ -23,7 +23,7 @@ import Effect.Class (liftEffect)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.GraphExplorer.Legend as Legend
import Gargantext.Components.GraphExplorer.
Sidebar.
Legend as Legend
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.Lang (Lang(..))
import Gargantext.Components.Lang (Lang(..))
...
@@ -51,15 +51,15 @@ import Toestand as T
...
@@ -51,15 +51,15 @@ import Toestand as T
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Sidebar"
here = R2.here "Gargantext.Components.GraphExplorer.Sidebar"
type Common =
(
type Common =
boxes :: Boxes
(
boxes :: Boxes
, graphId :: NodeID
, graphId :: NodeID
, metaData :: GET.MetaData
, metaData :: GET.MetaData
, session :: Session
, session :: Session
)
)
type Props =
(
type Props =
frontends :: Frontends
(
frontends :: Frontends
, graph :: SigmaxT.SGraph
, graph :: SigmaxT.SGraph
| Common
| Common
)
)
...
@@ -612,50 +612,46 @@ type Query =
...
@@ -612,50 +612,46 @@ type Query =
, nodesMap :: SigmaxT.NodesMap
, nodesMap :: SigmaxT.NodesMap
, searchType :: SearchType
, searchType :: SearchType
, selectedNodeIds :: SigmaxT.NodeIds
, selectedNodeIds :: SigmaxT.NodeIds
, session :: Session )
, session :: Session
)
query :: R2.Leaf Query
query :: R2.Leaf Query
query = R2.leaf queryCpt
query = R2.leaf queryCpt
queryCpt :: R.Component Query
queryCpt :: R.Component Query
queryCpt = here.component "query" cpt where
queryCpt = here.component "query'" cpt where
cpt props@{ selectedNodeIds } _ = do
pure $ if Set.isEmpty selectedNodeIds
then H.div {} []
else query' props []
query' :: R2.Component Query
query' = R.createElement queryCpt'
queryCpt' :: R.Component Query
queryCpt' = here.component "query'" cpt where
cpt { frontends
cpt { frontends
, metaData: GET.MetaData metaData
, metaData: GET.MetaData metaData
, nodesMap
, nodesMap
, searchType
, searchType
, selectedNodeIds
, selectedNodeIds
, session } _ = do
, session } _ = do
pure $ case (head metaData.corpusId) of
-- Computed
Nothing -> H.div {} []
let
Just corpusId ->
CGT.tabs { frontends
, query: SearchQuery { expected: searchType
, query : concat $ toQuery <$> Set.toUnfoldable selectedNodeIds
}
, session
, sides: [side corpusId]
}
where
toQuery id = case Map.lookup id nodesMap of
toQuery id = case Map.lookup id nodesMap of
Nothing -> []
Nothing -> []
Just n -> words n.label
Just n -> words n.label
side corpusId = GET.GraphSideCorpus { corpusId
side corpusId = GET.GraphSideCorpus
, corpusLabel: metaData.title
{ corpusId
, listId : metaData.list.listId
, corpusLabel: metaData.title
}
, listId : metaData.list.listId
}
-- Render
pure $
R2.fromMaybe_ (head metaData.corpusId) \corpusId ->
CGT.tabs
{ frontends
, query: SearchQuery
{ expected: searchType
, query: concat $ toQuery <$> Set.toUnfoldable selectedNodeIds
}
, session
, sides: [side corpusId]
}
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
deleted
100644 → 0
View file @
f4c47bfd
module Gargantext.Components.GraphExplorer.ToggleButton
( Props
, toggleButton
, toggleButtonCpt
, controlsToggleButton
) where
import Prelude
import Effect (Effect)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
-- @WIP: used?
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.ToggleButton"
type Props = (
state :: T.Box Boolean
, onMessage :: String
, offMessage :: String
, style :: String
, onClick :: forall e. e -> Effect Unit
)
toggleButton :: R2.Component Props
toggleButton = R.createElement toggleButtonCpt
toggleButtonCpt :: R.Component Props
toggleButtonCpt = here.component "toggleButton" cpt
where
cpt { state
, onMessage
, offMessage
, onClick
, style } _ = do
state' <- T.useLive T.unequal state
pure $ H.div { className: "btn btn-outline-" <> style <> " " <> cls state' <> " mx-2"
, on: { click: onClick }
} [ R2.small {} [ H.text (text onMessage offMessage state') ] ]
cls true = "active"
cls false = ""
text on _off true = on
text _on off false = off
----------------------------------------------------------------
type ControlsToggleButtonProps = (
state :: T.Box Boolean
)
controlsToggleButton :: R2.Component ControlsToggleButtonProps
controlsToggleButton = R.createElement controlsToggleButtonCpt
controlsToggleButtonCpt :: R.Component ControlsToggleButtonProps
controlsToggleButtonCpt = here.component "controlsToggleButton" cpt
where
cpt { state } _ = do
pure $ toggleButton {
state: state
, onMessage: "Hide Controls"
, offMessage: "Show Controls"
, onClick: \_ -> T.modify_ not state
, style: "light"
} []
src/Gargantext/Components/GraphExplorer/Buttons.purs
→
src/Gargantext/Components/GraphExplorer/
Toolbar/
Buttons.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.Buttons
module Gargantext.Components.GraphExplorer.Toolbar.Buttons
( Props
( centerButton
, centerButton
, simpleButton
, cameraButton
, cameraButton
, edgesToggleButton
, edgesToggleButton
, louvainToggleButton
, louvainToggleButton
...
@@ -19,7 +17,6 @@ import Data.Either (Either(..))
...
@@ -19,7 +17,6 @@ import Data.Either (Either(..))
import Data.Enum (fromEnum)
import Data.Enum (fromEnum)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.String as DS
import Data.String as DS
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Effect.Now as EN
import Effect.Now as EN
...
@@ -43,27 +40,10 @@ import Reactix.DOM.HTML as H
...
@@ -43,27 +40,10 @@ import Reactix.DOM.HTML as H
import Toestand as T
import Toestand as T
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Button"
here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.Button"
type Props = (
onClick :: forall e. e -> Effect Unit
, text :: String
)
-- @WIP
simpleButton :: Record Props -> R.Element
simpleButton props = R.createElement simpleButtonCpt props []
------------------------------------------------------
------------------------------------------------------
simpleButtonCpt :: R.Component Props
simpleButtonCpt = here.component "simpleButton" cpt
where
cpt {onClick, text} _ = do
pure $ H.button { className: "btn btn-outline-secondary"
, on: {click: onClick}
} [ R2.small {} [ H.text text ] ]
centerButton :: R.Ref Sigmax.Sigma -> R.Element
centerButton :: R.Ref Sigmax.Sigma -> R.Element
centerButton sigmaRef = B.button
centerButton sigmaRef = B.button
{ variant: OutlinedButtonVariant Secondary
{ variant: OutlinedButtonVariant Secondary
...
...
src/Gargantext/Components/GraphExplorer/Controls.purs
→
src/Gargantext/Components/GraphExplorer/
Toolbar/
Controls.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.Controls
module Gargantext.Components.GraphExplorer.
Toolbar.
Controls
( Controls
( Controls
, useGraphControls
, useGraphControls
, controls
, controls
...
@@ -15,11 +15,11 @@ import Data.Sequence as Seq
...
@@ -15,11 +15,11 @@ import Data.Sequence as Seq
import Data.Set as Set
import Data.Set as Set
import Effect.Timer (setTimeout)
import Effect.Timer (setTimeout)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.GraphExplorer.Buttons (centerButton, cameraButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton, multiSelectEnabledButton)
import Gargantext.Components.GraphExplorer.
Toolbar.
Buttons (centerButton, cameraButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton, multiSelectEnabledButton)
import Gargantext.Components.GraphExplorer.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.
Toolbar.
RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.Resources as Graph
import Gargantext.Components.GraphExplorer.Resources as Graph
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.SlideButton (labelSizeButton, mouseSelectorSizeButton)
import Gargantext.Components.GraphExplorer.
Toolbar.
SlideButton (labelSizeButton, mouseSelectorSizeButton)
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Hooks.Sigmax.Types as SigmaxT
...
@@ -33,7 +33,7 @@ import Reactix.DOM.HTML as H
...
@@ -33,7 +33,7 @@ import Reactix.DOM.HTML as H
import Toestand as T
import Toestand as T
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Controls"
here = R2.here "Gargantext.Components.GraphExplorer.
Toolbar.
Controls"
type Controls =
type Controls =
( edgeConfluence :: T.Box Range.NumberRange
( edgeConfluence :: T.Box Range.NumberRange
...
...
src/Gargantext/Components/GraphExplorer/RangeControl.purs
→
src/Gargantext/Components/GraphExplorer/
Toolbar/
RangeControl.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.RangeControl
module Gargantext.Components.GraphExplorer.
Toolbar.
RangeControl
( Props
( Props
, rangeControl
, rangeControl
, edgeConfluenceControl
, edgeConfluenceControl
...
@@ -16,7 +16,7 @@ import Gargantext.Utils.Range as Range
...
@@ -16,7 +16,7 @@ import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.RangeControl"
here = R2.here "Gargantext.Components.GraphExplorer.
Toolbar.
RangeControl"
type Props =
type Props =
( caption :: String
( caption :: String
...
...
src/Gargantext/Components/GraphExplorer/SlideButton.purs
→
src/Gargantext/Components/GraphExplorer/
Toolbar/
SlideButton.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.SlideButton
module Gargantext.Components.GraphExplorer.
Toolbar.
SlideButton
( Props
( Props
, sizeButton
, sizeButton
, labelSizeButton
, labelSizeButton
...
@@ -17,7 +17,7 @@ import Gargantext.Hooks.Sigmax.Sigma as Sigma
...
@@ -17,7 +17,7 @@ import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.SlideButton"
here = R2.here "Gargantext.Components.GraphExplorer.
Toolbar.
SlideButton"
type Props =
type Props =
( caption :: String
( caption :: String
...
...
src/Gargantext/Components/GraphExplorer/Search.purs
→
src/Gargantext/Components/GraphExplorer/
Topbar/
Search.purs
View file @
7fe038e4
module Gargantext.Components.GraphExplorer.Search
module Gargantext.Components.GraphExplorer.
Topbar.
Search
( Props, nodeSearchControl ) where
( Props, nodeSearchControl ) where
import Prelude
import Prelude
...
@@ -18,10 +18,10 @@ import Reactix.DOM.HTML as H
...
@@ -18,10 +18,10 @@ import Reactix.DOM.HTML as H
import Toestand as T
import Toestand as T
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Search"
here = R2.here "Gargantext.Components.GraphExplorer.
Topbar.
Search"
type Props =
(
type Props =
graph :: SigmaxT.SGraph
(
graph :: SigmaxT.SGraph
, multiSelectEnabled :: T.Box Boolean
, multiSelectEnabled :: T.Box Boolean
, selectedNodeIds :: T.Box SigmaxT.NodeIds
, selectedNodeIds :: T.Box SigmaxT.NodeIds
, className :: String
, className :: String
...
...
src/Gargantext/Components/GraphExplorer/TopBar.purs
→
src/Gargantext/Components/GraphExplorer/Top
bar/Top
Bar.purs
View file @
7fe038e4
...
@@ -5,7 +5,7 @@ import Gargantext.Prelude hiding (max, min)
...
@@ -5,7 +5,7 @@ import Gargantext.Prelude hiding (max, min)
import Data.Maybe (Maybe)
import Data.Maybe (Maybe)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.GraphExplorer.Search (nodeSearchControl)
import Gargantext.Components.GraphExplorer.
Topbar.
Search (nodeSearchControl)
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Types as GT
import Gargantext.Types as GT
import Gargantext.Utils ((?))
import Gargantext.Utils ((?))
...
...
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