Commit 2a31e454 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph] fix edge confluence filter

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