- data/graphs/ - saved graph configurations.
- lib/ - [Coco][coco] files. Application logic lives here.
- lib/{chart,dashboard,dataset,graph}/ - Models and View Classes
-- lib/main-*.co - These files get included from the main [Jade][jade] views in www/. They act like client side controllers. They are responsible for setting up data and rendering views.
- lib/template/ - client side [Jade][jade] views. These are included and rendered by View classes.
- lib/server/ - Server side [Coco][coco] files.
- lib/server/server.co - [Express][expressjs] server setup. Routing is done here.
# Helper for setting up models
processData: (id, data={}) ->
+ ### If we got querystring args, apply them as overrides to the data
+ # loc = String root.location
+ # if loc.split '?' .1
+ # data = _.uncollapseObject _.fromKV that.replace('#', '%23')
+ # data.parents = JSON.parse that if data.parents
+ # data.options = _.synthesize do
+ # data.options or {}
+ # (v, k) -> [ k, dyglib.parseOption(k,v) ]
unless id and _ <[ edit new ]> .contains id
data.id = data.slug = id
data
+++ /dev/null
-Seq = require 'seq'
-Backbone = require 'backbone'
-
-{ _, op,
-} = require 'limn/util'
-{ AppView,
-} = require 'limn/app'
-{ BaseView, BaseModel, BaseList,
-} = require 'limn/base'
-{ ChartType, DygraphsChartType,
-} = require 'limn/chart'
-{ Graph, GraphList, GraphDisplayView,
-} = require 'limn/graph'
-{ DashboardView, Dashboard,
-} = require 'limn/dashboard'
-
-
-root = this
-
-
-# Create the Graph Scaffold
-main = ->
- # Process URL
- loc = String root.location
- data = {}
- if match = /\/dashboards\/([^\/?]+)/i.exec loc
- id = match[1]
- data.id = data.slug = id unless _ <[ edit new ]> .contains id
-
- # Instantiate model & view
- root.app = new AppView ->
- @model = root.dashboard = new Dashboard data, {+parse}
- @view = root.view = new DashboardView {@model}
-
-
-jQuery main
-
+++ /dev/null
-Seq = require 'seq'
-Backbone = require 'backbone'
-
-{ _, op,
-} = require 'limn/util'
-{ AppView,
-} = require 'limn/app'
-{ BaseView, BaseModel, BaseList,
-} = require 'limn/base'
-{ ChartType, DygraphsChartType,
-} = require 'limn/chart'
-{ Graph, GraphList, GraphDisplayView,
-} = require 'limn/graph'
-
-
-root = this
-CHART_OPTIONS_SPEC = []
-CHART_DEFAULT_OPTIONS = {}
-
-
-# Create the Graph Scaffold
-main = ->
- # Bind to URL changes
- History.Adapter.bind window, 'statechange', ->
- # console.log 'StateChange!\n\n', String(root.location), '\n\n'
-
-
-
- # Process URL
- loc = String root.location
- data = {}
-
- # If we got querystring args, apply them to the graph
- # if loc.split '?' .1
- # data = _.uncollapseObject _.fromKV that.replace('#', '%23')
- # data.parents = JSON.parse that if data.parents
- # data.options = _.synthesize do
- # data.options or {}
- # (v, k) -> [ k, dyglib.parseOption(k,v) ]
-
- # Extract id from URL
- if match = /\/graphs\/([^\/?]+)/i.exec loc
- id = match[1]
- data.id = data.slug = id unless _ <[ edit new ]> .contains id
-
- # _.dump _.clone(data.options), 'data.options'
-
- # Instantiate model & view
- root.app = new AppView ->
- @model = root.graph = new Graph data, {+parse}
- @view = root.view = new GraphDisplayView {@model}
-
-jQuery main
+++ /dev/null
-Seq = require 'seq'
-Backbone = require 'backbone'
-
-{ _, op,
-} = require 'limn/util'
-{ AppView,
-} = require 'limn/app'
-{ BaseView, BaseModel, BaseList,
-} = require 'limn/base'
-{ ChartType,
-} = require 'limn/chart'
-{ DataSource, DataSourceList,
-} = require 'limn/data'
-{ Graph, GraphList, GraphEditView,
-} = require 'limn/graph'
-
-
-root = this
-CHART_OPTIONS_SPEC = []
-CHART_DEFAULT_OPTIONS = {}
-
-main = ->
- # Bind to URL changes
- History.Adapter.bind window, 'statechange', ->
- # console.log 'StateChange!\n\n', String(root.location), '\n\n'
-
-
-
- # Process URL
- loc = String root.location
- data = {}
-
- # If we got querystring args, apply them to the graph
- # if loc.split '?' .1
- # data = _.uncollapseObject _.fromKV that.replace('#', '%23')
- # data.parents = JSON.parse that if data.parents
- # data.options = _.synthesize do
- # data.options or {}
- # (v, k) -> [ k, dyglib.parseOption(k,v) ]
-
- # Extract id from URL
- if match = /\/graphs\/([^\/?]+)/i.exec loc
- id = match[1]
- data.id = data.slug = id unless _ <[ edit new ]> .contains id
-
- # _.dump _.clone(data.options), 'data.options'
-
- # Instantiate app with model & view
- root.app = new AppView ->
- @model = root.graph = new Graph data, {+parse}
- @view = root.view = new GraphEditView {@model}
-
-jQuery main
+++ /dev/null
-{ _, op,
-} = require 'limn/util'
-{ BaseView, BaseModel, BaseList,
-} = require 'limn/base'
-{ Graph, GraphList, GraphListView
-} = require 'limn/graph'
-
-root = do -> this
-
-# instantiates a new GraphListView with the
-# passed in JSON graph_list_data, and then
-# appends the rendered view to the DOM.
-main = (graph_list_data) ->
- # graphs = root.graphs = new GraphList graph_list_data
- # view = root.view = new GraphListView { 'collection': graphs }
- view = root.view = new GraphListView
- graphs = root.graphs = view.collection
- $ '#content .inner' .append view.el
-
-# URL to query for saved graph JSON data.
-# graph_list_url = '/graphs.json'
-#
-# jQuery.ajax do
-# url : graph_list_url
-# dataType : 'json'
-# success : (res) ->
-# # result will be the returned JSON
-# # data of all of the saved graphs
-# jQuery main.bind this, res
-# error : (err) -> console.error err
-
-jQuery main
\ No newline at end of file
mixin css('dashboard.css', media='print')
-block main-scripts
- script
- var limn = require('limn/limn');
- //- script(src="/js/limn/main-dashboard.js?"+version)
mixin css('isotope.css')
-block main-scripts
- script
- var limn = require('limn/limn');
- //- script(src="/js/limn/main-edit.js?"+version)
block title
title Browse Graphs | Limn
-block main-scripts
- script
- var limn = require('limn/limn');
- //- script(src="/js/limn/main-graph-list.js?"+version)
append styles
mixin css('graph-display.css')
-block main-scripts
- script
- var limn = require('limn/limn');
- //- script(src="/js/limn/main-display.js?"+version)
script(src=src+"?"+version)
block page-scripts
+ script
+ var limn = require('limn/limn');
block main-scripts
block addenda