Commit 75aa3eec authored by Karen Konou's avatar Karen Konou

[Graph] Display node and edge counts in toolbar

parent f9c5b3fa
Pipeline #6829 passed with stages
in 13 minutes and 55 seconds
...@@ -4,6 +4,7 @@ module Gargantext.Components.GraphExplorer.Toolbar.Controls ...@@ -4,6 +4,7 @@ module Gargantext.Components.GraphExplorer.Toolbar.Controls
import Prelude import Prelude
import Data.Array as A
import Data.Foldable (intercalate) import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Set as Set import Data.Set as Set
...@@ -14,9 +15,9 @@ import Gargantext.Components.GraphExplorer.Toolbar.Buttons (cameraButton, center ...@@ -14,9 +15,9 @@ import Gargantext.Components.GraphExplorer.Toolbar.Buttons (cameraButton, center
import Gargantext.Components.GraphExplorer.Toolbar.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl) import Gargantext.Components.GraphExplorer.Toolbar.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.Toolbar.SlideButton (labelSizeButton, labelRenderedSizeThresholdButton, mouseSelectorSizeSlider) import Gargantext.Components.GraphExplorer.Toolbar.SlideButton (labelSizeButton, labelRenderedSizeThresholdButton, mouseSelectorSizeSlider)
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.ForceAtlas2 as ForceAtlas import Gargantext.Hooks.Sigmax.ForceAtlas2 as ForceAtlas
import Gargantext.Hooks.Sigmax.Noverlap as Noverlap import Gargantext.Hooks.Sigmax.Noverlap as Noverlap
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Hooks.Sigmax.Types as SigmaxT import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
...@@ -90,6 +91,11 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -90,6 +91,11 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
-- If user pauses FA before auto is triggered, clear the timeoutId -- If user pauses FA before auto is triggered, clear the timeoutId
mFAPauseRef <- R.useRef Nothing mFAPauseRef <- R.useRef Nothing
-- | Helpers
-- |
let nodeCount (GET.HyperdataGraph { graph: GET.GraphData { nodes } }) = A.length nodes
let edgeCount (GET.HyperdataGraph { graph: GET.GraphData { edges } }) = A.length edges
-- | Effects -- | Effects
-- | -- |
...@@ -231,6 +237,17 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -231,6 +237,17 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
, title: "Save this graph" , title: "Save this graph"
} }
] ]
,
B.fieldset
{ className: "graph-toolbar__section"
, titleSlot: H.text "Parameters" }
[
H.div { }
[
H.p { } [ H.text $ "Nodes: " <> (show $ nodeCount hyperdataGraph') ]
, H.p { } [ H.text $ "Edges: " <> (show $ edgeCount hyperdataGraph') ]
]
]
] ]
, ,
......
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