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
f794707a
Commit
f794707a
authored
Dec 04, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] some small fixes to types, edge hover precision
parent
4cab26ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
Graph.purs
src/Gargantext/Components/Graph.purs
+3
-2
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+2
-2
Types.purs
src/Gargantext/Hooks/Sigmax/Types.purs
+3
-3
No files found.
src/Gargantext/Components/Graph.purs
View file @
f794707a
...
...
@@ -136,7 +136,7 @@ type SigmaSettings =
-- , edgeColor :: String
, edgeHoverColor :: String
, edgeHoverExtremities :: Boolean
--
, edgeHoverPrecision :: Number
, edgeHoverPrecision :: Number
, edgeHoverSizeRatio :: Number
-- , edgesPowRatio :: Number
-- , enableCamera :: Boolean
...
...
@@ -218,6 +218,7 @@ sigmaSettings =
, enableEdgeHovering: true
, edgeHoverExtremities: true
, edgeHoverColor: "edge"
, edgeHoverPrecision: 2.0
, edgeHoverSizeRatio: 2.0
, enableHovering: true
, font: "Droid Sans" -- font params
...
...
@@ -226,7 +227,7 @@ sigmaSettings =
, labelSize : "fixed"
, labelSizeRatio: 1.0 -- label size in ratio of node size
, labelThreshold: 1.0 -- min node cam size to start showing label
, maxEdgeSize:
1
.0
, maxEdgeSize:
2
.0
, maxNodeSize: 10.0
, minEdgeSize: 0.5 -- in fact used in tina as edge size
, minNodeSize: 5.0
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
f794707a
...
...
@@ -215,9 +215,9 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxTypes.Graph {nodes, edges}
}
where
cDef (GET.Cluster {clustDefault}) = clustDefault
nodesMap = SigmaxTypes.nodesMap
$ Seq.toUnfoldable
nodes
nodesMap = SigmaxTypes.nodesMap nodes
edges = foldMap edgeFn r.edges
edgeFn (GET.Edge e) = Seq.singleton {id : e.id_, color, size: 1.
5
, source : e.source, target : e.target}
edgeFn (GET.Edge e) = Seq.singleton {id : e.id_, color, size: 1.
0
, source : e.source, target : e.target}
where
color = case Map.lookup e.source nodesMap of
Nothing -> "#000000"
...
...
src/Gargantext/Hooks/Sigmax/Types.purs
View file @
f794707a
...
...
@@ -2,7 +2,7 @@ module Gargantext.Hooks.Sigmax.Types where
import Prelude (map, ($), (&&), (==))
import Data.Map as Map
import Data.Sequence (Seq
, toUnfoldable
)
import Data.Sequence (Seq)
import Data.Set as Set
import Data.Tuple (Tuple(..))
import DOM.Simple.Types (Element)
...
...
@@ -43,13 +43,13 @@ edgesGraphMap graph = do
let (Graph {edges}) = graph
Map.fromFoldable $ map (\e -> Tuple e.id e) edges
nodesMap ::
Array
(Record Node) -> NodesMap
nodesMap ::
Seq
(Record Node) -> NodesMap
nodesMap nodes = Map.fromFoldable $ map (\n -> Tuple n.id n) nodes
nodesGraphMap :: Graph Node Edge -> NodesMap
nodesGraphMap graph = do
let (Graph {nodes}) = graph
nodesMap
$ toUnfoldable
nodes
nodesMap nodes
eqGraph :: (Graph Node Edge) -> (Graph Node Edge) -> Boolean
eqGraph (Graph {nodes: n1, edges: e1}) (Graph {nodes: n2, edges: e2}) = (n1 == n2) && (e1 == e2)
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