Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 48d4542

Browse files
committed
update README
1 parent 1c9593a commit 48d4542

3 files changed

Lines changed: 91 additions & 2 deletions

File tree

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
react-charts
22
============
33

4-
common react charting components using chart.js
4+
rich interactive react charting components using [chart.js](http://www.chartjs.org/) including
5+
6+
* Line chart
7+
* Bar chart
8+
* Radar chart
9+
* Polar area chart
10+
* Pie chart
11+
* Doughnut chart
12+
13+
Installation
14+
------------
15+
### Browser
16+
```
17+
<script src="path/to/chart.js"></script>
18+
<script src="path/to/react-charts.js"></script>
19+
```
20+
21+
### CommonJS
22+
```
23+
// allow the components to use the React object
24+
require('react-charts/vars').React = React;
25+
```
26+
27+
Example Usage
28+
-------------
29+
```
30+
var LineChart = Chart.React.Line; // for browser include
31+
var LineChart = require("react-charts/line"); // for commonJS
32+
33+
var MyComponent = React.createClass({
34+
render: function() {
35+
return <LineChart data={chartData} options={chartOptions} width="600" height="250/>
36+
}
37+
});
38+
```
39+
40+
* ```data``` represents the chart data (see [chart.js](http://www.chartjs.org/) for details)
41+
* ```options``` represents the chart options (see [chart.js](http://www.chartjs.org/) for details)
42+
* all other parameters will be passed through to the ```canvas``` element

build.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,33 @@ var packageInfo = JSON.parse(fs.readFileSync('./package.json', {encoding: 'utf-8
1010
content = fs.readFileSync(file, {encoding: 'utf8'}),
1111
versionMatcher = new RegExp(name + ' v[0-9\.]+');
1212

13-
content = content.replace(versionMatcher, name + ' v' + version);
13+
var header = '/*!\n' +
14+
' * react-charts v' + version + '\n' +
15+
' * https://github.com/jhudson8/react-charts\n' +
16+
' *\n' +
17+
' *\n' +
18+
' * Copyright (c) 2014 Joe Hudson<joehud_AT_gmail.com>\n' +
19+
' *\n' +
20+
' * Permission is hereby granted, free of charge, to any person obtaining a copy\n' +
21+
' * of this software and associated documentation files (the "Software"), to deal\n' +
22+
' * in the Software without restriction, including without limitation the rights\n' +
23+
' * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n' +
24+
' * copies of the Software, and to permit persons to whom the Software is\n' +
25+
' * furnished to do so, subject to the following conditions:\n' +
26+
' *\n' +
27+
' * The above copyright notice and this permission notice shall be included in\n' +
28+
' * all copies or substantial portions of the Software.\n' +
29+
' *\n' +
30+
' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n' +
31+
' * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n' +
32+
' * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n' +
33+
' * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n' +
34+
' * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n' +
35+
' * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n' +
36+
' * THE SOFTWARE.\n' +
37+
' */\n';
38+
39+
content = header + content;
1440
fs.writeFileSync(file, content, {encoding: 'utf8'});
1541

1642
var minimized = UglifyJS.minify(file);

react-charts.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/*!
2+
* react-charts v0.0.1
3+
* https://github.com/jhudson8/react-charts
4+
*
5+
*
6+
* Copyright (c) 2014 Joe Hudson<joehud_AT_gmail.com>
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
126
/******/ (function(modules) { // webpackBootstrap
227
/******/ // The module cache
328
/******/ var installedModules = {};

0 commit comments

Comments
 (0)