{"name":"klayjs","version":"0.3.0","author":{"name":"Ulf Rueegg","email":"uru@informatik.uni-kiel.de"},"description":"Automatic graph layout based on Sugiyama's algorithm. Specialized for data flow diagrams and ports.","main":"klay.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/OpenKieler/klayjs.git"},"keywords":["graph","layout","layered","ports","dataflow"],"devDependencies":{"grunt":"~0.4.2","grunt-zip":"~0.13.0","grunt-curl":"~1.4.0","grunt-contrib-clean":"~0.5.0","grunt-rename":"~0.1.3","grunt-file-append":"~0.0.6"},"license":"EPL-1.0","gitHead":"68ab992b817d6229fc29b3886e1a29677feab4a2","bugs":{"url":"https://github.com/OpenKieler/klayjs/issues"},"homepage":"https://github.com/OpenKieler/klayjs","_id":"klayjs@0.3.0","_shasum":"1b7ccb80a871f2ac81bf06593ce0fe68bf667965","_from":"./","_npmVersion":"1.4.21","_npmUser":{"name":"uruuru","email":"uru@informatik.uni-kiel.de"},"maintainers":[{"name":"uruuru","email":"uru@informatik.uni-kiel.de"}],"dist":{"shasum":"1b7ccb80a871f2ac81bf06593ce0fe68bf667965","tarball":"http://registry-npm.ywwl.com/klayjs/download/klayjs-0.3.0.tgz","integrity":"sha512-jKiqiFw/XJAmTTuM38HzZxAJGjpW3+ZFALEdLhqgH/UDP6zXf+JzT7gzuo137a9RIuCM7mxCs3nSUGdzg8f4uQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoyQqWzLKa6FpY5/LqaVqS5Nc58B2vO05d5dMwv135bAIgWY09W/P9viZ+8G6R/d5IBCsasBzZOfYj8W+i1QmiMMU="}],"size":115514,"noattachment":false,"key":"/klayjs/-/klayjs-0.3.0.tgz"},"directories":{},"readme":"KLayJS\n===\n\nKLayJS is a layer-based layout algorithm that is particularly suited for\nnode-link diagrams with an inherent direction and ports \n(explicit attachment points on a node's border). It is based on the \nideas originally introduced by Sugiyama et al. \n\nThe algorithm is developed in Java and compiled to JavaScript using GWT. \nFor further information see the KIELER [Wiki pages][wiki-klay]. \n\nIn case you want to use the layout in conjunction with [D3.js][d3js] \nyou can take a look at our [KLayJS-D3][klayjs-d3] extension.\ngru\n\nExample Layout of a Ptolemy Diagram\n===\n![Ptolemy Diagram](http://rtsys.informatik.uni-kiel.de/~uru/ptolemy.png)\n\nInstallation\n===\nEither download the `klay.js` file or install it using `npm` or `bower`.\n```bash\nnpm install klayjs\n```\n```bash\nbower install klayjs\n```\n\nUsage\n===\nThe library can be used in the browser, in a WebWorker, and with server-side node.js. \n\nInput graph\n---\nWe use the [JSON KGraph][jsonkgraph] format to specify a graph with its properties. \nA minimal example looks like this:\n```js\nvar graph = {\n  \"id\": \"root\",\n  \"properties\": {\n      \"direction\": \"RIGHT\", \"spacing\": 40\n  },\n  \"children\": [{\"id\": \"n1\", \"width\": 40, \"height\": 40}, \n               {\"id\": \"n2\", \"width\": 40, \"height\": 40}],\n  \"edges\": [{\"id\": \"e1\", \"source\": \"n1\", \"target\": \"n2\"}]\n};\n```\n\nBrowser\n---\nWithin the browser KLayJS is registered globally with the `$klay` variable \nand can be used as follows. Note the difference between _local_ layout options\nspecified for specific elements in the graph and _global_ layout options \nthat are applied to every graph element.\n```html\n<script type=\"text/javascript\" src=\"klayjs.js\"></script>\n<script>\n$klay.layout({\n  graph: graph,\n  options: { spacing: 20 },\n  success: function(layouted) { console.log(layouted); },\n  error: function(error) { console.log(error); }\n});\n</script>\n```\n\nWeb Worker\n---\nDepending on the graph size the layout process can take \nsome time possibly freezing your browser (though it should be fast \nin most cases). Modern browsers support _web workers_, some kind of\nthreads for the browser. The following code snippet demonstrates\nhow to start and communicate with a web worker performing layout.\n\n```js\nvar worker = new Worker('klayjs.js');\n// send layout request\nworker.postMessage({\n  graph: [graph],\n  options: [options]\n});\n// \nworker.addEventListener('message', function (e) {\n  var graph = e.data;\n  // [ applyLayout(graph) ]\n}, false);\n```\n\nnode.js\n---\nFor rapid prototyping or headless diagram generation\nno browser is required and you might want to use node.js. \n\n```bash\nnpm install klayjs\n```\n\n```js\nvar klay = require('klayjs');\nklay.layout({\n  graph: [graph],\n  options: [options],\n  success: function(g) { console.log(g); }\n});\n```\n\nLayout Options\n---\nA broad variety of layout options is supported. The available options \nand their effects are discussed [here][wiki-layopts]\n\n### Differences\n- Other than for the original java version of the layouter, \n  the `layoutHierarchy` option is by default `true`.\n- If you intend to use the fixed layouter (`de.cau.cs.kieler.fixed`) at some point, you\n  have to set `layoutHierarchy` to `false`.\n\nExamples \n===\n\nSome examples using the [KLayJS-D3][klayjs-d3] extension are available at:\n- [Ports](http://openkieler.github.io/klayjs-d3/examples/ports/)\n- [Hierarchy](http://openkieler.github.io/klayjs-d3/examples/hierarchy/)\n- [Interactive](http://openkieler.github.io/klayjs-d3/examples/interactive/)\n- [Miserables](http://openkieler.github.io/klayjs-d3/examples/miserables/) (Data From D3 Force Example)\n\nSee the `examples` folder of the klayjs-d3 project.\n\n#### SCChart with Dataflow\n![SCChart with Dataflow](http://rtsys.informatik.uni-kiel.de/~uru/scchartsdataflow.png)\n\n#### Sequentially Constructive Graph\n![Sequentially Constructive Graph](http://rtsys.informatik.uni-kiel.de/~uru/scg.png)\n\n[wiki-klay]: http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/KLay+Layered\n[wiki-layopts]: http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/KLay+Layered+Layout+Options\n[jsonkgraph]: http://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/JSON+Graph+Format\n[klayjs-d3]: https://github.com/OpenKieler/klayjs-d3\n[d3js]: http://d3js.org/","publish_time":1422460172219,"_cnpm_publish_time":1422460172219,"dist-tags":{"latest":"0.4.1"}}