Checkpoint.
authorDavid Schoonover <dsc@wikimedia.org>
Tue, 5 Jun 2012 01:40:16 +0000 (18:40 -0700)
committerDavid Schoonover <dsc@wikimedia.org>
Tue, 5 Jun 2012 01:40:16 +0000 (18:40 -0700)
lib/base/base-view.co
lib/graph/graph-model.co
lib/graph/graph-view.co
lib/main-edit.co

index 8b15fac..0532d21 100644 (file)
@@ -58,7 +58,7 @@ BaseView = exports.BaseView = Backbone.View.extend mixinBase do # {{{
         
         @setModel @model
         @build()
-        @$el.on 'form submit', -> false
+        @$el.on 'form submit', -> it.preventDefault()
     
     setModel: (model) ->
         if @model
index c5b59ce..c205d16 100644 (file)
@@ -68,8 +68,12 @@ Graph = exports.Graph = BaseModel.extend do # {{{
         # dataset : null
         width   : 'auto'
         height  : 320
-        chartType : 'dygraphs'
         parents : <[ root ]>
+        callout :
+            enabled     : true
+            metric_idx  : 0
+            label       : ''
+        chartType : 'dygraphs'
         options : {}
     
     url: ->
index 659b760..80c6a6c 100644 (file)
@@ -153,6 +153,12 @@ GraphView = exports.GraphView = BaseView.extend do # {{{
         @chart = @chartType.render()
         this
     
+    /**
+     * Render the callout element.
+     */
+    renderCallout: ->
+        
+        this
     
     /**
      * Render the chart and other Graph-derived view components.
index 0ccad34..4ead2d5 100644 (file)
@@ -21,13 +21,7 @@ root = this
 CHART_OPTIONS_SPEC    = []
 CHART_DEFAULT_OPTIONS = {}
 
-
-# Create the Graph Scaffold
 main = ->
-    # Set up Dygraph chart type spec
-    # TODO: load this on-demand
-    # dyglib = new DygraphsChartType CHART_OPTIONS_SPEC
-    
     # Bind to URL changes
     History.Adapter.bind window, 'statechange', ->
         # console.log 'StateChange!\n\n', String(root.location), '\n\n'
@@ -58,18 +52,4 @@ main = ->
         @model = root.graph = new Graph data, {+parse}
         @view  = root.view  = new GraphEditView {@model}
 
-
-# Load data files
-# Seq([   <[ CHART_OPTIONS_SPEC /schema/dygraph.json ]>
-# ])
-# .parEach_ (next, [key, url]) ->
-#     jQuery.ajax do
-#         url : url,
-#         success : (res) ->
-#             root[key] = res
-#             next.ok()
-#         error : (err) -> console.error err
-# .seq ->
-#     jQuery main
-
 jQuery main