forked from dagrejs/dagre
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ordering] add bias constraints to graph opts
Add ability to pass in a list of graph constraints (list of high node vs low node relationships) to influence the ordering of the graph. Useful for picking which way edges go and for making a layout more 'stable' (the onesignal use case is making all branch edges of the same type go the same way). This is essentially this commit by izhan izhan@4b40097 in this PR dagrejs#302 with a couple changes - high/low over left/right plus some type overrides (alternatively could fork definitelytyped and put the changes there)
- Loading branch information
1 parent
c8bb4a1
commit 1c998f3
Showing
4 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import "dagre"; | ||
|
||
declare module "dagre" { | ||
interface Constraint { | ||
high: string; | ||
low: string; | ||
} | ||
|
||
interface Options { | ||
constraints?: Constraint[]; | ||
} | ||
|
||
function layout(g: graphlib.Graph, opts: Options): void; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters