@pluck 'default'
+
+
+ /**
+ * Resizes the HTML viewport. Override to disable, etc.
+ */
+ resizeViewport: ->
+ size = @determineSize()
+ @getElementsForRole 'viewport' .css size
+ size
+
/**
* Determines chart viewport size.
* @return { width, height }
/**
- * Resizes the HTML viewport.
- */
- resizeViewport: ->
- size = @determineSize()
- @getElementsForRole 'viewport' .css size
- size
-
-
- /**
* Transforms the domain objects into a hash of derived values using
* chart-type-specific keys.
* @returns {Object} The derived chart options.
mixin css('/vendor/bootstrap-colorpicker/css/colorpicker.css')
mixin css('/vendor/bootstrap-datepicker/css/datepicker.css')
mixin css('graph.css')
+ // new for SVG
mixin css('chart.css')
mixin css('data.css')
mixin css('isotope.css')
block main-scripts
script
- d3 = require('d3')
+ root = this
+
+ // import all the things, ugly JS-style
+ d3 = require('d3')
+ Seq = require('seq')
+ Backbone = require('backbone')
+ util = require('kraken/util'); _ = util._; op = util.op
+ AppView = require('kraken/app').AppView
+ base = require('kraken/base'); BaseView = base.BaseView; BaseModel = base.BaseModel; BaseList = base.BaseList
+ ChartType = require('kraken/chart').ChartType
+ data = require('kraken/data'); DataSource = data.DataSource; DataSourceList = data.DataSourceList
+ _graph = require('kraken/graph'); Graph = _graph.Graph; GraphList = _graph.GraphList; GraphEditView = _graph.GraphEditView
LineChartType = require('kraken/chart/type/d3/d3-line-chart-type')
+
+ // run on DOM-ready
jQuery(function(){
- setTimeout(function(){
- ct = view.chartType = graph.chartType = new LineChartType(graph, view);
- }, 100);
+ root.app = new AppView(function(){
+ this.model = root.graph = new Graph({ id:'d3-test' }, { parse:true })
+ this.view = root.view = new GraphEditView({ model:this.model })
+ this.view.chartType = this.model.chartType = new LineChartType(this.model, this.view);
+ });
});
- script(src="/js/kraken/main-edit.js?"+version)
+
+