Gathering detailed insights and metrics for cytoscape-dagre
Gathering detailed insights and metrics for cytoscape-dagre
Gathering detailed insights and metrics for cytoscape-dagre
Gathering detailed insights and metrics for cytoscape-dagre
@types/cytoscape-dagre
TypeScript definitions for cytoscape-dagre
cytoscape-dagre-cluster-fix
The Dagre layout for DAGs and trees for Cytoscape.js
dagre-d3-es
<p align="center"> <a href="https://www.npmjs.com/dagre-d3-es"><img src="https://img.shields.io/npm/v/dagre-d3-es.svg?logo=npm&logoColor=fff&label=NPM+package&color=limegreen" alt="dagre-d3-es on npm" /></a> <a href="https://www.npmjs.com/dagre-
cytoscape
Graph theory (a.k.a. network) library for analysis and visualisation
npm install cytoscape-dagre
86.7
Supply Chain
99.5
Quality
81.7
Maintenance
100
Vulnerability
99.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
253 Stars
111 Commits
82 Forks
20 Watching
2 Branches
33 Contributors
Updated on 26 Nov 2024
Minified
Minified + Gzipped
JavaScript (86.68%)
HTML (13.32%)
Cumulative downloads
Total Downloads
Last day
-10.5%
8,718
Compared to previous day
Last week
0.9%
50,726
Compared to previous week
Last month
5.5%
211,587
Compared to previous month
Last year
43.8%
3,297,384
Compared to previous year
1
1
The Dagre layout for DAGs and trees for Cytoscape.js (demo)
The dagre
layout organises the graph using a DAG (directed acyclic graph) system, written by Chris Pettitt. It is especially suitable for DAGs and trees. For more information, please refer to Dagre's documentation.
Download the library:
npm install cytoscape-dagre
,bower install cytoscape-dagre
, orImport the library as appropriate for your project:
ES import:
1import cytoscape from 'cytoscape'; 2import dagre from 'cytoscape-dagre'; 3 4cytoscape.use( dagre );
CommonJS require:
1let cytoscape = require('cytoscape'); 2let dagre = require('cytoscape-dagre'); 3 4cytoscape.use( dagre ); // register extension
AMD:
1require(['cytoscape', 'cytoscape-dagre'], function( cytoscape, dagre ){ 2 dagre( cytoscape ); // register extension 3});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
Call the layout, e.g. cy.layout({ name: 'dagre', ... }).run()
, with options:
1var defaults = { 2 // dagre algo options, uses default value on undefined 3 nodeSep: undefined, // the separation between adjacent nodes in the same rank 4 edgeSep: undefined, // the separation between adjacent edges in the same rank 5 rankSep: undefined, // the separation between each rank in the layout 6 rankDir: undefined, // 'TB' for top to bottom flow, 'LR' for left to right, 7 align: undefined, // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right 8 acyclicer: undefined, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph. 9 // A feedback arc set is a set of edges that can be removed to make a graph acyclic. 10 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' 11 minLen: function( edge ){ return 1; }, // number of ranks to keep between the source and target of the edge 12 edgeWeight: function( edge ){ return 1; }, // higher weight edges are generally made shorter and straighter than lower weight edges 13 14 // general layout options 15 fit: true, // whether to fit to viewport 16 padding: 30, // fit padding 17 spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up 18 nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node 19 animate: false, // whether to transition the node positions 20 animateFilter: function( node, i ){ return true; }, // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions 21 animationDuration: 500, // duration of animation in ms if enabled 22 animationEasing: undefined, // easing of animation if enabled 23 boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } 24 transform: function( node, pos ){ return pos; }, // a function that applies a transform to the final node position 25 ready: function(){}, // on layoutready 26 sort: undefined, // a sorting function to order the nodes and edges; e.g. function(a, b){ return a.data('weight') - b.data('weight') } 27 // because cytoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when 28 // defining the topology of a graph, this sort function can help ensure the correct order of the nodes/edges. 29 // this feature is most useful when adding and removing the same nodes and edges multiple times in a graph. 30 stop: function(){} // on layoutstop 31};
npm run test
: Run Mocha tests in ./test
npm run build
: Build ./src/**
into cytoscape-dagre.js
npm run watch
: Automatically build on changes with live reloading (N.b. you must already have an HTTP server running)npm run dev
: Automatically build on changes with live reloading with webpack dev servernpm run lint
: Run eslint on the sourceN.b. all builds use babel, so modern ES features can be used in the src
.
This project is set up to automatically be published to npm and bower. To publish:
npm run build:release
git commit -am "Build for release"
npm version major|minor|patch
git push && git push --tags
npm publish .
bower register cytoscape-dagre https://github.com/cytoscape/cytoscape.js-dagre.git
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/12 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
87 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More