Commit 2a6b66f6 authored by James Laver's avatar James Laver

x/y coords for Nodes of GraphExplorer

parent 6de0e699
...@@ -185,7 +185,7 @@ type SigmaEdgeEvent = ...@@ -185,7 +185,7 @@ type SigmaEdgeEvent =
{ node :: SigmaEdge { node :: SigmaEdge
, captor :: , captor ::
{ clientX :: Number { clientX :: Number
, clientY :: Number , clientY :: Number
} }
} }
} }
......
...@@ -11,8 +11,8 @@ newtype Node = Node ...@@ -11,8 +11,8 @@ newtype Node = Node
, size :: Int , size :: Int
, type_ :: String , type_ :: String
, label :: String , label :: String
-- , x_coord :: Number ? -- TODO JL add the right records for (x,y) coordinates interpreted by sigma-js , x :: Number
-- , y_coord :: Number ? -- TODO AD add the right records for the backend , y :: Number
, attributes :: Cluster , attributes :: Cluster
} }
...@@ -78,7 +78,9 @@ instance decodeJsonNode :: DecodeJson Node where ...@@ -78,7 +78,9 @@ instance decodeJsonNode :: DecodeJson Node where
label <- obj .? "label" label <- obj .? "label"
size <- obj .? "size" size <- obj .? "size"
attributes <- obj .? "attributes" attributes <- obj .? "attributes"
pure $ Node { id_, type_, size, label, attributes } x <- obj .? "x_coord"
y <- obj .? "y_coord"
pure $ Node { id_, type_, size, label, attributes, x, y }
instance decodeJsonMetaData :: DecodeJson MetaData where instance decodeJsonMetaData :: DecodeJson MetaData where
......
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