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
0afcba5e
Commit
0afcba5e
authored
Mar 20, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] Towards bipartite graph
parent
37484f3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
16 deletions
+20
-16
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+3
-1
Layout.purs
src/Gargantext/Components/GraphExplorer/Layout.purs
+5
-5
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+4
-3
Types.purs
src/Gargantext/Hooks/Sigmax/Types.purs
+8
-7
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
0afcba5e
...
...
@@ -119,12 +119,14 @@ updateGraphCpt = here.component "updateGraph" cpt where
, callback: \val -> T.write_ val methodGraphNodeType1
, print: show } []
, H.text "NodeType 2 ?"
--}
, H.text "Ngrams ?"
, formChoiceSafe { items: [GT.CTabTerms, GT.CTabSources, GT.CTabAuthors, GT.CTabInstitutes]
, default: methodGraphNodeType2'
, callback: \val -> T.write_ val methodGraphNodeType2
, print: show } []
{-
, H.text "Show Strong (expected) links or weak (maybe unexpected) links?"
, formChoiceSafe { items: [Strong, Weak]
, default: methodGraphEdgesStrength'
...
...
src/Gargantext/Components/GraphExplorer/Layout.purs
View file @
0afcba5e
...
...
@@ -370,12 +370,12 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
-- | See sigmajs/plugins/sigma.renderers.customShapes/shape-library.js
modeGraphType :: Types.Mode -> String
modeGraphType Types.Authors = "
squar
e"
modeGraphType Types.Institutes = "
equilateral
"
modeGraphType Types.Sources = "
star
"
modeGraphType Types.Authors = "
ccircl
e"
modeGraphType Types.Institutes = "
square
"
modeGraphType Types.Sources = "
diamond
"
--modeGraphType Types.Terms = "def"
--modeGraphType Types.Terms = "circle"
modeGraphType Types.Terms = "
ccirc
le"
modeGraphType Types.Terms = "
triang
le"
--------------------------------------------------------------
...
...
@@ -437,7 +437,7 @@ transformGraph graph { edgeConfluence'
selectedEdgeIds =
Set.fromFoldable
$ Seq.map _.id
$ SigmaxT.neighbo
u
ringEdges graph selectedNodeIds'
$ SigmaxT.neighboringEdges graph selectedNodeIds'
hasSelection = not $ Set.isEmpty selectedNodeIds'
newEdges' = Seq.filter edgeFilter $ Seq.map (
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
0afcba5e
...
...
@@ -529,7 +529,7 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt where
let refreshed = neighbourBadges graph' selectedNodeIds'
let count = Seq.length refreshed
let ordered = A.sortWith (\n -> -n.size) $ Seq.toUnfoldable refreshed
T.write_
count
termCountBox
T.write_
(count-1)
termCountBox
T.write_ ordered termListBox
T.write_ false showMoreBox
...
...
@@ -704,8 +704,9 @@ badges :: SigmaxT.SGraph -> SigmaxT.NodeIds -> Seq.Seq (Record SigmaxT.Node)
badges graph selectedNodeIds = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
neighbourBadges :: SigmaxT.SGraph -> SigmaxT.NodeIds -> Seq.Seq (Record SigmaxT.Node)
neighbourBadges graph selectedNodeIds = SigmaxT.neighbours graph selectedNodes' where
selectedNodes' = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
neighbourBadges graph selectedNodeIds = SigmaxT.neighbors graph selectedNodes'
where
selectedNodes' = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
---------------------------------------------------------
...
...
src/Gargantext/Hooks/Sigmax/Types.purs
View file @
0afcba5e
...
...
@@ -14,7 +14,7 @@ import Data.Traversable (class Traversable)
import Data.Tuple (Tuple(..))
import Effect (Effect)
import Partial.Unsafe (unsafePartial)
import Prelude (class Eq, class Show, map, ($), (&&), (==), (||), (<$>), (<), mod, not, pure)
import Prelude (class Eq, class Show, map, ($), (&&), (==), (||), (<$>), (<), mod, not, pure
, (<=)
)
import Record.Unsafe (unsafeGet, unsafeSet)
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
...
...
@@ -171,7 +171,8 @@ graphEdges (Graph {edges}) = edges
graphNodes :: SGraph -> Seq.Seq (Record Node)
graphNodes (Graph {nodes}) = nodes
idMap :: forall r t. Traversable t => t { id :: String | r } -> Map.Map String { id :: String | r }
idMap :: forall r t. Traversable t
=> t { id :: String | r } -> Map.Map String { id :: String | r }
idMap xs = Map.fromFoldable $ (\x@{ id } -> Tuple id x) <$> xs
edgesGraphMap :: SGraph -> EdgesMap
...
...
@@ -204,16 +205,16 @@ sub graph (Graph {nodes, edges}) = newGraph
filteredEdges = edgesFilter edgeFilterFunc graph
newGraph = nodesFilter (\n -> not (Set.member n.id nodeIds)) filteredEdges
neighbo
u
rs :: SGraph -> Seq.Seq (Record Node) -> Seq.Seq (Record Node)
neighbo
urs g nodes = Seq.fromFoldable $ Set.unions [Set.fromFoldable nodes, sources, target
s]
neighbors :: SGraph -> Seq.Seq (Record Node) -> Seq.Seq (Record Node)
neighbo
rs g nodes = Seq.fromFoldable $ Set.unions [if Set.size sources <= 1 then targets else source
s]
where
nodeIds = Set.fromFoldable $ Seq.map _.id nodes
selectedEdges = neighbo
u
ringEdges g nodeIds
selectedEdges = neighboringEdges g nodeIds
sources = Set.fromFoldable $ graphNodes $ nodesById g $ Set.fromFoldable $ Seq.map _.source selectedEdges
targets = Set.fromFoldable $ graphNodes $ nodesById g $ Set.fromFoldable $ Seq.map _.target selectedEdges
neighbo
u
ringEdges :: SGraph -> NodeIds -> Seq.Seq (Record Edge)
neighbo
u
ringEdges g nodeIds = Seq.filter condition $ graphEdges g
neighboringEdges :: SGraph -> NodeIds -> Seq.Seq (Record Edge)
neighboringEdges g nodeIds = Seq.filter condition $ graphEdges g
where
condition {source, target} = (Set.member source nodeIds) || (Set.member target nodeIds)
...
...
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