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
9f0a0a6a
Commit
9f0a0a6a
authored
Sep 05, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] reload tree after graph cloning
parent
2b22fc81
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
17 deletions
+41
-17
App.purs
src/Gargantext/Components/App.purs
+2
-1
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+12
-4
Button.purs
src/Gargantext/Components/GraphExplorer/Button.purs
+7
-2
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+16
-7
Version.purs
src/Gargantext/Version.purs
+4
-3
No files found.
src/Gargantext/Components/App.purs
View file @
9f0a0a6a
...
...
@@ -104,7 +104,8 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
, session
, sessions: (fst sessions)
, showLogin
, treeReload }
--, treeReload
}
type ForestLayoutProps =
( child :: R.Element
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
9f0a0a6a
...
...
@@ -45,7 +45,7 @@ type LayoutProps =
, session :: Session
, sessions :: Sessions
, showLogin :: R.State Boolean
, treeReload :: R.State Int
--
, treeReload :: R.State Int
)
type Props = (
...
...
@@ -99,7 +99,8 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
, session
, sessions
, showLogin
, treeReload } _ = do
--, treeReload
} _ = do
let startForceAtlas = maybe true (\(GET.MetaData { startForceAtlas }) -> startForceAtlas) mMetaData
let forceAtlasS = if startForceAtlas then SigmaxT.InitialRunning else SigmaxT.InitialStopped
...
...
@@ -107,7 +108,14 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
dataRef <- R.useRef graph
graphRef <- R.useRef null
graphVersionRef <- R.useRef (fst graphVersion)
controls <- Controls.useGraphControls graph graphId hyperdataGraph session forceAtlasS
treeReload <- R.useState' 0
controls <- Controls.useGraphControls { forceAtlasS
, graph
, graphId
, hyperdataGraph
, session
, treeReload: \_ -> (snd treeReload) $ (+) 1
}
multiSelectEnabledRef <- R.useRef $ fst controls.multiSelectEnabled
R.useEffect' $ do
...
...
@@ -144,7 +152,7 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
tree { frontends
, handed
, mCurrentRoute
, reload:
props.
treeReload
, reload: treeReload
, sessions
, show: fst controls.showTree
, showLogin: snd showLogin }
...
...
src/Gargantext/Components/GraphExplorer/Button.purs
View file @
9f0a0a6a
...
...
@@ -15,6 +15,7 @@ import Data.String as DS
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Now as EN
import Reactix as R
import Reactix.DOM.HTML as H
...
...
@@ -62,6 +63,7 @@ type CameraButtonProps = (
, hyperdataGraph :: GET.HyperdataGraph
, session :: Session
, sigmaRef :: R.Ref Sigmax.Sigma
, treeReload :: Unit -> Effect Unit
)
...
...
@@ -69,7 +71,8 @@ cameraButton :: Record CameraButtonProps -> R.Element
cameraButton { id
, hyperdataGraph: GET.HyperdataGraph { graph: GET.GraphData hyperdataGraph }
, session
, sigmaRef } = simpleButton {
, sigmaRef
, treeReload } = simpleButton {
onClick: \_ -> do
let sigma = R.readRef sigmaRef
Sigmax.dependOnSigma sigma "[cameraButton] sigma: Nothing" $ \s -> do
...
...
@@ -100,6 +103,8 @@ cameraButton { id
, mCamera: Just camera }
launchAff_ $ do
clonedGraphId <- cloneGraph { id, hyperdataGraph, session }
uploadArbitraryDataURL session clonedGraphId (Just $ nowStr <> "-" <> "screenshot.png") screen
ret <- uploadArbitraryDataURL session clonedGraphId (Just $ nowStr <> "-" <> "screenshot.png") screen
liftEffect $ treeReload unit
pure ret
, text: "Screenshot"
}
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
9f0a0a6a
...
...
@@ -52,6 +52,7 @@ type Controls =
, showSidePanel :: R.State GET.SidePanelState
, showTree :: R.State Boolean
, sigmaRef :: R.Ref Sigmax.Sigma
, treeReload :: Unit -> Effect Unit
)
type LocalControls =
...
...
@@ -165,18 +166,25 @@ controlsCpt = R.hooksComponent "GraphControls" cpt
, RH.li {} [ cameraButton { id: props.graphId
, hyperdataGraph: props.hyperdataGraph
, session: props.session
, sigmaRef: props.sigmaRef } ]
, sigmaRef: props.sigmaRef
, treeReload: props.treeReload } ]
]
]
]
useGraphControls :: SigmaxT.SGraph
-> GET.GraphId
-> GET.HyperdataGraph
-> Session
-> SigmaxT.ForceAtlasState
useGraphControls :: { forceAtlasS :: SigmaxT.ForceAtlasState
, graph :: SigmaxT.SGraph
, graphId :: GET.GraphId
, hyperdataGraph :: GET.HyperdataGraph
, session :: Session
, treeReload :: Unit -> Effect Unit }
-> R.Hooks (Record Controls)
useGraphControls graph graphId hyperdataGraph session forceAtlasS = do
useGraphControls { forceAtlasS
, graph
, graphId
, hyperdataGraph
, session
, treeReload } = do
edgeConfluence <- R.useState' $ Range.Closed { min: 0.0, max: 1.0 }
edgeWeight <- R.useState' $ Range.Closed {
min: 0.0
...
...
@@ -214,6 +222,7 @@ useGraphControls graph graphId hyperdataGraph session forceAtlasS = do
, showSidePanel
, showTree
, sigmaRef
, treeReload
}
getShowControls :: Record Controls -> Boolean
...
...
src/Gargantext/Version.purs
View file @
9f0a0a6a
...
...
@@ -4,13 +4,14 @@ import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Config.REST as REST
import Gargantext.Ends (toUrl)
import Gargantext.Sessions (Session(..))
import Gargantext.Sessions as Sessions
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
type Version = String
...
...
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