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
b889ed13
Unverified
Commit
b889ed13
authored
Jan 21, 2019
by
Mael NICOLAS
Committed by
Nicolas Pouillard
Apr 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[HELP] working on a basic alert ffi
Problem with type for myGoto
parent
0538f5ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
Sigmajs.js
src/Gargantext/Components/GraphExplorer/Sigmajs.js
+6
-0
Sigmajs.purs
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
+7
-3
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+2
-1
No files found.
src/Gargantext/Components/GraphExplorer/Sigmajs.js
View file @
b889ed13
...
...
@@ -39,3 +39,9 @@ exports.sigmaEnableWebGLClass = SJS.SigmaEnableWebGL;
exports
.
forceLinkClass
=
FL
.
default
;
}
const
myGoto
=
function
(
sigma
){
alert
(
"My goto ffi"
);
};
exports
.
myGoto
=
myGoto
;
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
View file @
b889ed13
...
...
@@ -2,8 +2,11 @@ module Gargantext.Components.GraphExplorer.Sigmajs where
import Prelude
import Data.Nullable (Nullable)
import Data.Unit (Unit)
import Effect (Effect)
import React (Children, ReactClass, ReactElement, createElement, unsafeCreateElement)
import React (Children, ReactClass, ReactElement, ReactRef, createElement, unsafeCreateElement)
import React.DOM.Props (Props)
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Types (class Optional)
...
...
@@ -242,12 +245,14 @@ sigmaSettings :: forall o. Optional o SigmaSettingProps => { | o } -> SigmaSetti
sigmaSettings = unsafeCoerce
foreign import data SigmaStyle :: Type
foreign import myGoto :: Nullable ReactRef -> Effect Unit
type SigmaProps =
( renderer :: Renderer
, settings :: SigmaSettings
, style :: SigmaStyle
, graph :: SigmaGraphData
, ref :: (Nullable ReactRef -> Effect Unit) -> Props
, onClickNode :: SigmaNodeEvent -> Unit
, onOverNode :: SigmaNodeEvent -> Unit
, onOutNode :: SigmaNodeEvent -> Effect Unit
...
...
@@ -311,13 +316,12 @@ newtype ScalingMode = ScalingMode String
scalingMode :: { inside :: ScalingMode
, outside :: ScalingMode
}
scalingMode =
{ inside : ScalingMode "inside"
, outside : ScalingMode "outside"
}
type SigmaSettingProps =
( clone :: Boolean
, immutable :: Boolean
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
b889ed13
...
...
@@ -25,7 +25,7 @@ import Effect.Aff (Aff, attempt)
import Effect.Aff.Class (liftAff)
import Effect.Class (liftEffect)
import Effect.Console (log)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2,
myGoto,
sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import Gargantext.Components.GraphExplorer.Types (Cluster(..), MetaData(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Components.Login.Types (AuthData(..), TreeId)
import Gargantext.Components.RandomText (words)
...
...
@@ -192,6 +192,7 @@ render d p (State {sigmaGraphData, settings, legendData}) c =
[ sigma { graph, settings
, renderer : canvas
, style : sStyle { height : "95%"}
, ref: myGoto
, onClickNode : \e -> unsafePerformEffect $ do
_ <- log "hello"
-- _ <- 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