Temporarily added test.json for debugging of new dataset-ui graph spec.
authordeclerambaul <fabian.kaelin@gmail.com>
Wed, 6 Jun 2012 15:01:57 +0000 (17:01 +0200)
committerdeclerambaul <fabian.kaelin@gmail.com>
Wed, 6 Jun 2012 15:01:57 +0000 (17:01 +0200)
data/graphs/test.json [moved from data/graphs/active_editors_v1.json with 62% similarity]
lib/server/controllers/graph.co

similarity index 62%
rename from data/graphs/active_editors_v1.json
rename to data/graphs/test.json
index 571b417..560e988 100644 (file)
         "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,
                 "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,
                 "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"
+    }
 
 }
index b399ad6..50a11bb 100644 (file)
@@ -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