Commit b96aa26f authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] Graph/Sigmax small fixes

parent f5c319e9
...@@ -7,15 +7,18 @@ module Gargantext.Components.Graph ...@@ -7,15 +7,18 @@ module Gargantext.Components.Graph
import Prelude (bind, discard, pure, ($), (<$>), (<*>)) import Prelude (bind, discard, pure, ($), (<$>), (<*>))
import Data.Either (Either(..), either, note) import Data.Either (Either(..), either, note)
import Data.Maybe (Maybe) import Data.Maybe (Maybe)
import Data.Nullable (null) import Data.Nullable (null, Nullable)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple as DOM import DOM.Simple as DOM
import Effect (Effect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as RH import Reactix.DOM.HTML as RH
import Gargantext.Hooks.Sigmax import Gargantext.Hooks.Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Hooks.Sigmax.Types as Sigmax import Gargantext.Hooks.Sigmax.Types as Sigmax
import Gargantext.Utils.Reactix as R2
type OnProps = () type OnProps = ()
...@@ -74,7 +77,7 @@ graphCpt = R.hooksComponent "Graph" cpt ...@@ -74,7 +77,7 @@ graphCpt = R.hooksComponent "Graph" cpt
graphEffect {graph, forceAtlas2Settings, sigmaSettings} = R.useEffect3 graph forceAtlas2Settings sigmaSettings $ graphEffect {graph, forceAtlas2Settings, sigmaSettings} = R.useEffect3 graph forceAtlas2Settings sigmaSettings $
pure unit pure unit
setLast :: forall s fa2. R.Ref (Record (Last s fa2)) -> R.Record (Props s fa2) -> Effect Unit setLast :: forall s fa2. R.Ref (Record (Last s fa2)) -> Record (Props s fa2) -> Effect Unit
setLast ref {graph, forceAtlas2Settings, sigmaSettings} = R.setRef ref new setLast ref {graph, forceAtlas2Settings, sigmaSettings} = R.setRef ref new
where where
new = {graph, fa2: forceAtlas2Settings, sigma: sigmaSettings} new = {graph, fa2: forceAtlas2Settings, sigma: sigmaSettings}
......
...@@ -49,8 +49,7 @@ cleanupFirst sigma = ...@@ -49,8 +49,7 @@ cleanupFirst sigma =
startSigma :: forall settings faSettings n e. R.Ref (Nullable Element) -> R.Ref (Maybe Sigma) -> settings -> faSettings -> Graph n e -> R.Hooks Unit startSigma :: forall settings faSettings n e. R.Ref (Nullable Element) -> R.Ref (Maybe Sigma) -> settings -> faSettings -> Graph n e -> R.Hooks Unit
startSigma ref sigmaRef settings forceAtlas2Settings graph = do startSigma ref sigmaRef settings forceAtlas2Settings graph = do
--{sigma, isNew} <- useSigma ref settings sigmaRef {sigma, isNew} <- useSigma ref settings sigmaRef
sigmaRef <- useSigma
useCanvasRenderer ref sigma useCanvasRenderer ref sigma
if isNew then do if isNew then 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