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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
e69f0940
Unverified
Commit
e69f0940
authored
Feb 14, 2019
by
James Laver
Committed by
Nicolas Pouillard
Apr 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make graph explorer camera manipulation compile
parent
a1c7ab5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
Sigmajs.purs
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
+8
-7
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+3
-4
No files found.
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
View file @
e69f0940
...
...
@@ -4,7 +4,7 @@ import Prelude
import Data.Nullable (Nullable)
import Effect (Effect)
import Effect.Uncurried (EffectFn
2
, runEffectFn2)
import Effect.Uncurried (EffectFn
1, EffectFn2, mkEffectFn1
, runEffectFn2)
import React (Children, ReactClass, ReactElement, ReactRef, SyntheticEventHandler, createElement, unsafeCreateElement)
import Thermite (EventHandler)
import Unsafe.Coerce (unsafeCoerce)
...
...
@@ -254,13 +254,14 @@ type Camera =
angle :: Number
}
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
-- foreign import applyOnCameraImpl :: EffectFn2 (a → b) (Nullable ReactRef)
-- applyOnCamera = applyOnCameraImpl
foreign import applyOnCameraImpl :: forall a. EffectFn2 (Nullable ReactRef) (a -> EventHandler) Unit
applyOnCamera :: forall a. (a -> EventHandler) -> EffectFn1 (Nullable ReactRef) Unit
applyOnCamera a = mkEffectFn1 h
where h :: Nullable ReactRef -> Effect Unit
h r = runEffectFn2 applyOnCameraImpl r a
type SigmaProps =
( renderer :: Renderer
, settings :: SigmaSettings
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
e69f0940
...
...
@@ -209,8 +209,8 @@ render d p (State {sigmaGraphData, settings, legendData}) c =
, settings
, renderer : canvas
, style : sStyle { height : "96%"}
, ref: applyOnCamera
--, ref: flip applyOnCamera $ d <<< SaveCamera
--
, ref: applyOnCamera
, ref: applyOnCamera $ (d <<< SaveCamera)
, onClickNode : \e -> unsafePerformEffect $ do
_ <- log "this should be deleted"
-- _ <- logs $ unsafeCoerce e
...
...
@@ -535,8 +535,7 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
[ sigma { graph, settings
, renderer : canvas
, style : sStyle { height : "95%"}
, ref: applyOnCamera
-- , ref: flip applyOnCamera $ d <<< SaveCamera
, ref: 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