{"name":"cytoscape-dagre","version":"4.0.0","keywords":["cytoscape","cytoscape-extension"],"author":{"name":"Max Franz","email":"maxkfranz@gmail.com"},"license":"MIT","_id":"cytoscape-dagre@4.0.0","maintainers":[{"name":"cytoscapenpm","email":"cytoscapenpm@gmail.com"},{"name":"maxkfranz","email":"maxkfranz@gmail.com"},{"name":"dylanfong","email":"dylanfong.ut@gmail.com"},{"name":"mikekucera","email":"mikekucera@gmail.com"},{"name":"chrtannus","email":"chrtannus@gmail.com"}],"homepage":"https://github.com/cytoscape/cytoscape.js-dagre","bugs":{"url":"https://github.com/cytoscape/cytoscape.js-dagre/issues"},"dist":{"shasum":"8c673b6a37626c69506c3678965dec7c5359b040","tarball":"http://registry-npm.ywwl.com/cytoscape-dagre/download/cytoscape-dagre-4.0.0.tgz","fileCount":18,"integrity":"sha512-wsDgi1hHpWfslQxe/Gd/xCCeg2YUDrzwulhHOSI7fMfll92FFVY2AWhSRulLiOVcyDE4zz0rRd/+1TBTw+ew5Q==","signatures":[{"sig":"MEQCIEMMJQuX2Nn7IWeLtR1FZnLt+Z4ZfbE9BvDaHu1mGcInAiAs37dxDifGfLkcJrCbzHh6z4hkkbocCuMhKtq/Iyn4ZA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":826336,"size":219534,"noattachment":false,"key":"/cytoscape-dagre/-/cytoscape-dagre-4.0.0.tgz"},"main":"dist/cytoscape-dagre.js","types":"index.d.ts","module":"dist/cytoscape-dagre.mjs","exports":{".":{"types":"./index.d.ts","import":"./dist/cytoscape-dagre.mjs","require":"./dist/cytoscape-dagre.js"},"./package.json":"./package.json"},"gitHead":"95a80821061969bb07f14930ec2b52630ceb3f54","scripts":{"lint":"eslint src --ext .mjs","test":"run-s build test:mocha","build":"rollup -c","watch":"rollup -c --watch","gh-pages":"gh-pages -d pages","build:min":"rollup -c","copyright":"update license","test:mocha":"mocha \"test/**/*.test.mjs\"","postpublish":"run-s gh-pages","build:release":"run-s build build:min copyright"},"_npmUser":{"name":"maxkfranz","email":"maxkfranz@gmail.com"},"repository":{"url":"git+https://github.com/cytoscape/cytoscape.js-dagre.git","type":"git"},"_npmVersion":"11.5.1","description":"The Dagre layout for DAGs and trees for Cytoscape.js","directories":{},"_nodeVersion":"24.7.0","_hasShrinkwrap":false,"devDependencies":{"chai":"4.2.0","mocha":"8.1.1","eslint":"^7.6.0","rimraf":"^3.0.2","rollup":"^4.60.4","update":"^0.7.4","cpy-cli":"^3.1.1","gh-pages":"^5.0.0","camelcase":"^6.0.0","cross-env":"^7.0.2","@babel/core":"^7.29.0","npm-run-all":"^4.1.5","@dagrejs/dagre":"^3.0.0","updater-license":"^1.0.0","@babel/preset-env":"^7.29.2","@rollup/plugin-babel":"^7.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-commonjs":"^29.0.2","@rollup/plugin-node-resolve":"^16.0.3"},"peerDependencies":{"cytoscape":"^3.2.22"},"_npmOperationalInternal":{"tmp":"tmp/cytoscape-dagre_4.0.0_1780580080899_0.706140304858083","host":"s3://npm-registry-packages-npm-production"},"readme":"cytoscape-dagre\n================================================================================\n\n[![DOI](https://zenodo.org/badge/42206402.svg)](https://zenodo.org/badge/latestdoi/42206402)\n\n## Description\n\nThe Dagre layout for DAGs and trees for Cytoscape.js ([demo](https://cytoscape.github.io/cytoscape.js-dagre))\n\nThe `dagre` layout organises the graph using a DAG (directed acyclic graph) system, written by [Chris Pettitt](https://www.linkedin.com/in/chrismpettitt).  It is especially suitable for DAGs and trees.  For more information, please refer to [Dagre's documentation](https://github.com/dagrejs/dagre).\n\n## Dependencies\n\n * Cytoscape.js ^3.2.0\n * Dagre v3 is bundled into the distributed extension files\n\n\n## Usage instructions\n\nDownload the library:\n * via npm: `npm install cytoscape-dagre`,\n * via bower: `bower install cytoscape-dagre`, or\n * via direct download in the repository (probably from a tag).\n\nImport the library as appropriate for your project:\n\nES import:\n\n```js\nimport cytoscape from 'cytoscape';\nimport dagre from 'cytoscape-dagre';\n\ncytoscape.use( dagre );\n```\n\nCommonJS require:\n\n```js\nlet cytoscape = require('cytoscape');\nlet dagre = require('cytoscape-dagre');\n\ncytoscape.use( dagre ); // register extension\n```\n\nAMD:\n\n```js\nrequire(['cytoscape', 'cytoscape-dagre'], function( cytoscape, dagre ){\n  dagre( cytoscape ); // register extension\n});\n```\n\nPlain HTML/JS has the extension registered for you automatically, because no `require()` is needed.  Dagre v3 is bundled into `dist/cytoscape-dagre.js`, so you do not need to include a separate dagre script.\n\n\n## API\n\nCall the layout, e.g. `cy.layout({ name: 'dagre', ... }).run()`, with options:\n\n```js\nvar defaults = {\n  // dagre algo options, uses default value on undefined\n  nodeSep: undefined, // the separation between adjacent nodes in the same rank\n  edgeSep: undefined, // the separation between adjacent edges in the same rank\n  rankSep: undefined, // the separation between each rank in the layout\n  rankDir: undefined, // 'TB' for top to bottom flow, 'LR' for left to right,\n  align: undefined,  // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right\n  acyclicer: undefined, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.\n                        // A feedback arc set is a set of edges that can be removed to make a graph acyclic.\n  ranker: undefined, // Type of algorithm to assign a rank to each node in the input graph. Possible values: 'network-simplex', 'tight-tree' or 'longest-path'\n  minLen: function( edge ){ return 1; }, // number of ranks to keep between the source and target of the edge\n  edgeWeight: function( edge ){ return 1; }, // higher weight edges are generally made shorter and straighter than lower weight edges\n\n  // general layout options\n  fit: true, // whether to fit to viewport\n  padding: 30, // fit padding\n  spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n  nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node\n  animate: false, // whether to transition the node positions\n  animateFilter: function( node, i ){ return true; }, // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions\n  animationDuration: 500, // duration of animation in ms if enabled\n  animationEasing: undefined, // easing of animation if enabled\n  boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  transform: function( node, pos ){ return pos; }, // a function that applies a transform to the final node position\n  ready: function(){}, // on layoutready\n  sort: undefined, // a sorting function to order the nodes and edges; e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n                   // because cytoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when\n                   // defining the topology of a graph, this sort function can help ensure the correct order of the nodes/edges.\n                   // this feature is most useful when adding and removing the same nodes and edges multiple times in a graph.\n  stop: function(){} // on layoutstop\n  /**\n   * Enable bezier curves using dagre's control points\n   */\n  useDagreEdgeControlPoints: false, \n  /**\n   * Automatically adds edge class '.useDagreEdgeControlPoints' to all edges and configure it with this.dagreEdgeStyle.\n   * If set to `false` and `useDagreEdgeControlPoints` is `true` then apply `this.dagreEdgeStyle` yourself.\n   */\n  automaticDagreEdgeStyle: this.useDagreEdgeControlPoints,\n  /**\n   * Defines the style for rendering dagre edge control points stored by the layout algorithm\n   * if `useDagreEdgeControlPoints` is `true` and `automaticDagreEdgeStyle` is `true`\n   */\n  dagreEdgeStyle: {\n    'curve-style'             : 'unbundled-bezier',\n    'control-point-weights'   : ele => ele.scratch('controlPointWeights'),\n    'control-point-distances' : ele => ele.scratch('controlPointDistances'),\n    'edge-distances'          : 'intersection',\n    'edge-ends-overlap'       : false\n  }\n};\n```\n\nWhen `useDagreEdgeControlPoints` is `true` the layout algoritm maps Dagre's edge control points to Cytoscape edge coordinates. The `dagreEdgeStyle` default\nshows how to configure each edge to make use of the control points. If `automaticDagreEdgeStyle` is set to true, the layout will add a style (`.useDagreEdgeControlPoints`)\nto all edges and register the exact style given by `dagreEdgeStyle` for this class of edges. You can always role your own style instead, as long as you \ncopy the fields of `dagreEdgeStyle` exactly.\n\n## Build targets\n\n* `npm run test` : Run Mocha tests in `./test`\n* `npm run build` : Build `./src/**` into UMD and ESM files in `dist/`\n* `npm run watch` : Automatically rebuild Rollup outputs on changes\n* `npm run lint` : Run eslint on the source\n\nN.b. all builds use babel, so modern ES features can be used in the `src`.\n\n\n## Publishing instructions\n\nThis project is set up to automatically be published to npm and bower.  To publish:\n\n1. Build the extension : `npm run build:release`\n1. Commit the build : `git commit -am \"Build for release\"`\n1. Bump the version number and tag: `npm version major|minor|patch`\n1. Push to origin: `git push && git push --tags`\n1. Publish to npm: `npm publish .`\n1. If publishing to bower for the first time, you'll need to run `bower register cytoscape-dagre https://github.com/cytoscape/cytoscape.js-dagre.git`\n1. [Make a new release](https://github.com/cytoscape/cytoscape.js-dagre/releases/new) for Zenodo.\n","publish_time":1780580081104,"_cnpm_publish_time":1780580081104,"dist-tags":{"latest":"4.0.1"}}