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
a1c7ab5d
Unverified
Commit
a1c7ab5d
authored
Feb 14, 2019
by
Mael NICOLAS
Committed by
Nicolas Pouillard
Apr 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[HELP] Small exemple of a working ref callback
parent
541666fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
Sigmajs.js
src/Gargantext/Components/GraphExplorer/Sigmajs.js
+9
-2
Sigmajs.purs
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
+6
-4
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+4
-2
No files found.
src/Gargantext/Components/GraphExplorer/Sigmajs.js
View file @
a1c7ab5d
...
...
@@ -40,10 +40,17 @@ exports.forceLinkClass = FL.default;
}
const
applyOnCamera
=
function
(
props
,
f
){
const
applyOnCamera
=
function
(
props
){
console
.
log
(
props
);
//const camera = props.sigma.cameras[0];
//f(camera)
};
exports
.
applyOnCamera
=
applyOnCamera
;
/*const applyOnCamera = function(props, f){
console.log(props);
//const camera = props.sigma.cameras[0];
//f(camera)
};
*/
exports
.
applyOnCameraImpl
=
applyOnCamera
;
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
View file @
a1c7ab5d
...
...
@@ -254,17 +254,19 @@ type Camera =
angle :: Number
}
foreign import applyOnCameraImpl :: forall a. EffectFn2 (Nullable ReactRef) (a -> EventHandler) Unit
foreign import applyOnCameraImpl :: SyntheticEventHandler (Nullable ReactRef)
applyOnCamera = applyOnCameraImpl
--foreign import applyOnCameraImpl :: forall a. EffectFn2 (Nullable ReactRef) (a -> EventHandler) Unit
applyOnCamera :: forall a. (Nullable ReactRef) -> (a -> EventHandler) -> Effect Unit
applyOnCamera = runEffectFn2 applyOnCameraImpl
--
applyOnCamera :: forall a. (Nullable ReactRef) -> (a -> EventHandler) -> Effect Unit
--
applyOnCamera = runEffectFn2 applyOnCameraImpl
type SigmaProps =
( renderer :: Renderer
, settings :: SigmaSettings
, style :: SigmaStyle
, graph :: SigmaGraphData
, ref ::
(Nullable ReactRef) -> Effect Unit
, ref ::
SyntheticEventHandler (Nullable ReactRef)
, onClickNode :: SigmaNodeEvent -> Unit
, onOverNode :: SigmaNodeEvent -> Unit
, onOutNode :: SigmaNodeEvent -> Effect Unit
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
a1c7ab5d
...
...
@@ -209,7 +209,8 @@ render d p (State {sigmaGraphData, settings, legendData}) c =
, settings
, renderer : canvas
, style : sStyle { height : "96%"}
, ref: flip applyOnCamera <<< d <<< SaveCamera
, ref: applyOnCamera
--, ref: flip applyOnCamera $ d <<< SaveCamera
, onClickNode : \e -> unsafePerformEffect $ do
_ <- log "this should be deleted"
-- _ <- logs $ unsafeCoerce e
...
...
@@ -534,7 +535,8 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
[ sigma { graph, settings
, renderer : canvas
, style : sStyle { height : "95%"}
, ref: flip applyOnCamera <<< d <<< SaveCamera
, ref: applyOnCamera
-- , ref: flip applyOnCamera $ d <<< SaveCamera
, onClickNode : \e -> unsafePerformEffect $ do
_ <- log " hello 2"
--logs $ unsafeCoerce e
...
...
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