Open
Description
Ask your questions
I'm able to get the example from the readme working in two situations:
- Using
nodejs
, or - Using a browser
However, when I try to call elkjs through e.g. pythonmonkey
:
elkjs_bundled = Path("./node_modules/elkjs/lib/elk.bundled.js").read_text()
pm.eval(elkjs_bundled)
ELK = pm.new("ELK")
elk = ELK()
elk_graph = json.load(< example graph from readme >)
fut = elk.layout(elk_graph)
fut.add_done_callback(print)
I get the following error:
Uncaught TypeError: can't access property "max", $wnd.Math is undefined
Wp@evaluate:4113:22
Io@evaluate:4933:34
IEd@evaluate:5079:38
QId@evaluate:6210:61
h/this.dispatch@evaluate:6523:476
h/this.saveDispatch@evaluate:6523:603
j/this.postMessage/<@evaluate:6524:162
Presumably this is related to the Java compile to JS using GWT, but the main thing here is that there is no window object with which to rely on.