     else if args[0] instanceof Bacon.Observable
       data = args[0]
       params = _.extend {}, ctx.options(), args[1]
-    else if args[0] instanceof Server.LeadDataSource
-      # TODO opentsdb won't like some of these params
-      params = _.extend {}, ctx.options(), args[1]
-      if params.bindToBrush == true
-        params.brush ?= new Bacon.Model
-        data = bindToBrush params.brush, args[0]
-      else if params.bindToBrush instanceof Bacon.Observable
-        data = bindToBrush params.bindToBrush, args[0]
-      else
-        promise = args[0].load params
-    else
-      all_params = Server.args_to_params {args, default_options: ctx.options()}
-      params = all_params.client
-      source = new Server.LeadDataSource (brushParams) ->
-        Server.get_data _.extend {}, all_params.server, brushParams
+    else
+      if args[0] instanceof Server.LeadDataSource
+        source = args[0]
+        # TODO opentsdb won't like some of these params
+        params = _.extend {}, ctx.options(), args[1]
+      else
+        all_params = Server.args_to_params {args, default_options: ctx.options()}
+        params = all_params.client
+        source = serverDataSource(all_params.server)
+
       if params.bindToBrush == true
         params.brush ?= new Bacon.Model
         data = bindToBrush params.brush, source
       else if params.bindToBrush instanceof Bacon.Observable
         data = bindToBrush params.bindToBrush, source
         params.brush ?= params.bindToBrush
-        delete params.bindToBrush
-      else
-        promise = Server.get_data all_params.server
+      else
+        promise = source.load params
 
     if promise
       data = Bacon.fromPromise(promise)


    Bacon.combineTemplate params



  doc 'shareCursor', 'Use the same cursor on multiple graphs',
  '''
  # Usage

  ## `shareCursor()`

  Sets the `cursor` option to a new cursor. This cursor will be used by all subsequent calls to [`graph`](help:graphing.graph).

  ## `shareCursor(false)`

  Unsets the `cursor` option.

  ## `shareCursor(cursor)`

  Sets the value of the `cursor` option to the specified cursor.
  '''

  cmd 'shareCursor', (ctx, share=true) ->
    options = ctx.options()
    if share == false
      delete options.cursor
    else
      if share instanceof Bacon.Observable
        options.cursor = share
      else
        options.cursor = new Bacon.Model

  doc 'shareBrush', 'Use the same brush on multiple graphs',
  '''
  # Usage

  ## `shareBrush()`

  Sets the `brush` option to a new brush. This brush will be used by all subsequent calls to [`graph`](help:graphing.graph).

  ## `shareBrush(false)`

  Unsets the `brush` option.

  ## `shareBrush(brush)`

  Sets the value of the `brush` option to the specified brush.
  '''

  cmd 'shareBrush', (ctx, share=true) ->
    options = ctx.options()
    if share == false
      delete options.brush
    else
      if share instanceof Bacon.Observable
        options.brush = share
      else
        options.brush = new Bacon.Model

  fn 'brushParams', (ctx, brush) ->
    Context.value brushParams brush ? ctx.options().brush

  bindToBrush = (brush, source) ->
    serverParams = new Bacon.Model null
    serverParams.addSource brushParams(brush)

    serverParams.flatMapLatest (brushParams) ->
      Bacon.fromPromise source.load brushParams

  fn 'bindToBrush', (ctx, args...) ->
    if args[0] instanceof Server.LeadDataSource

      React.DOM.img {src: @props.url, style: {border: '1px solid #aaa'}}

Graphing = modules.export exports, 'graphing', ({component_fn, doc, cmd, fn}) ->
  doc 'shareCursor', 'Use the same cursor on multiple graphs',
  '''
  # Usage

  ## `shareCursor()`

  Sets the `cursor` option to a new cursor. This cursor will be used by all subsequent calls to [`graph`](help:graphing.graph).

  ## `shareCursor(false)`

  Unsets the `cursor` option.

  ## `shareCursor(cursor)`

  Sets the value of the `cursor` option to the specified cursor.
  '''

  cmd 'shareCursor', (ctx, share=true) ->
    options = ctx.options()
    if share == false
      delete options.cursor
    else
      if share instanceof Bacon.Observable
        options.cursor = share
      else
        options.cursor = new Bacon.Model

  doc 'shareBrush', 'Use the same brush on multiple graphs',
  '''
  # Usage

  ## `shareBrush()`

  Sets the `brush` option to a new brush. This brush will be used by all subsequent calls to [`graph`](help:graphing.graph).

  ## `shareBrush(false)`

  Unsets the `brush` option.

  ## `shareBrush(brush)`

  Sets the value of the `brush` option to the specified brush.
  '''

  cmd 'shareBrush', (ctx, share=true) ->
    options = ctx.options()
    if share == false
      delete options.brush
    else
      if share instanceof Bacon.Observable
        options.brush = share
      else
        options.brush = new Bacon.Model

  fn 'brushParams', (ctx, brush) ->
    Context.value brushParams brush ? ctx.options().brush

  brushParams = (brush) ->
    brush.filter(({brushing}) -> !brushing).map ({extent}) ->
      if extent?
