{"name":"dagrejs","version":"0.1.0","description":"Layered layout for directed acyclic graph","license":"MIT","main":"index.js","keywords":["graph","layout"],"dependencies":{"graphlib":"^2.1.8","lodash":"^4.17.19"},"devDependencies":{"benchmark":"2.1.4","browserify":"16.5.1","chai":"4.2.0","eslint":"7.4.0","jshint":"2.11.1","jshint-stylish":"2.2.1","karma":"5.1.0","karma-chrome-launcher":"3.1.0","karma-firefox-launcher":"1.3.0","karma-mocha":"2.0.1","karma-phantomjs-launcher":"1.0.4","karma-requirejs":"1.1.0","karma-safari-launcher":"1.0.0","mocha":"8.2.0","phantomjs-prebuilt":"2.1.16","requirejs":"2.3.6","semver":"7.3.2","sprintf":"0.1.5","uglify-js":"3.10.0"},"repository":{"type":"git","url":"git+https://github.com/brickmaker/dagre.git"},"gitHead":"9a31790639430f18ee9b946b9175324632184fc6","bugs":{"url":"https://github.com/brickmaker/dagre/issues"},"homepage":"https://github.com/brickmaker/dagre#readme","_id":"dagrejs@0.1.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ySCtUjzHA/RGhH+7XJ8YeUXezr11nlDlPNRfPTf/ka7vlqAzQH2EpjgMHxcQURmz5/fGYwK+CerK9chZuZI/5w==","shasum":"0a591fa5f485836d1fa5c5ba191a9fe6c2610fdb","tarball":"http://registry-npm.ywwl.com/dagrejs/download/dagrejs-0.1.0.tgz","fileCount":61,"unpackedSize":1605979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCQmiCRA9TVsSAnZWagAAmAUQAIhDxfvHybAyP9Sy/jIM\n+86qYUQE9G7/4YBFJfq3e2eMPpIOSb/5pGYC2g2mMvTKPu9xKPqWFtK0aNKo\n9id5h7PF/an1nujz3XBo+U97+s8Zx3PY80CjhxMx4h9dIvlpXmUxdLNJUJJ7\nDSq4vbv9gPEBCAf+Wqyo+vyqlGlkwFSwzFU3cKWjLYuJT9fYmLPo5aBgmFJc\nF1JqvkBf9s397dGMrhsAwbN17fq8Zah8+GxTQN+y4zmjENueJQtXmPdDd9qv\n/xHFRJFqE2u6uROyhPi9hvGzkKBVDlncJWhaGQPlOsdHf4auh4sZ5PH7NiWO\nJiNOugd5Xsd07wy8IBQJN/ekkoAJyOHzgxEjxK6K5LV4EBSu8rya5ftpvLH3\nVAxGtLynIeP6CNqzgo2b1tpDG5zFLjOoLXMJ0g+qlkGL6PAkIYIC8yhPmn4R\nB0Q0p9hMJYxlG/RsUfm41+Qac1Cw5wui3hm6Gar4bR7fnmMzyEBzW5b9Ho+u\n7aCLUQ5c9aIKq4+FnWgpPbIBsOxhS+1/uQXXRYJGlqSAkLo1Of92loH02iAU\ntxKfuHUviwTAV5YgFs5VcXbfSDJEQZGKDuiCDStfO1lSRxoh+bfWnIZfZosP\n97DxvmICCEcfzzGv8MAiFAOK39K/6hcGc/3zs2Y6Ho1A7srwpp1EwAejFOx2\ngu/V\r\n=O25+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgRg6oZskJC4y1cqsXVmrkYobzgZK6K70hBryjHRNNOAiAPtLv3ItTzkEoHo+8oFqAXeYEZQbxUVDjXGl1vji7sGQ=="}],"size":402154,"noattachment":false,"key":"/dagrejs/-/dagrejs-0.1.0.tgz"},"_npmUser":{"name":"xdzhao","email":"zhaoxiaodong@zju.edu.cn"},"directories":{},"maintainers":[{"name":"xdzhao","email":"zhaoxiaodong@zju.edu.cn"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dagrejs_0.1.0_1627982242316_0.5161164541896024"},"_hasShrinkwrap":false,"readme":"# dagrejs - Layered layout for directed acyclic graph\n\n**This project is a fork from [dagre](https://github.com/dagrejs/dagre). For more information prelase refer to origin project.**\n\n## Enhanced features\n\nNew features:\n* support specify layer(rank) for certain node\n* support manually control nodes' order\n* support keep origin layout when re-layout with nodes added\n\nOptimizations:\n* rewrite rank algorithm to support assign layer\n* consider previous iteration result at node-ordering step\n* support generate `edgeLabelSpacing` or not, which controls generate dummy node between nodes\n\n## Usage\n\n> For full usage please refer to dagre's documentation: https://github.com/dagrejs/dagre/wiki.\n\n### edgeLabelSpace\n\nDefault dagre always generate dummy node for every edge, which can be used for edge's curve drawing, etc. If you do not need it, disable it in layout's options:\n\n```js\ndagre.layout(g, {\n  edgeLabelSpace: false\n})\n```\n\nBellow shows graph with or without `edgeLabelSpace`:\n\n![](./assets/edgeLabelSpace.jpg)\n![](./assets/noEdgeLabelSpace.jpg)\n\n### Specify layer\n\nNow you can manually specify node's layer(rank) by add layer in node's attribute:\n\n```js\nconst data = {\n    nodes: [\n        { id: '0' },\n        { id: '1', layer: 1 },\n        { id: '2', layer: 3 },\n        { id: '3' },\n    ],\n    // edges: [...]\n}\n\ndata.nodes.forEach((n) => {\n    g.setNode(n.id, n);\n});\n```\n\nCaution:\n* layer is **0-indexed**, which means the root node's layer is 0\n* manual layer **should not** violate DAG's properties (e.g. You cannot assign a layer value for a target node greater or equal to cresponding source node.)\n\n### Control nodes' order\n\nSometimes we want to manually control nodes' order in every layer in case of unexpected result caused by alogrithm. Now we can also configurate in options.\n\n```js\ndagre.layout(g, {\n  keepNodeOrder: true,\n  nodeOrder: ['3', '2', '1', '0'] // an array of nodes's ID.\n});\n```\n\nA common usage is keeping data's order:\n```js\nconst data = {\n    nodes: [\n        { id: '0' },\n        { id: '2' },\n        { id: '3' },\n        { id: '1' },\n    ],\n    // edges: [...]\n}\n\ndagre.layout(g, {\n  keepNodeOrder: true,\n  nodeOrder: data.nodes.map(n => n.id)\n});\n```\n\nCaution:\n* The order only work at same layer ordering step. It does not affect the layer assignment step.\n* Like specifying layer, internally the library added `fixorder` attribute for each node. Of cause you can manually set this attribute, but it introduces ambiguity.\n\n### Keep origin layout\n\nWhen re-layout with small modification, we may want to keep origin layout result. Now we can pass the origin graph to new layout function:\n\n```js\ndagre.layout(originGraph) // layout() will internally modify originGraph\ndagre.layout(\n  g,\n  {\n    prevGraph: originGraph // pass originGraph to new function\n  }\n);\n```\n\nFor full example please refer to `add-subgraph` example in examples folder.","publish_time":1627982242517,"_cnpm_publish_time":1627982242517,"dist-tags":{"latest":"0.2.1"}}