Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
122
Issues
122
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
7cda9bfa
Commit
7cda9bfa
authored
Aug 09, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] some more controls added
parent
b30ab918
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+6
-3
SlideButton.purs
src/Gargantext/Components/GraphExplorer/SlideButton.purs
+5
-0
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+9
-10
No files found.
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
7cda9bfa
...
...
@@ -21,7 +21,7 @@ import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Components.Graph as Graph
import Gargantext.Components.GraphExplorer.SlideButton (labelSizeButton, nodeSizeButton)
import Gargantext.Components.GraphExplorer.SlideButton (
cursorSizeButton,
labelSizeButton, nodeSizeButton)
import Gargantext.Components.GraphExplorer.ToggleButton (edgesToggleButton)
import Gargantext.Utils.Reactix as R2
...
...
@@ -38,10 +38,13 @@ type Controls =
)
controlsToSigmaSettings :: Record Controls -> Record Graph.SigmaSettings
controlsToSigmaSettings { labelSize: (labelSize /\ _)
controlsToSigmaSettings { cursorSize: (cursorSize /\ _)
, labelSize: (labelSize /\ _)
, nodeSize: (nodeSize /\ _)
, showEdges: (showEdges /\ _)} = Graph.sigmaSettings {
drawEdges = showEdges
, drawEdgeLabels = showEdges
, hideEdgesOnMove = not showEdges
, labelMaxSize = labelSize
, maxEdgeSize = if showEdges then 1.0 else 0.0
, maxNodeSize = nodeSize
...
...
@@ -69,7 +72,7 @@ controlsCpt = R.hooksComponent "GraphControls" cpt
-- run demo
-- search button
-- search topics
-- cursor size: 0-100
, RH.li {} [ cursorSizeButton props.cursorSize ]
-- cursor size: 0-100
, RH.li {} [ labelSizeButton props.labelSize ] -- labels size: 1-4
, RH.li {} [ nodeSizeButton props.nodeSize ] -- node size : 5-15
-- edge size : ??
...
...
src/Gargantext/Components/GraphExplorer/SlideButton.purs
View file @
7cda9bfa
module Gargantext.Components.GraphExplorer.SlideButton
( Props
, sizeButton
, cursorSizeButton
, labelSizeButton
, nodeSizeButton
) where
...
...
@@ -35,6 +36,10 @@ sizeButtonCpt = R.hooksComponent "SizeButton" cpt
}
]
cursorSizeButton :: R.State Number -> R.Element
cursorSizeButton state =
sizeButton { state: state, caption: "Cursor Size", min: 1.0, max: 4.0 }
labelSizeButton :: R.State Number -> R.Element
labelSizeButton state =
sizeButton { state: state, caption: "Label Size", min: 1.0, max: 4.0 }
...
...
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
View file @
7cda9bfa
module Gargantext.Components.GraphExplorer.ToggleButton
( Props, toggleButton, toggleButtonCpt
, treeToggleButton
, controlsToggleButton
, sidebarToggleButton
, edgesToggleButton
, sidebarToggleButton
, treeToggleButton
) where
import Prelude
...
...
@@ -31,19 +31,18 @@ toggleButtonCpt = R.hooksComponent "ToggleButton" cpt
text on _off true = on
text _on off false = off
treeToggleButton :: R.State Boolean -> R.Element
treeToggleButton state =
toggleButton { state: state, onMessage: "Hide Tree", offMessage: "Show Tree" }
controlsToggleButton :: R.State Boolean -> R.Element
controlsToggleButton state =
toggleButton { state: state, onMessage: "Hide Controls", offMessage: "Show Controls" }
sidebarToggleButton :: R.State Boolean -> R.Element
sidebarToggleButton state =
toggleButton { state: state, onMessage: "Hide Sidebar", offMessage: "Show Sidebar" }
edgesToggleButton :: R.State Boolean -> R.Element
edgesToggleButton state =
toggleButton { state: state, onMessage: "Hide Edges", offMessage: "Show Edges" }
treeToggleButton :: R.State Boolean -> R.Element
treeToggleButton state =
toggleButton { state: state, onMessage: "Hide Tree", offMessage: "Show Tree" }
sidebarToggleButton :: R.State Boolean -> R.Element
sidebarToggleButton state =
toggleButton { state: state, onMessage: "Hide Sidebar", offMessage: "Show Sidebar" }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment