Skip to content

Commit

Permalink
artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Mar 30, 2017
1 parent ece94a5 commit 4a1efaa
Show file tree
Hide file tree
Showing 12 changed files with 245 additions and 113 deletions.
8 changes: 4 additions & 4 deletions dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dc.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/docs/api-latest.md
Expand Up @@ -11,7 +11,7 @@ such as [.svg](#dc.baseMixin+svg) and [.xAxis](#dc.coordinateGridMixin+xAxis),
return values that are themselves chainable d3 objects.

**Kind**: global namespace
**Version**: 2.0.1
**Version**: 2.0.2
**Example**
```js
// Example chaining
Expand Down
109 changes: 61 additions & 48 deletions web/img/class-hierarchy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions web/js/dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/js/dc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/js/dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/js/dc.min.js.map

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions web/js/queue.js
@@ -0,0 +1,106 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define('queue', factory) :
(global.queue = factory());
}(this, function () { 'use strict';

var slice = [].slice;

function noop() {}

var noabort = {};
var success = [null];
function newQueue(concurrency) {
if (!(concurrency >= 1)) throw new Error;

var q,
tasks = [],
results = [],
waiting = 0,
active = 0,
ended = 0,
starting, // inside a synchronous task callback?
error,
callback = noop,
callbackAll = true;

function start() {
if (starting) return; // let the current task complete
while (starting = waiting && active < concurrency) {
var i = ended + active,
t = tasks[i],
j = t.length - 1,
c = t[j];
t[j] = end(i);
--waiting, ++active, tasks[i] = c.apply(null, t) || noabort;
}
}

function end(i) {
return function(e, r) {
if (!tasks[i]) throw new Error; // detect multiple callbacks
--active, ++ended, tasks[i] = null;
if (error != null) return; // only report the first error
if (e != null) {
abort(e);
} else {
results[i] = r;
if (waiting) start();
else if (!active) notify();
}
};
}

function abort(e) {
error = e; // ignore new tasks and squelch active callbacks
waiting = NaN; // stop queued tasks from starting
notify();
}

function notify() {
if (error != null) callback(error);
else if (callbackAll) callback(null, results);
else callback.apply(null, success.concat(results));
}

return q = {
defer: function(f) {
if (callback !== noop) throw new Error;
var t = slice.call(arguments, 1);
t.push(f);
++waiting, tasks.push(t);
start();
return q;
},
abort: function() {
if (error == null) {
var i = ended + active, t;
while (--i >= 0) (t = tasks[i]) && t.abort && t.abort();
abort(new Error("abort"));
}
return q;
},
await: function(f) {
if (callback !== noop) throw new Error;
callback = f, callbackAll = false;
if (!waiting && !active) notify();
return q;
},
awaitAll: function(f) {
if (callback !== noop) throw new Error;
callback = f, callbackAll = true;
if (!waiting && !active) notify();
return q;
}
};
}

function queue(concurrency) {
return newQueue(arguments.length ? +concurrency : Infinity);
}

queue.version = "1.2.1";

return queue;

}));

0 comments on commit 4a1efaa

Please sign in to comment.