Sha256: 89ac33043c4489d31d2d6f90b66f71f1562ccedd8e1bd3da23ef83e75fcab7ac

Contents?: true

Size: 784 Bytes

Versions: 2

Compression:

Stored size: 784 Bytes

Contents

Provides [d3.js|http://d3js.org] and its minimized version as a [Rack Middleware|https://github.com/rack/rack]. The version of this gem is intended to be the same as the version of d3 that is provided.

== Usage

=== Installation

+ (sudo) gem install rack-d3js

=== Rack

+ require 'rack/d3js'
+ use Rack::D3js
+
+ # run MyApp

If you prefer it in a particular path, that works as per Rack:

+ require 'rack/d3js'
+ map "/js" do
+   run Rack::D3js
+ end

=== Sinatra

If you want to serve d3 directly from a sinatra application, that is also possible:

+ require 'sinatra'
+ require 'rack/d3js'
+
+ use Rack::D3js
+ get '/' do
+   # ...
+ end

Or with modular sinatra

+ require 'sinatra/base'
+ require 'rack/d3js'
+
+ class MyApp < Sinatra::Base
+   use Rack::D3js
+   # ...
+ end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-d3js-3.4.10 wiki/Main
rack-d3js-3.4.8 wiki/Main