Socket
Socket
Sign inDemoInstall

@domoinc/button

Package Overview
Dependencies
127
Maintainers
18
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

bower_components/BaseWidget/.bower.json

8

bower_components/AutoWidgets/.bower.json
{
"name": "AutoWidgets",
"main": "AutoWidgets.js",
"version": "1.0.16",
"version": "1.0.13",
"authors": [

@@ -32,7 +32,7 @@ "AppTeam6"

},
"_release": "1.0.16",
"_release": "1.0.13",
"_resolution": {
"type": "version",
"tag": "v1.0.16",
"commit": "b0f48df7acb0ce66dd578babff2b959310e0c864"
"tag": "v1.0.13",
"commit": "d5a1cf8cd42f2cf81bfb143c37ba71f8a6b6d6d0"
},

@@ -39,0 +39,0 @@ "_source": "git@git.empdev.domo.com:DA/AutoWidgets.git",

@@ -110,68 +110,46 @@ if (!window.AutoWidgets) {

}
document.body.style.visibility = 'visible';
widgets.renderAll = function() {
for (var i = 0; i < widgets.length; i++) {
renderWidget(widgets[i]);
}
window.addEventListener('message', function(event) {
var message = JSON.parse(event.data);
// send acknowledgement to prevent autorefresh
var ack = JSON.stringify({
event: 'ack',
alias: message.alias
});
event.source.postMessage(ack, event.origin);
// inform domo app which alias has been updated
for (var i = 0; i < widgets.length; i++) {
if (widgets[i].sampleData()[message.alias]){
renderWidget(widgets[i]);
break;
(function(widget) {
var key;
var requests = [];
var data = {};
var req;
var sampleData = widgets[i].sampleData();
if (widget._notifier) {
widget._notifier.clearSampleDataMessages();
}
}
});
};
function renderWidget(widget) {
var key;
var requests = [];
var data = {};
var req;
var sampleData = widget.sampleData();
if (widget._notifier) {
widget._notifier.showMessage(false);
widget._notifier.clearSampleDataMessages();
}
for (key in sampleData) {
(function(k) {
req = new Promise(function(resolve, reject) {
d3.text('data/v1/' + k)
.header('Accept', '*/*')
.get(function(err, value) {
if (err) {
if (widget._notifier) {
// widget._notifier.appendMessage(widget.config('chartName'), 'SAMPLE_DATA', 'Using Sample Data', widget._dataDefs, [widget.sampleData()[k].data]);
}
resolve(widget.sampleData()[k]);
} else {
var dataObj = widget.sampleData()[k];
var data = JSON.parse(value);
dataObj = dataToArrays(data, dataObj);
resolve(dataObj);
}
});
})
.then(function(value) {
data[k] = value;
for (key in sampleData) {
(function(k) {
req = new Promise(function(resolve, reject) {
d3.text('data/v1/' + k)
.header('Accept', '*/*')
.get(function(err, value) {
if (err) {
if (widget._notifier) {
widget._notifier.appendMessage(widget.config('chartName'), 'SAMPLE_DATA', 'Using Sample Data', widget._dataDefs, [widget.sampleData()[k].data]);
}
resolve(widget.sampleData()[k]);
} else {
var dataObj = widget.sampleData()[k];
var data = JSON.parse(value);
dataObj = dataToArrays(data, dataObj);
resolve(dataObj);
}
});
})
.then(function(value) {
data[k] = value;
});
requests.push(req);
})(key);
}
Promise.all(requests)
.then(function() {
widget.renderWithData(applyAllFilters(widget, data));
});
requests.push(req);
})(key);
})(widgets[i]);
}
Promise.all(requests)
.then(function() {
widget.renderWithData(applyAllFilters(widget, data));
});
}
};

@@ -184,9 +162,3 @@ function dataToArrays(input, dataObj) {

columns.map(function(col) {
if (obj.hasOwnProperty(col)) {
row.push(obj[col]);
} else if (obj.hasOwnProperty(col.replace(/\s/g, ''))) {
row.push(obj[col.replace(/\s/g, '')]);
} else {
row.push('');
}
row.push(obj[col]);
});

@@ -218,18 +190,9 @@ data.push(row);

if (widget.categories.indexOf('Controls') >= 0) {
var widgets = {};
_.map(widget.widgets, function(def, id) {
var w = AutoWidgets.configs[id];
if (w) {
var name = w.config.widgetName.value;
widgets[name] = def;
}
});
if(widget.config) {
filters[widget.config.widgetName.value] = {
value: widget.value || [],
widgets: widgets
};
}
filters[name] = {
value: widget.value || [],
widgets: widget.widgets || {}
};
}
});
return filters;

@@ -258,18 +221,16 @@ }

function addConfig(widget) {
if (AutoWidgets.configs) {
var config = _.find(AutoWidgets.configs, function(d) {
return d.config && d.config.widgetName.value === widget.dataName();
var hasConfig = AutoWidgets.configs && AutoWidgets.configs[widget.dataName()];
if (hasConfig) {
var config;
config = AutoWidgets.configs[widget.dataName()];
// The configure pane currently uses configs differently than the preview
// or live version, so this check makes them both work properly
if (config.config) {
config = config.config;
}
_.map(config, function(item, key) {
if (widget._config[key]) {
_.extend(widget._config[key], item);
}
});
if (config) {
// The configure pane currently uses configs differently than the preview
// or live version, so this check makes them both work properly
if (config.config) {
config = config.config;
}
_.map(config, function(item, key) {
if (widget._config[key]) {
_.extend(widget._config[key], item);
}
});
}
}

@@ -279,16 +240,10 @@ }

function addData(widget) {
if (AutoWidgets.configs) {
var config = _.find(AutoWidgets.configs, function(d) {
return d.config && d.config.widgetName.value === widget.dataName();
});
if (config) {
var data = config.data;
var key;
if (data) {
for (key in data) {
data[key].data = data[key].defaultValue;
}
widget.sampleData(data);
}
var hasData = AutoWidgets.configs && AutoWidgets.configs[widget.dataName()] && AutoWidgets.configs[widget.dataName()].data;
if (hasData) {
var data = AutoWidgets.configs[widget.dataName()].data;
var key;
for (key in data) {
data[key].data = data[key].defaultValue;
}
widget.sampleData(data);
}

@@ -318,15 +273,8 @@ }

var filteredData = removeNullRows(data);
var widgetName = widget.dataName();
var widgetName = widget.dataName();
var filterColumns;
var tempFilterColumns;
_.map(filters, function(filter, name) {
if (filter.widgets[widgetName]) {
filterColumns = {};
tempFilterColumns = filter.widgets[widgetName];
_.map(tempFilterColumns, function(ds, dsName) {
if (dsName !== 'widget' && dsName !== 'data') {
filterColumns[widgetName + dsName] = ds;
}
});
filter.widgets[widgetName].widget = widget;
filterColumns = filter.widgets[widgetName];
filter.widgets[widgetName].widget = widget;
filter.widgets[widgetName].data = data;

@@ -333,0 +281,0 @@ filteredData = filterData(filteredData, filterColumns, filter.value);

{
"name": "d3.chart",
"version": "0.2.1",
"main": "d3.chart.js",

@@ -27,11 +26,13 @@ "ignore": [

"homepage": "https://github.com/misoproject/d3.chart",
"_release": "0.2.1",
"version": "0.3.0",
"_release": "0.3.0",
"_resolution": {
"type": "version",
"tag": "v0.2.1",
"commit": "bbf8ff3b8452033efbd955e83e3761ecf725d623"
"tag": "v0.3.0",
"commit": "a7dca264770e7a3e623315b1f7e47c6a599b18d2"
},
"_source": "git://github.com/misoproject/d3.chart.git",
"_target": "~0.2.0",
"_originalSource": "d3.chart"
"_target": "^0.3.0",
"_originalSource": "d3.chart",
"_direct": true
}
# d3.chart change log
### 0.3.0 (01.23.2016)
- Define library using Universal Module Definition ("UMD") pattern
### 0.2.1 (06.24.2014)

@@ -4,0 +8,0 @@

@@ -1,730 +0,919 @@

/*! d3.chart - v0.2.1
* License: MIT Expat
* Date: 2014-06-24
/*!
* d3.chart - v0.3.0
* License: MIT
* Date: 2016-01-23
*/
(function(window) {
"use strict";
/*jshint unused: false */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("d3"));
else if(typeof define === 'function' && define.amd)
define("d3.chart", ["d3"], factory);
else if(typeof exports === 'object')
exports["d3.chart"] = factory(require("d3"));
else
root["d3.chart"] = factory(root["d3"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
var d3 = window.d3;
var hasOwnProp = Object.hasOwnProperty;
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
var d3cAssert = function(test, message) {
if (test) {
return;
}
throw new Error("[d3.chart] " + message);
};
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
d3cAssert(d3, "d3.js is required");
d3cAssert(typeof d3.version === "string" && d3.version.match(/^3/),
"d3.js version 3 is required");
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
"use strict";
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
var lifecycleRe = /^(enter|update|merge|exit)(:transition)?$/;
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/**
* Create a layer using the provided `base`. The layer instance is *not*
* exposed to d3.chart users. Instead, its instance methods are mixed in to the
* `base` selection it describes; users interact with the instance via these
* bound methods.
*
* @private
* @constructor
*
* @param {d3.selection} base The containing DOM node for the layer.
*/
var Layer = function(base) {
d3cAssert(base, "Layers must be initialized with a base.");
this._base = base;
this._handlers = {};
};
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/**
* Invoked by {@link Layer#draw} to join data with this layer's DOM nodes. This
* implementation is "virtual"--it *must* be overridden by Layer instances.
*
* @param {Array} data Value passed to {@link Layer#draw}
*/
Layer.prototype.dataBind = function() {
d3cAssert(false, "Layers must specify a `dataBind` method.");
};
/**
* Invoked by {@link Layer#draw} in order to insert new DOM nodes into this
* layer's `base`. This implementation is "virtual"--it *must* be overridden by
* Layer instances.
*/
Layer.prototype.insert = function() {
d3cAssert(false, "Layers must specify an `insert` method.");
};
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/**
* Subscribe a handler to a "lifecycle event". These events (and only these
* events) are triggered when {@link Layer#draw} is invoked--see that method
* for more details on lifecycle events.
*
* @param {String} eventName Identifier for the lifecycle event for which to
* subscribe.
* @param {Function} handler Callback function
*
* @returns {d3.selection} Reference to the layer's base.
*/
Layer.prototype.on = function(eventName, handler, options) {
options = options || {};
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
d3cAssert(
lifecycleRe.test(eventName),
"Unrecognized lifecycle event name specified to `Layer#on`: '" +
eventName + "'."
);
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
if (!(eventName in this._handlers)) {
this._handlers[eventName] = [];
}
this._handlers[eventName].push({
callback: handler,
chart: options.chart || null
});
return this._base;
};
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Unsubscribe the specified handler from the specified event. If no handler is
* supplied, remove *all* handlers from the event.
*
* @param {String} eventName Identifier for event from which to remove
* unsubscribe
* @param {Function} handler Callback to remove from the specified event
*
* @returns {d3.selection} Reference to the layer's base.
*/
Layer.prototype.off = function(eventName, handler) {
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) {
"use strict";
var d3 = __webpack_require__(1);
var handlers = this._handlers[eventName];
var idx;
var Chart = __webpack_require__(2);
var assert = __webpack_require__(3);
d3cAssert(
lifecycleRe.test(eventName),
"Unrecognized lifecycle event name specified to `Layer#off`: '" +
eventName + "'."
);
assert(/^3\./.test(d3.version), "d3.js version 3 is required");
if (!handlers) {
return this._base;
}
__webpack_require__(4);
if (arguments.length === 1) {
handlers.length = 0;
return this._base;
}
/**
* A namespace defined by [the D3.js library](http://d3js.org/). The d3.chart
* API is defined within this namespace.
* @namespace d3
*/
for (idx = handlers.length - 1; idx > -1; --idx) {
if (handlers[idx].callback === handler) {
handlers.splice(idx, 1);
}
}
return this._base;
};
/**
* A constructor function defined by [the D3.js library](http://d3js.org/).
* @constructor d3.selection
* @memberof d3
*/
/**
* Render the layer according to the input data: Bind the data to the layer
* (according to {@link Layer#dataBind}, insert new elements (according to
* {@link Layer#insert}, make lifecycle selections, and invoke all relevant
* handlers (as attached via {@link Layer#on}) with the lifecycle selections.
*
* - update
* - update:transition
* - enter
* - enter:transition
* - exit
* - exit:transition
*
* @param {Array} data Data to drive the rendering.
*/
Layer.prototype.draw = function(data) {
var bound, entering, events, selection, handlers, eventName, idx, len;
/**
* Create a new chart constructor or return a previously-created chart
* constructor.
*
* @static
* @memberof d3
* @externalExample {runnable} chart
*
* @param {String} name If no other arguments are specified, return the
* previously-created chart with this name.
* @param {Object} protoProps If specified, this value will be forwarded to
* {@link Chart.extend} and used to create a new chart.
* @param {Object} staticProps If specified, this value will be forwarded to
* {@link Chart.extend} and used to create a new chart.
*/
d3.chart = function(name) {
if (arguments.length === 0) {
return Chart;
} else if (arguments.length === 1) {
return Chart[name];
}
bound = this.dataBind.call(this._base, data);
return Chart.extend.apply(Chart, arguments);
};
// Although `bound instanceof d3.selection` is more explicit, it fails
// in IE8, so we use duck typing to maintain compatability.
d3cAssert(bound && bound.call === d3.selection.prototype.call,
"Invalid selection defined by `Layer#dataBind` method.");
d3cAssert(bound.enter, "Layer selection not properly bound.");
/**
* Instantiate a chart or return the chart that the current selection belongs
* to.
*
* @externalExample {runnable} selection-chart
*
* @param {String} [chartName] The name of the chart to instantiate. If the
* name is unspecified, this method will return the chart that the
* current selection belongs to.
* @param {mixed} options The options to use when instantiated the new chart.
* See {@link Chart} for more information.
*/
d3.selection.prototype.chart = function(chartName, options) {
// Without an argument, attempt to resolve the current selection's
// containing d3.chart.
if (arguments.length === 0) {
return this._chart;
}
var ChartCtor = Chart[chartName];
assert(ChartCtor, "No chart registered with name '" + chartName + "'");
entering = bound.enter();
entering._chart = this._base._chart;
return new ChartCtor(this, options);
};
events = [
{
name: "update",
selection: bound
},
{
name: "enter",
// Defer invocation of the `insert` method so that the previous
// `update` selection does not contain the new nodes.
selection: this.insert.bind(entering)
},
{
name: "merge",
// This selection will be modified when the previous selection
// is made.
selection: bound
},
{
name: "exit",
selection: bound.exit.bind(bound)
}
];
// Implement the zero-argument signature of `d3.selection.prototype.chart`
// for all selection types.
d3.selection.enter.prototype.chart = function() {
return this._chart;
};
d3.transition.prototype.chart = d3.selection.enter.prototype.chart;
for (var i = 0, l = events.length; i < l; ++i) {
eventName = events[i].name;
selection = events[i].selection;
module.exports = d3.chart;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
// Some lifecycle selections are expressed as functions so that
// they may be delayed.
if (typeof selection === "function") {
selection = selection();
}
if (selection.empty()) {
continue;
}
/***/ },
/* 1 */
/***/ function(module, exports) {
// Although `selection instanceof d3.selection` is more explicit,
// it fails in IE8, so we use duck typing to maintain
// compatability.
d3cAssert(selection &&
selection.call === d3.selection.prototype.call,
"Invalid selection defined for '" + eventName +
"' lifecycle event.");
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
handlers = this._handlers[eventName];
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
if (handlers) {
for (idx = 0, len = handlers.length; idx < len; ++idx) {
// Attach a reference to the parent chart so the selection"s
// `chart` method will function correctly.
selection._chart = handlers[idx].chart || this._base._chart;
selection.call(handlers[idx].callback);
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) {
"use strict";
var assert = __webpack_require__(3);
var hasOwnProp = Object.hasOwnProperty;
// extend
// Borrowed from Underscore.js
function extend(object) {
var argsIndex, argsLength, iteratee, key;
if (!object) {
return object;
}
argsLength = arguments.length;
for (argsIndex = 1; argsIndex < argsLength; argsIndex++) {
iteratee = arguments[argsIndex];
if (iteratee) {
for (key in iteratee) {
object[key] = iteratee[key];
}
}
}
return object;
}
handlers = this._handlers[eventName + ":transition"];
/**
* Call the {@Chart#initialize} method up the inheritance chain, starting with
* the base class and continuing "downward".
*
* @private
*/
var initCascade = function(instance, args) {
var ctor = this.constructor;
var sup = ctor.__super__;
if (sup) {
initCascade.call(sup, instance, args);
}
if (handlers && handlers.length) {
selection = selection.transition();
for (idx = 0, len = handlers.length; idx < len; ++idx) {
selection._chart = handlers[idx].chart || this._base._chart;
selection.call(handlers[idx].callback);
// Do not invoke the `initialize` method on classes further up the
// prototype chain (again).
if (hasOwnProp.call(ctor.prototype, "initialize")) {
this.initialize.apply(instance, args);
}
}
}
};
};
"use strict";
/**
* Call the `transform` method down the inheritance chain, starting with the
* instance and continuing "upward". The result of each transformation should
* be supplied as input to the next.
*
* @private
*/
var transformCascade = function(instance, data) {
var ctor = this.constructor;
var sup = ctor.__super__;
/**
* Create a new layer on the d3 selection from which it is called.
*
* @static
*
* @param {Object} [options] Options to be forwarded to {@link Layer|the Layer
* constructor}
* @returns {d3.selection}
*/
d3.selection.prototype.layer = function(options) {
var layer = new Layer(this);
var eventName;
// Unlike `initialize`, the `transform` method has significance when
// attached directly to a chart instance. Ensure that this transform takes
// first but is not invoked on later recursions.
if (this === instance && hasOwnProp.call(this, "transform")) {
data = this.transform(data);
}
// Set layer methods (required)
layer.dataBind = options.dataBind;
layer.insert = options.insert;
// Do not invoke the `transform` method on classes further up the prototype
// chain (yet).
if (hasOwnProp.call(ctor.prototype, "transform")) {
data = ctor.prototype.transform.call(instance, data);
}
// Bind events (optional)
if ("events" in options) {
for (eventName in options.events) {
layer.on(eventName, options.events[eventName]);
}
}
if (sup) {
data = transformCascade.call(sup, instance, data);
}
// Mix the public methods into the D3.js selection (bound appropriately)
this.on = function() { return layer.on.apply(layer, arguments); };
this.off = function() { return layer.off.apply(layer, arguments); };
this.draw = function() { return layer.draw.apply(layer, arguments); };
return data;
};
return this;
};
/**
* Create a d3.chart
*
* @constructor
* @externalExample {runnable} chart
*
* @param {d3.selection} selection The chart's "base" DOM node. This should
* contain any nodes that the chart generates.
* @param {mixed} chartOptions A value for controlling how the chart should be
* created. This value will be forwarded to {@link Chart#initialize}, so
* charts may define additional properties for consumers to modify their
* behavior during initialization. The following attributes will be
* copied onto the chart instance (if present):
* @param {Function} [chartOptions.transform] - A data transformation function
* unique to the Chart instance being created. If specified, this
* function will be invoked after all inherited implementations as part
* of the `Chart#draw` operation.
* @param {Function} [chartOptions.demux] - A data filtering function for
* attachment charts. If specified, this function will be invoked with
* every {@link Chart#draw|draw} operation and provided with two
* arguments: the attachment name (see {@link Chart#attach}) and the
* data.
*
* @constructor
*/
var Chart = function(selection, chartOptions) {
this.base = selection;
this._layers = {};
this._attached = {};
this._events = {};
"use strict";
if (chartOptions && chartOptions.transform) {
this.transform = chartOptions.transform;
}
// extend
// Borrowed from Underscore.js
function extend(object) {
var argsIndex, argsLength, iteratee, key;
if (!object) {
return object;
}
argsLength = arguments.length;
for (argsIndex = 1; argsIndex < argsLength; argsIndex++) {
iteratee = arguments[argsIndex];
if (iteratee) {
for (key in iteratee) {
object[key] = iteratee[key];
initCascade.call(this, this, [chartOptions]);
};
/**
* Set up a chart instance. This method is intended to be overridden by Charts
* authored with this library. It will be invoked with a single argument: the
* `options` value supplied to the {@link Chart|constructor}.
*
* For charts that are defined as extensions of other charts using
* `Chart.extend`, each chart's `initilize` method will be invoked starting
* with the "oldest" ancestor (see the private {@link initCascade} function for
* more details).
*/
Chart.prototype.initialize = function() {};
/**
* Remove a layer from the chart.
*
* @externalExample chart-unlayer
*
* @param {String} name The name of the layer to remove.
*
* @returns {Layer} The layer removed by this operation.
*/
Chart.prototype.unlayer = function(name) {
var layer = this.layer(name);
delete this._layers[name];
delete layer._chart;
return layer;
};
/**
* Interact with the chart's {@link Layer|layers}.
*
* If only a `name` is provided, simply return the layer registered to that
* name (if any).
*
* If a `name` and `selection` are provided, treat the `selection` as a
* previously-created layer and attach it to the chart with the specified
* `name`.
*
* If all three arguments are specified, initialize a new {@link Layer} using
* the specified `selection` as a base passing along the specified `options`.
*
* The {@link Layer.draw} method of attached layers will be invoked
* whenever this chart's {@link Chart#draw} is invoked and will receive the
* data (optionally modified by the chart's {@link Chart#transform} method.
*
* @externalExample chart-layer
*
* @param {String} name Name of the layer to attach or retrieve.
* @param {d3.selection|Layer} [selection] The layer's base or a
* previously-created {@link Layer}.
* @param {Object} [options] Options to be forwarded to {@link Layer|the Layer
* constructor}
*
* @returns {Layer}
*/
Chart.prototype.layer = function(name, selection, options) {
var layer;
if (arguments.length === 1) {
return this._layers[name];
}
}
}
return object;
}
/**
* Call the {@Chart#initialize} method up the inheritance chain, starting with
* the base class and continuing "downward".
*
* @private
*/
var initCascade = function(instance, args) {
var ctor = this.constructor;
var sup = ctor.__super__;
if (sup) {
initCascade.call(sup, instance, args);
}
// we are reattaching a previous layer, which the
// selection argument is now set to.
if (arguments.length === 2) {
// Do not invoke the `initialize` method on classes further up the
// prototype chain (again).
if (hasOwnProp.call(ctor.prototype, "initialize")) {
this.initialize.apply(instance, args);
}
};
if (typeof selection.draw === "function") {
selection._chart = this;
this._layers[name] = selection;
return this._layers[name];
/**
* Call the `transform` method down the inheritance chain, starting with the
* instance and continuing "upward". The result of each transformation should
* be supplied as input to the next.
*
* @private
*/
var transformCascade = function(instance, data) {
var ctor = this.constructor;
var sup = ctor.__super__;
} else {
assert(false, "When reattaching a layer, the second argument " +
"must be a d3.chart layer");
}
}
// Unlike `initialize`, the `transform` method has significance when
// attached directly to a chart instance. Ensure that this transform takes
// first but is not invoked on later recursions.
if (this === instance && hasOwnProp.call(this, "transform")) {
data = this.transform(data);
}
layer = selection.layer(options);
// Do not invoke the `transform` method on classes further up the prototype
// chain (yet).
if (hasOwnProp.call(ctor.prototype, "transform")) {
data = ctor.prototype.transform.call(instance, data);
}
this._layers[name] = layer;
if (sup) {
data = transformCascade.call(sup, instance, data);
}
selection._chart = this;
return data;
};
return layer;
};
/**
* Create a d3.chart
*
* @param {d3.selection} selection The chart's "base" DOM node. This should
* contain any nodes that the chart generates.
* @param {mixed} chartOptions A value for controlling how the chart should be
* created. This value will be forwarded to {@link Chart#initialize}, so
* charts may define additional properties for consumers to modify their
* behavior during initialization.
*
* @constructor
*/
var Chart = function(selection, chartOptions) {
/**
* Register or retrieve an "attachment" Chart. The "attachment" chart's `draw`
* method will be invoked whenever the containing chart's `draw` method is
* invoked.
*
* @externalExample chart-attach
*
* @param {String} attachmentName Name of the attachment
* @param {Chart} [chart] d3.chart to register as a mix in of this chart. When
* unspecified, this method will return the attachment previously
* registered with the specified `attachmentName` (if any).
*
* @returns {Chart} Reference to this chart (chainable).
*/
Chart.prototype.attach = function(attachmentName, chart) {
if (arguments.length === 1) {
return this._attached[attachmentName];
}
this.base = selection;
this._layers = {};
this._attached = {};
this._events = {};
this._attached[attachmentName] = chart;
return chart;
};
if (chartOptions && chartOptions.transform) {
this.transform = chartOptions.transform;
}
/**
* A "hook" method that you may define to modify input data before it is used
* to draw the chart's layers and attachments. This method will be used by all
* sub-classes (see {@link transformCascade} for details).
*
* Note you will most likely never call this method directly, but rather
* include it as part of a chart definition, and then rely on d3.chart to
* invoke it when you draw the chart with {@link Chart#draw}.
*
* @externalExample {runnable} chart-transform
*
* @param {Array} data Input data provided to @link Chart#draw}.
*
* @returns {mixed} Data to be used in drawing the chart's layers and
* attachments.
*/
Chart.prototype.transform = function(data) {
return data;
};
initCascade.call(this, this, [chartOptions]);
};
/**
* Update the chart's representation in the DOM, drawing all of its layers and
* any "attachment" charts (as attached via {@link Chart#attach}).
*
* @externalExample chart-draw
*
* @param {Object} data Data to pass to the {@link Layer#draw|draw method} of
* this cart's {@link Layer|layers} (if any) and the {@link
* Chart#draw|draw method} of this chart's attachments (if any).
*/
Chart.prototype.draw = function(data) {
/**
* Set up a chart instance. This method is intended to be overridden by Charts
* authored with this library. It will be invoked with a single argument: the
* `options` value supplied to the {@link Chart|constructor}.
*
* For charts that are defined as extensions of other charts using
* `Chart.extend`, each chart's `initilize` method will be invoked starting
* with the "oldest" ancestor (see the private {@link initCascade} function for
* more details).
*/
Chart.prototype.initialize = function() {};
var layerName, attachmentName, attachmentData;
/**
* Remove a layer from the chart.
*
* @param {String} name The name of the layer to remove.
*
* @returns {Layer} The layer removed by this operation.
*/
Chart.prototype.unlayer = function(name) {
var layer = this.layer(name);
data = transformCascade.call(this, this, data);
delete this._layers[name];
delete layer._chart;
for (layerName in this._layers) {
this._layers[layerName].draw(data);
}
return layer;
};
for (attachmentName in this._attached) {
if (this.demux) {
attachmentData = this.demux(attachmentName, data);
} else {
attachmentData = data;
}
this._attached[attachmentName].draw(attachmentData);
}
};
/**
* Interact with the chart's {@link Layer|layers}.
*
* If only a `name` is provided, simply return the layer registered to that
* name (if any).
*
* If a `name` and `selection` are provided, treat the `selection` as a
* previously-created layer and attach it to the chart with the specified
* `name`.
*
* If all three arguments are specified, initialize a new {@link Layer} using
* the specified `selection` as a base passing along the specified `options`.
*
* The {@link Layer.draw} method of attached layers will be invoked
* whenever this chart's {@link Chart#draw} is invoked and will receive the
* data (optionally modified by the chart's {@link Chart#transform} method.
*
* @param {String} name Name of the layer to attach or retrieve.
* @param {d3.selection|Layer} [selection] The layer's base or a
* previously-created {@link Layer}.
* @param {Object} [options] Options to be forwarded to {@link Layer|the Layer
* constructor}
*
* @returns {Layer}
*/
Chart.prototype.layer = function(name, selection, options) {
var layer;
/**
* Function invoked with the context specified when the handler was bound (via
* {@link Chart#on} {@link Chart#once}).
*
* @callback ChartEventHandler
* @param {...*} arguments Invoked with the arguments passed to {@link
* Chart#trigger}
*/
if (arguments.length === 1) {
return this._layers[name];
}
/**
* Subscribe a callback function to an event triggered on the chart. See {@link
* Chart#once} to subscribe a callback function to an event for one occurence.
*
* @externalExample {runnable} chart-on
*
* @param {String} name Name of the event
* @param {ChartEventHandler} callback Function to be invoked when the event
* occurs
* @param {Object} [context] Value to set as `this` when invoking the
* `callback`. Defaults to the chart instance.
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.on = function(name, callback, context) {
var events = this._events[name] || (this._events[name] = []);
events.push({
callback: callback,
context: context || this,
_chart: this
});
return this;
};
// we are reattaching a previous layer, which the
// selection argument is now set to.
if (arguments.length === 2) {
/**
* Subscribe a callback function to an event triggered on the chart. This
* function will be invoked at the next occurance of the event and immediately
* unsubscribed. See {@link Chart#on} to subscribe a callback function to an
* event indefinitely.
*
* @externalExample {runnable} chart-once
*
* @param {String} name Name of the event
* @param {ChartEventHandler} callback Function to be invoked when the event
* occurs
* @param {Object} [context] Value to set as `this` when invoking the
* `callback`. Defaults to the chart instance
*
* @returns {Chart} A reference to this chart (chainable)
*/
Chart.prototype.once = function(name, callback, context) {
var self = this;
var once = function() {
self.off(name, once);
callback.apply(this, arguments);
};
return this.on(name, once, context);
};
if (typeof selection.draw === "function") {
selection._chart = this;
this._layers[name] = selection;
return this._layers[name];
/**
* Unsubscribe one or more callback functions from an event triggered on the
* chart. When no arguments are specified, *all* handlers will be unsubscribed.
* When only a `name` is specified, all handlers subscribed to that event will
* be unsubscribed. When a `name` and `callback` are specified, only that
* function will be unsubscribed from that event. When a `name` and `context`
* are specified (but `callback` is omitted), all events bound to the given
* event with the given context will be unsubscribed.
*
* @externalExample {runnable} chart-off
*
* @param {String} [name] Name of the event to be unsubscribed
* @param {ChartEventHandler} [callback] Function to be unsubscribed
* @param {Object} [context] Contexts to be unsubscribe
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.off = function(name, callback, context) {
var names, n, events, event, i, j;
} else {
d3cAssert(false, "When reattaching a layer, the second argument "+
"must be a d3.chart layer");
}
}
// remove all events
if (arguments.length === 0) {
for (name in this._events) {
this._events[name].length = 0;
}
return this;
}
layer = selection.layer(options);
// remove all events for a specific name
if (arguments.length === 1) {
events = this._events[name];
if (events) {
events.length = 0;
}
return this;
}
this._layers[name] = layer;
// remove all events that match whatever combination of name, context
// and callback.
names = name ? [name] : Object.keys(this._events);
for (i = 0; i < names.length; i++) {
n = names[i];
events = this._events[n];
j = events.length;
while (j--) {
event = events[j];
if ((callback && callback === event.callback) ||
(context && context === event.context)) {
events.splice(j, 1);
}
}
}
selection._chart = this;
return this;
};
return layer;
};
/**
* Publish an event on this chart with the given `name`.
*
* @externalExample {runnable} chart-trigger
*
* @param {String} name Name of the event to publish
* @param {...*} arguments Values with which to invoke the registered
* callbacks.
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.trigger = function(name) {
var args = Array.prototype.slice.call(arguments, 1);
var events = this._events[name];
var i, ev;
/**
* Register or retrieve an "attachment" Chart. The "attachment" chart's `draw`
* method will be invoked whenever the containing chart's `draw` method is
* invoked.
*
* @param {String} attachmentName Name of the attachment
* @param {Chart} [chart] d3.chart to register as a mix in of this chart. When
* unspecified, this method will return the attachment previously
* registered with the specified `attachmentName` (if any).
*
* @returns {Chart} Reference to this chart (chainable).
*/
Chart.prototype.attach = function(attachmentName, chart) {
if (arguments.length === 1) {
return this._attached[attachmentName];
}
if (events !== undefined) {
for (i = 0; i < events.length; i++) {
ev = events[i];
ev.callback.apply(ev.context, args);
}
}
this._attached[attachmentName] = chart;
return chart;
};
return this;
};
/**
* Update the chart's representation in the DOM, drawing all of its layers and
* any "attachment" charts (as attached via {@link Chart#attach}).
*
* @param {Object} data Data to pass to the {@link Layer#draw|draw method} of
* this cart's {@link Layer|layers} (if any) and the {@link
* Chart#draw|draw method} of this chart's attachments (if any).
*/
Chart.prototype.draw = function(data) {
/**
* Create a new {@link Chart} constructor with the provided options acting as
* "overrides" for the default chart instance methods. Allows for basic
* inheritance so that new chart constructors may be defined in terms of
* existing chart constructors. Based on the `extend` function defined by
* [Backbone.js](http://backbonejs.org/).
*
* @static
* @externalExample {runnable} chart-extend
*
* @param {String} name Identifier for the new Chart constructor.
* @param {Object} protoProps Properties to set on the new chart's prototype.
* @param {Object} staticProps Properties to set on the chart constructor
* itself.
*
* @returns {Function} A new Chart constructor
*/
Chart.extend = function(name, protoProps, staticProps) {
var parent = this;
var child;
var layerName, attachmentName, attachmentData;
// The constructor function for the new subclass is either defined by
// you (the "constructor" property in your `extend` definition), or
// defaulted by us to simply call the parent's constructor.
if (protoProps && hasOwnProp.call(protoProps, "constructor")) {
child = protoProps.constructor;
} else {
child = function(){ return parent.apply(this, arguments); };
}
data = transformCascade.call(this, this, data);
// Add static properties to the constructor function, if supplied.
extend(child, parent, staticProps);
for (layerName in this._layers) {
this._layers[layerName].draw(data);
}
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
var Surrogate = function(){ this.constructor = child; };
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate();
for (attachmentName in this._attached) {
if (this.demux) {
attachmentData = this.demux(attachmentName, data);
} else {
attachmentData = data;
}
this._attached[attachmentName].draw(attachmentData);
}
};
// Add prototype properties (instance properties) to the subclass, if
// supplied.
if (protoProps) { extend(child.prototype, protoProps); }
/**
* Function invoked with the context specified when the handler was bound (via
* {@link Chart#on} {@link Chart#once}).
*
* @callback ChartEventHandler
* @param {...*} arguments Invoked with the arguments passed to {@link
* Chart#trigger}
*/
// Set a convenience property in case the parent's prototype is needed
// later.
child.__super__ = parent.prototype;
/**
* Subscribe a callback function to an event triggered on the chart. See {@link
* Chart#once} to subscribe a callback function to an event for one occurence.
*
* @param {String} name Name of the event
* @param {ChartEventHandler} callback Function to be invoked when the event
* occurs
* @param {Object} [context] Value to set as `this` when invoking the
* `callback`. Defaults to the chart instance.
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.on = function(name, callback, context) {
var events = this._events[name] || (this._events[name] = []);
events.push({
callback: callback,
context: context || this,
_chart: this
});
return this;
};
Chart[name] = child;
return child;
};
/**
* Subscribe a callback function to an event triggered on the chart. This
* function will be invoked at the next occurance of the event and immediately
* unsubscribed. See {@link Chart#on} to subscribe a callback function to an
* event indefinitely.
*
* @param {String} name Name of the event
* @param {ChartEventHandler} callback Function to be invoked when the event
* occurs
* @param {Object} [context] Value to set as `this` when invoking the
* `callback`. Defaults to the chart instance
*
* @returns {Chart} A reference to this chart (chainable)
*/
Chart.prototype.once = function(name, callback, context) {
var self = this;
var once = function() {
self.off(name, once);
callback.apply(this, arguments);
};
return this.on(name, once, context);
};
module.exports = Chart;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
/**
* Unsubscribe one or more callback functions from an event triggered on the
* chart. When no arguments are specified, *all* handlers will be unsubscribed.
* When only a `name` is specified, all handlers subscribed to that event will
* be unsubscribed. When a `name` and `callback` are specified, only that
* function will be unsubscribed from that event. When a `name` and `context`
* are specified (but `callback` is omitted), all events bound to the given
* event with the given context will be unsubscribed.
*
* @param {String} [name] Name of the event to be unsubscribed
* @param {ChartEventHandler} [callback] Function to be unsubscribed
* @param {Object} [context] Contexts to be unsubscribe
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.off = function(name, callback, context) {
var names, n, events, event, i, j;
// remove all events
if (arguments.length === 0) {
for (name in this._events) {
this._events[name].length = 0;
}
return this;
}
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
// remove all events for a specific name
if (arguments.length === 1) {
events = this._events[name];
if (events) {
events.length = 0;
}
return this;
}
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) {
"use strict";
// remove all events that match whatever combination of name, context
// and callback.
names = name ? [name] : Object.keys(this._events);
for (i = 0; i < names.length; i++) {
n = names[i];
events = this._events[n];
j = events.length;
while (j--) {
event = events[j];
if ((callback && callback === event.callback) ||
(context && context === event.context)) {
events.splice(j, 1);
module.exports = function(test, message) {
if (test) {
return;
}
}
}
throw new Error("[d3.chart] " + message);
};
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
return this;
};
/**
* Publish an event on this chart with the given `name`.
*
* @param {String} name Name of the event to publish
* @param {...*} arguments Values with which to invoke the registered
* callbacks.
*
* @returns {Chart} A reference to this chart (chainable).
*/
Chart.prototype.trigger = function(name) {
var args = Array.prototype.slice.call(arguments, 1);
var events = this._events[name];
var i, ev;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
if (events !== undefined) {
for (i = 0; i < events.length; i++) {
ev = events[i];
ev.callback.apply(ev.context, args);
}
}
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function(require) {
"use strict";
var d3 = __webpack_require__(1);
return this;
};
var Layer = __webpack_require__(5);
/**
* Create a new {@link Chart} constructor with the provided options acting as
* "overrides" for the default chart instance methods. Allows for basic
* inheritance so that new chart constructors may be defined in terms of
* existing chart constructors. Based on the `extend` function defined by
* {@link http://backbonejs.org/|Backbone.js}.
*
* @static
*
* @param {String} name Identifier for the new Chart constructor.
* @param {Object} protoProps Properties to set on the new chart's prototype.
* @param {Object} staticProps Properties to set on the chart constructor
* itself.
*
* @returns {Function} A new Chart constructor
*/
Chart.extend = function(name, protoProps, staticProps) {
var parent = this;
var child;
/**
* Create a new layer on the d3 selection from which it is called.
*
* @static
*
* @param {Object} [options] Options to be forwarded to {@link Layer|the Layer
* constructor}
* @returns {d3.selection}
*/
d3.selection.prototype.layer = function(options) {
var layer = new Layer(this);
var eventName;
// The constructor function for the new subclass is either defined by
// you (the "constructor" property in your `extend` definition), or
// defaulted by us to simply call the parent's constructor.
if (protoProps && hasOwnProp.call(protoProps, "constructor")) {
child = protoProps.constructor;
} else {
child = function(){ return parent.apply(this, arguments); };
}
// Set layer methods (required)
layer.dataBind = options.dataBind;
layer.insert = options.insert;
// Add static properties to the constructor function, if supplied.
extend(child, parent, staticProps);
// Bind events (optional)
if ("events" in options) {
for (eventName in options.events) {
layer.on(eventName, options.events[eventName]);
}
}
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
var Surrogate = function(){ this.constructor = child; };
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate();
// Mix the public methods into the D3.js selection (bound appropriately)
this.on = function() { return layer.on.apply(layer, arguments); };
this.off = function() { return layer.off.apply(layer, arguments); };
this.draw = function() { return layer.draw.apply(layer, arguments); };
// Add prototype properties (instance properties) to the subclass, if
// supplied.
if (protoProps) { extend(child.prototype, protoProps); }
return this;
};
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
// Set a convenience property in case the parent's prototype is needed
// later.
child.__super__ = parent.prototype;
Chart[name] = child;
return child;
};
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) {
"use strict";
var d3 = __webpack_require__(1);
/**
* Create a new chart constructor or return a previously-created chart
* constructor.
*
* @static
*
* @param {String} name If no other arguments are specified, return the
* previously-created chart with this name.
* @param {Object} protoProps If specified, this value will be forwarded to
* {@link Chart.extend} and used to create a new chart.
* @param {Object} staticProps If specified, this value will be forwarded to
* {@link Chart.extend} and used to create a new chart.
*/
d3.chart = function(name) {
if (arguments.length === 0) {
return Chart;
} else if (arguments.length === 1) {
return Chart[name];
}
var assert = __webpack_require__(3);
return Chart.extend.apply(Chart, arguments);
};
var lifecycleRe = /^(enter|update|merge|exit)(:transition)?$/;
/**
* Instantiate a chart or return the chart that the current selection belongs
* to.
*
* @static
*
* @param {String} [chartName] The name of the chart to instantiate. If the
* name is unspecified, this method will return the chart that the
* current selection belongs to.
* @param {mixed} options The options to use when instantiated the new chart.
* See {@link Chart} for more information.
*/
d3.selection.prototype.chart = function(chartName, options) {
// Without an argument, attempt to resolve the current selection's
// containing d3.chart.
if (arguments.length === 0) {
return this._chart;
}
var ChartCtor = Chart[chartName];
d3cAssert(ChartCtor, "No chart registered with name '" + chartName + "'");
/**
* Create a layer using the provided `base`. The layer instance is *not*
* exposed to d3.chart users. Instead, its instance methods are mixed in to the
* `base` selection it describes; users interact with the instance via these
* bound methods.
*
* @private
* @constructor
* @externalExample {runnable} layer
*
* @param {d3.selection} base The containing DOM node for the layer.
*/
var Layer = function(base) {
assert(base, "Layers must be initialized with a base.");
this._base = base;
this._handlers = {};
};
return new ChartCtor(this, options);
};
/**
* Invoked by {@link Layer#draw} to join data with this layer's DOM nodes. This
* implementation is "virtual"--it *must* be overridden by Layer instances.
*
* @param {Array} data Value passed to {@link Layer#draw}
*/
Layer.prototype.dataBind = function() {
assert(false, "Layers must specify a `dataBind` method.");
};
// Implement the zero-argument signature of `d3.selection.prototype.chart`
// for all selection types.
d3.selection.enter.prototype.chart = function() {
return this._chart;
};
d3.transition.prototype.chart = d3.selection.enter.prototype.chart;
})(this);
/**
* Invoked by {@link Layer#draw} in order to insert new DOM nodes into this
* layer's `base`. This implementation is "virtual"--it *must* be overridden by
* Layer instances.
*/
Layer.prototype.insert = function() {
assert(false, "Layers must specify an `insert` method.");
};
/**
* Subscribe a handler to a "lifecycle event". These events (and only these
* events) are triggered when {@link Layer#draw} is invoked--see that method
* for more details on lifecycle events.
*
* @externalExample {runnable} layer-on
*
* @param {String} eventName Identifier for the lifecycle event for which to
* subscribe.
* @param {Function} handler Callback function
*
* @returns {d3.selection} Reference to the layer's base.
*/
Layer.prototype.on = function(eventName, handler, options) {
options = options || {};
assert(
lifecycleRe.test(eventName),
"Unrecognized lifecycle event name specified to `Layer#on`: '" +
eventName + "'."
);
if (!(eventName in this._handlers)) {
this._handlers[eventName] = [];
}
this._handlers[eventName].push({
callback: handler,
chart: options.chart || null
});
return this._base;
};
/**
* Unsubscribe the specified handler from the specified event. If no handler is
* supplied, remove *all* handlers from the event.
*
* @externalExample {runnable} layer-off
*
* @param {String} eventName Identifier for event from which to remove
* unsubscribe
* @param {Function} handler Callback to remove from the specified event
*
* @returns {d3.selection} Reference to the layer's base.
*/
Layer.prototype.off = function(eventName, handler) {
var handlers = this._handlers[eventName];
var idx;
assert(
lifecycleRe.test(eventName),
"Unrecognized lifecycle event name specified to `Layer#off`: '" +
eventName + "'."
);
if (!handlers) {
return this._base;
}
if (arguments.length === 1) {
handlers.length = 0;
return this._base;
}
for (idx = handlers.length - 1; idx > -1; --idx) {
if (handlers[idx].callback === handler) {
handlers.splice(idx, 1);
}
}
return this._base;
};
/**
* Render the layer according to the input data: Bind the data to the layer
* (according to {@link Layer#dataBind}, insert new elements (according to
* {@link Layer#insert}, make lifecycle selections, and invoke all relevant
* handlers (as attached via {@link Layer#on}) with the lifecycle selections.
*
* - update
* - update:transition
* - enter
* - enter:transition
* - exit
* - exit:transition
*
* @externalExample {runnable} layer-draw
*
* @param {Array} data Data to drive the rendering.
*/
Layer.prototype.draw = function(data) {
var bound, entering, events, selection, method, handlers, eventName, idx,
len;
bound = this.dataBind.call(this._base, data);
// Although `bound instanceof d3.selection` is more explicit, it fails
// in IE8, so we use duck typing to maintain compatability.
assert(bound && bound.call === d3.selection.prototype.call,
"Invalid selection defined by `Layer#dataBind` method.");
assert(bound.enter, "Layer selection not properly bound.");
entering = bound.enter();
entering._chart = this._base._chart;
events = [
{
name: "update",
selection: bound
},
{
name: "enter",
selection: entering,
method: this.insert
},
{
name: "merge",
// Although the `merge` lifecycle event shares its selection object
// with the `update` lifecycle event, the object's contents will be
// modified when d3.chart invokes the user-supplied `insert` method
// when triggering the `enter` event.
selection: bound
},
{
name: "exit",
// Although the `exit` lifecycle event shares its selection object
// with the `update` and `merge` lifecycle events, the object's
// contents will be modified when d3.chart invokes
// `d3.selection.exit`.
selection: bound,
method: bound.exit
}
];
for (var i = 0, l = events.length; i < l; ++i) {
eventName = events[i].name;
selection = events[i].selection;
method = events[i].method;
// Some lifecycle selections modify shared state, so they must be
// deferred until just prior to handler invocation.
if (typeof method === "function") {
selection = method.call(selection);
}
if (selection.empty()) {
continue;
}
// Although `selection instanceof d3.selection` is more explicit,
// it fails in IE8, so we use duck typing to maintain
// compatability.
assert(selection &&
selection.call === d3.selection.prototype.call,
"Invalid selection defined for '" + eventName +
"' lifecycle event.");
handlers = this._handlers[eventName];
if (handlers) {
for (idx = 0, len = handlers.length; idx < len; ++idx) {
// Attach a reference to the parent chart so the selection"s
// `chart` method will function correctly.
selection._chart = handlers[idx].chart || this._base._chart;
selection.call(handlers[idx].callback);
}
}
handlers = this._handlers[eventName + ":transition"];
if (handlers && handlers.length) {
selection = selection.transition();
for (idx = 0, len = handlers.length; idx < len; ++idx) {
selection._chart = handlers[idx].chart || this._base._chart;
selection.call(handlers[idx].callback);
}
}
}
};
module.exports = Layer;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
/***/ }
/******/ ])
});
;

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

/*! d3.chart - v0.2.1
* License: MIT Expat
* Date: 2014-06-24
/*!
* d3.chart - v0.3.0
* License: MIT
* Date: 2016-01-23
*/
(function(t){"use strict";function e(t){var e,r,n,i;if(!t)return t;for(r=arguments.length,e=1;r>e;e++)if(n=arguments[e])for(i in n)t[i]=n[i];return t}var r=t.d3,n=Object.hasOwnProperty,i=function(t,e){if(!t)throw Error("[d3.chart] "+e)};i(r,"d3.js is required"),i("string"==typeof r.version&&r.version.match(/^3/),"d3.js version 3 is required");var a=/^(enter|update|merge|exit)(:transition)?$/,s=function(t){i(t,"Layers must be initialized with a base."),this._base=t,this._handlers={}};s.prototype.dataBind=function(){i(!1,"Layers must specify a `dataBind` method.")},s.prototype.insert=function(){i(!1,"Layers must specify an `insert` method.")},s.prototype.on=function(t,e,r){return r=r||{},i(a.test(t),"Unrecognized lifecycle event name specified to `Layer#on`: '"+t+"'."),t in this._handlers||(this._handlers[t]=[]),this._handlers[t].push({callback:e,chart:r.chart||null}),this._base},s.prototype.off=function(t,e){var r,n=this._handlers[t];if(i(a.test(t),"Unrecognized lifecycle event name specified to `Layer#off`: '"+t+"'."),!n)return this._base;if(1===arguments.length)return n.length=0,this._base;for(r=n.length-1;r>-1;--r)n[r].callback===e&&n.splice(r,1);return this._base},s.prototype.draw=function(t){var e,n,a,s,o,h,c,l;e=this.dataBind.call(this._base,t),i(e&&e.call===r.selection.prototype.call,"Invalid selection defined by `Layer#dataBind` method."),i(e.enter,"Layer selection not properly bound."),n=e.enter(),n._chart=this._base._chart,a=[{name:"update",selection:e},{name:"enter",selection:this.insert.bind(n)},{name:"merge",selection:e},{name:"exit",selection:e.exit.bind(e)}];for(var u=0,p=a.length;p>u;++u)if(h=a[u].name,s=a[u].selection,"function"==typeof s&&(s=s()),!s.empty()){if(i(s&&s.call===r.selection.prototype.call,"Invalid selection defined for '"+h+"' lifecycle event."),o=this._handlers[h])for(c=0,l=o.length;l>c;++c)s._chart=o[c].chart||this._base._chart,s.call(o[c].callback);if(o=this._handlers[h+":transition"],o&&o.length)for(s=s.transition(),c=0,l=o.length;l>c;++c)s._chart=o[c].chart||this._base._chart,s.call(o[c].callback)}},r.selection.prototype.layer=function(t){var e,r=new s(this);if(r.dataBind=t.dataBind,r.insert=t.insert,"events"in t)for(e in t.events)r.on(e,t.events[e]);return this.on=function(){return r.on.apply(r,arguments)},this.off=function(){return r.off.apply(r,arguments)},this.draw=function(){return r.draw.apply(r,arguments)},this};var o=function(t,e){var r=this.constructor,i=r.__super__;i&&o.call(i,t,e),n.call(r.prototype,"initialize")&&this.initialize.apply(t,e)},h=function(t,e){var r=this.constructor,i=r.__super__;return this===t&&n.call(this,"transform")&&(e=this.transform(e)),n.call(r.prototype,"transform")&&(e=r.prototype.transform.call(t,e)),i&&(e=h.call(i,t,e)),e},c=function(t,e){this.base=t,this._layers={},this._attached={},this._events={},e&&e.transform&&(this.transform=e.transform),o.call(this,this,[e])};c.prototype.initialize=function(){},c.prototype.unlayer=function(t){var e=this.layer(t);return delete this._layers[t],delete e._chart,e},c.prototype.layer=function(t,e,r){var n;if(1===arguments.length)return this._layers[t];if(2===arguments.length){if("function"==typeof e.draw)return e._chart=this,this._layers[t]=e,this._layers[t];i(!1,"When reattaching a layer, the second argument must be a d3.chart layer")}return n=e.layer(r),this._layers[t]=n,e._chart=this,n},c.prototype.attach=function(t,e){return 1===arguments.length?this._attached[t]:(this._attached[t]=e,e)},c.prototype.draw=function(t){var e,r,n;t=h.call(this,this,t);for(e in this._layers)this._layers[e].draw(t);for(r in this._attached)n=this.demux?this.demux(r,t):t,this._attached[r].draw(n)},c.prototype.on=function(t,e,r){var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:r||this,_chart:this}),this},c.prototype.once=function(t,e,r){var n=this,i=function(){n.off(t,i),e.apply(this,arguments)};return this.on(t,i,r)},c.prototype.off=function(t,e,r){var n,i,a,s,o,h;if(0===arguments.length){for(t in this._events)this._events[t].length=0;return this}if(1===arguments.length)return a=this._events[t],a&&(a.length=0),this;for(n=t?[t]:Object.keys(this._events),o=0;n.length>o;o++)for(i=n[o],a=this._events[i],h=a.length;h--;)s=a[h],(e&&e===s.callback||r&&r===s.context)&&a.splice(h,1);return this},c.prototype.trigger=function(t){var e,r,n=Array.prototype.slice.call(arguments,1),i=this._events[t];if(void 0!==i)for(e=0;i.length>e;e++)r=i[e],r.callback.apply(r.context,n);return this},c.extend=function(t,r,i){var a,s=this;a=r&&n.call(r,"constructor")?r.constructor:function(){return s.apply(this,arguments)},e(a,s,i);var o=function(){this.constructor=a};return o.prototype=s.prototype,a.prototype=new o,r&&e(a.prototype,r),a.__super__=s.prototype,c[t]=a,a},r.chart=function(t){return 0===arguments.length?c:1===arguments.length?c[t]:c.extend.apply(c,arguments)},r.selection.prototype.chart=function(t,e){if(0===arguments.length)return this._chart;var r=c[t];return i(r,"No chart registered with name '"+t+"'"),new r(this,e)},r.selection.enter.prototype.chart=function(){return this._chart},r.transition.prototype.chart=r.selection.enter.prototype.chart})(this);
//@ sourceMappingURL=d3.chart.min.map
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3")):"function"==typeof define&&define.amd?define("d3.chart",["d3"],e):"object"==typeof exports?exports["d3.chart"]=e(require("d3")):t["d3.chart"]=e(t.d3)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var n;n=function(t,e,n){"use strict";var i=r(1),o=r(2),a=r(3);a(/^3\./.test(i.version),"d3.js version 3 is required"),r(4),i.chart=function(t){return 0===arguments.length?o:1===arguments.length?o[t]:o.extend.apply(o,arguments)},i.selection.prototype.chart=function(t,e){if(0===arguments.length)return this._chart;var r=o[t];return a(r,"No chart registered with name '"+t+"'"),new r(this,e)},i.selection.enter.prototype.chart=function(){return this._chart},i.transition.prototype.chart=i.selection.enter.prototype.chart,n.exports=i.chart}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))},function(e,r){e.exports=t},function(t,e,r){var n;n=function(t,e,n){"use strict";function i(t){var e,r,n,i;if(!t)return t;for(r=arguments.length,e=1;r>e;e++)if(n=arguments[e])for(i in n)t[i]=n[i];return t}var o=r(3),a=Object.hasOwnProperty,s=function(t,e){var r=this.constructor,n=r.__super__;n&&s.call(n,t,e),a.call(r.prototype,"initialize")&&this.initialize.apply(t,e)},c=function(t,e){var r=this.constructor,n=r.__super__;return this===t&&a.call(this,"transform")&&(e=this.transform(e)),a.call(r.prototype,"transform")&&(e=r.prototype.transform.call(t,e)),n&&(e=c.call(n,t,e)),e},h=function(t,e){this.base=t,this._layers={},this._attached={},this._events={},e&&e.transform&&(this.transform=e.transform),s.call(this,this,[e])};h.prototype.initialize=function(){},h.prototype.unlayer=function(t){var e=this.layer(t);return delete this._layers[t],delete e._chart,e},h.prototype.layer=function(t,e,r){var n;if(1===arguments.length)return this._layers[t];if(2===arguments.length){if("function"==typeof e.draw)return e._chart=this,this._layers[t]=e,this._layers[t];o(!1,"When reattaching a layer, the second argument must be a d3.chart layer")}return n=e.layer(r),this._layers[t]=n,e._chart=this,n},h.prototype.attach=function(t,e){return 1===arguments.length?this._attached[t]:(this._attached[t]=e,e)},h.prototype.transform=function(t){return t},h.prototype.draw=function(t){var e,r,n;t=c.call(this,this,t);for(e in this._layers)this._layers[e].draw(t);for(r in this._attached)n=this.demux?this.demux(r,t):t,this._attached[r].draw(n)},h.prototype.on=function(t,e,r){var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:r||this,_chart:this}),this},h.prototype.once=function(t,e,r){var n=this,i=function(){n.off(t,i),e.apply(this,arguments)};return this.on(t,i,r)},h.prototype.off=function(t,e,r){var n,i,o,a,s,c;if(0===arguments.length){for(t in this._events)this._events[t].length=0;return this}if(1===arguments.length)return o=this._events[t],o&&(o.length=0),this;for(n=t?[t]:Object.keys(this._events),s=0;s<n.length;s++)for(i=n[s],o=this._events[i],c=o.length;c--;)a=o[c],(e&&e===a.callback||r&&r===a.context)&&o.splice(c,1);return this},h.prototype.trigger=function(t){var e,r,n=Array.prototype.slice.call(arguments,1),i=this._events[t];if(void 0!==i)for(e=0;e<i.length;e++)r=i[e],r.callback.apply(r.context,n);return this},h.extend=function(t,e,r){var n,o=this;n=e&&a.call(e,"constructor")?e.constructor:function(){return o.apply(this,arguments)},i(n,o,r);var s=function(){this.constructor=n};return s.prototype=o.prototype,n.prototype=new s,e&&i(n.prototype,e),n.__super__=o.prototype,h[t]=n,n},n.exports=h}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,r){var n;n=function(t,e,r){"use strict";r.exports=function(t,e){if(!t)throw new Error("[d3.chart] "+e)}}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,r){var n;n=function(t){"use strict";var e=r(1),n=r(5);e.selection.prototype.layer=function(t){var e,r=new n(this);if(r.dataBind=t.dataBind,r.insert=t.insert,"events"in t)for(e in t.events)r.on(e,t.events[e]);return this.on=function(){return r.on.apply(r,arguments)},this.off=function(){return r.off.apply(r,arguments)},this.draw=function(){return r.draw.apply(r,arguments)},this}}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,r){var n;n=function(t,e,n){"use strict";var i=r(1),o=r(3),a=/^(enter|update|merge|exit)(:transition)?$/,s=function(t){o(t,"Layers must be initialized with a base."),this._base=t,this._handlers={}};s.prototype.dataBind=function(){o(!1,"Layers must specify a `dataBind` method.")},s.prototype.insert=function(){o(!1,"Layers must specify an `insert` method.")},s.prototype.on=function(t,e,r){return r=r||{},o(a.test(t),"Unrecognized lifecycle event name specified to `Layer#on`: '"+t+"'."),t in this._handlers||(this._handlers[t]=[]),this._handlers[t].push({callback:e,chart:r.chart||null}),this._base},s.prototype.off=function(t,e){var r,n=this._handlers[t];if(o(a.test(t),"Unrecognized lifecycle event name specified to `Layer#off`: '"+t+"'."),!n)return this._base;if(1===arguments.length)return n.length=0,this._base;for(r=n.length-1;r>-1;--r)n[r].callback===e&&n.splice(r,1);return this._base},s.prototype.draw=function(t){var e,r,n,a,s,c,h,l,u;e=this.dataBind.call(this._base,t),o(e&&e.call===i.selection.prototype.call,"Invalid selection defined by `Layer#dataBind` method."),o(e.enter,"Layer selection not properly bound."),r=e.enter(),r._chart=this._base._chart,n=[{name:"update",selection:e},{name:"enter",selection:r,method:this.insert},{name:"merge",selection:e},{name:"exit",selection:e,method:e.exit}];for(var p=0,f=n.length;f>p;++p)if(h=n[p].name,a=n[p].selection,s=n[p].method,"function"==typeof s&&(a=s.call(a)),!a.empty()){if(o(a&&a.call===i.selection.prototype.call,"Invalid selection defined for '"+h+"' lifecycle event."),c=this._handlers[h])for(l=0,u=c.length;u>l;++l)a._chart=c[l].chart||this._base._chart,a.call(c[l].callback);if(c=this._handlers[h+":transition"],c&&c.length)for(a=a.transition(),l=0,u=c.length;u>l;++l)a._chart=c[l].chart||this._base._chart,a.call(c[l].callback)}},n.exports=s}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}])});
//# sourceMappingURL=d3.chart.min.map
# d3.chart migration guide
### From 0.2 to 0.3
- Change configuration from AMD- and CommonJS-enabled environments. d3.chart is
now defined using the Universal Module Definition ("UMD") pattern,
facilitating more natural consumption from projects that are structured
according to the AMD or CommonJS module formats.
- AMD projects should now define an entry to the "paths" configuration for
"d3.chart" (a "shim" configuration is no longer necessary).
- CommonJS projects may now include d3.chart directly via
`require('d3.chart')`.
- No change is required in projects that include `d3.chart` via an HTML
`<script>` tag.
- In all cases, this library will continue to define a new property on the
object exposed by the `d3` module.
### From 0.1 to 0.2

@@ -4,0 +19,0 @@

@@ -18,14 +18,27 @@ # d3.chart

$ bower install
$ bower install d3.chart
Otherwise, you can download it directly and embed it using a script tag.
You can also install it via [npm](http://npmjs.org) by running:
`d3.chart` depends on D3.js, so include it only *after* D3.js has been
defined in the document, e.g.
$ npm install d3.chart
```html
<script src="scripts/lib/d3.v3.min.js"></script>
<script src="scripts/lib/d3.chart.min.js"></script>
```
Otherwise, you can download it directly from this repository.
## Using
d3.chart implements "UMD", making it convenient to consume from a number of
environments:
- The library may be loaded in a web browser directly via HTML `<script>`
tags--just be sure to load it *after* D3.js, e.g.
```html
<script src="scripts/lib/d3.v3.min.js"></script>
<script src="scripts/lib/d3.chart.min.js"></script>
```
- From [AMD](https://github.com/amdjs/amdjs-api)-enabled environments, simply
add an entry for "d3.chart" in your `paths` configuration.
- Consuming using [CommonJS modules](http://wiki.commonjs.org/wiki/Modules/1.1)
(e.g. via tools like [Browserify](http://browserify.org/)) should "just work"
## Build Instructions

@@ -32,0 +45,0 @@

{
"name": "d3",
"version": "3.4.13",
"description": "A JavaScript visualization library for HTML and SVG.",
"main": "d3.js",
"scripts": [
"d3.js"
],
"ignore": [
".DS_Store",
".git",
".gitignore",
".npmignore",
".travis.yml",
"Makefile",
"bin",
"component.json",
"index.js",
"lib",
"node_modules",
"package.json",
"src",
"test"
],
"license": "BSD-3-Clause",
"ignore": [],
"homepage": "https://github.com/mbostock-bower/d3-bower",
"_release": "3.4.13",
"version": "3.5.16",
"_release": "3.5.16",
"_resolution": {
"type": "version",
"tag": "v3.4.13",
"commit": "2309086581f6ddb57a263c4f9ada77ea81e922da"
"tag": "v3.5.16",
"commit": "f541593777ebe842059fda09d3ce1b6de8b29a7d"
},
"_source": "git://github.com/mbostock-bower/d3-bower.git",
"_target": "~3.4.6",
"_originalSource": "d3"
"_target": "^3.5.16",
"_originalSource": "d3",
"_direct": true
}
# Data-Driven Documents
<a href="http://d3js.org"><img src="http://d3js.org/logo.svg" align="left" hspace="10" vspace="6"></a>
<a href="https://d3js.org"><img src="https://d3js.org/logo.svg" align="left" hspace="10" vspace="6"></a>
**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG, and CSS. **D3** emphasizes web standards and combines powerful visualization components with a data-driven approach to DOM manipulation, giving you the full capabilities of modern browsers without tying yourself to a proprietary framework.

@@ -7,0 +7,0 @@ Want to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki)

{
"name": "es6-promise-polyfill",
"version": "1.0.2",
"version": "1.0.0",
"main": "promise.js",

@@ -12,7 +12,7 @@ "ignore": [

"homepage": "https://github.com/lahmatiy/es6-promise-polyfill",
"_release": "1.0.2",
"_release": "1.0.0",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "e6f8c338ccf365cdd393f7953654851cac5f19e0"
"tag": "v1.0.0",
"commit": "70c9b49bf318f47696065fd40bf6a54b41009d23"
},

@@ -19,0 +19,0 @@ "_source": "git://github.com/lahmatiy/es6-promise-polyfill.git",

{
"name": "es6-promise-polyfill",
"namespace": "Promise",
"version": "1.0.2",
"version": "1.0.0",
"author": "Roman Dvornov <rdvornov@gmail.com>",

@@ -11,4 +11,6 @@ "description": "A polyfill for ES6 Promise",

},
"devDependencies": {},
"scripts": {},
"devDependencies": {
},
"scripts": {
},
"repository": {

@@ -15,0 +17,0 @@ "type": "git",

@@ -32,3 +32,3 @@ (function(global){

// node.js
exports.Promise = nativePromiseSupported ? NativePromise : Promise;
exports.Promise = Promise || NativePromise;
}

@@ -35,0 +35,0 @@ else

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

(function(t){function y(){for(var a=0;a<h.length;a++)h[a][0](h[a][1]);h=[];m=!1}function n(a,b){h.push([a,b]);m||(m=!0,z(y,0))}function A(a,b){function c(a){p(b,a)}function e(a){k(b,a)}try{a(c,e)}catch(d){e(d)}}function q(a){var b=a.owner,c=b.state_,b=b.data_,e=a[c];a=a.then;if("function"===typeof e){c=l;try{b=e(b)}catch(d){k(a,d)}}u(a,b)||(c===l&&p(a,b),c===r&&k(a,b))}function u(a,b){var c;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(b&&("function"===
typeof b||"object"===typeof b)){var e=b.then;if("function"===typeof e)return e.call(b,function(d){c||(c=!0,b!==d?p(a,d):v(a,d))},function(b){c||(c=!0,k(a,b))}),!0}}catch(d){return c||k(a,d),!0}return!1}function p(a,b){a!==b&&u(a,b)||v(a,b)}function v(a,b){a.state_===s&&(a.state_=w,a.data_=b,n(B,a))}function k(a,b){a.state_===s&&(a.state_=w,a.data_=b,n(C,a))}function B(a){a.state_=l;a.then_=a.then_.forEach(q)}function C(a){a.state_=r;a.then_=a.then_.forEach(q)}function f(a){if("function"!==typeof a)throw new TypeError("Promise constructor takes a function argument");
if(!1===this instanceof f)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];A(a,this)}var g=t.Promise,x=g&&"resolve"in g&&"reject"in g&&"all"in g&&"race"in g&&function(){var a;new g(function(b){a=b});return"function"===typeof a}();"undefined"!==typeof exports&&exports?exports.Promise=x?g:f:x||(t.Promise=f);var s="pending",w="sealed",l="fulfilled",r="rejected",D=function(){},z="undefined"!==typeof setImmediate?
(function(t){function x(){for(var a=0;a<h.length;a++)h[a][0](h[a][1]);h=[];m=!1}function n(a,b){h.push([a,b]);m||(m=!0,y(x,0))}function z(a,b){function c(a){p(b,a)}function e(a){k(b,a)}try{a(c,e)}catch(d){e(d)}}function q(a){var b=a.owner,c=b.state_,b=b.data_,e=a[c];a=a.then;if("function"===typeof e){c=l;try{b=e(b)}catch(d){k(a,d)}}u(a,b)||(c===l&&p(a,b),c===r&&k(a,b))}function u(a,b){var c;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(b&&("function"===
typeof b||"object"===typeof b)){var e=b.then;if("function"===typeof e)return e.call(b,function(d){c||(c=!0,b!==d?p(a,d):v(a,d))},function(b){c||(c=!0,k(a,b))}),!0}}catch(d){return c||k(a,d),!0}return!1}function p(a,b){a!==b&&u(a,b)||v(a,b)}function v(a,b){a.state_===s&&(a.state_=w,a.data_=b,n(A,a))}function k(a,b){a.state_===s&&(a.state_=w,a.data_=b,n(B,a))}function A(a){a.state_=l;a.then_=a.then_.forEach(q)}function B(a){a.state_=r;a.then_=a.then_.forEach(q)}function f(a){if("function"!==typeof a)throw new TypeError("Promise constructor takes a function argument");
if(!1===this instanceof f)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];z(a,this)}var g=t.Promise,C=g&&"resolve"in g&&"reject"in g&&"all"in g&&"race"in g&&function(){var a;new g(function(b){a=b});return"function"===typeof a}();"undefined"!==typeof exports&&exports?exports.Promise=f||g:C||(t.Promise=f);var s="pending",w="sealed",l="fulfilled",r="rejected",D=function(){},y="undefined"!==typeof setImmediate?
setImmediate:setTimeout,h=[],m;f.prototype={constructor:f,state_:s,then_:null,data_:void 0,then:function(a,b){var c={owner:this,then:new this.constructor(D),fulfilled:a,rejected:b};this.state_===l||this.state_===r?n(q,c):this.then_.push(c);return c.then},"catch":function(a){return this.then(null,a)}};f.all=function(a){if(!Array.isArray(a))throw new TypeError("You must pass an array to Promise.all().");return new this(function(b,c){function e(a){f++;return function(c){d[a]=c;--f||b(d)}}for(var d=[],
f=0,g=0,h;g<a.length;g++)(h=a[g])&&"function"===typeof h.then?h.then(e(g),c):d[g]=h;f||b(d)})};f.race=function(a){if(!Array.isArray(a))throw new TypeError("You must pass an array to Promise.race().");return new this(function(b,c){for(var e=0,d;e<a.length;e++)(d=a[e])&&"function"===typeof d.then?d.then(b,c):b(d)})};f.resolve=function(a){return a&&"object"===typeof a&&a.constructor===this?a:new this(function(b){b(a)})};f.reject=function(a){return new this(function(b,c){c(a)})}})((new Function("return this"))());

@@ -13,3 +13,3 @@ # ES6 Promise polyfill

The polyfill uses `setImmediate` if available, or fallback to use `setTimeout`. Use [setImmediate polyfill](https://github.com/YuzuJS/setImmediate) by @YuzuJS to reach better performance.
The polyfill uses `setImmediate` if available, or fallback to use `setTimeout`. Use [setImmediate polyfill](https://github.com/YuzuJS/setImmediate) by @YuzuJS to rich better performance.

@@ -67,5 +67,1 @@ ## How to use

```
## License
Licensed under the MIT License.
{
"name": "lodash",
"version": "2.4.2",
"main": "dist/lodash.compat.js",
"main": "lodash.js",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.log",
"*.map",
"*.md",
"/*.min.*",
"/lodash.js",
"index.js",
"lodash.src.js",
"component.json",
"package.json",
"doc",
"modularize",
"node_modules",

@@ -24,11 +20,12 @@ "perf",

"homepage": "https://github.com/lodash/lodash",
"_release": "2.4.2",
"version": "3.10.1",
"_release": "3.10.1",
"_resolution": {
"type": "version",
"tag": "2.4.2",
"commit": "47289d89e0155462ea6888e6bb2e258dc4daa9d0"
"tag": "3.10.1",
"commit": "ef20b4290cc4fe7551c82a552ea7ffa76548eec8"
},
"_source": "git://github.com/lodash/lodash.git",
"_target": "~2.4.1",
"_target": "^3.10.1",
"_originalSource": "lodash"
}

@@ -82,2 +82,4 @@ /*! Copyright 2016 Domo Inc. */

validateInitialIndex(validData);
if (validData.length) {

@@ -254,2 +256,16 @@ if (_Chart.c('staticValue')) {

/**
* ensure the initial index is within the range of the data length
*/
function validateInitialIndex(validData) {
if (_Chart.c('selectedIndex') < 0) {
_Chart.c('selectedIndex', 0);
return;
} else if (_Chart.c('selectedIndex') > validData.length - 1) {
_Chart.c('selectedIndex', validData.length - 1);
return;
}
return;
}
function updateConfigs() {

@@ -256,0 +272,0 @@ button.select('.btn-text').classed('center', _Chart.c('centerText')); //centerText

@@ -58,3 +58,3 @@ /*----------------------------------------------------------------------------------

},
src: ['*.js', '!Gruntfile.js', '!Publish_Gruntfile.js']
src: ['src/*.js']
},

@@ -66,3 +66,3 @@ dep: {

},
src: ['*.js', '!Gruntfile.js', '!Publish_Gruntfile.js']
src: ['src/*.js']
}

@@ -75,3 +75,3 @@ },

all: {
files: ['*.js'],
files: ['src/*.js'],
tasks: ['jshint:dev', 'webpack'],

@@ -78,0 +78,0 @@ options: {

{
"name": "@domoinc/button",
"version": "1.1.2",
"version": "1.1.3",
"description": "Button - Domo Widget",

@@ -16,4 +16,4 @@ "main": "dist/bundle.js",

"dependencies": {
"@domoinc/base-widget": "^1.5.0",
"d3": "^3.5.15",
"@domoinc/base-widget": "^1.5.2",
"d3": "^3.5.16",
"d3.chart": "^0.3.0"

@@ -20,0 +20,0 @@ },

@@ -25,2 +25,4 @@ var d3 = require('d3');

validateInitialIndex(validData);
if (validData.length) {

@@ -197,2 +199,16 @@ if (_Chart.c('staticValue')) {

/**
* ensure the initial index is within the range of the data length
*/
function validateInitialIndex(validData) {
if (_Chart.c('selectedIndex') < 0) {
_Chart.c('selectedIndex', 0);
return;
} else if (_Chart.c('selectedIndex') > validData.length - 1) {
_Chart.c('selectedIndex', validData.length - 1);
return;
}
return;
}
function updateConfigs() {

@@ -199,0 +215,0 @@ button.select('.btn-text').classed('center', _Chart.c('centerText')); //centerText

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc