Skip to content

Commit

Permalink
Merge pull request #90 from ethan-keller/align-acyclicer-options
Browse files Browse the repository at this point in the history
Align and acyclicer options
  • Loading branch information
maxkfranz authored Jan 27, 2022
2 parents f2b4cfe + 19feca8 commit 2aadb1c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ var defaults = {
edgeSep: undefined, // the separation between adjacent edges in the same rank
rankSep: undefined, // the separation between each rank in the layout
rankDir: undefined, // 'TB' for top to bottom flow, 'LR' for left to right,
align: undefined, // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right
acyclicer: undefined, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.
// A feedback arc set is a set of edges that can be removed to make a graph acyclic.
ranker: undefined, // Type of algorithm to assign a rank to each node in the input graph. Possible values: 'network-simplex', 'tight-tree' or 'longest-path'
minLen: function( edge ){ return 1; }, // number of ranks to keep between the source and target of the edge
edgeWeight: function( edge ){ return 1; }, // higher weight edges are generally made shorter and straighter than lower weight edges
Expand Down
4 changes: 4 additions & 0 deletions cytoscape-dagre.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ DagreLayout.prototype.run = function () {
setGObj('edgesep', options.edgeSep);
setGObj('ranksep', options.rankSep);
setGObj('rankdir', options.rankDir);
setGObj('align', options.align);
setGObj('ranker', options.ranker);
setGObj('acyclicer', options.acyclicer);
g.setGraph(gObj);
g.setDefaultEdgeLabel(function () {
return {};
Expand Down Expand Up @@ -304,6 +306,8 @@ var defaults = {
rankSep: undefined,
// the separation between adjacent nodes in the same rank
rankDir: undefined,
// alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right
align: undefined,
// 'TB' for top to bottom flow, 'LR' for left to right,
ranker: undefined,
// Type of algorithm to assigns a rank to each node in the input graph.
Expand Down
3 changes: 3 additions & 0 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ let defaults = {
edgeSep: undefined, // the separation between adjacent edges in the same rank
rankSep: undefined, // the separation between adjacent nodes in the same rank
rankDir: undefined, // 'TB' for top to bottom flow, 'LR' for left to right,
align: undefined, // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right
acyclicer: undefined, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.
// A feedback arc set is a set of edges that can be removed to make a graph acyclic.
ranker: undefined, // Type of algorithm to assigns a rank to each node in the input graph.
// Possible values: network-simplex, tight-tree or longest-path
minLen: function( edge ){ return 1; }, // number of ranks to keep between the source and target of the edge
Expand Down
2 changes: 2 additions & 0 deletions src/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ DagreLayout.prototype.run = function(){
setGObj( 'edgesep', options.edgeSep );
setGObj( 'ranksep', options.rankSep );
setGObj( 'rankdir', options.rankDir );
setGObj( 'align', options.align);
setGObj( 'ranker', options.ranker );
setGObj( 'acyclicer', options.acyclicer);

g.setGraph( gObj );

Expand Down

0 comments on commit 2aadb1c

Please sign in to comment.