Content-Length: 261503 | pFad | http://github.com/kieler/elkjs/issues/330

68 [Question] Clarify use within non-nodejs and non-browser use-cases · Issue #330 · kieler/elkjs · GitHub
Skip to content

[Question] Clarify use within non-nodejs and non-browser use-cases #330

Open
@peekxc

Description

@peekxc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/kieler/elkjs/issues/330

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy