@domoinc/bar-capacity-gauge
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "AutoWidgets", | ||
"main": "AutoWidgets.js", | ||
"version": "1.0.16", | ||
"version": "1.0.15", | ||
"authors": [ | ||
@@ -32,11 +32,11 @@ "AppTeam6" | ||
}, | ||
"_release": "1.0.16", | ||
"_release": "1.0.15", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "v1.0.16", | ||
"commit": "b0f48df7acb0ce66dd578babff2b959310e0c864" | ||
"tag": "v1.0.15", | ||
"commit": "a68ab5c57769b375470b0b08512105a4a8d6cd86" | ||
}, | ||
"_source": "git@git.empdev.domo.com:DA/AutoWidgets.git", | ||
"_target": "^1.0.1", | ||
"_target": "~1.0.1", | ||
"_originalSource": "DA/AutoWidgets" | ||
} |
@@ -114,64 +114,44 @@ if (!window.AutoWidgets) { | ||
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.showMessage(false); | ||
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 +164,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 +192,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 +223,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 +242,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 +275,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 +283,0 @@ filteredData = filterData(filteredData, filterColumns, filter.value); |
{ | ||
"name": "BaseWidget", | ||
"version": "1.5.0", | ||
"version": "1.5.2", | ||
"authors": [ | ||
@@ -36,12 +36,11 @@ "Domo Apps Team" | ||
}, | ||
"_release": "1.5.0", | ||
"_release": "1.5.2", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "v1.5.0", | ||
"commit": "4206be3ae3a1c3fb164674333b4c293c9ca70745" | ||
"tag": "v1.5.2", | ||
"commit": "f94735a58f479c7bda3d07545a22bddab4ccb69f" | ||
}, | ||
"_source": "git@git.empdev.domo.com:DA/BaseWidget.git", | ||
"_target": "~1.5.0", | ||
"_originalSource": "DA/BaseWidget", | ||
"_direct": true | ||
"_originalSource": "DA/BaseWidget" | ||
} |
@@ -93,3 +93,4 @@ /*! Copyright 2016 Domo Inc. */ | ||
left: 0, | ||
top: 0 | ||
top: 0, | ||
'pointer-events': 'none' | ||
}); | ||
@@ -96,0 +97,0 @@ } |
{ | ||
"name": "@domoinc/base-widget", | ||
"version": "1.5.0", | ||
"version": "1.5.2", | ||
"description": "BaseWidget - Domo Widget", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
@@ -36,3 +36,4 @@ var d3 = require('d3'); | ||
left: 0, | ||
top: 0 | ||
top: 0, | ||
'pointer-events': 'none' | ||
}); | ||
@@ -39,0 +40,0 @@ } |
@@ -35,3 +35,4 @@ { | ||
"_target": "^0.3.0", | ||
"_originalSource": "d3.chart" | ||
"_originalSource": "d3.chart", | ||
"_direct": true | ||
} |
@@ -35,5 +35,5 @@ { | ||
"_source": "git://github.com/mbostock-bower/d3-bower.git", | ||
"_target": "~3.5.15", | ||
"_target": "^3.5.15", | ||
"_originalSource": "d3", | ||
"_direct": true | ||
} |
@@ -36,4 +36,3 @@ { | ||
"_target": "~2.3.1", | ||
"_originalSource": "DA/da-theme2", | ||
"_direct": true | ||
"_originalSource": "DA/da-theme2" | ||
} |
{ | ||
"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": "@domoinc/bar-capacity-gauge", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "BarCapacityGauge - Domo Widget", | ||
@@ -16,3 +16,3 @@ "main": "dist/bundle.js", | ||
"dependencies": { | ||
"@domoinc/base-widget": "^1.5.0", | ||
"@domoinc/base-widget": "^1.5.2", | ||
"@domoinc/da-theme2": "^2.3.1", | ||
@@ -19,0 +19,0 @@ "@domoinc/utilities": "^4.2.3", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
16
1759785
154
36969
1
Updated@domoinc/base-widget@^1.5.2