Commit 0e8a6162 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph explorer] fix to node selection (tab data selected)

parent bf231ed5
...@@ -10,7 +10,6 @@ import Data.Int as I ...@@ -10,7 +10,6 @@ import Data.Int as I
import Data.Maybe (Maybe(..), maybe) import Data.Maybe (Maybe(..), maybe)
import Data.Sequence as Seq import Data.Sequence as Seq
import Data.Set as Set import Data.Set as Set
import Effect (Effect)
import Effect.Timer (setTimeout) import Effect.Timer (setTimeout)
import Prelude import Prelude
import Reactix as R import Reactix as R
...@@ -52,8 +51,9 @@ type Controls = ...@@ -52,8 +51,9 @@ type Controls =
, showControls :: T.Box Boolean , showControls :: T.Box Boolean
, showEdges :: T.Box SigmaxT.ShowEdgesState , showEdges :: T.Box SigmaxT.ShowEdgesState
, showLouvain :: T.Box Boolean , showLouvain :: T.Box Boolean
, sidePanelState :: T.Box GT.SidePanelState
, showTree :: T.Box Boolean , showTree :: T.Box Boolean
, sidePanelState :: T.Box GT.SidePanelState
, sideTab :: T.Box GET.SideTab
, sigmaRef :: R.Ref Sigmax.Sigma , sigmaRef :: R.Ref Sigmax.Sigma
) )
...@@ -88,6 +88,7 @@ controlsCpt = here.component "controls" cpt ...@@ -88,6 +88,7 @@ controlsCpt = here.component "controls" cpt
, showLouvain , showLouvain
, showTree , showTree
, sidePanelState , sidePanelState
, sideTab
, sigmaRef } _ = do , sigmaRef } _ = do
forceAtlasState' <- T.useLive T.unequal forceAtlasState forceAtlasState' <- T.useLive T.unequal forceAtlasState
graphStage' <- T.useLive T.unequal graphStage graphStage' <- T.useLive T.unequal graphStage
...@@ -116,8 +117,9 @@ controlsCpt = here.component "controls" cpt ...@@ -116,8 +117,9 @@ controlsCpt = here.component "controls" cpt
-- Automatic opening of sidebar when a node is selected (but only first time). -- Automatic opening of sidebar when a node is selected (but only first time).
R.useEffect' $ do R.useEffect' $ do
if sidePanelState' == GT.InitialClosed && (not Set.isEmpty selectedNodeIds') then if sidePanelState' == GT.InitialClosed && (not Set.isEmpty selectedNodeIds') then do
T.write_ GT.Opened sidePanelState T.write_ GT.Opened sidePanelState
T.write_ GET.SideTabData sideTab
else else
pure unit pure unit
...@@ -255,7 +257,7 @@ useGraphControls { forceAtlasS ...@@ -255,7 +257,7 @@ useGraphControls { forceAtlasS
sigma <- Sigmax.initSigma sigma <- Sigmax.initSigma
sigmaRef <- R.useRef sigma sigmaRef <- R.useRef sigma
{ multiSelectEnabled, removedNodeIds, selectedNodeIds, showControls } <- GEST.focusedSidePanel sidePanel { multiSelectEnabled, removedNodeIds, selectedNodeIds, showControls, sideTab } <- GEST.focusedSidePanel sidePanel
pure { edgeConfluence pure { edgeConfluence
, edgeWeight , edgeWeight
...@@ -274,6 +276,7 @@ useGraphControls { forceAtlasS ...@@ -274,6 +276,7 @@ useGraphControls { forceAtlasS
, showLouvain , showLouvain
, sidePanelState , sidePanelState
, showTree , showTree
, sideTab
, sigmaRef , sigmaRef
, reloadForest , reloadForest
} }
...@@ -195,9 +195,6 @@ sidePanelCpt = here.component "sidePanel" cpt where ...@@ -195,9 +195,6 @@ sidePanelCpt = here.component "sidePanel" cpt where
sidePanelState' <- T.useLive T.unequal sidePanelState sidePanelState' <- T.useLive T.unequal sidePanelState
session' <- T.useLive T.unequal session session' <- T.useLive T.unequal session
R.useEffect' $ do
here.log2 "sidePanel session" session'
case session' of case session' of
Nothing -> pure $ H.div {} [] Nothing -> pure $ H.div {} []
Just s -> Just s ->
...@@ -233,10 +230,6 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where ...@@ -233,10 +230,6 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where
, sidePanel: sidePanelLists , sidePanel: sidePanelLists
, sidePanelState } [] ] , sidePanelState } [] ]
GR.PGraphExplorer s g -> do GR.PGraphExplorer s g -> do
R.useEffect' $ do
here.log2 "mGraph" mGraph'
here.log2 "mGraphMetaData" mGraphMetaData'
case (mGraph' /\ mGraphMetaData') of case (mGraph' /\ mGraphMetaData') of
(Nothing /\ _) -> pure $ wrapper [] (Nothing /\ _) -> pure $ wrapper []
(_ /\ Nothing) -> pure $ wrapper [] (_ /\ Nothing) -> pure $ wrapper []
......
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