Commit a54ded1c authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph] center button disable when fa2 running

parent ce88d2c0
Pipeline #3315 failed with stage
...@@ -47,13 +47,23 @@ here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.Button" ...@@ -47,13 +47,23 @@ here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.Button"
------------------------------------------------------ ------------------------------------------------------
centerButton :: R.Ref Sigmax.Sigma -> R.Element type CenterButtonProps =
centerButton sigmaRef = B.button ( forceAtlasState :: SigmaxTypes.ForceAtlasState
{ variant: OutlinedButtonVariant Secondary , sigmaRef :: R.Ref Sigmax.Sigma )
, callback: \_ -> do
let sigma = R.readRef sigmaRef centerButton :: R2.Leaf CenterButtonProps
Sigmax.dependOnSigma sigma "[centerButton] sigma: Nothing" $ \s -> centerButton = R2.leaf centerButtonCpt
centerButtonCpt :: R.Component CenterButtonProps
centerButtonCpt = here.component "centerButton" cpt
where
cpt { forceAtlasState
, sigmaRef } _ = do
pure $ B.button
{ callback: \_ -> do
Sigmax.dependOnSigma (R.readRef sigmaRef) "[centerButton] sigma: Nothing" $ \s ->
Camera.updateCamera (Camera.camera s) Camera.defaultCamera Camera.updateCamera (Camera.camera s) Camera.defaultCamera
, status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState
, variant: OutlinedButtonVariant Secondary
} }
[ H.text "Center" ] [ H.text "Center" ]
...@@ -238,7 +248,7 @@ resetForceAtlasButtonCpt = here.component "resetForceAtlasToggleButton" cpt ...@@ -238,7 +248,7 @@ resetForceAtlasButtonCpt = here.component "resetForceAtlasToggleButton" cpt
onClick forceAtlasState sigmaRef _ = do onClick forceAtlasState sigmaRef _ = do
-- TODO Sigma.killForceAtlas2 sigma -- TODO Sigma.killForceAtlas2 sigma
-- startForceAtlas2 sigma -- startForceAtlas2 sigma
Sigmax.dependOnSigma (R.readRef sigmaRef) "[resetForceAtlasButton] no sigma" $ \sigma -> do Sigmax.dependOnSigma (R.readRef sigmaRef) "[resetForceAtlasButton] no sigma" $ \_sigma -> do
-- TODO Use fa2Ref instead of sigmaRef -- TODO Use fa2Ref instead of sigmaRef
--Sigma.killForceAtlas2 sigma --Sigma.killForceAtlas2 sigma
--Sigma.refreshForceAtlas sigma Graph.forceAtlas2Settings --Sigma.refreshForceAtlas sigma Graph.forceAtlas2Settings
......
...@@ -198,7 +198,8 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -198,7 +198,8 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
, titleSlot: H.text "View settings" , titleSlot: H.text "View settings"
} }
[ [
centerButton sigmaRef centerButton { forceAtlasState: forceAtlasState'
, sigmaRef }
, ,
gap gap
, ,
......
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