Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Standard Linker
    I.e. GWT's IFrameLinker that "loads the GWT module in a separate iframe".
  • Custom Linker
    The linker extends GWT's DirectInstallLinker and enables the library to be used with, for instance, Chrome Packaged Apps. According to the javadoc the linker "adds a script tag to the iframe rather than downloading the code as a string and then installing it into the iframe". However, when using this linker a lot of GWT's variables will be added to the global namespace.
  • Web Worker Linker
    The linker allows to use our library with a Web Worker. It removes GWT generations that are not required for our use case, e.g. loading of browser specific permutations. A bower component is available on GitHub, a specific example further down on this page.

 

Panel
titleReleases
Near future

...

Panel
titleBower Component on GitGub (Web Worker)
https://github.com/automata/klay-js

...

Code Block
languagejs
<!doctype html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>KIELER Klay JS Layout Test</title>
    <!--
      <script type="text/javascript" src="bower_components/klay-js/klay/klay.nocache.js"></script>
       
      <script src="klay-ww/klay.nocache.js"></script>
      -->
  </head>
  <body>
    <h1>KIELER Klay JS Layout Test</h1>
  </body>
  <script>
    (function () {
      // assemble a graph
      var graph = {
        "id": "root",
        "properties": {
          "direction": "DOWN",
          "spacing": 40
        },
        "children": [{
          "id": "n1",
          "width": 40,
          "height": 40
        }, {
          "id": "n2",
          "width": 40,
          "height": 40
        }, {
          "id": "n3",
          "width": 40,
          "height": 40
        }],
        "edges": [{
          "id": "e1",
          "source": "n1",
          "target": "n2"
        }, {
          "id": "e2",
          "source": "n1",
          "target": "n3"
        }, {
          "id": "e3",
          "source": "n2",
          "target": "n3"
        }]
      };

      // Creates a KlayJS Web Worker
      var worker = new Worker('klayjs_worker.js');

      // Receives the layouted graph from the Web Worker
      worker.addEventListener('message', function (e) {
        console.log('Layouted graph:', e.data);
      }, false);

      // Sends the original graph to the Web Worker
      worker.postMessage({
        "graph": graph,
        "options": {
          "spacing": 50
        }
      });
    })();
  </script>
</html>

...