Commit f794707a authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] some small fixes to types, edge hover precision

parent 4cab26ba
......@@ -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
......
......@@ -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"
......
......@@ -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)
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