Skip to content

Commit

Permalink
fixes shutterstock#604 seperate build into minification and development
Browse files Browse the repository at this point in the history
  • Loading branch information
cesine committed Jan 10, 2018
1 parent 2cc3276 commit cc49c00
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![NPM version][npm-image]][npm-url]
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coverage-image]][coverage-url]

Expand Down Expand Up @@ -90,15 +90,15 @@ A Rickshaw graph. Send an `element` reference, `series` data, and optionally ot

##### element

A reference to an HTML element that should hold the graph.
A reference to an HTML element that should hold the graph.

##### series

Array of objects containing series data to plot. Each object should contain `data` at a minimum, a sorted array of objects each with x and y properties. Optionally send a `name` and `color` as well. Some renderers and extensions may also support additional keys.

##### renderer

A string containing the name of the renderer to be used. Options include `area`, `stack`, `bar`, `line`, and `scatterplot`. Defaults to `line`. Also see the `multi` meta renderer in order to support different renderers per series.
A string containing the name of the renderer to be used. Options include `area`, `stack`, `bar`, `line`, and `scatterplot`. Defaults to `line`. Also see the `multi` meta renderer in order to support different renderers per series.

##### width

Expand Down Expand Up @@ -187,7 +187,7 @@ Rickshaw comes with a few color schemes. Instantiate a palette and specify a sch

```javascript
var palette = new Rickshaw.Color.Palette( { scheme: 'spectrum2001' } );

palette.color() // => first color in the palette
palette.color() // => next color in the palette...
```
Expand All @@ -196,7 +196,7 @@ Optionally, to palette.color() can take a numeric argument to specify which colo

```javascript
var palette = new Rickshaw.Color.Palette( { scheme: 'colorwheel' } );

palette.color(0) // => first color in the palette - red in this example
palette.color(2) // => third color in the palette - light blue
```
Expand All @@ -219,21 +219,17 @@ For graphs with more series than palettes have colors, specify an `interpolatedS

This library works in modern browsers and Internet Explorer 9+.

Rickshaw relies on the HTMLElement#classList API, which isn't natively supported in Internet Explorer 9. Rickshaw adds support by including a shim which implements the classList API by extending the HTMLElement prototype. You can disable this behavior if you like, by setting `RICKSHAW_NO_COMPAT` to a true value before including the library.

## Building
Rickshaw relies on the HTMLElement#classList API, which isn't natively supported in Internet Explorer 9. Rickshaw adds support by including a shim which implements the classList API by extending the HTMLElement prototype. You can disable this behavior if you like, by setting `RICKSHAW_NO_COMPAT` to a true value before including the library.

For building, we need [Node](http://nodejs.org) and [npm](http://npmjs.org). Running `make` should get you going with any luck.
## Minification

After doing a build you can run the tests with the command: `npm test`

If you'd like to do your own minification, you will need to give a hint to the minifier to leave variables named `$super` named `$super`. For example, with uglify on the command line:
If your project uses minification, you will need to give a hint to the minifier to leave variables named `$super` named `$super`. For example, with uglify on the command line:

```
$ uglify-js --reserved-names "$super" rickshaw.js > rickshaw.min.js
```

Or a sample configuration with `grunt-contrib-uglify`:
Or a sample configuration with `grunt-contrib-uglify`:

```javascript
uglify: {
Expand All @@ -243,6 +239,15 @@ uglify: {
}
```

## Development

For building, we use [Node](http://nodejs.org) and [npm](http://npmjs.org). Running `npm run build` or `make` should get you going with any luck.

After doing a build you can run the tests with the command: `npm test`

For more availible options see the [package.json](package.json) scripts section.


## Contributing

Pull requests are always welcome! Please follow a few guidelines:
Expand Down

0 comments on commit cc49c00

Please sign in to comment.