Commit 90da6d31 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski Committed by Alexandre Delanoë

[graph] fix edge confluence filter

parent 42a4aa6a
...@@ -268,9 +268,9 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where ...@@ -268,9 +268,9 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
, showEdges' } , showEdges' }
-- R.useEffect' $ do -- R.useEffect' $ do
-- here.log2 "[graphView] selectedNodeIds'" $ A.fromFoldable selectedNodeIds' -- let (SigmaxT.Graph { edges: e }) = transformedGraph
-- let (SigmaxT.Graph { nodes: n }) = transformedGraph -- here.log2 "[graphView] transformedGraph edges" $ A.fromFoldable e
-- here.log2 "[graphView] transformedGraph nodes" $ A.fromFoldable n -- here.log2 "[graphView] hidden edges" $ A.filter(_.hidden) $ A.fromFoldable e
-- | Render -- | Render
-- | -- |
......
...@@ -60,6 +60,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where ...@@ -60,6 +60,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
boxes <- AppStore.use boxes <- AppStore.use
{ showEdges { showEdges
, edgeConfluence
, edgeWeight , edgeWeight
, graph , graph
, graphStage , graphStage
...@@ -71,6 +72,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where ...@@ -71,6 +72,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
} <- GraphStore.use } <- GraphStore.use
showEdges' <- R2.useLive' showEdges showEdges' <- R2.useLive' showEdges
edgeConfluence' <- R2.useLive' edgeConfluence
edgeWeight' <- R2.useLive' edgeWeight edgeWeight' <- R2.useLive' edgeWeight
graphStage' <- R2.useLive' graphStage graphStage' <- R2.useLive' graphStage
graph' <- R2.useLive' graph graph' <- R2.useLive' graph
...@@ -133,7 +135,9 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where ...@@ -133,7 +135,9 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
_ <- Sigma.bindMouseSelectorPlugin sigma _ <- Sigma.bindMouseSelectorPlugin sigma
pure unit pure unit
Sigmax.setSigmaEdgesVisibility sig { edgeWeight: edgeWeight', showEdges: showEdges' } Sigmax.setSigmaEdgesVisibility sig { edgeConfluence: edgeConfluence'
, edgeWeight: edgeWeight'
, showEdges: showEdges' }
-- here.log2 "[graph] startForceAtlas" startForceAtlas -- here.log2 "[graph] startForceAtlas" startForceAtlas
if startForceAtlas' then if startForceAtlas' then
...@@ -190,7 +194,9 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where ...@@ -190,7 +194,9 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
-- Sigmax.updateNodes sigma tNodesMap -- Sigmax.updateNodes sigma tNodesMap
let edgesState = not $ SigmaxTypes.edgeStateHidden showEdges' let edgesState = not $ SigmaxTypes.edgeStateHidden showEdges'
-- here.log2 "[graphCpt] edgesState" edgesState -- here.log2 "[graphCpt] edgesState" edgesState
Sigmax.setSigmaEdgesVisibility sigma { edgeWeight: edgeWeight', showEdges: showEdges' } Sigmax.setSigmaEdgesVisibility sigma { edgeConfluence: edgeConfluence'
, edgeWeight: edgeWeight'
, showEdges: showEdges' }
_ -> pure unit _ -> pure unit
......
...@@ -270,10 +270,13 @@ defaultPalette = ["#5fa571","#ab9ba2","#da876d","#bdd3ff" ...@@ -270,10 +270,13 @@ defaultPalette = ["#5fa571","#ab9ba2","#da876d","#bdd3ff"
type EdgeVisibilityProps = type EdgeVisibilityProps =
( edgeWeight :: Range.NumberRange ( edgeConfluence :: Range.NumberRange
, showEdges :: ShowEdgesState ) , edgeWeight :: Range.NumberRange
, showEdges :: ShowEdgesState )
setEdgeVisibility :: Record EdgeVisibilityProps -> Record Edge -> Record Edge setEdgeVisibility :: Record EdgeVisibilityProps -> Record Edge -> Record Edge
setEdgeVisibility { edgeWeight, showEdges } e@{ weight } = e { hidden = hidden } setEdgeVisibility { edgeConfluence, edgeWeight, showEdges } e@{ confluence, weight } = e { hidden = hidden }
where where
hidden = (edgeStateHidden showEdges) || (not $ Range.within edgeWeight weight) hidden = (edgeStateHidden showEdges)
|| (not $ Range.within edgeConfluence confluence)
|| (not $ Range.within edgeWeight weight)
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