Commit f256e891 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[forest] some debugging for graph added

parent 20a7cbb9
...@@ -154,6 +154,7 @@ explorerCpt = here.component "explorer" cpt ...@@ -154,6 +154,7 @@ explorerCpt = here.component "explorer" cpt
{ mGraph, mMetaData, sideTab } <- GEST.focusedSidePanel sidePanelGraph { mGraph, mMetaData, sideTab } <- GEST.focusedSidePanel sidePanelGraph
R.useEffectOnce' $ do R.useEffectOnce' $ do
here.log2 "writing graph" graph
T.write_ (Just graph) mGraph T.write_ (Just graph) mGraph
T.write_ mMetaData' mMetaData T.write_ mMetaData' mMetaData
...@@ -208,9 +209,9 @@ explorerCpt = here.component "explorer" cpt ...@@ -208,9 +209,9 @@ explorerCpt = here.component "explorer" cpt
Types.RightHanded -> "righthanded" Types.RightHanded -> "righthanded"
type TopBar = type TopBar =
( (
boxes :: Boxes boxes :: Boxes
) )
topBar :: R2.Component TopBar topBar :: R2.Component TopBar
topBar = R.createElement topBarCpt topBar = R.createElement topBarCpt
...@@ -220,12 +221,11 @@ topBarCpt = here.component "topBar" cpt where ...@@ -220,12 +221,11 @@ topBarCpt = here.component "topBar" cpt where
cpt { boxes: { showTree cpt { boxes: { showTree
, sidePanelGraph , sidePanelGraph
, sidePanelState } } _ = do , sidePanelState } } _ = do
sidePanelGraph' <- T.useLive T.unequal sidePanelGraph { mGraph, multiSelectEnabled, selectedNodeIds, showControls } <- GEST.focusedSidePanel sidePanelGraph
let mGraph = maybe Nothing (_.mGraph) sidePanelGraph'
{ multiSelectEnabled, selectedNodeIds, showControls } <- GEST.focusedSidePanel sidePanelGraph mGraph' <- T.useLive T.unequal mGraph
let search = case mGraph of let search = case mGraph' of
Just graph -> nodeSearchControl { graph Just graph -> nodeSearchControl { graph
, multiSelectEnabled , multiSelectEnabled
, selectedNodeIds } [] , selectedNodeIds } []
......
...@@ -158,10 +158,9 @@ controlsCpt = here.component "controls" cpt ...@@ -158,10 +158,9 @@ controlsCpt = here.component "controls" cpt
let nodeSizeMax = maybe 100.0 _.size $ A.last nodesSorted let nodeSizeMax = maybe 100.0 _.size $ A.last nodesSorted
let nodeSizeRange = Range.Closed { min: nodeSizeMin, max: nodeSizeMax } let nodeSizeRange = Range.Closed { min: nodeSizeMin, max: nodeSizeMax }
pure $ case showControls' of let className = "navbar navbar-expand-lg " <> if showControls' then "" else "d-none"
false -> RH.div {} []
-- true -> R2.menu { id: "toolbar" } [ pure $ RH.nav { className }
true -> RH.nav { className: "navbar navbar-expand-lg" }
[ RH.ul { className: "navbar-nav mx-auto" } [ RH.ul { className: "navbar-nav mx-auto" }
[ -- change type button (?) [ -- change type button (?)
navItem [ centerButton sigmaRef ] navItem [ centerButton sigmaRef ]
......
...@@ -174,6 +174,24 @@ sidePanel = R.createElement sidePanelCpt ...@@ -174,6 +174,24 @@ sidePanel = R.createElement sidePanelCpt
sidePanelCpt :: R.Component (WithSessionContext Props) sidePanelCpt :: R.Component (WithSessionContext Props)
sidePanelCpt = here.component "sidePanel" cpt where sidePanelCpt = here.component "sidePanel" cpt where
cpt props@{ boxes: boxes@{ graphVersion
, reloadForest
, sidePanelGraph
, sidePanelState
, sidePanelLists
, sidePanelTexts }
, session } _ = do
sidePanelState' <- T.useLive T.unequal sidePanelState
case sidePanelState' of
Opened -> pure $ openedSidePanel props []
_ -> pure $ H.div {} []
openedSidePanel :: R2.Component (WithSessionContext Props)
openedSidePanel = R.createElement openedSidePanelCpt
openedSidePanelCpt :: R.Component (WithSessionContext Props)
openedSidePanelCpt = here.component "openedSidePanel" cpt where
cpt props@{ boxes: boxes@{ graphVersion cpt props@{ boxes: boxes@{ graphVersion
, reloadForest , reloadForest
, sidePanelGraph , sidePanelGraph
...@@ -183,45 +201,45 @@ sidePanelCpt = here.component "sidePanel" cpt where ...@@ -183,45 +201,45 @@ sidePanelCpt = here.component "sidePanel" cpt where
, session } _ = do , session } _ = do
route' <- T.useLive T.unequal boxes.route route' <- T.useLive T.unequal boxes.route
session' <- R.useContext session session' <- R.useContext session
sidePanelState' <- T.useLive T.unequal sidePanelState
let className = "side-panel" let className = "side-panel"
case sidePanelState' of case route' of
Opened -> GR.Lists s n -> do
case route' of pure $ H.div { className }
GR.Lists s n -> do [ Lists.sidePanel { session: session'
pure $ H.div { className } , sidePanel: sidePanelLists
[ Lists.sidePanel { session: session' , sidePanelState } [] ]
, sidePanel: sidePanelLists GR.PGraphExplorer s g -> do
, sidePanelState } [] ] { mGraph, mMetaData, removedNodeIds, selectedNodeIds, sideTab } <- GEST.focusedSidePanel sidePanelGraph
GR.PGraphExplorer s g -> do mGraph' <- T.useLive T.unequal mGraph
{ mGraph, mMetaData, removedNodeIds, selectedNodeIds, sideTab } <- GEST.focusedSidePanel sidePanelGraph mGraphMetaData' <- T.useLive T.unequal mMetaData
mGraph' <- T.useLive T.unequal mGraph
mGraphMetaData' <- T.useLive T.unequal mMetaData R.useEffect' $ do
here.log2 "mGraph" mGraph'
case (mGraph' /\ mGraphMetaData') of here.log2 "mGraphMetaData" mGraphMetaData'
(Nothing /\ _) -> pure $ H.div {} []
(_ /\ Nothing) -> pure $ H.div {} [] case (mGraph' /\ mGraphMetaData') of
(Just graph /\ Just metaData) -> do (Nothing /\ _) -> pure $ H.div {} []
pure $ H.div { className } (_ /\ Nothing) -> pure $ H.div {} []
[ GES.sidebar { frontends: defaultFrontends (Just graph /\ Just metaData) -> do
, graph
, graphId: g
, graphVersion
, metaData
, reloadForest
, removedNodeIds
, selectedNodeIds
, session: session'
, sideTab
} [] ]
GR.Texts s n -> do
pure $ H.div { className } pure $ H.div { className }
[ Texts.sidePanel { session: session' [ GES.sidebar { frontends: defaultFrontends
, sidePanel: sidePanelTexts , graph
, sidePanelState } [] ] , graphId: g
_ -> pure $ H.div {} [] , graphVersion
, metaData
, reloadForest
, removedNodeIds
, selectedNodeIds
, session: session'
, sideTab
} [] ]
GR.Texts s n -> do
pure $ H.div { className }
[ Texts.sidePanel { session: session'
, sidePanel: sidePanelTexts
, sidePanelState } [] ]
_ -> pure $ H.div {} [] _ -> pure $ H.div {} []
annuaire :: R2.Component SessionNodeProps annuaire :: R2.Component SessionNodeProps
......
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