From: declerambaul Date: Wed, 6 Jun 2012 15:01:57 +0000 (+0200) Subject: Temporarily added test.json for debugging of new dataset-ui graph spec. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=65c9591c025870612186fb271e979dbed12cf835;p=kraken-ui.git Temporarily added test.json for debugging of new dataset-ui graph spec. --- diff --git a/data/graphs/active_editors_v1.json b/data/graphs/test.json similarity index 62% rename from data/graphs/active_editors_v1.json rename to data/graphs/test.json index 571b417..560e988 100644 --- a/data/graphs/active_editors_v1.json +++ b/data/graphs/test.json @@ -98,23 +98,26 @@ "ylabel": "Number of Editors" }, - "slug": "active_editors_v1", - "id": "active_editors_v1", + "slug": "test", + "id": "active_editors", "name": "Active Wikimedia Editors for All Wikimedia Projects (5+ edits per month)", "desc": "Aug 2010: Editors on Commons are no longer included in overall total, on the assumption that most also edit on one or more other projects. More precise detection of double counts between any projects and languages is in development (using Single User Login registration).", "notes": "", "height": 250, - "width": "auto", - + "width": "auto", "parents": ["root"], "data": { "palette": null, "lines": [], - "id": "active_editors_v1", - "metrics": [{ + "id": "active_editors", + "metrics": [ + { "index": 0, - "label": "Total Active Editors", + "source_id": "rc_active_editors_count", + "source_col": 1, + "label": "Total", + "color": "#E62F74", "type": "int", "timespan": { "start": null, @@ -122,17 +125,37 @@ "step": null }, "disabled": false, + "visible": true, + "format_value": null, + "format_axis": null, + "transforms": [], + "scale": 1 + }, + { + "index": 0, "source_id": "rc_active_editors_count", - "source_col": 1, - "color": "#E62F74", + "source_col": 2, + "label": "English", + "color": "#E62F74", + "type": "int", + "timespan": { + "start": null, + "end": null, + "step": null + }, + "disabled": false, "visible": true, "format_value": null, "format_axis": null, "transforms": [], "scale": 1 - }, { + }, + { "index": 0, - "label": "Total Very Active Editors", + "source_id": "rc_active_editors_count", + "source_col": 3, + "label": "Commons", + "color": "#E62F74", "type": "int", "timespan": { "start": null, @@ -140,16 +163,69 @@ "step": null }, "disabled": false, + "visible": true, + "format_value": null, + "format_axis": null, + "transforms": [], + "scale": 1 + }, + { + "index": 0, "source_id": "rc_active_editors_count", - "source_col": 1, - "color": "#244792", + "source_col": 4, + "label": "French", + "color": "#E62F74", + "type": "int", + "timespan": { + "start": null, + "end": null, + "step": null + }, + "disabled": false, + "visible": true, + "format_value": null, + "format_axis": null, + "transforms": [], + "scale": 1 + }, + { + "index": 0, + "source_id": "rc_active_editors_count", + "source_col": 5, + "label": "German", + "color": "#E62F74", + "type": "int", + "timespan": { + "start": null, + "end": null, + "step": null + }, + "disabled": false, + "visible": true, + "format_value": null, + "format_axis": null, + "transforms": [], + "scale": 1 + }, + { + "index": 0, + "source_id": "rc_active_editors_count", + "source_col": 6, + "label": "Russian", + "color": "#E62F74", + "type": "int", + "timespan": { + "start": null, + "end": null, + "step": null + }, + "disabled": false, "visible": true, "format_value": null, "format_axis": null, "transforms": [], "scale": 1 }] - }, - "result": "ok" + } } diff --git a/lib/server/controllers/graph.co b/lib/server/controllers/graph.co index b399ad6..50a11bb 100644 --- a/lib/server/controllers/graph.co +++ b/lib/server/controllers/graph.co @@ -54,6 +54,7 @@ class GraphController extends Controller parser = yaml.load err, data <- fs.readFile file, 'utf8' + if 'ENOENT' is err?.code return cb null, {} if err