Skip to content

Commit

Permalink
provide warning if columns arity does not match Fixes jupyter#83
Browse files Browse the repository at this point in the history
(c) Copyright IBM Corp. 2015
  • Loading branch information
peller committed Nov 6, 2015
1 parent 561d9ea commit 38a44a8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion elements/urth-viz-chart/urth-viz-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
},

behaviors: [
Polymer.IronResizableBehavior
Polymer.IronResizableBehavior,
Urth.JupyterWidgetBehavior
],

listeners: {
Expand Down Expand Up @@ -205,6 +206,16 @@
primary = primary || this.primary;
secondary = secondary || this.secondary;

if (columns && datarows[0] && columns.length && datarows[0].length) {
if (columns.length != datarows[0].length) {
this.displayErrorMessage("Warning: arity of columns does not match data");
} else {
require(['d3'], function(d3) {
d3.select(this).select('.urth-widget-error').remove();
}.bind(this));
}
}

var columnSettings = this.columnSettings;
var values = (datarows[0] || []).map(function (rows, i) {
var t = function (d, i) {
Expand Down

0 comments on commit 38a44a8

Please sign in to comment.