Skip to content

Commit 92be61a

Browse files
committed
Updates
1 parent 675b49f commit 92be61a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cytoscape-elk.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ var defaults = {
130130
// Callback on layoutready
131131
stop: undefined,
132132
// Callback on layoutstop
133+
nodeLayoutOptions: undefined,
134+
// Special options for only the nodes
133135
elk: {
134136
// Options to pass directly to ELK `layoutOptions`. The subsequent identifier has to be used as property key in quotes.
135137
// E.g. for 'org.eclipse.elk.direction' use:
@@ -183,7 +185,12 @@ var makeNode = function makeNode(node, options) {
183185
var k = {
184186
_cyEle: node,
185187
id: node.id()
186-
};
188+
}; // Apply nodeLayoutOptions per user-specified function
189+
// e.g. nodeLayoutOptions => n.scratch('layoutOptions')
190+
191+
if (options.nodeLayoutOptions) {
192+
k.layoutOptions = options.nodeLayoutOptions(node);
193+
}
187194

188195
if (!node.isParent()) {
189196
var dims = node.layoutDimensions(options);

0 commit comments

Comments
 (0)