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