{"name":"cytoscape-fcose","version":"1.0.0","description":"The fCoSE layout for Cytoscape.js by Bilkent with fast compound node placement","main":"cytoscape-fcose.js","author":{"name":"iVis-at-Bilkent"},"scripts":{"postpublish":"run-s gh-pages","gh-pages":"gh-pages -d pages","copyright":"update license","lint":"eslint src","build":"cross-env NODE_ENV=production webpack","build:min":"cross-env NODE_ENV=production MIN=true webpack","build:release":"run-s build copyright","watch":"webpack --progress --watch","dev":"webpack-dev-server --open","test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/iVis-at-Bilkent/cytoscape.js-fcose.git"},"keywords":["cytoscape","cytoscape-extension"],"license":"MIT","bugs":{"url":"https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues"},"homepage":"https://github.com/iVis-at-Bilkent/cytoscape.js-fcose","devDependencies":{"babel-core":"^6.24.1","babel-loader":"^7.0.0","babel-preset-env":"^1.5.1","camelcase":"^4.1.0","chai":"4.0.2","cpy-cli":"^1.0.1","cross-env":"^5.0.0","eslint":"^3.9.1","gh-pages":"^1.0.0","mocha":"3.4.2","npm-run-all":"^4.1.2","rimraf":"^2.6.3","update":"^0.7.4","updater-license":"^1.0.0","webpack":"^2.6.1","webpack-dev-server":"^2.4.5"},"peerDependencies":{"cytoscape":"^3.2.0"},"dependencies":{"numeric":"1.2.6","cose-base":"^1.0.0"},"gitHead":"41c84197145547b88ea8cadf311bb3b24184c57d","_id":"cytoscape-fcose@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"ivisatbilkent","email":"ivisatbilkent@gmail.com"},"dist":{"integrity":"sha512-tEVGs+Kivb8ddFcZV5TGxtqLdCydemdGUX/7droT+oT92SkeE+LEQ+qhvaFwSFFM7v1UKbZ3xnkBFi+EZDXCFg==","shasum":"fd91517a8d1f84aa487e95ffa34b525a0ae19a1b","tarball":"http://registry-npm.ywwl.com/cytoscape-fcose/download/cytoscape-fcose-1.0.0.tgz","fileCount":18,"unpackedSize":120743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsIejCRA9TVsSAnZWagAAZMkP/jbqJXi3QdIpn5EeBCLo\nDxCIQo3aOOd7nFOJVVE1lgj6vP5sfeXcWc3BdW8VDYFY2cQgHPJhsG6fbOl/\ndGiOIACW7C7pSWmeFHVnTVsWbjXZBVLSk4DFsn0GusJuTbJrbzeQsTyjDbq0\nZaxJ1+gWfbEWl8bfd0x75XSselWzL29+kJ4Ntee3W3uhekV6cRbZNlhfEp2w\nu1n2BseqA4U847UjXlL3/Ck8J5e+KwL6qDl3RhthR3axf4aCEnJpNxIjG9uU\nP05nSwLsfRhecB8TC4dIoCE80DFOPrfazIP8bX80Vjsq1487VUBKkzoYaNni\nyJ7Up68D3K+5shV+ZCTGGff94UOnp1VxrHGKnMZggQsCKNW//mXL7c52RkHY\nucbBmq1o9dZ9guWQDW4fISfRJKFRPuModpd8IGh2urFRBZjc5yPDbswrd9TQ\nBL5Kly3FpOCjwefuHgM6eGRwekx/SNnJlXcMJkgueLUfsYB51FDdxO/dpMie\nbGpIJnOoRDRuy0hqVVtb3baepu9VP1DCsQUBoFZuBdyAd6J05sQ7O8DUTjNC\nc+pCYjBZQ8Mr5GkoHJ6+hc3nGFl9opNgD6DqQqOGUw5+r0VNFmi6oTIbqczH\nBAGffcZ/9xRiGtPp5AHGojINHNXwKegSXyQEw6FsXNZ1VmJmQlGTdGLyum1p\nJzF5\r\n=lkgO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5ezqPDjCK6WRzRbUQ6j4w+9odTTXis9Hj6FTAFLrBeAIgNxeUBLWi70Eefw5ecDspKvopxJddba4E1XAW1N2GED0="}],"size":26023,"noattachment":false,"key":"/cytoscape-fcose/-/cytoscape-fcose-1.0.0.tgz"},"maintainers":[{"name":"ivisatbilkent","email":"ivisatbilkent@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cytoscape-fcose_1.0.0_1555072930775_0.6083452460158532"},"_hasShrinkwrap":false,"readme":"cytoscape-fcose\n================================================================================\n\n\n## Description\n\n\nfCoSE (pron. \"f-cosay\", **f**ast **Co**mpound **S**pring **E**mbedder), is a faster version of our earlier compound spring embedder algorithm named [CoSE](https://github.com/cytoscape/cytoscape.js-cose-bilkent), implemented as a Cytoscape.js extension by [i-Vis Lab](http://cs.bilkent.edu.tr/~ivis/) in Bilkent University.\n\nHere are some demos: **simple**, **compound**, and **constraints**, respectively:\n<p align=\"center\">\n<a href=\"https://ivis-at-bilkent.github.io/cytoscape.js-fcose/demo/demo.html\" title=\"Simple\"><img src=\"https://www.cs.bilkent.edu.tr/~ivis/images/demo1.png\" height=42px></a> &emsp;\n<a href=\"https://ivis-at-bilkent.github.io/cytoscape.js-fcose/demo/demo-compound.html\" title=\"Compound\"><img src=\"https://www.cs.bilkent.edu.tr/~ivis/images/demo2.png\" height=42px></a> &emsp;\n<a href=\"https://ivis-at-bilkent.github.io/cytoscape.js-fcose/demo/demo-constraint.html\" title=\"Constraints\"><img src=\"https://www.cs.bilkent.edu.tr/~ivis/images/demo3.png\" height=42px></a>\n</p>\n\nfCoSE layout algorithm combines the speed of spectral layout with the aesthetics of force-directed layout. fCoSE runs up to 2 times as fast as CoSE while achieving similar aesthetics.\n\n<p align=\"center\"><img src=\"demo/demo.gif\" width=\"440\"></p>\n\nFurthermore, fCoSE also supports a fairly rich set of constraint types (i.e., fixed position, vertical/horizontal alignment and relative placement).\n\n<p align=\"center\"><img src=\"demo/incrementalConstraints.gif\" width=\"800\"></p>\n\nYou can see constraint support in action in the following videos: [fixed node](https://youtu.be/vRZVlwntzGY), [alignment](https://youtu.be/O5rddJ7DteU), [relative placement](https://youtu.be/Xcm87bT50RA), [hybrid](https://youtu.be/KRAQHmnTvUA), [real life graphs](https://youtu.be/vTPy9G2ALcI). Constraints can also be added [incrementally](https://youtu.be/DTm2WmzwP4k) on a given layout. \n\nPlease cite the following when you use this layout:\n\nH. Balci and U. Dogrusoz, \"[fCoSE: A Fast Compound Graph Layout Algorithm with Constraint Support](https://doi.org/10.1109/TVCG.2021.3095303),\" in IEEE Transactions on Visualization and Computer Graphics, 28(12), pp. 4582-4593, 2022.\n\nU. Dogrusoz, E. Giral, A. Cetintas, A. Civril and E. Demir, \"[A Layout Algorithm For Undirected Compound Graphs](http://www.sciencedirect.com/science/article/pii/S0020025508004799)\", Information Sciences, 179, pp. 980-994, 2009.\n\n## Dependencies\n\n * Cytoscape.js ^3.2.0\n * cose-base ^2.0.0\n * cytoscape-layout-utilities.js (optional for packing disconnected components) ^1.0.0\n\n## Documentation\n\nfCoSE supports user-defined placement constraints as well as its full support for compound graphs. These constraints may be defined for simple nodes. Supported constraint types are:\n\n* **Fixed node constraint:** The user may provide *exact* desired positions for a set of nodes called *fixed nodes*. For example, in order to position node *n1* to *(x: 100, y: 200)* and node *n2* to *(x: 200, y: -300)* as a result of the layout, ```fixedNodeConstraint``` option should be set as follows:   \n\n  ```js\n  fixedNodeConstraint: [{nodeId: 'n1', position: {x: 100, y: 200}},\n    {nodeId: 'n2', position: {x: 200, y: -300}}],\n  ```\n\n* **Alignment constraint:** This constraint aims to align two or more nodes (with respect to their centers) vertically or horizontally. For example, for the vertical alignment of nodes {*n1, n2, n3*} and {*n4, n5*}, and horizontal alignment of nodes {*n2, n4*} as a result of the layout, ```alignmentConstraint``` option should be set as follows:\n  ```js\n  alignmentConstraint: {vertical: [['n1', 'n2', 'n3'], ['n4', 'n5']], horizontal: [['n2', 'n4']]},\n  ```\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***Note:** Alignment constraints in a direction must be given in most compact form. Example: ```['n1', 'n2', 'n3']``` instead of ```['n1', 'n2'], ['n1', 'n3']```.* \n\n* **Relative placement constraint:** The user may constrain the position of a node relative to another node in either vertical or horizontal direction. For example, in order to position node *n1* to be above of node *n2* by at least 100 pixels and position node *n3* to be on the left of node *n4* by at least 75 pixels as a result of the layout, ```relativePlacementConstraint``` option should be set as follows: \n\n  ```js\n  relativePlacementConstraint: [{top: 'n1', bottom: 'n2', gap: 100}, \n     {left: 'n3', right: 'n4', gap: 75}],\n  ```\n  The `gap` property is optional. If it is omitted, average `idealEdgeLength` is used as the gap value.\n\n## Usage instructions\n\nDownload the library:\n * via npm: `npm install cytoscape-fcose`,\n * via bower: `bower install cytoscape-fcose`, 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 fcose from 'cytoscape-fcose';\n\ncytoscape.use( fcose );\n```\n\nCommonJS require:\n\n```js\nlet cytoscape = require('cytoscape');\nlet fcose = require('cytoscape-fcose');\n\ncytoscape.use( fcose ); // register extension\n```\n\nAMD:\n\n```js\nrequire(['cytoscape', 'cytoscape-fcose'], function( cytoscape, fcose ){\n  fcose( cytoscape ); // register extension\n});\n```\n\nPlain HTML/JS has the extension registered for you automatically, because no `require()` is needed. Just add the following files:\n\n```\n<script src=\"https://unpkg.com/layout-base/layout-base.js\"></script>\n<script src=\"https://unpkg.com/cose-base/cose-base.js\"></script>\n<script src=\"https://unpkg.com/cytoscape-fcose/cytoscape-fcose.js\"></script>\n```\n\n\n## API\n\nWhen calling the layout, e.g. `cy.layout({ name: 'fcose', ... })`, the following options are supported:\n\n```js\nvar defaultOptions = {\n\n  // 'draft', 'default' or 'proof' \n  // - \"draft\" only applies spectral layout \n  // - \"default\" improves the quality with incremental layout (fast cooling rate)\n  // - \"proof\" improves the quality with incremental layout (slow cooling rate) \n  quality: \"default\",\n  // Use random node positions at beginning of layout\n  // if this is set to false, then quality option must be \"proof\"\n  randomize: true, \n  // Whether or not to animate the layout\n  animate: true, \n  // Duration of animation in ms, if enabled\n  animationDuration: 1000, \n  // Easing of animation, if enabled\n  animationEasing: undefined, \n  // Fit the viewport to the repositioned nodes\n  fit: true, \n  // Padding around layout\n  padding: 30,\n  // Whether to include labels in node dimensions. Valid in \"proof\" quality\n  nodeDimensionsIncludeLabels: false,\n  // Whether or not simple nodes (non-compound nodes) are of uniform dimensions\n  uniformNodeDimensions: false,\n  // Whether to pack disconnected components - cytoscape-layout-utilities extension should be registered and initialized\n  packComponents: true,\n  // Layout step - all, transformed, enforced, cose - for debug purpose only\n  step: \"all\",\n  \n  /* spectral layout options */\n  \n  // False for random, true for greedy sampling\n  samplingType: true,\n  // Sample size to construct distance matrix\n  sampleSize: 25,\n  // Separation amount between nodes\n  nodeSeparation: 75,\n  // Power iteration tolerance\n  piTol: 0.0000001,\n  \n  /* incremental layout options */\n  \n  // Node repulsion (non overlapping) multiplier\n  nodeRepulsion: node => 4500,\n  // Ideal edge (non nested) length\n  idealEdgeLength: edge => 50,\n  // Divisor to compute edge forces\n  edgeElasticity: edge => 0.45,\n  // Nesting factor (multiplier) to compute ideal edge length for nested edges\n  nestingFactor: 0.1,\n  // Maximum number of iterations to perform - this is a suggested value and might be adjusted by the algorithm as required\n  numIter: 2500,\n  // For enabling tiling\n  tile: true,\n  // The comparison function to be used while sorting nodes during tiling operation.\n  // Takes the ids of 2 nodes that will be compared as a parameter and the default tiling operation is performed when this option is not set.\n  // It works similar to ``compareFunction`` parameter of ``Array.prototype.sort()``\n  // If node1 is less then node2 by some ordering criterion ``tilingCompareBy(nodeId1, nodeId2)`` must return a negative value\n  // If node1 is greater then node2 by some ordering criterion ``tilingCompareBy(nodeId1, nodeId2)`` must return a positive value\n  // If node1 is equal to node2 by some ordering criterion ``tilingCompareBy(nodeId1, nodeId2)`` must return 0\n  tilingCompareBy: undefined, \n  // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)\n  tilingPaddingVertical: 10,\n  // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)\n  tilingPaddingHorizontal: 10,\n  // Gravity force (constant)\n  gravity: 0.25,\n  // Gravity range (constant) for compounds\n  gravityRangeCompound: 1.5,\n  // Gravity force (constant) for compounds\n  gravityCompound: 1.0,\n  // Gravity range (constant)\n  gravityRange: 3.8, \n  // Initial cooling factor for incremental layout  \n  initialEnergyOnIncremental: 0.3,\n\n  /* constraint options */\n\n  // Fix desired nodes to predefined positions\n  // [{nodeId: 'n1', position: {x: 100, y: 200}}, {...}]\n  fixedNodeConstraint: undefined,\n  // Align desired nodes in vertical/horizontal direction\n  // {vertical: [['n1', 'n2'], [...]], horizontal: [['n2', 'n4'], [...]]}\n  alignmentConstraint: undefined,\n  // Place two nodes relatively in vertical/horizontal direction\n  // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}, {...}]\n  relativePlacementConstraint: undefined,\n\n  /* layout event callbacks */\n  ready: () => {}, // on layoutready\n  stop: () => {} // on layoutstop\n};\n```\nTo be able to use `packComponents` option, `cytoscape-layout-utilities` extension should also be registered in the application.\nPacking related [options](https://github.com/iVis-at-Bilkent/cytoscape.js-layout-utilities#default-options) should be set via `cytoscape-layout-utilities` extension.\nIf they are not set, fCoSE uses default options.\n\n\n## Build targets\n\n* `npm run test` : Run Mocha tests in `./test`\n* `npm run build` : Build `./src/**` into `cytoscape-fcose.js`\n* `npm run watch` : Automatically build on changes with live reloading (N.b. you must already have an HTTP server running)\n* `npm run dev` : Automatically build on changes with live reloading with webpack dev server\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-fcose https://github.com/iVis-at-Bilkent/cytoscape.js-fcose.git`\n1. [Make a new release](https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/releases/new) for Zenodo.\n\n## Team\n\n  * [Hasan Balcı](https://github.com/hasanbalci) and [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis)\n","publish_time":1555072931028,"_cnpm_publish_time":1555072931028,"dist-tags":{"latest":"2.2.0"}}