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
1
Merge Requests
1
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
Przemyslaw Kaminski
purescript-gargantext
Commits
2438ea19
Commit
2438ea19
authored
Oct 25, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph search] some work on ngrams group search
parent
ed4b7f46
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
54 deletions
+51
-54
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+30
-31
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+3
-3
Search.purs
src/Gargantext/Components/GraphExplorer/Search.purs
+7
-9
TopBar.purs
src/Gargantext/Components/GraphExplorer/TopBar.purs
+4
-4
Types.purs
src/Gargantext/Components/GraphExplorer/Types.purs
+7
-7
No files found.
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
2438ea19
...
@@ -124,36 +124,36 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
...
@@ -124,36 +124,36 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
, nodeType
, nodeType
, session } []
, session } []
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType } []
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType } []
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, barType: Pie
, barType: Pie
, errors
, errors
, nodeId: id
, nodeId: id
, onFinish: onTaskFinish id t
, onFinish: onTaskFinish id t
, session } []
, session } []
) currentTasks'
) currentTasks'
)
)
, if nodeType == GT.NodeUser
, if nodeType == GT.NodeUser
then GV.versionView { session } []
then GV.versionView { session } []
else H.div {} []
else H.div {} []
, if showBox then
, if showBox then
Popover.popover { arrow: false
Popover.popover { arrow: false
, open: false
, open: false
, onClose: \_ -> pure unit
, onClose: \_ -> pure unit
, onOpen: \_ -> pure unit
, onOpen: \_ -> pure unit
, ref: popoverRef } [
, ref: popoverRef } [
popOverIcon
popOverIcon
, mNodePopupView props (onPopoverClose popoverRef)
, mNodePopupView props (onPopoverClose popoverRef)
]
]
else H.div {} []
else H.div {} []
, nodeActions { id
, nodeActions { id
, nodeType
, nodeType
, refresh: const $ dispatch RefreshTree
, refresh: const $ dispatch RefreshTree
, session
, session
} []
} []
]
]
where
where
onTaskFinish id' t _ = do
onTaskFinish id' t _ = do
GAT.finish id' t tasks
GAT.finish id' t tasks
...
@@ -296,7 +296,6 @@ type NodeActionsProps = ( nodeType :: GT.NodeType | NodeActionsCommon )
...
@@ -296,7 +296,6 @@ type NodeActionsProps = ( nodeType :: GT.NodeType | NodeActionsCommon )
nodeActions :: R2.Component NodeActionsProps
nodeActions :: R2.Component NodeActionsProps
nodeActions = R.createElement nodeActionsCpt
nodeActions = R.createElement nodeActionsCpt
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = here.component "nodeActions" cpt where
nodeActionsCpt = here.component "nodeActions" cpt where
cpt props _ = pure (child props.nodeType) where
cpt props _ = pure (child props.nodeType) where
...
...
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
2438ea19
...
@@ -209,9 +209,9 @@ controlsCpt = here.component "controls" cpt
...
@@ -209,9 +209,9 @@ controlsCpt = here.component "controls" cpt
-- -- zoom: 0 -100 - calculate ratio
-- -- zoom: 0 -100 - calculate ratio
-- , RH.li {} [ multiSelectEnabledButton multiSelectEnabled ] -- toggle multi node selection
-- , RH.li {} [ multiSelectEnabledButton multiSelectEnabled ] -- toggle multi node selection
-- -- save button
-- -- save button
-- , RH.li {} [ nodeSearch
Control
{ graph: graph
-- , RH.li {} [ nodeSearch { graph: graph
--
, multiSelectEnabled: multiSelectEnabled
-- , multiSelectEnabled: multiSelectEnabled
--
, selectedNodeIds: selectedNodeIds } ]
-- , selectedNodeIds: selectedNodeIds } ]
-- , RH.li {} [ mouseSelectorSizeButton sigmaRef localControls.mouseSelectorSize ]
-- , RH.li {} [ mouseSelectorSizeButton sigmaRef localControls.mouseSelectorSize ]
-- , RH.li {} [ cameraButton { id: graphId
-- , RH.li {} [ cameraButton { id: graphId
-- , hyperdataGraph: hyperdataGraph
-- , hyperdataGraph: hyperdataGraph
...
...
src/Gargantext/Components/GraphExplorer/Search.purs
View file @
2438ea19
module Gargantext.Components.GraphExplorer.Search
module Gargantext.Components.GraphExplorer.Search
( Props, nodeSearch
Control
) where
( Props, nodeSearch ) where
import Prelude
import Prelude
import Data.Sequence as Seq
import Data.Sequence as Seq
import Data.Set as Set
import Data.Set as Set
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect (Effect)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -33,11 +31,10 @@ searchNodes :: String -> Seq.Seq (Record SigmaxT.Node) -> Seq.Seq (Record Sigmax
...
@@ -33,11 +31,10 @@ searchNodes :: String -> Seq.Seq (Record SigmaxT.Node) -> Seq.Seq (Record Sigmax
searchNodes "" _ = Seq.empty
searchNodes "" _ = Seq.empty
searchNodes s nodes = Seq.filter (nodeMatchesSearch s) nodes
searchNodes s nodes = Seq.filter (nodeMatchesSearch s) nodes
nodeSearchControl :: R2.Component Props
nodeSearch :: R2.Component Props
nodeSearchControl = R.createElement sizeButtonCpt
nodeSearch = R.createElement nodeSearchCpt
nodeSearchCpt :: R.Component Props
sizeButtonCpt :: R.Component Props
nodeSearchCpt = here.component "nodeSearch" cpt
sizeButtonCpt = here.component "nodeSearchControl" cpt
where
where
cpt { graph, multiSelectEnabled, selectedNodeIds } _ = do
cpt { graph, multiSelectEnabled, selectedNodeIds } _ = do
search <- T.useBox ""
search <- T.useBox ""
...
@@ -70,7 +67,8 @@ triggerSearch graph search multiSelectEnabled selectedNodeIds = do
...
@@ -70,7 +67,8 @@ triggerSearch graph search multiSelectEnabled selectedNodeIds = do
let graphNodes = SigmaxT.graphNodes graph
let graphNodes = SigmaxT.graphNodes graph
let matching = Set.fromFoldable $ (_.id) <$> searchNodes search graphNodes
let matching = Set.fromFoldable $ (_.id) <$> searchNodes search graphNodes
log2 "[triggerSearch] search" search
here.log2 "[triggerSearch] search" search
here.log2 "[triggerSearch] graphNodes" graphNodes
T.modify_ (\nodes ->
T.modify_ (\nodes ->
Set.union matching $ if multiSelectEnabled then nodes else SigmaxT.emptyNodeIds) selectedNodeIds
Set.union matching $ if multiSelectEnabled then nodes else SigmaxT.emptyNodeIds) selectedNodeIds
src/Gargantext/Components/GraphExplorer/TopBar.purs
View file @
2438ea19
...
@@ -8,7 +8,7 @@ import Toestand as T
...
@@ -8,7 +8,7 @@ import Toestand as T
import Gargantext.Prelude hiding (max,min)
import Gargantext.Prelude hiding (max,min)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.GraphExplorer.Search (nodeSearch
Control
)
import Gargantext.Components.GraphExplorer.Search (nodeSearch)
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.ToggleButton as Toggle
import Gargantext.Components.GraphExplorer.ToggleButton as Toggle
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
...
@@ -32,9 +32,9 @@ topBarCpt = here.component "topBar" cpt where
...
@@ -32,9 +32,9 @@ topBarCpt = here.component "topBar" cpt where
mGraph' <- T.useLive T.unequal mGraph
mGraph' <- T.useLive T.unequal mGraph
let search = case mGraph' of
let search = case mGraph' of
Just graph -> nodeSearch
Control
{ graph
Just graph -> nodeSearch { graph
, multiSelectEnabled
, multiSelectEnabled
, selectedNodeIds } []
, selectedNodeIds } []
Nothing -> RH.div {} []
Nothing -> RH.div {} []
pure $ RH.form { className: "d-flex" }
pure $ RH.form { className: "d-flex" }
...
...
src/Gargantext/Components/GraphExplorer/Types.purs
View file @
2438ea19
...
@@ -5,7 +5,6 @@ import Data.Generic.Rep (class Generic)
...
@@ -5,7 +5,6 @@ import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq)
import Data.Eq.Generic (genericEq)
import Data.Maybe (Maybe(..), fromJust)
import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Data.Ord
import Data.Ord.Generic (genericCompare)
import Data.Ord.Generic (genericCompare)
import Data.Symbol (SProxy(..))
import Data.Symbol (SProxy(..))
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
...
@@ -18,12 +17,13 @@ type GraphId = Int
...
@@ -18,12 +17,13 @@ type GraphId = Int
newtype Node = Node {
newtype Node = Node {
attributes :: Cluster
attributes :: Cluster
, id_ :: String
, children :: Array String
, label :: String
, id_ :: String
, size :: Int
, label :: String
, type_ :: String
, size :: Int
, x :: Number
, type_ :: String
, y :: Number
, x :: Number
, y :: Number
}
}
x_coordP = SProxy :: SProxy "x_coord"
x_coordP = SProxy :: SProxy "x_coord"
...
...
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