Comparing version 0.3.0 to 0.3.1
@@ -0,1 +1,6 @@ | ||
v0.3.1 | ||
====== | ||
* Added support for rank constraints. | ||
v0.3.0 | ||
@@ -2,0 +7,0 @@ ====== |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
61058
19
1443
15
256
+ Addedcp-data@1.1.0(transitive)
+ Addedgraphlib@0.7.0(transitive)
- Removedgraphlib@0.5.7(transitive)
Updatedgraphlib@0.7.0