Unverified Commit 43e812aa authored by Mael NICOLAS's avatar Mael NICOLAS Committed by Nicolas Pouillard

[HELP] big issue that make computer crash!!

if you compile and go to graph, navigator will crash.
This is probably due with the call of dispatch(d) in Graph.purs.
Work perfectly fine with log instead of dispatch.
parent 0ef30a74
......@@ -45,7 +45,7 @@ const applyOnCamera = function(props, f){
const camera = props.sigma.cameras[0];
// console.log(camera);
// console.log(f);
f(camera);
f(camera)();
}
};
......
......@@ -254,14 +254,13 @@ type Camera =
angle :: Number
}
-- 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
......
......@@ -179,7 +179,8 @@ performAction DisplayEdges _ _ =
performAction (SaveCamera c) _ _ =
modifyState_ $ \(State s) -> do
State $ ((_camera) .~ (Just c)) s
State $ ((_camera) .~ cam) s
where cam = Just {x: 0.0, y: 0.0, ratio: 0.0, angle: 0.0}
--performAction (Zoom True) _ _ =
-- modifyState_ $ \() -> do
......@@ -539,7 +540,7 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
[ sigma { graph, settings
, renderer : canvas
, style : sStyle { height : "95%"}
, ref: applyOnCamera log -- d <<< SaveCamera
, ref: applyOnCamera $ d <<< SaveCamera
, onClickNode : \e ->
unsafePerformEffect $ do
_ <- log " hello 2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment