From 3a2404010f8c0fdb3a9e9940202f59b84cb2791f Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 10 Jun 2019 14:34:48 +0100 Subject: Validate data according to a schema It became clear that a formal schema would make it easier to validate data. This is now added and the code is updated to work with this schema. --- app/static/js/makeChart.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/static') diff --git a/app/static/js/makeChart.js b/app/static/js/makeChart.js index 85d743b..1a0283d 100644 --- a/app/static/js/makeChart.js +++ b/app/static/js/makeChart.js @@ -3,10 +3,12 @@ function preprocessData(data) { var n = 0; - data.forEach(function(d) { - d.X = n++; - d.Y = d.value; - }); + cleanData = []; + for (i=0; i