Skip to content
No description or website provided.
Groovy
Find file
Latest commit 7a6204a @jljouannic * Upgrade to Grails 2.4.0
* Upgrade to D3 3.4.8
* Added support for Asset Pipeline Plugin
Failed to load latest commit information.
grails-app * Upgrade to Grails 2.4.0
test/projects/d3-test-app * Upgrade to Grails 2.4.0
web-app/js/D3 * Upgrade to Grails 2.4.0
.gitignore cleanup
D3GrailsPlugin.groovy * Upgrade to Grails 2.4.0
LICENSE Initial commit
README.md
application.properties * Upgrade to Grails 2.4.0

README.md

D3.js Grails plugin

D3.js (Data-Driven Documents) is a JavaScript library for manipulating data and bring it to life using HTML, SVG and CSS.

This plugin simply provides a resource file for d3.js.

Installation

Edit BuildConfig.groovy and add the following plugin dependency:

runtime ":d3:3.4.8.0"

Version number

The version number of this plugin follows the version number of the D3.js version it bundles, with possible 4th-level point releases for patches/iterations of the plugin with the same D3.js library.

For example, the first release of this plugin is 3.4.8.0 because it provides D3.js 3.4.6. If there was a problem with this release, this might change to 3.4.8.1, 3.4.8.2, etc.

Usage

This plugin supports both the Resources Plugin and the Asset Pipeline Plugin

Resources Plugin

This plugin provides a D3Resources.groovy file in which a d3 module is defined. So, adding a reference to the D3.js library can be done by adding the following in GSP page header:

<r:require modules="d3"/>

Asset Pipeline Plugin

To use Asset-Pipeline to add a dependency to D3.js in your JavaScript code, you just have to write a require directive at the beginning of you JavaScript file:

//= require d3
console.log("And here begins my code");

See D3.js web site for documentation and many great examples to get you started.

Something went wrong with that request. Please try again.