You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to set fx/fy on the root node of a radialout tree to keep it fixed instead of bouncing around cholerically (as in the example, but it does not work.
The properties get re-set to undefined here:
// Fix nodes to x,y for dag mode
if (state.dagMode) {
var getFFn = function getFFn(fix, invert) {
return function (node) {
return !fix ? undefined : (nodeDepths[node[state.nodeId]] - maxDepth / 2) * dagLevelDistance * (invert ? -1 : 1);
};
};
var fxFn = getFFn(['lr', 'rl'].indexOf(state.dagMode) !== -1, state.dagMode === 'rl');
var fyFn = getFFn(['td', 'bu'].indexOf(state.dagMode) !== -1, state.dagMode === 'bu');
state.graphData.nodes.filter(state.dagNodeFilter).forEach(function (node) {
node.fx = fxFn(node); <-------
node.fy = fyFn(node); <-------
});
}
I believe this should check if fx/fy is already set, and if so, not set it to undefined.
If I exclude the node using dagNodeFilter then fx/fy remain set, but the other nodes are not repelled and instead sit on top of the root for some reason.
I've just modified the handling of the nodes' f* attributes in the case of dag mode, so that it doesn't reset them to undefined unnecessary, as was happening in your case.
Trying to set
fx
/fy
on the root node of aradialout
tree to keep it fixed instead of bouncing around cholerically (as in the example, but it does not work.The properties get re-set to
undefined
here:I believe this should check if
fx
/fy
is already set, and if so, not set it toundefined
.If I exclude the node using
dagNodeFilter
thenfx
/fy
remain set, but the other nodes are not repelled and instead sit on top of the root for some reason.// edit: I can work around it by:
The text was updated successfully, but these errors were encountered: