Commit dd13d277 authored by Sudhir Kumar's avatar Sudhir Kumar

nodes filter is working, not sure if edges filter is working. There are no errors though

parent e9233997
...@@ -23,6 +23,9 @@ foreign import sigmaClass :: ReactClass {children :: Children} ...@@ -23,6 +23,9 @@ foreign import sigmaClass :: ReactClass {children :: Children}
foreign import sigmaEnableSVGClass :: forall props. ReactClass props foreign import sigmaEnableSVGClass :: forall props. ReactClass props
foreign import sigmaEnableWebGLClass :: ReactClass {children :: Children} foreign import sigmaEnableWebGLClass :: ReactClass {children :: Children}
filterNodesBy :: forall o. Optional o FilterNodesByOptProps => {| o} -> ReactElement
filterNodesBy props = unsafeCreateElement filterClass (unsafeCoerce props) []
neoCypher :: forall o. Optional o NeoCypherOptProps => NeoCypherReqProps o -> ReactElement neoCypher :: forall o. Optional o NeoCypherOptProps => NeoCypherReqProps o -> ReactElement
neoCypher props = unsafeCreateElement neoCypherClass (unsafeCoerce props) [] neoCypher props = unsafeCreateElement neoCypherClass (unsafeCoerce props) []
...@@ -68,7 +71,18 @@ foreign import data SigmaSettings :: Type ...@@ -68,7 +71,18 @@ foreign import data SigmaSettings :: Type
class Optional (r :: # Type) (s :: # Type) class Optional (r :: # Type) (s :: # Type)
instance srInstance :: Union r t s => Optional r s instance srInstance :: Union r t s => Optional r s
filterNodes :: forall r. Number -> {size :: Number | r} -> Boolean
filterNodes minNode {size} =
size >= minNode
filterEdges :: forall r. Number -> {weight :: Number | r} -> Boolean
filterEdges minEdgeWeight {weight} =
weight >= minEdgeWeight
type FilterNodesByOptProps =
( nodesBy :: forall r. {size :: Number | r} -> Boolean
, edgesBy :: forall r. {weight :: Number | r} -> Boolean
)
type NeoCypherOptProps = type NeoCypherOptProps =
( producers :: String ( producers :: String
...@@ -331,7 +345,7 @@ type SigmaSettingProps = ...@@ -331,7 +345,7 @@ type SigmaSettingProps =
, defaultNodeType :: String , defaultNodeType :: String
, defaultEdgeType :: String , defaultEdgeType :: String
, defaultLabelColor :: String , defaultLabelColor :: String
, defaultEdgeCOlor :: String , defaultEdgeColor :: String
, defaultNodeColor :: String , defaultNodeColor :: String
, defaultLabelSize :: String , defaultLabelSize :: String
, edgeColor :: String , edgeColor :: String
......
...@@ -45,7 +45,7 @@ frontHaskell = { baseUrl: "http://localhost:8008" ...@@ -45,7 +45,7 @@ frontHaskell = { baseUrl: "http://localhost:8008"
} }
frontDev :: Config frontDev :: Config
frontDev = { baseUrl: "https://dev.gargantext.org" frontDev = { baseUrl: "https://demo.gargantext.org"
, prePath: "/#/" , prePath: "/#/"
} }
...@@ -62,7 +62,7 @@ backLocal v = { baseUrl: "http://localhost:8008" ...@@ -62,7 +62,7 @@ backLocal v = { baseUrl: "http://localhost:8008"
} }
backDev :: ApiVersion -> Config backDev :: ApiVersion -> Config
backDev v = { baseUrl: "https://dev.gargantext.org" backDev v = { baseUrl: "https://demo.gargantext.org"
, prePath: "/api/" <> show v <> "/" , prePath: "/api/" <> show v <> "/"
} }
......
This diff is collapsed.
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