Commit 48f220be authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] remove refreshForceAtlas usage

Apparently, when graph rendering was fixed, it's not necessary to
refresh forceAtlas after sigma updates.
parent 2794eb90
......@@ -66,13 +66,6 @@ startSigma ref sigmaRef settings forceAtlas2Settings graph = do
else
pure unit
R.useEffect $ do
delay unit $ handleRefresh sigma
where
handleRefresh sigma _ = pure $
dependOnSigma sigma "[handleRefresh] can't refresh" Sigma.refreshForceAtlas
-- | Manages a sigma with the given settings
useSigma :: forall settings. settings -> R.Ref (Maybe Sigma) -> R.Hooks {sigma :: Sigma, isNew :: Boolean}
useSigma settings sigmaRef = do
......@@ -220,37 +213,14 @@ startSigmaEff ref sigmaRef settings forceAtlas2Settings graph = do
let rSigma = R.readRef sigmaRef
case readSigma rSigma of
Nothing -> do
--log "[startSigmaEff] calling useSigmaEff"
sigma <- useSigmaEff settings sigmaRef
--log "[startSigmaEff] calling useCanvasRendererEff"
useCanvasRendererEff ref sigma
--log "[startSigmaEff] calling useDataEff"
useDataEff sigma graph
--log "[startSigmaEff] calling useForceAtlas2Eff"
useForceAtlas2Eff sigma forceAtlas2Settings
Just sig -> do
--log "[startSigmaEff] sigma initialized already"
--Sigma.swapRendererContainer ref sig
--dependOnContainer ref "[startSigmaEff] no container" $ Sigma.setRendererContainer sig
--useCanvasRendererEff ref rSigma
--useDataEff rSigma graph
--useForceAtlas2Eff rSigma forceAtlas2Settings
--log "[startSigmaEff] refreshForceAtlas"
--Sigma.refreshForceAtlas sig
--if isFARunning then
-- Sigma.restartForceAtlas2 sig
--else
-- Sigma.stopForceAtlas2 sig
pure unit
--handleRefresh sigma
where
handleRefresh :: Sigma -> Effect Unit
handleRefresh sigma = dependOnSigma sigma "[handleRefresh] can't refresh" $ \s -> do
Sigma.refreshForceAtlas s
useSigmaEff :: forall settings. settings -> R.Ref Sigma -> Effect Sigma
useSigmaEff settings sigmaRef = do
......
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