Skip to content
Browse files

Merge branch 'railsification'

Conflicts:
	js/index.js
	js/kde.js
  • Loading branch information...
2 parents 70367bc + c340a95 commit c76d64d0d971429287b68395417c87f0d248d4b3 @ConradIrwin committed
Showing with 1,186 additions and 8,497 deletions.
  1. +12 −0 .gitignore
  2. +38 −0 Gemfile
  3. +112 −0 Gemfile.lock
  4. +261 −0 README.rdoc
  5. +7 −0 Rakefile
  6. BIN app/assets/images/rails.png
  7. +16 −0 app/assets/javascripts/application.js
  8. +20 −0 app/assets/javascripts/bisect.js.coffee
  9. +90 −0 app/assets/javascripts/index.js.coffee
  10. +223 −0 app/assets/javascripts/kde.js.coffee
  11. 0 {components/d3 → app/assets/javascripts/lib}/d3.js
  12. 0 {components/jquery → app/assets/javascripts/lib}/jquery.js
  13. 0 {components/science.js → app/assets/javascripts/lib}/science.v1.js
  14. +4 −0 app/assets/javascripts/sample.js.coffee
  15. +13 −0 app/assets/stylesheets/application.css
  16. 0 {css → app/assets/stylesheets}/index.css
  17. +3 −0 app/controllers/application_controller.rb
  18. +2 −0 app/helpers/application_helper.rb
  19. 0 node_modules/express/node_modules/connect/node_modules/qs/test/browser/qs.css → app/mailers/.gitkeep
  20. 0 node_modules/bower/test/assets/package-jquery/foo.js → app/models/.gitkeep
  21. +14 −0 app/views/layouts/application.html.erb
  22. +0 −13 client/index.html
  23. +0 −3 components/bootstrap/.travis.yml
  24. +4 −0 config.ru
  25. +62 −0 config/application.rb
  26. +6 −0 config/boot.rb
  27. +25 −0 config/database.yml
  28. +5 −0 config/environment.rb
  29. +37 −0 config/environments/development.rb
  30. +67 −0 config/environments/production.rb
  31. +37 −0 config/environments/test.rb
  32. +7 −0 config/initializers/backtrace_silencers.rb
  33. +15 −0 config/initializers/inflections.rb
  34. +5 −0 config/initializers/mime_types.rb
  35. +7 −0 config/initializers/secret_token.rb
  36. +8 −0 config/initializers/session_store.rb
  37. +14 −0 config/initializers/wrap_parameters.rb
  38. +5 −0 config/locales/en.yml
  39. +58 −0 config/routes.rb
  40. +7 −0 db/seeds.rb
  41. +2 −0 doc/README_FOR_APP
  42. +0 −24 js/bisect.js
  43. +0 −158 js/index.js
  44. +0 −234 js/kde.js
  45. +0 −5 js/sample.js
  46. 0 node_modules/bower/node_modules/rimraf/test/test-fiber.js → lib/assets/.gitkeep
  47. 0 node_modules/bower/node_modules/request/tests/ssl/ca/ca.crl → lib/tasks/.gitkeep
  48. 0 node_modules/bower/node_modules/nopt/.npmignore → log/.gitkeep
  49. +0 −1 node_modules/.bin/bower
  50. +0 −1 node_modules/.bin/express
  51. +0 −62 node_modules/bower/.jshintrc
  52. +0 −3 node_modules/bower/.npmignore
  53. +0 −3 node_modules/bower/.travis.yml
  54. +0 −66 node_modules/bower/CHANGELOG.md
  55. +0 −7 node_modules/bower/LICENSE
  56. +0 −4 node_modules/bower/Makefile
  57. +0 −283 node_modules/bower/README.md
  58. +0 −44 node_modules/bower/bin/bower
  59. +0 −52 node_modules/bower/cleanup.js
  60. +0 −72 node_modules/bower/lib/commands/cache-clean.js
  61. +0 −45 node_modules/bower/lib/commands/help.js
  62. +0 −22 node_modules/bower/lib/commands/index.js
  63. +0 −45 node_modules/bower/lib/commands/info.js
  64. +0 −47 node_modules/bower/lib/commands/install.js
  65. +0 −111 node_modules/bower/lib/commands/link.js
  66. +0 −193 node_modules/bower/lib/commands/list.js
  67. +0 −49 node_modules/bower/lib/commands/lookup.js
  68. +0 −56 node_modules/bower/lib/commands/register.js
  69. +0 −49 node_modules/bower/lib/commands/search.js
  70. +0 −178 node_modules/bower/lib/commands/uninstall.js
  71. +0 −80 node_modules/bower/lib/commands/update.js
  72. +0 −44 node_modules/bower/lib/core/config.js
  73. +0 −220 node_modules/bower/lib/core/manager.js
  74. +0 −725 node_modules/bower/lib/core/package.js
  75. +0 −72 node_modules/bower/lib/core/source.js
  76. +0 −64 node_modules/bower/lib/core/unit_work.js
  77. +0 −12 node_modules/bower/lib/index.js
  78. +0 −26 node_modules/bower/lib/util/file-exists.js
  79. +0 −27 node_modules/bower/lib/util/hogan-colors.js
  80. +0 −23 node_modules/bower/lib/util/is-repo.js
  81. +0 −74 node_modules/bower/lib/util/prune.js
  82. +0 −24 node_modules/bower/lib/util/read-json.js
  83. +0 −64 node_modules/bower/lib/util/save.js
  84. +0 −36 node_modules/bower/lib/util/spawn.js
  85. +0 −41 node_modules/bower/lib/util/template.js
  86. +0 −1 node_modules/bower/node_modules/.bin/hulk
  87. +0 −1 node_modules/bower/node_modules/.bin/lodash
  88. +0 −1 node_modules/bower/node_modules/.bin/nopt
  89. +0 −1 node_modules/bower/node_modules/.bin/semver
  90. +0 −1 node_modules/bower/node_modules/.bin/vows
  91. +0 −4 node_modules/bower/node_modules/archy/.travis.yml
  92. +0 −92 node_modules/bower/node_modules/archy/README.markdown
  93. +0 −24 node_modules/bower/node_modules/archy/examples/beep.js
  94. +0 −25 node_modules/bower/node_modules/archy/examples/multi_line.js
  95. +0 −35 node_modules/bower/node_modules/archy/index.js
  96. +0 −44 node_modules/bower/node_modules/archy/package.json
  97. +0 −40 node_modules/bower/node_modules/archy/test/beep.js
  98. +0 −45 node_modules/bower/node_modules/archy/test/multi_line.js
  99. +0 −40 node_modules/bower/node_modules/archy/test/non_unicode.js
  100. +0 −9 node_modules/bower/node_modules/async/.gitmodules
  101. +0 −4 node_modules/bower/node_modules/async/.npmignore
  102. +0 −19 node_modules/bower/node_modules/async/LICENSE
  103. +0 −25 node_modules/bower/node_modules/async/Makefile
  104. +0 −1,021 node_modules/bower/node_modules/async/README.md
  105. +0 −3 node_modules/bower/node_modules/async/index.js
  106. +0 −692 node_modules/bower/node_modules/async/lib/async.js
  107. +0 −34 node_modules/bower/node_modules/async/package.json
  108. +0 −22 node_modules/bower/node_modules/colors/MIT-LICENSE.txt
  109. +0 −77 node_modules/bower/node_modules/colors/ReadMe.md
  110. +0 −269 node_modules/bower/node_modules/colors/colors.js
  111. +0 −74 node_modules/bower/node_modules/colors/example.html
  112. +0 −65 node_modules/bower/node_modules/colors/example.js
  113. +0 −23 node_modules/bower/node_modules/colors/package.json
  114. +0 −65 node_modules/bower/node_modules/colors/test.js
  115. +0 −5 node_modules/bower/node_modules/fstream/.npmignore
  116. +0 −3 node_modules/bower/node_modules/fstream/.travis.yml
  117. +0 −27 node_modules/bower/node_modules/fstream/LICENSE
  118. +0 −76 node_modules/bower/node_modules/fstream/README.md
  119. +0 −131 node_modules/bower/node_modules/fstream/examples/filter-pipe.js
  120. +0 −115 node_modules/bower/node_modules/fstream/examples/pipe.js
  121. +0 −54 node_modules/bower/node_modules/fstream/examples/reader.js
  122. +0 −24 node_modules/bower/node_modules/fstream/examples/symlink-write.js
  123. +0 −31 node_modules/bower/node_modules/fstream/fstream.js
  124. +0 −85 node_modules/bower/node_modules/fstream/lib/abstract.js
  125. +0 −67 node_modules/bower/node_modules/fstream/lib/collect.js
  126. +0 −250 node_modules/bower/node_modules/fstream/lib/dir-reader.js
  127. +0 −171 node_modules/bower/node_modules/fstream/lib/dir-writer.js
  128. +0 −147 node_modules/bower/node_modules/fstream/lib/file-reader.js
  129. +0 −95 node_modules/bower/node_modules/fstream/lib/file-writer.js
  130. +0 −32 node_modules/bower/node_modules/fstream/lib/get-type.js
  131. +0 −54 node_modules/bower/node_modules/fstream/lib/link-reader.js
  132. +0 −95 node_modules/bower/node_modules/fstream/lib/link-writer.js
  133. +0 −93 node_modules/bower/node_modules/fstream/lib/proxy-reader.js
  134. +0 −109 node_modules/bower/node_modules/fstream/lib/proxy-writer.js
  135. +0 −259 node_modules/bower/node_modules/fstream/lib/reader.js
  136. +0 −38 node_modules/bower/node_modules/fstream/lib/socket-reader.js
  137. +0 −389 node_modules/bower/node_modules/fstream/lib/writer.js
  138. +0 −1 node_modules/bower/node_modules/fstream/node_modules/graceful-fs/.npmignore
  139. +0 −23 node_modules/bower/node_modules/fstream/node_modules/graceful-fs/LICENSE
  140. +0 −5 node_modules/bower/node_modules/fstream/node_modules/graceful-fs/README.md
