Created
August 5, 2014 01:31
-
-
Save AndyMoreland/b647652a4b51f0ad3f9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ = require 'underscore' | |
Query = require '../../models/query' | |
# Intended to compute various properties about a report model | |
# This should keep view logic out of the model, hopefully. | |
module.exports = | |
class ReportPresenter extends window.Backbone.Model | |
@AxisProvider: null | |
initialize: ({@report}) -> | |
# Proxy model events through the presenter | |
@listenTo @report, 'all', => | |
@trigger.apply this, arguments | |
getWeekOverWeekChange: => | |
throw new Error 'Abstract method.' | |
getData: => | |
@report.get 'data' | |
getDomain: => | |
throw new Error 'Abstract method.' | |
getRange: => | |
throw new Error 'Abstract method.' | |
buildAxisProvider: => | |
new @AxisProvider({reportPresenter: this}) | |
getLineData: => | |
throw new Error 'Abstract method.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment