Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dagre

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dagre - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

Gruntfile.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

v0.3.1
======
* Added support for rank constraints.
v0.3.0

@@ -2,0 +7,0 @@ ======

2

index.js

@@ -24,3 +24,3 @@ /*

exports.Graph = require("graphlib").Graph;
exports.layout = require("./lib/layout/layout");
exports.layout = require("./lib/layout");
exports.version = require("./lib/version");

@@ -23,3 +23,3 @@ /*

if (!f(xs[i])) {
return false;
return false;
}

@@ -44,28 +44,2 @@ }

exports.createTimer = function(enabled) {
var self = {};
// Default to disabled
enabled = enabled || false;
self.enabled = function(x) {
if (!arguments.length) return enabled;
enabled = x;
return self;
};
self.wrap = function(name, func) {
return function() {
var start = enabled ? new Date().getTime() : null;
try {
return func.apply(null, arguments);
} finally {
if (start) console.log(name + " time: " + (new Date().getTime() - start) + "ms");
}
};
};
return self;
};
exports.propertyAccessor = function(self, config, field, setHook) {

@@ -79,1 +53,67 @@ return function(x) {

};
/*
* Given a layered, directed graph with `rank` and `order` node attributes,
* this function returns an array of ordered ranks. Each rank contains an array
* of the ids of the nodes in that rank in the order specified by the `order`
* attribute.
*/
exports.ordering = function(g) {
var ordering = [];
g.eachNode(function(u, value) {
var rank = ordering[value.rank] || (ordering[value.rank] = []);
rank[value.order] = u;
});
return ordering;
};
/*
* A filter that can be used with `filterNodes` to get a graph that only
* includes nodes that do not contain others nodes.
*/
exports.filterNonSubgraphs = function(g) {
return function(u) {
return g.children(u).length === 0;
};
};
/*
* Returns a new function that wraps `func` with a timer. The wrapper logs the
* time it takes to execute the function. `name` may optionally be supplied. If
* it is not, the name is derived from `func.name`.
*
* The timer will be enabled provided `log.level >= 1`.
*/
function time(name, func) {
if (arguments.length === 1) {
func = name;
name = func.name;
if (name.length === 0) {
name = "unnamed";
}
}
return function() {
var start = new Date().getTime();
try {
return func.apply(null, arguments);
} finally {
log(1, name + " time: " + (new Date().getTime() - start) + "ms");
}
};
}
time.enabled = false;
exports.time = time;
/*
* A global logger with the specification `log(level, message, ...)` that
* will log a message to the console if `log.level >= level`.
*/
function log(level) {
if (log.level >= level) {
console.log.apply(console, Array.prototype.slice.call(arguments, 1));
}
}
log.level = 0;
exports.log = log;

@@ -1,1 +0,1 @@

module.exports = '0.3.0';
module.exports = '0.3.1';
{
"name": "dagre",
"version": "0.3.0",
"description": "Directed graph rendering",
"version": "0.3.1",
"description": "Graph layout for JavaScript",
"main": "index.js",

@@ -24,11 +24,19 @@ "directories": {

"blanket": "1.x.x",
"browserify": "2.28.x",
"chai": "1.7.x",
"graphlib-dot": "0.4.1",
"cp-data": "1.x.x",
"graphlib-dot": "0.4.8",
"jshint": "2.1.x",
"grunt": "~0.4.1",
"grunt-browserify": "~1.2.8",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "~0.2.4",
"grunt-mocha-cov": "0.0.7",
"mocha": "1.12.x",
"semver": "2.1.x",
"uglify-js": "1.2.3"
"uglify-js": "1.2.3",
"browserify": "~2.33.1",
"grunt-contrib-watch": "~0.5.3"
},
"dependencies": {
"graphlib": "0.5.7"
"graphlib": "0.7.0"
},

@@ -40,22 +48,3 @@ "author": "Chris Pettitt <chris@samsarin.com>",

},
"license": "MIT",
"testling": {
"files": [
"test/**/*.js"
],
"browsers": [
"ie/9..latest",
"firefox/17..latest",
"firefox/nightly",
"chrome/22..latest",
"chrome/canary",
"opera/12..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2..latest"
],
"harness": "mocha"
}
"license": "MIT"
}

@@ -1,7 +0,5 @@

# dagre - Directed graph rendering
# dagre - Graph layout for JavaScript
[![Build Status](https://secure.travis-ci.org/cpettitt/dagre.png)](http://travis-ci.org/cpettitt/dagre)
[![browser support](https://ci.testling.com/cpettitt/dagre.png)](https://ci.testling.com/cpettitt/dagre)
Dagre is a JavaScript library that makes it easy to lay out directed graphs on

@@ -43,5 +41,5 @@ the client-side.

To get graphlib from npm, use:
To get dagre from npm, use:
$ npm install graphlib
$ npm install dagre

@@ -54,3 +52,3 @@ ### Build From Source

$ make
$ make dist

@@ -93,3 +91,3 @@ This will generate `dagre.js` and `dagre.min.js` in the `dist` directory

[API](http://cpettitt.github.io/project/graphlib/latest/doc/index.html).
Graphlib comes bundled with dagre-d3. In this section, we'll show you how to
Graphlib comes bundled with dagre. In this section, we'll show you how to
create a simple graph.

@@ -96,0 +94,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc