Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workerScript should be able to be set globally #1

Open
forresto opened this issue Jun 3, 2014 · 3 comments
Open

workerScript should be able to be set globally #1

forresto opened this issue Jun 3, 2014 · 3 comments

Comments

@forresto
Copy link

forresto commented Jun 3, 2014

We set the workerScript location in klay.init:

     this.autolayouter = klay.init({
       onSuccess: this.applyAutolayout.bind(this),
       workerScript: "../bower_components/klay-js/klay-worker.js"
    });

But there should be a way to do it globally. So

window.KLAY_CONFIG = { workerScript: "./bower_components/klay-js/klay-worker.js" }

and

  if ("KLAY_CONFIG" in window && "workerScript" in window.KLAY_CONFIG) {
    workerScript = window.KLAY_CONFIG.workerScript;
  } else if ("workerScript" in params) {
    workerScript = params.workerScript;
  } else {
    workerScript = "klay-worker.js";
  }    

This was an issue in noflo/visualize b/c we're using the-graph as a bower dependency, klay.init needs to happen in the-graph custom element, and the worker script path is different b/c it is hosted here: http://noflojs.org/visualize/

forresto added a commit to noflo/visualize that referenced this issue Jun 3, 2014
forresto added a commit to noflo/visualize that referenced this issue Jun 3, 2014
@forresto
Copy link
Author

forresto commented Jun 3, 2014

(Changed to KLAY_CONFIG to mirror GSS's config.)

@kelegorm
Copy link

klay-wroker.js still is problem. Will you fix it?

@uruuru
Copy link
Collaborator

uruuru commented Nov 28, 2014

Hi, I improved the the underlying library code which you can find in another repository. Maybe that helps you. If not, let me know.

See https://github.com/OpenKieler/klayjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants