Commit a4a24fc8 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] selectorSize: remove unused code

parent d1a1e6ec
...@@ -30,7 +30,6 @@ type Props sigma forceatlas2 = ...@@ -30,7 +30,6 @@ type Props sigma forceatlas2 =
, graph :: SigmaxTypes.SGraph , graph :: SigmaxTypes.SGraph
, multiSelectEnabledRef :: R.Ref Boolean , multiSelectEnabledRef :: R.Ref Boolean
, selectedNodeIds :: R.State SigmaxTypes.SelectedNodeIds , selectedNodeIds :: R.State SigmaxTypes.SelectedNodeIds
, selectorSize :: R.State Int
, showEdges :: R.State SigmaxTypes.ShowEdgesState , showEdges :: R.State SigmaxTypes.ShowEdgesState
, sigmaRef :: R.Ref Sigmax.Sigma , sigmaRef :: R.Ref Sigmax.Sigma
, sigmaSettings :: sigma , sigmaSettings :: sigma
...@@ -104,10 +103,6 @@ graphCpt = R.hooksComponent "Graph" cpt ...@@ -104,10 +103,6 @@ graphCpt = R.hooksComponent "Graph" cpt
Sigmax.updateNodes sigma tNodesMap Sigmax.updateNodes sigma tNodesMap
Sigmax.setEdges sigma (not $ SigmaxTypes.edgeStateHidden showEdges) Sigmax.setEdges sigma (not $ SigmaxTypes.edgeStateHidden showEdges)
-- R.useEffect1' (fst props.selectorSize) $ do
-- Sigmax.dependOnSigma (R.readRef sigmaRef) "[graphCpt (Ready)] no sigma" $ \sigma -> do
-- Sigmax.selectorWithSize sigma $ fst props.selectorSize
stageHooks _ = pure unit stageHooks _ = pure unit
...@@ -241,7 +236,7 @@ sigmaSettings = ...@@ -241,7 +236,7 @@ sigmaSettings =
, minEdgeSize: 0.5 -- in fact used in tina as edge size , minEdgeSize: 0.5 -- in fact used in tina as edge size
, minNodeSize: 1.0 , minNodeSize: 1.0
, mouseEnabled: true , mouseEnabled: true
, mouseSelectorSize: 10.0 , mouseSelectorSize: 15.0
, mouseZoomDuration: 150.0 , mouseZoomDuration: 150.0
, nodeBorderColor: "default" -- choices: "default" color vs. "node" color , nodeBorderColor: "default" -- choices: "default" color vs. "node" color
--, nodesPowRatio : 10.8 --, nodesPowRatio : 10.8
......
...@@ -189,7 +189,6 @@ graphViewCpt = R.hooksComponent "GraphView" cpt ...@@ -189,7 +189,6 @@ graphViewCpt = R.hooksComponent "GraphView" cpt
, graph , graph
, multiSelectEnabledRef , multiSelectEnabledRef
, selectedNodeIds: controls.selectedNodeIds , selectedNodeIds: controls.selectedNodeIds
, selectorSize: controls.selectorSize
, showEdges: controls.showEdges , showEdges: controls.showEdges
, sigmaRef: controls.sigmaRef , sigmaRef: controls.sigmaRef
, sigmaSettings: Graph.sigmaSettings , sigmaSettings: Graph.sigmaSettings
......
...@@ -43,7 +43,6 @@ type Controls = ...@@ -43,7 +43,6 @@ type Controls =
, multiSelectEnabled :: R.State Boolean , multiSelectEnabled :: R.State Boolean
, nodeSize :: R.State Range.NumberRange , nodeSize :: R.State Range.NumberRange
, selectedNodeIds :: R.State SigmaxTypes.SelectedNodeIds , selectedNodeIds :: R.State SigmaxTypes.SelectedNodeIds
, selectorSize :: R.State Int
, showControls :: R.State Boolean , showControls :: R.State Boolean
, showEdges :: R.State SigmaxTypes.ShowEdgesState , showEdges :: R.State SigmaxTypes.ShowEdgesState
, showSidePanel :: R.State GET.SidePanelState , showSidePanel :: R.State GET.SidePanelState
...@@ -62,7 +61,7 @@ type LocalControls = ...@@ -62,7 +61,7 @@ type LocalControls =
initialLocalControls :: R.Hooks (Record LocalControls) initialLocalControls :: R.Hooks (Record LocalControls)
initialLocalControls = do initialLocalControls = do
labelSize <- R.useState' 14.0 labelSize <- R.useState' 14.0
mouseSelectorSize <- R.useState' 10.0 mouseSelectorSize <- R.useState' 15.0
pure $ { pure $ {
labelSize labelSize
...@@ -172,7 +171,6 @@ useGraphControls graph = do ...@@ -172,7 +171,6 @@ useGraphControls graph = do
nodeSize <- R.useState' $ Range.Closed { min: 0.0, max: 100.0 } nodeSize <- R.useState' $ Range.Closed { min: 0.0, max: 100.0 }
showTree <- R.useState' false showTree <- R.useState' false
selectedNodeIds <- R.useState' $ Set.empty selectedNodeIds <- R.useState' $ Set.empty
selectorSize <- R.useState' 15
showControls <- R.useState' false showControls <- R.useState' false
showEdges <- R.useState' SigmaxTypes.EShow showEdges <- R.useState' SigmaxTypes.EShow
showSidePanel <- R.useState' GET.InitialClosed showSidePanel <- R.useState' GET.InitialClosed
...@@ -188,7 +186,6 @@ useGraphControls graph = do ...@@ -188,7 +186,6 @@ useGraphControls graph = do
, multiSelectEnabled , multiSelectEnabled
, nodeSize , nodeSize
, selectedNodeIds , selectedNodeIds
, selectorSize
, showControls , showControls
, showEdges , showEdges
, showSidePanel , showSidePanel
......
...@@ -9,6 +9,7 @@ import Data.Map as Map ...@@ -9,6 +9,7 @@ import Data.Map as Map
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Sequence as Seq import Data.Sequence as Seq
import Data.Set as Set import Data.Set as Set
import Data.Traversable (traverse)
import Data.Tuple.Nested((/\)) import Data.Tuple.Nested((/\))
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
...@@ -25,7 +26,6 @@ import Gargantext.Hooks.Sigmax.Types as SigmaxTypes ...@@ -25,7 +26,6 @@ import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, delete) import Gargantext.Sessions (Session, delete)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Monad (mapM_)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
type Props = type Props =
...@@ -125,8 +125,9 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt ...@@ -125,8 +125,9 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
deleteNodes session nodeIds deleteNodes session nodeIds
deleteNodes :: Session -> Array Int -> Effect Unit deleteNodes :: Session -> Array Int -> Effect Unit
deleteNodes session nodeIds = deleteNodes session nodeIds = do
mapM_ (launchAff_ <<< deleteNode session) nodeIds _ <- traverse (launchAff_ <<< deleteNode session) nodeIds
pure unit
deleteNode :: Session -> Int -> Aff Int deleteNode :: Session -> Int -> Aff Int
deleteNode session nodeId = delete session $ NodeAPI Node (Just nodeId) "" deleteNode session nodeId = delete session $ NodeAPI Node (Just nodeId) ""
......
module Gargantext.Utils.Monad where
import Prelude (unit, pure, Unit, (<<<))
import Control.Monad (class Monad, (>>=))
import Data.Foldable (class Foldable, foldr)
bind_ :: forall a b m. Monad m => m a -> m b -> m b
bind_ m k = m >>= \_ -> k -- See Note [Recursive bindings for Applicative/Monad]
infixr 1 bind_ as >>
mapM_ :: forall a b t m. Foldable t => Monad m => (a -> m b) -> t a -> m Unit
mapM_ f = foldr ((>>) <<< f) (pure unit)
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