Commit 74a2e7aa authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] Edge Confluence added.

parent f5c6e917
...@@ -27,6 +27,7 @@ newtype Edge = Edge ...@@ -27,6 +27,7 @@ newtype Edge = Edge
, source :: String , source :: String
, target :: String , target :: String
, weight :: Number , weight :: Number
, confluence :: Number
} }
derive instance newtypeEdge :: Newtype Edge _ derive instance newtypeEdge :: Newtype Edge _
...@@ -114,7 +115,8 @@ instance decodeJsonEdge :: DecodeJson Edge where ...@@ -114,7 +115,8 @@ instance decodeJsonEdge :: DecodeJson Edge where
source <- obj .? "source" source <- obj .? "source"
target <- obj .? "target" target <- obj .? "target"
weight <- obj .? "weight" weight <- obj .? "weight"
pure $ Edge { id_, source, target, weight } confluence <- obj .? "confluence"
pure $ Edge { id_, source, target, weight, confluence }
newtype Legend = Legend {id_ ::Int , color :: String, label :: String} newtype Legend = Legend {id_ ::Int , color :: String, label :: String}
......
...@@ -224,7 +224,7 @@ convert (GraphData r) = SigmaGraphData {nodes, edges} ...@@ -224,7 +224,7 @@ convert (GraphData r) = SigmaGraphData {nodes, edges}
, size : toNumber n.size , size : toNumber n.size
, label : n.label , label : n.label
, x : n.x -- cos (toNumber i) , x : n.x -- cos (toNumber i)
, y : n.y -- sin (toNumber i) , y : n.confluence -- sin (toNumber i)
, color : intColor $ cDef n.attributes , color : intColor $ cDef n.attributes
} }
where where
...@@ -278,7 +278,7 @@ forceAtlas2Config = { -- fixedY : false ...@@ -278,7 +278,7 @@ forceAtlas2Config = { -- fixedY : false
, iterationsPerRender : 4.0 , iterationsPerRender : 4.0
, barnesHutOptimize : true , barnesHutOptimize : true
, linLogMode : true -- false , linLogMode : true -- false
, edgeWeightInfluence : 0.0 , edgeWeightInfluence : 1.0
, gravity : 1.0 , gravity : 1.0
, strongGravityMode : false , strongGravityMode : false
, scalingRatio : 4.0 , scalingRatio : 4.0
......
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