From 65c9591c025870612186fb271e979dbed12cf835 Mon Sep 17 00:00:00 2001 From: declerambaul Date: Wed, 6 Jun 2012 17:01:57 +0200 Subject: [PATCH] Temporarily added test.json for debugging of new dataset-ui graph spec. --- data/graphs/active_editors_v1.json | 155 ------------------------ data/graphs/test.json | 231 ++++++++++++++++++++++++++++++++++++ lib/server/controllers/graph.co | 1 + 3 files changed, 232 insertions(+), 155 deletions(-) delete mode 100644 data/graphs/active_editors_v1.json create mode 100644 data/graphs/test.json diff --git a/data/graphs/active_editors_v1.json b/data/graphs/active_editors_v1.json deleted file mode 100644 index 571b417..0000000 --- a/data/graphs/active_editors_v1.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "options": { - "animatedZooms": true, - "avoidMinZero": false, - "axis": null, - "axisLabelColor": "#666666", - "axisLabelFontSize": 11, - "axisLabelFormatter": null, - "axisLabelWidth": 50, - "axisLineColor": "#AAAAAA", - "axisLineWidth": 0.3, - "axisTickSize": 3, - "colorSaturation": 1, - "colorValue": 0.5, - "colors": [ - "#FF0097", - "#EF8158", - "#83BB32", - "#182B53", - "#4596FF", - "#553DC9", - "#AD3238", - "#00FFBC", - "#F1D950" - ], - "connectSeparatedPoints": false, - "customBars": false, - "dateWindow": null, - "delimiter": ",", - "digitsAfterDecimal": 2, - "displayAnnotations": false, - "drawPoints": true, - "drawXAxis": true, - "drawXGrid": true, - "drawYAxis": true, - "drawYGrid": true, - "errorBars": false, - "file": null, - "fillAlpha": 0.15, - "fillGraph": false, - "fractions": false, - "gridLineColor": "#D8D8D8", - "gridLineWidth": 0.3, - "hideOverlayOnMouseOut": false, - "highlightCircleSize": 4, - "includeZero": false, - "interactionModel": null, - "isZoomedIgnoreProgrammaticZoom": false, - "labels": null, - "labelsDiv": null, - "labelsDivStyles": null, - "labelsDivWidth": 250, - "labelsKMB": true, - "labelsKMG2": false, - "labelsSeparateLines": true, - "labelsShowZeroValues": true, - "legend": "always", - "logscale": true, - "maxNumberWidth": 30, - "panEdgeFraction": null, - "pixelsPerLabel": null, - "pixelsPerXLabel": null, - "pixelsPerYLabel": null, - "pointSize": 1, - "rangeSelectorHeight": 40, - "rangeSelectorPlotFillColor": "#A7B1C4", - "rangeSelectorPlotStrokeColor": "#808FAB", - "rightGap": 20, - "rollPeriod": 1, - "showLabelsOnHighlight": true, - "showRangeSelector": false, - "showRoller": false, - "sigFigs": null, - "sigma": 2, - "stackedGraph": false, - "stepPlot": false, - "strokePattern": null, - "strokeWidth": 3, - "ticker": null, - "title": null, - "titleHeight": 18, - "valueFormatter": null, - "valueRange": null, - "visibility": null, - "wilsonInterval": true, - "xAxisHeight": null, - "xAxisLabelFormatter": null, - "xAxisLabelWidth": 55, - "xLabelHeight": 18, - "xValueFormatter": null, - "xValueParser": null, - "xlabel": null, - "y2label": null, - "yAxisLabelFormatter": null, - "yAxisLabelWidth": 50, - "yLabelWidth": 18, - "yValueFormatter": null, - "ylabel": "Number of Editors" - }, - - "slug": "active_editors_v1", - "id": "active_editors_v1", - "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", - - "parents": ["root"], - - "data": { - "palette": null, - "lines": [], - "id": "active_editors_v1", - "metrics": [{ - "index": 0, - "label": "Total Active Editors", - "type": "int", - "timespan": { - "start": null, - "end": null, - "step": null - }, - "disabled": false, - "source_id": "rc_active_editors_count", - "source_col": 1, - "color": "#E62F74", - "visible": true, - "format_value": null, - "format_axis": null, - "transforms": [], - "scale": 1 - }, { - "index": 0, - "label": "Total Very Active Editors", - "type": "int", - "timespan": { - "start": null, - "end": null, - "step": null - }, - "disabled": false, - "source_id": "rc_active_editors_count", - "source_col": 1, - "color": "#244792", - "visible": true, - "format_value": null, - "format_axis": null, - "transforms": [], - "scale": 1 - }] - }, - "result": "ok" - -} diff --git a/data/graphs/test.json b/data/graphs/test.json new file mode 100644 index 0000000..560e988 --- /dev/null +++ b/data/graphs/test.json @@ -0,0 +1,231 @@ +{ + "options": { + "animatedZooms": true, + "avoidMinZero": false, + "axis": null, + "axisLabelColor": "#666666", + "axisLabelFontSize": 11, + "axisLabelFormatter": null, + "axisLabelWidth": 50, + "axisLineColor": "#AAAAAA", + "axisLineWidth": 0.3, + "axisTickSize": 3, + "colorSaturation": 1, + "colorValue": 0.5, + "colors": [ + "#FF0097", + "#EF8158", + "#83BB32", + "#182B53", + "#4596FF", + "#553DC9", + "#AD3238", + "#00FFBC", + "#F1D950" + ], + "connectSeparatedPoints": false, + "customBars": false, + "dateWindow": null, + "delimiter": ",", + "digitsAfterDecimal": 2, + "displayAnnotations": false, + "drawPoints": true, + "drawXAxis": true, + "drawXGrid": true, + "drawYAxis": true, + "drawYGrid": true, + "errorBars": false, + "file": null, + "fillAlpha": 0.15, + "fillGraph": false, + "fractions": false, + "gridLineColor": "#D8D8D8", + "gridLineWidth": 0.3, + "hideOverlayOnMouseOut": false, + "highlightCircleSize": 4, + "includeZero": false, + "interactionModel": null, + "isZoomedIgnoreProgrammaticZoom": false, + "labels": null, + "labelsDiv": null, + "labelsDivStyles": null, + "labelsDivWidth": 250, + "labelsKMB": true, + "labelsKMG2": false, + "labelsSeparateLines": true, + "labelsShowZeroValues": true, + "legend": "always", + "logscale": true, + "maxNumberWidth": 30, + "panEdgeFraction": null, + "pixelsPerLabel": null, + "pixelsPerXLabel": null, + "pixelsPerYLabel": null, + "pointSize": 1, + "rangeSelectorHeight": 40, + "rangeSelectorPlotFillColor": "#A7B1C4", + "rangeSelectorPlotStrokeColor": "#808FAB", + "rightGap": 20, + "rollPeriod": 1, + "showLabelsOnHighlight": true, + "showRangeSelector": false, + "showRoller": false, + "sigFigs": null, + "sigma": 2, + "stackedGraph": false, + "stepPlot": false, + "strokePattern": null, + "strokeWidth": 3, + "ticker": null, + "title": null, + "titleHeight": 18, + "valueFormatter": null, + "valueRange": null, + "visibility": null, + "wilsonInterval": true, + "xAxisHeight": null, + "xAxisLabelFormatter": null, + "xAxisLabelWidth": 55, + "xLabelHeight": 18, + "xValueFormatter": null, + "xValueParser": null, + "xlabel": null, + "y2label": null, + "yAxisLabelFormatter": null, + "yAxisLabelWidth": 50, + "yLabelWidth": 18, + "yValueFormatter": null, + "ylabel": "Number of Editors" + }, + + "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", + "parents": ["root"], + + "data": { + "palette": null, + "lines": [], + "id": "active_editors", + "metrics": [ + { + "index": 0, + "source_id": "rc_active_editors_count", + "source_col": 1, + "label": "Total", + "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": 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, + "source_id": "rc_active_editors_count", + "source_col": 3, + "label": "Commons", + "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": 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 + }] + } + +} 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 -- 1.7.0.4