Skip to content

Commit

Permalink
Clock on first layer for elk layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed Jul 27, 2021
1 parent 6ba4011 commit fe9bad0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/elkjs.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import elkjs from 'elkjs/lib/elk.bundled.js';
import { Input, Output } from "./cells/io";
import { Clock, Input, Output } from "./cells/io";

function to_elkjs(graph) {
const elkGraph = {
Expand Down Expand Up @@ -51,7 +51,8 @@ function to_elkjs(graph) {
ports: ports,
properties: {
portConstraints: 'FIXED_POS',
layerConstraint: cell instanceof Input ? "FIRST" : cell instanceof Output ? "LAST" : "NONE"
layerConstraint: (cell instanceof Input || cell instanceof Clock) ? "FIRST"
: cell instanceof Output ? "LAST" : "NONE"
}
});
}
Expand Down

0 comments on commit fe9bad0

Please sign in to comment.