Commit d611c524 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'dev-warnings-cleanup' of...

Merge branch 'dev-warnings-cleanup' of ssh://gitlab.iscpif.fr:20022/gargantext/purescript-gargantext into dev
parents 4891a7ce 61a19df3
...@@ -136,7 +136,7 @@ type SigmaSettings = ...@@ -136,7 +136,7 @@ type SigmaSettings =
-- , edgeColor :: String -- , edgeColor :: String
, edgeHoverColor :: String , edgeHoverColor :: String
, edgeHoverExtremities :: Boolean , edgeHoverExtremities :: Boolean
-- , edgeHoverPrecision :: Number , edgeHoverPrecision :: Number
, edgeHoverSizeRatio :: Number , edgeHoverSizeRatio :: Number
-- , edgesPowRatio :: Number -- , edgesPowRatio :: Number
-- , enableCamera :: Boolean -- , enableCamera :: Boolean
...@@ -218,6 +218,7 @@ sigmaSettings = ...@@ -218,6 +218,7 @@ sigmaSettings =
, enableEdgeHovering: false , enableEdgeHovering: false
, edgeHoverExtremities: true , edgeHoverExtremities: true
, edgeHoverColor: "edge" , edgeHoverColor: "edge"
, edgeHoverPrecision: 2.0
, edgeHoverSizeRatio: 2.0 , edgeHoverSizeRatio: 2.0
, enableHovering: true , enableHovering: true
, font: "Droid Sans" -- font params , font: "Droid Sans" -- font params
......
...@@ -216,9 +216,9 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxTypes.Graph {nodes, edges} ...@@ -216,9 +216,9 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxTypes.Graph {nodes, edges}
} }
where where
cDef (GET.Cluster {clustDefault}) = clustDefault cDef (GET.Cluster {clustDefault}) = clustDefault
nodesMap = SigmaxTypes.nodesMap $ Seq.toUnfoldable nodes nodesMap = SigmaxTypes.nodesMap nodes
edges = foldMap edgeFn r.edges 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 where
color = case Map.lookup e.source nodesMap of color = case Map.lookup e.source nodesMap of
Nothing -> "#000000" Nothing -> "#000000"
......
...@@ -2,7 +2,7 @@ module Gargantext.Hooks.Sigmax.Types where ...@@ -2,7 +2,7 @@ module Gargantext.Hooks.Sigmax.Types where
import Prelude (map, ($), (&&), (==)) import Prelude (map, ($), (&&), (==))
import Data.Map as Map import Data.Map as Map
import Data.Sequence (Seq, toUnfoldable) import Data.Sequence (Seq)
import Data.Set as Set import Data.Set as Set
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import DOM.Simple.Types (Element) import DOM.Simple.Types (Element)
...@@ -43,13 +43,13 @@ edgesGraphMap graph = do ...@@ -43,13 +43,13 @@ edgesGraphMap graph = do
let (Graph {edges}) = graph let (Graph {edges}) = graph
Map.fromFoldable $ map (\e -> Tuple e.id e) edges 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 nodesMap nodes = Map.fromFoldable $ map (\n -> Tuple n.id n) nodes
nodesGraphMap :: Graph Node Edge -> NodesMap nodesGraphMap :: Graph Node Edge -> NodesMap
nodesGraphMap graph = do nodesGraphMap graph = do
let (Graph {nodes}) = graph let (Graph {nodes}) = graph
nodesMap $ toUnfoldable nodes nodesMap nodes
eqGraph :: (Graph Node Edge) -> (Graph Node Edge) -> Boolean eqGraph :: (Graph Node Edge) -> (Graph Node Edge) -> Boolean
eqGraph (Graph {nodes: n1, edges: e1}) (Graph {nodes: n2, edges: e2}) = (n1 == n2) && (e1 == e2) eqGraph (Graph {nodes: n1, edges: e1}) (Graph {nodes: n2, edges: e2}) = (n1 == n2) && (e1 == e2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment