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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
d520d23f
Commit
d520d23f
authored
Jun 22, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-list-charts
parents
0b03d8c1
9b63f39a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
220 additions
and
32 deletions
+220
-32
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+11
-3
Action.purs
src/Gargantext/Components/Forest/Tree/Node/Action.purs
+0
-2
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+10
-6
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+81
-20
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+113
-0
Graph.purs
src/Gargantext/Components/Graph.purs
+2
-1
SlideButton.purs
src/Gargantext/Components/GraphExplorer/SlideButton.purs
+2
-0
Sigma.js
src/Gargantext/Hooks/Sigmax/Sigma.js
+1
-0
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
d520d23f
...
@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree where
...
@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree where
import DOM.Simple.Console (log, log2)
import DOM.Simple.Console (log, log2)
import Data.Array as A
import Data.Array as A
import Data.Maybe (Maybe)
import Data.Maybe (Maybe
(..)
)
import Data.Set as Set
import Data.Set as Set
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
...
@@ -12,7 +12,6 @@ import Gargantext.AsyncTasks as GAT
...
@@ -12,7 +12,6 @@ import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest.Tree.Node (nodeMainSpan)
import Gargantext.Components.Forest.Tree.Node (nodeMainSpan)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Add (AddNodeValue(..), addNode)
import Gargantext.Components.Forest.Tree.Node.Action.Add (AddNodeValue(..), addNode)
import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (getNodeTree)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (deleteNode)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (deleteNode)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (RenameValue(..), rename)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (RenameValue(..), rename)
import Gargantext.Components.Forest.Tree.Node.Action.Share (ShareValue(..), share)
import Gargantext.Components.Forest.Tree.Node.Action.Share (ShareValue(..), share)
...
@@ -24,8 +23,10 @@ import Gargantext.Ends (Frontends)
...
@@ -24,8 +23,10 @@ import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>))
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>))
import Gargantext.Routes (AppRoute)
import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (OpenNodes, Session, mkNodeId)
import Gargantext.Sessions (OpenNodes, Session, mkNodeId
, get
)
import Gargantext.Types (ID, Reload)
import Gargantext.Types (ID, Reload)
import Gargantext.Types as GT
import Gargantext.Routes as GR
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Record as Record
import Record as Record
...
@@ -95,6 +96,13 @@ treeLoadView p = R.createElement treeLoadViewCpt p []
...
@@ -95,6 +96,13 @@ treeLoadView p = R.createElement treeLoadViewCpt p []
}
}
useLoader { root, counter: fst reload } fetch paint
useLoader { root, counter: fst reload } fetch paint
--------------
getNodeTree :: Session -> GT.ID -> Aff FTree
getNodeTree session nodeId = get session $ GR.NodeAPI GT.Tree (Just nodeId) ""
--------------
type TreeViewProps = ( asyncTasks :: R.State GAT.Storage
type TreeViewProps = ( asyncTasks :: R.State GAT.Storage
, tree :: FTree
, tree :: FTree
, tasks :: Record Tasks
, tasks :: Record Tasks
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
d520d23f
...
@@ -19,7 +19,6 @@ type UpdateNodeProps =
...
@@ -19,7 +19,6 @@ type UpdateNodeProps =
)
)
-}
-}
data Action = AddNode String GT.NodeType
data Action = AddNode String GT.NodeType
| DeleteNode
| DeleteNode
| RenameNode String
| RenameNode String
...
@@ -30,7 +29,6 @@ data Action = AddNode String GT.NodeType
...
@@ -30,7 +29,6 @@ data Action = AddNode String GT.NodeType
| DownloadNode
| DownloadNode
| RefreshTree
| RefreshTree
instance showShow :: Show Action where
instance showShow :: Show Action where
show (AddNode _ _ )= "AddNode"
show (AddNode _ _ )= "AddNode"
show DeleteNode = "DeleteNode"
show DeleteNode = "DeleteNode"
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
d520d23f
...
@@ -12,7 +12,6 @@ import Reactix.DOM.HTML as H
...
@@ -12,7 +12,6 @@ import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (copyFromCorpusView)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
import Gargantext.Components.Forest.Tree.Node.Action.Download (actionDownload)
import Gargantext.Components.Forest.Tree.Node.Action.Download (actionDownload)
...
@@ -25,6 +24,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload)
...
@@ -25,6 +24,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView)
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID)
import Gargantext.Types (Name, ID)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -245,12 +245,16 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
...
@@ -245,12 +245,16 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
cpt {action: Config , dispatch, id, nodeType, session} _ = do
cpt {action: Config , dispatch, id, nodeType, session} _ = do
pure $ fragmentPT $ "Config " <> show nodeType
pure $ fragmentPT $ "Config " <> show nodeType
cpt {action: CopyFromCorpus, dispatch, id, nodeType, session} _ = do
-----------
pure $ copyFromCorpusView {dispatch, id, nodeType, session}
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session} _ = do
pure $ subTreeView {dispatch, id, nodeType, session, subTreeParams}
cpt {action: Link _} _ = pure $ fragmentPT $ "Soon, you will be able "
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session} _ = do
<> "to link the corpus with your Annuaire"
pure $ subTreeView {dispatch, id, nodeType, session, subTreeParams}
<> " (and reciprocally)."
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session} _ = do
pure $ subTreeView {dispatch, id, nodeType, session, subTreeParams}
-----------
cpt {action : Share, dispatch, id, name } _ = do
cpt {action : Share, dispatch, id, name } _ = do
isOpen <- R.useState' true
isOpen <- R.useState' true
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
d520d23f
module Gargantext.Components.Forest.Tree.Node.Settings where
module Gargantext.Components.Forest.Tree.Node.Settings where
import Prelude (class Eq, class Show, show, (&&), (<>), (==))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Eq (genericEq)
import Gargantext.Prelude (class Eq, class Show, show, (&&), (<>), (==))
import Data.Array (foldl)
import Data.Array (foldl)
import Gargantext.Types
import Gargantext.Types
...
@@ -12,16 +15,32 @@ if user has access to node then he can do all his related actions
...
@@ -12,16 +15,32 @@ if user has access to node then he can do all his related actions
-}
-}
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
data Status a = IsBeta a | IsProd a
-- Beta Status
data Status a = TODO a | WIP a | OnTest a | Beta a
data NodeAction = Documentation NodeType
data NodeAction = Documentation NodeType
| SearchBox
| SearchBox
| Download | Upload | Refresh | Config
| Download | Upload | Refresh | Config
| Move | Clone | Delete
| Delete
| Share | Link NodeType
| Share
| Add (Array NodeType)
| Add (Array NodeType)
| CopyFromCorpus
| Merge { subTreeParams :: SubTreeParams }
| Move { subTreeParams :: SubTreeParams }
| Link { subTreeParams :: SubTreeParams }
| Clone
------------------------------------------------------------------------
-- TODO move elsewhere
data SubTreeParams = SubTreeParams { showtypes :: Array NodeType
, valitypes :: Array NodeType
}
derive instance eqSubTreeParams :: Eq SubTreeParams
derive instance genericSubTreeParams :: Generic SubTreeParams _
instance showSubTreeParams :: Show SubTreeParams where
show = genericShow
------------------------------------------------------------------------
instance eqNodeAction :: Eq NodeAction where
instance eqNodeAction :: Eq NodeAction where
eq (Documentation x) (Documentation y) = true && (x == y)
eq (Documentation x) (Documentation y) = true && (x == y)
...
@@ -29,13 +48,13 @@ instance eqNodeAction :: Eq NodeAction where
...
@@ -29,13 +48,13 @@ instance eqNodeAction :: Eq NodeAction where
eq Download Download = true
eq Download Download = true
eq Upload Upload = true
eq Upload Upload = true
eq Refresh Refresh = true
eq Refresh Refresh = true
eq
Move Move = true
eq
(Move x) (Move y) = x == y
eq Clone Clone = true
eq Clone Clone = true
eq Delete Delete = true
eq Delete Delete = true
eq Share Share = true
eq Share Share = true
eq (Link x) (Link y)
= (x == y)
eq (Link x) (Link y)
= x == y
eq (Add x) (Add y)
= (x == y)
eq (Add x) (Add y)
= x == y
eq
CopyFromCorpus CopyFromCorpus = true
eq
(Merge x) (Merge y) = x == y
eq Config Config = true
eq Config Config = true
eq _ _ = false
eq _ _ = false
...
@@ -45,14 +64,14 @@ instance showNodeAction :: Show NodeAction where
...
@@ -45,14 +64,14 @@ instance showNodeAction :: Show NodeAction where
show Download = "Download"
show Download = "Download"
show Upload = "Upload"
show Upload = "Upload"
show Refresh = "Refresh"
show Refresh = "Refresh"
show
Move = "Move"
show
(Move t) = "Move with subtree params" <> show t
show Clone = "Clone"
show Clone = "Clone"
show Delete = "Delete"
show Delete = "Delete"
show Share = "Share"
show Share = "Share"
show Config = "Config"
show Config = "Config"
show (Link x) = "Link to " <> show x
show (Link x) = "Link to " <> show x
show (Add xs) = foldl (\a b -> a <> show b) "Add " xs
show (Add xs) = foldl (\a b -> a <> show b) "Add " xs
show
CopyFromCorpus = "Copy from corpus"
show
(Merge t) = "Merge with subtree" <> show t
glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction :: NodeAction -> String
...
@@ -63,11 +82,11 @@ glyphiconNodeAction SearchBox = "search"
...
@@ -63,11 +82,11 @@ glyphiconNodeAction SearchBox = "search"
glyphiconNodeAction Upload = "upload"
glyphiconNodeAction Upload = "upload"
glyphiconNodeAction (Link _) = "arrows-h"
glyphiconNodeAction (Link _) = "arrows-h"
glyphiconNodeAction Download = "download"
glyphiconNodeAction Download = "download"
glyphiconNodeAction
CopyFromCorpus
= "random"
glyphiconNodeAction
(Merge _)
= "random"
glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction
Move
= "share-square-o"
glyphiconNodeAction
(Move _)
= "share-square-o"
glyphiconNodeAction _ = ""
glyphiconNodeAction _ = ""
...
@@ -138,7 +157,7 @@ settingsBox Folder =
...
@@ -138,7 +157,7 @@ settingsBox Folder =
, Folder
, Folder
, Annuaire
, Annuaire
]
]
, Move
, Move
moveParameters
, Delete
, Delete
]
]
}
}
...
@@ -154,9 +173,9 @@ settingsBox Corpus =
...
@@ -154,9 +173,9 @@ settingsBox Corpus =
, SearchBox
, SearchBox
, Upload
, Upload
, Download
, Download
, Move
, Move
moveParameters
--, Clone
--, Clone
, Link
Annuaire
, Link
linkParams
, Delete
, Delete
]
]
}
}
...
@@ -191,7 +210,17 @@ settingsBox NodeList =
...
@@ -191,7 +210,17 @@ settingsBox NodeList =
, Config
, Config
, Download
, Download
, Upload
, Upload
, CopyFromCorpus
, Merge {subTreeParams : SubTreeParams { showtypes: [ FolderPrivate
, FolderShared
, Team
, FolderPublic
, Folder
, Corpus
, NodeList
]
, valitypes: [ NodeList ]
}
}
, Delete
, Delete
]
]
}
}
...
@@ -207,10 +236,10 @@ settingsBox Dashboard =
...
@@ -207,10 +236,10 @@ settingsBox Dashboard =
settingsBox Annuaire =
settingsBox Annuaire =
SettingsBox { show : true
SettingsBox { show : true
, edit :
fals
e
, edit :
tru
e
, doc : Documentation Annuaire
, doc : Documentation Annuaire
, buttons : [ Upload
, buttons : [ Upload
, Move
, Move
moveParameters
, Delete
, Delete
]
]
}
}
...
@@ -221,3 +250,35 @@ settingsBox _ =
...
@@ -221,3 +250,35 @@ settingsBox _ =
, doc : Documentation NodeUser
, doc : Documentation NodeUser
, buttons : []
, buttons : []
}
}
-- | SubTree Parameters
moveParameters = { subTreeParams : SubTreeParams
{ showtypes: [ FolderPrivate
, FolderShared
, Team
, FolderPublic
, Folder
]
, valitypes: [ FolderPrivate
, FolderShared
, Team
, FolderPublic
, Folder
]
}
}
linkParams = { subTreeParams : SubTreeParams
{ showtypes: [ FolderPrivate
, FolderShared
, Team
, FolderPublic
, Folder
, Annuaire
]
, valitypes: [ Annuaire
]
}
}
src/Gargantext/Components/Forest/Tree/Node/
Action/CopyFrom
.purs
→
src/Gargantext/Components/Forest/Tree/Node/
Tools/SubTree
.purs
View file @
d520d23f
module Gargantext.Components.Forest.Tree.Node.
Action.CopyFrom
where
module Gargantext.Components.Forest.Tree.Node.
Tools.SubTree
where
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
import Data.Array as A
import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (Props)
import Gargantext.Components.Forest.Tree.Node.Action (Props)
import Gargantext.Components.Forest.Tree.Node.Settings (SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (discard, map, pure, show, unit, ($), (&&), (/=), (<>))
import Gargantext.Prelude (discard, map, pure, show, unit, ($), (&&), (/=), (<>)
, class Eq
)
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), get)
import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -16,56 +19,71 @@ import Reactix.DOM.HTML as H
...
@@ -16,56 +19,71 @@ import Reactix.DOM.HTML as H
------------------------------------------------------------------------
------------------------------------------------------------------------
getNodeTree :: Session -> GT.ID -> Aff FTree
type SubTreeParamsProps =
getNodeTree session nodeId = get session $ GR.NodeAPI GT.Tree (Just nodeId) ""
( subTreeParams :: SubTreeParams
| Props
)
copyFromCorpusView :: Record
Props -> R.Element
subTreeView :: Record SubTreeParams
Props -> R.Element
copyFromCorpusView props = R.createElement copyFromCorpus
ViewCpt props []
subTreeView props = R.createElement subTree
ViewCpt props []
copyFromCorpusViewCpt :: R.Component
Props
subTreeViewCpt :: R.Component SubTreeParams
Props
copyFromCorpusViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
View" cpt
subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
View" cpt
where
where
cpt { dispatch
cpt
params@
{ dispatch
, id
, id
, nodeType
, nodeType
, session
, session
, subTreeParams
} _ =
} _ =
do
do
useLoader session loadCorporaTree $
let SubTreeParams {showtypes} = subTreeParams
useLoader session (loadSubTree showtypes) $
\tree ->
\tree ->
copyFromCorpus
ViewLoaded { dispatch
subTree
ViewLoaded { dispatch
, id
, id
, nodeType
, nodeType
, session
, session
, tree
, tree
, subTreeParams
}
}
------------------------------------------------------------------------
loadSubTree :: Array GT.NodeType -> Session -> Aff FTree
loadSubTree nodetypes session = getSubTree session treeId nodetypes
where
Session { treeId } = session
getSubTree :: Session -> Int -> Array GT.NodeType -> Aff FTree
getSubTree session treeId showtypes = get session $ GR.NodeAPI GT.Tree (Just treeId) nodeTypes
where
nodeTypes = A.foldl (\a b -> a <> "type=" <> show b <> "&") "?" showtypes
------------------------------------------------------------------------
type CorpusTreeProps =
type CorpusTreeProps =
( tree :: FTree
( tree :: FTree
| Props
|
SubTreeParams
Props
)
)
copyFromCorpus
ViewLoaded :: Record CorpusTreeProps -> R.Element
subTree
ViewLoaded :: Record CorpusTreeProps -> R.Element
copyFromCorpusViewLoaded props = R.createElement copyFromCorpus
ViewLoadedCpt props []
subTreeViewLoaded props = R.createElement subTree
ViewLoadedCpt props []
copyFromCorpus
ViewLoadedCpt :: R.Component CorpusTreeProps
subTree
ViewLoadedCpt :: R.Component CorpusTreeProps
copyFromCorpusViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
ViewLoadedCpt" cpt
subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
ViewLoadedCpt" cpt
where
where
cpt p@{dispatch, id, nodeType, session, tree} _ = do
cpt p@{dispatch, id, nodeType, session, tree} _ = do
pure $ H.div { className: "copy-from-corpus" }
pure $ H.div { className: "copy-from-corpus" }
[ H.div { className: "tree" }
[ H.div { className: "tree" }
[
copyFromCorpus
TreeView p]
[
subTree
TreeView p]
]
]
copyFromCorpus
TreeView :: Record CorpusTreeProps -> R.Element
subTree
TreeView :: Record CorpusTreeProps -> R.Element
copyFromCorpusTreeView props = R.createElement copyFromCorpus
TreeViewCpt props []
subTreeTreeView props = R.createElement subTree
TreeViewCpt props []
copyFromCorpus
TreeViewCpt :: R.Component CorpusTreeProps
subTree
TreeViewCpt :: R.Component CorpusTreeProps
copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpus
TreeViewCpt" cpt
subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTree
TreeViewCpt" cpt
where
where
cpt p@{id, tree: NTree (LNode { id: sourceId, name, nodeType }) ary} _ = do
cpt p@{id, tree: NTree (LNode { id: sourceId, name, nodeType }) ary
, subTreeParams
} _ = do
pure $ {- H.div {} [ H.h5 { className: GT.fldr nodeType true} []
pure $ {- H.div {} [ H.h5 { className: GT.fldr nodeType true} []
, -} H.div { className: "node" }
, -} H.div { className: "node" }
( [ H.span { className: "name " <> clickable
( [ H.span { className: "name " <> clickable
...
@@ -76,29 +94,20 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
...
@@ -76,29 +94,20 @@ copyFromCorpusTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.copyFromCorpusTreeVi
)
)
-- ]
-- ]
where
where
children = map (\c -> copyFromCorpusTreeView (p { tree = c })) ary
validNodeType = (A.elem nodeType [GT.NodeList]) && (id /= sourceId)
SubTreeParams { valitypes } = subTreeParams
children = map (\c -> subTreeTreeView (p { tree = c })) ary
validNodeType = (A.elem nodeType valitypes) && (id /= sourceId)
clickable = if validNodeType then "clickable" else ""
clickable = if validNodeType then "clickable" else ""
onClick _ = case validNodeType of
onClick _ = case validNodeType of
false -> pure unit
false -> pure unit
true -> do
true -> do
log2 "[
copyFromCorpus
TreeViewCpt] issue copy into" id
log2 "[
subTree
TreeViewCpt] issue copy into" id
log2 "[
copyFromCorpus
TreeViewCpt] issue copy from" sourceId
log2 "[
subTree
TreeViewCpt] issue copy from" sourceId
loadCorporaTree :: Session -> Aff FTree
--------------------------------------------------------------------------------------------
loadCorporaTree session = getCorporaTree session treeId
where
Session { treeId } = session
getCorporaTree :: Session -> Int -> Aff FTree
getCorporaTree session treeId = get session $ GR.NodeAPI GT.Tree (Just treeId) nodeTypes
where
nodeTypes = A.foldl (\a b -> a <> "type=" <> show b <> "&") "?" typesList
typesList = [ GT.FolderPrivate
, GT.FolderShared
, GT.Team
, GT.FolderPublic
, GT.Folder
, GT.Corpus
, GT.NodeList
]
src/Gargantext/Components/Graph.purs
View file @
d520d23f
...
@@ -231,7 +231,8 @@ sigmaSettings =
...
@@ -231,7 +231,8 @@ sigmaSettings =
, font: "arial" -- font params
, font: "arial" -- font params
, fontStyle: "bold"
, fontStyle: "bold"
, hideEdgesOnMove: true
, hideEdgesOnMove: true
, labelSize : "proportional" -- alt : proportional
--, labelSize : "proportional" -- alt : proportional, fixed
, labelSize: "fixed"
, labelSizeRatio: 2.0 -- label size in ratio of node size
, labelSizeRatio: 2.0 -- label size in ratio of node size
, labelThreshold: 7.0 -- min node cam size to start showing label
, labelThreshold: 7.0 -- min node cam size to start showing label
, maxEdgeSize: 1.0
, maxEdgeSize: 1.0
...
...
src/Gargantext/Components/GraphExplorer/SlideButton.purs
View file @
d520d23f
...
@@ -58,6 +58,8 @@ labelSizeButton sigmaRef state =
...
@@ -58,6 +58,8 @@ labelSizeButton sigmaRef state =
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
Sigma.setSettings s {
defaultLabelSize: newValue
defaultLabelSize: newValue
, drawLabels: true
, labelSizeRatio: newValue / 2.5
}
}
setValue $ const newValue
setValue $ const newValue
}
}
...
...
src/Gargantext/Hooks/Sigmax/Sigma.js
View file @
d520d23f
...
@@ -42,6 +42,7 @@ sigma.canvas.nodes.selected = (node, context, settings) => {
...
@@ -42,6 +42,7 @@ sigma.canvas.nodes.selected = (node, context, settings) => {
node
.
type
=
'def'
;
node
.
type
=
'def'
;
sigma
.
canvas
.
hovers
.
def
(
node
,
context
,
settings
);
sigma
.
canvas
.
hovers
.
def
(
node
,
context
,
settings
);
node
.
type
=
'selected'
;
node
.
type
=
'selected'
;
console
.
log
(
'hovers, settings:'
,
settings
);
};
};
CustomShapes
.
init
();
CustomShapes
.
init
();
...
...
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