Sorry, we could not display the entire diff because too many files (2,726) changed.
View
12 .gitignore
@@ -0,0 +1,12 @@
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+/public/assets
+
+.DS_Store
View
38 Gemfile
@@ -0,0 +1,38 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.9'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platforms => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'debugger'
View
112 Gemfile.lock
@@ -0,0 +1,112 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.9)
+ actionpack (= 3.2.9)
+ mail (~> 2.4.4)
+ actionpack (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.9)
+ activesupport (= 3.2.9)
+ builder (~> 3.0.0)
+ activerecord (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.4)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.4.0)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.1)
+ journey (1.0.4)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.7.5)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.5.0)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (3.2.9)
+ actionmailer (= 3.2.9)
+ actionpack (= 3.2.9)
+ activerecord (= 3.2.9)
+ activeresource (= 3.2.9)
+ activesupport (= 3.2.9)
+ bundler (~> 1.0)
+ railties (= 3.2.9)
+ railties (3.2.9)
+ actionpack (= 3.2.9)
+ activesupport (= 3.2.9)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.3)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.2.4)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.2.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ jquery-rails
+ rails (= 3.2.9)
+ sass-rails (~> 3.2.3)
+ sqlite3
+ uglifier (>= 1.0.3)
View
261 README.rdoc
@@ -0,0 +1,261 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, create a new Rails application:
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
+
+2. Change directory to <tt>myapp</tt> and start the web server:
+ <tt>cd myapp; rails server</tt> (run with --help for options)
+
+3. Go to http://localhost:3000/ and you'll see:
+ "Welcome aboard: You're riding Ruby on Rails!"
+
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
+
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
+
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.all
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+ #<Post:0x14a6620
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better, you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you can enter "cont".
+
+
+== Console
+
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+ made to the database.
+* Passing an environment name as an argument will load the corresponding
+ environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.org/pickaxe/irb.html
+
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
+
+== Description of Contents
+
+The default directory structure of a generated Ruby on Rails application:
+
+ |-- app
+ | |-- assets
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ | |-- controllers
+ | |-- helpers
+ | |-- mailers
+ | |-- models
+ | `-- views
+ | `-- layouts
+ |-- config
+ | |-- environments
+ | |-- initializers
+ | `-- locales
+ |-- db
+ |-- doc
+ |-- lib
+ | `-- tasks
+ |-- log
+ |-- public
+ |-- script
+ |-- test
+ | |-- fixtures
+ | |-- functional
+ | |-- integration
+ | |-- performance
+ | `-- unit
+ |-- tmp
+ | |-- cache
+ | |-- pids
+ | |-- sessions
+ | `-- sockets
+ `-- vendor
+ |-- assets
+ `-- stylesheets
+ `-- plugins
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/assets
+ Contains subdirectories for images, stylesheets, and JavaScript files.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from
+ ApplicationController which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb. Models descend from
+ ActiveRecord::Base by default.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
+ eRuby syntax by default.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the
+ common header/footer method of wrapping views. In your views, define a layout
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
+ Inside default.html.erb, call <% yield %> to render the view using this
+ layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are
+ generated for you automatically when using generators for controllers.
+ Helpers can be used to wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database,
+ and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all the
+ sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when
+ generated using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that
+ doesn't belong under controllers, models, or helpers. This directory is in
+ the load path.
+
+public
+ The directory available for the web server. Also contains the dispatchers and the
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
+ server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the rails generate
+ command, template test files will be generated for you and placed in this
+ directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins
+ subdirectory. If the app has frozen rails, those gems also go here, under
+ vendor/rails/. This directory is in the load path.
View
7 Rakefile
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Plotocrat::Application.load_tasks
View
BIN app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
16 app/assets/javascripts/application.js
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree ./lib
+//= require_tree .
View
20 app/assets/javascripts/bisect.js.coffee
@@ -0,0 +1,20 @@
+# Binary search within an array.
+# *
+# * Returns the first index at which 'f' returns false.
+# *
+# * e.g. to find the index of 3 in array:
+# * science.bisect(array, function (x) { return x < 3;})
+# *
+# * Taken from http://hg.python.org/cpython/file/2.7/Lib/bisect.py
+#
+science.bisect = (array, f) ->
+ lo = 0
+ hi = array.length
+ mid = undefined
+ while lo < hi
+ mid = Math.floor((lo + hi) / 2)
+ if f(array[mid])
+ lo = mid + 1
+ else
+ hi = mid
+ lo
View
90 app/assets/javascripts/index.js.coffee
@@ -0,0 +1,90 @@
+
+# cdf(window.faithful);
+(->
+ $ ->
+ cdf = (data) ->
+ kde = science.stats.distribution.kde().sample(data).resolution(200)
+ x = undefined
+ if kde.feelsLogarithmic()
+ kde.log true
+ x = d3.scale.log()
+ else
+ x = d3.scale.linear()
+ x.clamp(true).domain([data[0], data[data.length - 1]]).range([40, width]).nice()
+ axisTicks = x.ticks(10)
+ y = d3.scale.linear().domain([1, 0]).range([40, height])
+ yk = d3.scale.linear().domain([kde.max(), 0]).range([40, height])
+ viz = d3.select("#cdf").style("width", width).style("height", height).append("svg:svg").attr("width", 40 + width).attr("height", height + 40).attr("class", "viz").append("svg:g")
+ viz.selectAll("line.ydivisions.strong").data([0, 1]).enter().append("svg:line").attr("class", "ydivisions strong").attr("x1", x(axisTicks[0])).attr("x2", x(axisTicks[axisTicks.length - 1])).attr("y1", y).attr "y2", y
+ viz.selectAll("line.ydivisions.weak").data(d3.range(0, 1, 0.25)).enter().append("svg:line").attr("class", "ydivisions weak").attr("x1", x(axisTicks[0])).attr("x2", x(axisTicks[axisTicks.length - 1])).attr("y1", y).attr "y2", y
+ viz.selectAll("line.xdivisions").data(axisTicks).enter().append("svg:line").attr("class", (d, i) ->
+ if i is 0 or d.toString().match(/^10*$/) or i is axisTicks.length - 1
+ "xdivisions strong"
+ else
+ "xdivisions weak"
+ ).attr("y1", y(0)).attr("y2", y(1)).attr("x1", x).attr "x2", x
+ viz.selectAll("text.xticklabels").data(axisTicks).enter().append("svg:text").attr("class", "xticklabels").text((d, i) ->
+ if i is 0 or d.toString().match(/^10*$/) or i is axisTicks.length - 1
+ d
+ else
+ ""
+ ).attr("x", x).attr "y", height + 15
+ viz.selectAll("text.xtitle").data([0]).enter().append("svg:text").attr("class", "xtitle").text("Email size (kb)").attr("x", 40 + width / 2).attr "y", height + 30
+ viz.selectAll("text.ytitle").data([0]).enter().append("svg:text").attr("class", "ytitle").text("Probability").attr("transform", "rotate(270 30 " + (40 + height / 2) + ")").attr("x", 20).attr "y", 40 + height / 2
+ viz.selectAll("text.y2title").data([0]).enter().append("svg:text").attr("class", "y2title").text("Count so far").attr("transform", "rotate(90 " + (width + 10) + " " + (40 + height / 2) + ")").attr("x", width + 10).attr "y", 40 + height / 2
+ viz.selectAll("path.pdf").data([kde.pdf()]).enter().append("svg:path").attr("class", "pdf").attr "d", d3.svg.line().x((d) ->
+ x d[0]
+ ).y((d) ->
+ yk d[1]
+ )
+ viz.selectAll("path.cdf").data([kde.cdf()]).enter().append("svg:path").attr("class", "cdf").attr "d", d3.svg.line().x((d) ->
+ x d[0]
+ ).y((d) ->
+ y d[1]
+ )
+ viz.selectAll("circle.mode").data([kde.mode()]).enter().append("svg:circle").attr("class", "mode").attr("r", 4).attr("cx", x).attr "cy", (d) ->
+ yk kde(d)
+
+ viz.selectAll("circle.expectation").data([kde.expectation()]).enter().append("svg:circle").attr("class", "expectation").attr("r", 4).attr("cx", x).attr "cy", ->
+ y 0.25
+
+ viz.selectAll("circle.percentile").data(kde.qf()).enter().append("svg:circle").attr("class", "percentile").attr("r", 4).attr("cx", (d) ->
+ x d[0]
+ ).attr "cy", (d) ->
+ y d[1]
+
+ viz.selectAll("line.fugi").data([0]).enter().append("svg:line").attr("class", "fugi").attr("y1", y(0)).attr("y2", y(1)).attr("x1", x).attr "x2", x
+ viz.selectAll("circle.fugired").data([0]).enter().append("svg:circle").attr("class", "fugired").attr("r", 5).attr("cx", 0).attr "cy", 0
+ viz.selectAll("circle.fugiblue").data([0]).enter().append("svg:circle").attr("class", "fugiblue").attr("r", 5).attr("cx", 0).attr "cy", 0
+ $svg = $(viz[0][0]).closest("svg")
+ $svg.mousemove((e) ->
+ pos = x.invert(e.clientX - 10)
+ if pos < axisTicks[0]
+ pos = axisTicks[0]
+ else pos = axisTicks[axisTicks.length - 1] if pos > axisTicks[axisTicks.length - 1]
+ $svg.find("line.fugi").attr("x1", x(pos)).attr "x2", x(pos)
+ $svg.find(".fugired, .fugiblue").attr "cx", x(pos)
+ $svg.find(".fugiblue").attr "cy", yk(kde(pos))
+ $svg.find(".fugired").attr "cy", y(kde.inverseQuantile(pos))
+ ).mouseover(->
+ $svg.find("line.fugi").show()
+ ).mouseout ->
+ $svg.find("line.fugi").hide()
+
+ height = 400
+ width = 600
+ window.emails = window.emails.filter((x) ->
+ x isnt 0
+ )
+ window.normal = window.normal.map(Number).filter((x) ->
+ x isnt 0
+ ).sort(d3.ascending)
+ window.faithful = window.faithful.sort(d3.ascending)
+ window.foo = [1, 2]
+ cdf window.emails
+ cdf window.normal
+ cdf window.files
+ cdf window.faithful
+ cdf window.foo
+
+).call this
View
223 app/assets/javascripts/kde.js.coffee
@@ -0,0 +1,223 @@
+# TODO: figure out http://www.umiacs.umd.edu/labs/cvl/pirl/vikas/Software/optimal_bw/optimal_bw_code.htm
+science.stats.distribution.kde = ->
+ delog = (x) ->
+ (if log then Math.exp(x) else x)
+ enlog = (x) ->
+ (if log then Math.log(x) else x)
+ logSample = ->
+ unless cache.log
+ cache.log = (if log then sample.map((x) ->
+ Math.log x
+ ) else sample)
+ cache.log
+
+ # Return the KDE as an array of [x, probability-density] pairs.
+ quantized = ->
+ unless cache.quantized
+ first = logSample()[0]
+ last = logSample()[logSample().length - 1]
+ step = (last - first) / resolution
+ calculated = underlying(d3.range(first, last, step))
+
+ # Ensure KDE function hits the axis.
+ # (this is necessary to calculate expectation correctly)
+ while calculated[0][1] > 1e-3
+ first -= step
+ calculated.unshift underlying([first])[0]
+ while calculated[calculated.length - 1][1] > 1e-3
+ last += step
+ calculated.push underlying([last])[0]
+ calculated.unshift [first, 0]
+ calculated.push [last, 0]
+ cache.quantized = calculated
+ cache.quantized
+ delogKde = ->
+ if log
+ quantized().map (d) ->
+ [Math.exp(d[0]), d[1]]
+
+ else
+ quantized()
+ kde = (x) ->
+ underlying([enlog(x)])[0][1]
+ underlying = science.stats.kde()
+ sample = []
+ cache = {}
+ log = false
+ resolution = 100
+ kde.bandwidth = (x) ->
+ return underlying.bandwidth() unless arguments.length
+ underlying.bandwidth x
+ kde
+
+ kde.kernel = (x) ->
+ return underlying.kernel() unless arguments.length
+ underlying.kernel x
+ kde
+
+
+ # The samples from which to derive the KDE.
+ # *
+ # * An array of numbers.
+ #
+ kde.sample = (x) ->
+ return sample unless arguments.length
+ sample = x
+ cache = {}
+ underlying.sample logSample()
+ kde
+
+
+ # Whether to perform KDE on the log of the samples instead of the samples themselves
+ # *
+ # * The main reason to set this is that the symmetrical kernel used by default will
+ # * give very bizarre results if the data distribution is not locally symmetrical,
+ # * however it also interacts with the resolution parameter so that the resolution will
+ # * appear uniform when plotted on a log-graph.
+ # *
+ # * If you set this you should plot the KDE function on a log-graph (and vice-versa).
+ # *
+ # * [1] http://www.ebyte.it/library/docs/math04a/PdfChangeOfCoordinates04.html
+ #
+ kde.log = (x) ->
+ return log unless arguments.length
+ log = x
+ cache = {}
+ underlying.sample logSample()
+ kde
+
+
+ # How many samples will be used.
+ # *
+ # * This effects the number of points returned by kde() with no arguments,
+ # * and (to a small amount) the accuracy of the estimate provided by .expectation().
+ # *
+ # * You probably want to set this to the same order of magnitude as the number of
+ # * pixels in the graph so that the curve looks smooth.
+ #
+ kde.resolution = (x) ->
+ return resolution unless arguments.length
+ resolution = x
+ cache = {}
+ kde
+
+
+ # The 'mode' of the kde.
+ # *
+ # * This is the highest point of the probability density function; intuitively the value
+ # * around which samples tend to cluster. (e.g. most files are 4kb)
+ # *
+ # * (The more usual definition of mode as 'the value that occurs most often' falls
+ # * apart a bit when you have continuous data as the chances of the same exact value
+ # * occuring more than once is negligable).
+ # *
+ # * http://en.wikipedia.org/wiki/Mode_(statistics)
+ #
+ kde.mode = ->
+ max = -Infinity
+ kde = quantized()
+ ret = undefined
+ kde.forEach (d) ->
+ if d[1] > max
+ max = d[1]
+ ret = d[0]
+
+ delog ret
+
+
+ # The 'expectation' of the kde.
+ # *
+ # * This is the first moment of the data; and corresponds to most people's intuitive
+ # * value for 'average'. (e.g. a typical file is 32kb, size = 32kb * number of files)
+ # *
+ # * (The arithmetic mean is often used in place of expectation, as they're roughly
+ # * equivalent for symmetrical distributions. The expectation degrades more gracefully
+ # * when the data is very skewed).
+ # *
+ # * http://en.wikipedia.org/wiki/Expected_value
+ #
+ kde.expectation = ->
+ accum = 0
+ kde = quantized()
+ a = undefined
+ b = undefined
+ i = 0
+
+ while i < kde.length - 1
+ a = kde[i]
+ b = kde[i + 1]
+
+ # integrate(x * f(x))
+ # => sum the area of all quadrilaterals of size d
+ accum += (b[0] - a[0]) * (a[0] * a[1] + b[0] * b[1]) / 2
+ i++
+ delog accum
+
+
+ # The 'median' of the data.
+ # *
+ # * Half the data is smaller than the median, the other half is bigger.
+ # * (e.g. half of all files are smaller than 16kb)
+ #
+ kde.median = ->
+ kde.percentile 0.5
+
+ kde.max = ->
+ kde kde.mode()
+
+ kde.quantile = (q) ->
+ index = q * (sample.length - 1)
+ lo = Math.floor(index)
+ hi = Math.ceil(index)
+ if lo is hi or hi >= sample.length
+ sample[lo]
+ else
+ sample[lo] + (index - lo) * (sample[hi] - sample[lo]) / (hi - lo)
+
+ kde.inverseQuantile = (x) ->
+ # sample[lo] < x <= sample[hi]
+ hi = science.bisect(sample, (d) ->
+ d < x
+ )
+ lo = hi - 1
+ if hi is sample.length
+ 1
+ else if hi is 0
+ 0
+ else
+ (lo + (hi - lo) * (x - sample[lo]) / (sample[hi] - sample[lo])) / (sample.length - 1)
+
+
+ # The probability density function as an array of [x, y] pairs.
+ kde.pdf = ->
+ delogKde()
+
+
+ # Some quartiles as an array of [x, y] pairs.
+ kde.qf = ->
+ ys = [0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99, 1]
+ ys.map (y) ->
+ [kde.quantile(y), y]
+
+
+
+ # The cumulative probability function as an array of [x, y] pairs
+ kde.cdf = ->
+ unless cache.cdf
+ cache.cdf = sample.map((x, i) ->
+ [x, i / (sample.length - 1)]
+ )
+ cache.cdf
+
+ kde.feelsLogarithmic = ->
+ tenth = kde.quantile(0.1)
+ fiftieth = kde.quantile(0.5)
+ ninetieth = kde.quantile(0.9)
+
+ # if 50% of the data takes up <10% of the graph, it's logarithmic
+ if (fiftieth - tenth) / (ninetieth - tenth) < 0.2
+ true
+ else
+ false
+
+ kde
View
0 components/d3/d3.js → app/assets/javascripts/lib/d3.js
File renamed without changes.
View
0 components/jquery/jquery.js → app/assets/javascripts/lib/jquery.js
File renamed without changes.
View
0 components/science.js/science.v1.js → app/assets/javascripts/lib/science.v1.js
File renamed without changes.
View
4 app/assets/javascripts/sample.js.coffee
4 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
13 app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
View
0 css/index.css → app/assets/stylesheets/index.css
File renamed without changes.
View
3 app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
View
2 app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
0 ...nnect/node_modules/qs/test/browser/qs.css → app/mailers/.gitkeep
File renamed without changes.
View
0 ...s/bower/test/assets/package-jquery/foo.js → app/models/.gitkeep
File renamed without changes.
View
14 app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Plotocrat</title>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
13 client/index.html
@@ -1,13 +0,0 @@
-<script src="/components/jquery/jquery.js"></script>
-<script src="/components/d3/d3.js"></script>
-<script src="/components/science.js/science.v1.js"></script>
-<script src="/js/sample.js"></script>
-<script src="/js/bisect.js"></script>
-<script src="/js/kde.js"></script>
-<script src="/js/index.js"></script>
-<style>
- @import url("/css/index.css");
-</style>
-<textarea></textarea>
-
-<div id="cdf"></div>
View
0 components/bootstrap/.gitignore
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
3 components/bootstrap/.travis.yml
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - 0.6
View
0 components/bootstrap/CONTRIBUTING.md
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/LICENSE
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/Makefile
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/README.md
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/component.json
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/composer.json
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/css/bootstrap-responsive.css
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/css/bootstrap.css
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/css/docs.css
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/ico/apple-touch-icon-114-precomposed.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/ico/apple-touch-icon-144-precomposed.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/ico/apple-touch-icon-57-precomposed.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/ico/apple-touch-icon-72-precomposed.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/ico/favicon.ico
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/ico/favicon.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bs-docs-bootstrap-features.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bs-docs-masthead-pattern.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bs-docs-responsive-illustrations.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/bs-docs-twitter-github.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/8020select.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/adoptahydrant.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/breakingnews.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/fleetio.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/gathercontent.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/jshint.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/kippt.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/example-sites/soundready.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-carousel.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-fluid.jpg
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-hero.jpg
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-marketing-narrow.png
Deleted file not rendered
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-signin.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-starter.jpg
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/bootstrap-example-sticky-footer.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/browser-icon-chrome.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/browser-icon-firefox.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/browser-icon-safari.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/slide-01.jpg
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/slide-02.jpg
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/examples/slide-03.jpg
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/glyphicons-halflings-white.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/glyphicons-halflings.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/grid-baseline-20px.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/less-logo-large.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/img/responsive-illustrations.png
Diff not rendered.
View
0 components/bootstrap/docs/assets/js/README.md
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/application.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-affix.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-alert.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-button.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-carousel.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-collapse.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-dropdown.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-modal.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-popover.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-scrollspy.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-tab.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-tooltip.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-transition.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap-typeahead.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/bootstrap.min.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/google-code-prettify/prettify.css
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/google-code-prettify/prettify.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/holder/holder.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/assets/js/jquery.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/base-css.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/build/index.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/build/package.json
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/components.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/customize.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/carousel.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/fluid.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/hero.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/marketing-alternate.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/marketing-narrow.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/signin.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/starter-template.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/examples/sticky-footer.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/extend.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/getting-started.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/index.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/javascript.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/scaffolding.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/layout.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/base-css.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/components.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/customize.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/extend.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/getting-started.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/index.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/javascript.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/docs/templates/pages/scaffolding.mustache
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/img/glyphicons-halflings-white.png
Diff not rendered.
View
0 components/bootstrap/img/glyphicons-halflings.png
Diff not rendered.
View
0 components/bootstrap/js/.jshintrc
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-affix.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-alert.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-button.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-carousel.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-collapse.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-dropdown.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-modal.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-popover.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-scrollspy.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-tab.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-tooltip.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-transition.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/bootstrap-typeahead.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/index.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/phantom.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/server.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-affix.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-alert.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-button.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-carousel.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-collapse.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-dropdown.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-modal.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-phantom.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-popover.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-scrollspy.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-tab.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-tooltip.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-transition.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/unit/bootstrap-typeahead.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/vendor/jquery.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/vendor/qunit.css
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/js/tests/vendor/qunit.js
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/accordion.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/alerts.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/bootstrap.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/breadcrumbs.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/button-groups.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/buttons.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/carousel.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/close.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/code.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/component-animations.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/dropdowns.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/forms.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/grid.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/hero-unit.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/labels-badges.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/layouts.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/media.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/mixins.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/modals.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/navbar.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/navs.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/pager.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/pagination.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/popovers.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/progress-bars.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/reset.less
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 components/bootstrap/less/responsive-1200px-min.less
Sorry, we could not display the changes to this file because there were too many other files to display.
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Plotocrat::Application
View
62 config/application.rb
@@ -0,0 +1,62 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
+
+module Plotocrat
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+
+ # Enable escaping HTML in JSON.
+ config.active_support.escape_html_entities_in_json = true
+
+ # Use SQL instead of Active Record's schema dumper when creating the database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ config.active_record.whitelist_attributes = true
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+ end
+end
View
6 config/boot.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
View
25 config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
View
5 config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Plotocrat::Application.initialize!
View
37 config/environments/development.rb
@@ -0,0 +1,37 @@
+Plotocrat::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+end
View
67 config/environments/production.rb
@@ -0,0 +1,67 @@
+Plotocrat::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to nil and saved in location specified by config.assets.prefix
+ # config.assets.manifest = YOUR_PATH
+
+ # Specifies the header that your server uses for sending files
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Prepend all log lines with the following tags
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
+end
View
37 config/environments/test.rb
@@ -0,0 +1,37 @@
+Plotocrat::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Log error messages when you accidentally call methods on nil
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
View
7 config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
15 config/initializers/inflections.rb
@@ -0,0 +1,15 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+#
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.acronym 'RESTful'
+# end
View
5 config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
View
7 config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Plotocrat::Application.config.secret_token = '7e91d35595d5a4ec89427b81da284dfeb5cd83db250cf08ceb489a3de135e61a3e341884290b1a7a83f3b6b47e7670c9f37613652d13d5c855194e4dffa04070'
View
8 config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Plotocrat::Application.config.session_store :cookie_store, key: '_plotocrat_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Plotocrat::Application.config.session_store :active_record_store
View
14 config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
View
5 config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
View
58 config/routes.rb
@@ -0,0 +1,58 @@
+Plotocrat::Application.routes.draw do
+ # The priority is based upon order of creation:
+ # first created -> highest priority.
+
+ # Sample of regular route:
+ # match 'products/:id' => 'catalog#view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Sample resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Sample resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Sample resource route with more complex sub-resources
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', :on => :collection
+ # end
+ # end
+
+ # Sample resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ root :to => 'plots#index'
+
+ # See how all your routes lay out with "rake routes"
+
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
+ # Note: This route will make all actions in every controller accessible via GET requests.
+ # match ':controller(/:action(/:id))(.:format)'
+end
View
7 db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
+# Mayor.create(name: 'Emanuel', city: cities.first)
View
2 doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
24 js/bisect.js
@@ -1,24 +0,0 @@
-/* Binary search within an array.
- *
- * Returns the first index at which 'f' returns false.
- *
- * e.g. to find the index of 3 in array:
- * science.bisect(array, function (x) { return x < 3;})
- *
- * Taken from http://hg.python.org/cpython/file/2.7/Lib/bisect.py
- */
-science.bisect = function (array, f) {
- var lo = 0, hi = array.length, mid;
-
- while (lo < hi) {
- mid = Math.floor((lo + hi) / 2);
-
- if (f(array[mid])) {
- lo = mid + 1;
- } else {
- hi = mid;
- }
- }
-
- return lo;
-};
View
158 js/index.js
@@ -1,158 +0,0 @@
-(function () {
- $(function () {
- var height = 400, width = 600;
-
- function cdf(data) {
- var kde = science.stats.distribution.kde().sample(data).resolution(200);
-
- var x;
- if (kde.feelsLogarithmic()) {
- x = d3.scale.log();
- } else {
- x = d3.scale.linear();
- }
- x.clamp(true).domain([data[0], data[data.length - 1]]).range([40, width]).nice();
- kde.scale(x.copy());
- var axisTicks = x.ticks(5);
- var y = d3.scale.linear().domain([1, 0]).range([40, height]);
- var yk = d3.scale.linear().domain([kde.max(), 0]).range([40, height]);
-
- var viz = d3.select('#cdf').style('width', width).style('height', height)
- .append('svg:svg').attr('width', 40 + width).attr('height', height + 40).attr('class', 'viz')