Commit 84ca8906 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[sigma.js] it works, but don't touch the graph or it crashes :)

parent cee15b12
......@@ -326,7 +326,8 @@ modeGraphType :: Types.Mode -> String
modeGraphType Types.Authors = "square"
modeGraphType Types.Institutes = "equilateral"
modeGraphType Types.Sources = "star"
modeGraphType Types.Terms = "def"
--modeGraphType Types.Terms = "def"
modeGraphType Types.Terms = "circle"
--------------------------------------------------------------
......
......@@ -63,6 +63,8 @@ mapEdges = runEffectFn2 _mapEdges
-- too much. We convert Types.Graph into Graphology.Graph and then
-- update Sigma.graph with this.
-- NOTE: See `sigmax.performDiff`
-- | Since we don't want to replace directly the sigma.graph, we call
-- update. This "intelligently" scans the `target` graph and updates
-- so that in the end it is the same as `source`.
......
......@@ -249,6 +249,11 @@ let _setSettings = function(g, settings) {
}
}
let _refresh = function(g) {
console.log('[refresh], g', g);
return g.refresh();
}
export { _sigma,
_addRenderer,
dummy as _bindMouseSelectorPlugin,
......@@ -257,4 +262,5 @@ export { _sigma,
_getEdges,
_getNodes,
_proxySetSettings,
_setSettings };
_setSettings,
_refresh };
......@@ -46,7 +46,8 @@ kill s = pure $ s ... "kill" $ []
-- | Call the `refresh()` method on a sigmajs instance.
refresh :: Sigma -> Effect Unit
refresh s = pure $ s ... "refresh" $ []
refresh = runEffectFn1 _refresh
--refresh s = pure $ s ... "refresh" $ []
-- | Type representing a sigmajs renderer.
foreign import data Renderer :: Type
......@@ -303,3 +304,4 @@ foreign import _proxySetSettings
settings
Unit
foreign import _setSettings :: forall settings. EffectFn2 Sigma settings Unit
foreign import _refresh :: EffectFn1 Sigma Unit
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