From 6a7910bbd0c3011d26bebc7961dafa0c7aaeb8eb Mon Sep 17 00:00:00 2001 From: peller Date: Thu, 5 Nov 2015 22:28:51 -0500 Subject: [PATCH] provide warning if columns arity does not match Fixes #83 (c) Copyright IBM Corp. 2015 --- elements/urth-viz-chart/urth-viz-chart.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/elements/urth-viz-chart/urth-viz-chart.html b/elements/urth-viz-chart/urth-viz-chart.html index ced4df3e..6ca854d2 100644 --- a/elements/urth-viz-chart/urth-viz-chart.html +++ b/elements/urth-viz-chart/urth-viz-chart.html @@ -175,7 +175,8 @@ }, behaviors: [ - Polymer.IronResizableBehavior + Polymer.IronResizableBehavior, + Urth.JupyterWidgetBehavior ], listeners: { @@ -205,6 +206,10 @@ primary = primary || this.primary; secondary = secondary || this.secondary; + if (this.columns.length && datarows[0] && this.columns.length != datarows[0].length) { + this.displayErrorMessage("Warning: arity of columns does not match data"); + } + var columnSettings = this.columnSettings; var values = (datarows[0] || []).map(function (rows, i) { var t = function (d, i) {