diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b4e8dc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +lib/ +node_modules/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a169b3d --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +.gitignore +.travis.yml +examples/ +src/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..31ca458 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +notifications: + email: false +node_js: + - '5.7' +before_install: + - npm i -g npm@^3.6.0 +before_script: + - npm prune +after_success: + - npm run semantic-release +branches: + except: + - "/^v\\d+\\.\\d+\\.\\d+$/" diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..98f6262 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,16 @@ +Internet Systems Consortium license +=================================== + +Copyright (c) `2016`, `Colin Meinke` + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d08113f --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# React SVG chart + +Animated SVG charts for React. + +## Installation + +``` +npm install react-svg-chart +``` + +## Usage + +```js +import React from 'react'; +import { BarChart } from 'react-svg-chart'; + +const App = () => ( + +); +``` diff --git a/examples/barChart/.gitignore b/examples/barChart/.gitignore new file mode 100644 index 0000000..8c7d1b8 --- /dev/null +++ b/examples/barChart/.gitignore @@ -0,0 +1,2 @@ +client.dist.js +node_modules/ diff --git a/examples/barChart/App.js b/examples/barChart/App.js new file mode 100644 index 0000000..2a232c7 --- /dev/null +++ b/examples/barChart/App.js @@ -0,0 +1,67 @@ +import React, { createClass } from 'react'; +import { BarChart } from '../../src'; + +const days = [ + { + title: 'Thursday, 9th March', + bars: [ + { value: 3.50 }, + { value: 7.45 }, + { value: 1.27 }, + { value: 1.15 }, + { value: 2.93 }, + ], + }, + { + title: 'Wednesday, 8th March', + bars: [ + { value: 1.92 }, + { value: 1.11 }, + { value: 7.20 }, + { value: 6.34 }, + { value: 3.15 }, + ], + }, + { + title: 'Tuesday, 7th March', + bars: [ + { value: 5.37 }, + { value: 7.32 }, + { value: 0.90 }, + { value: 4.78 }, + { value: 2.75 }, + ], + }, +]; + +const App = createClass({ + onChange ( e ) { + this.setState({ + day: days[ e.target.value ], + }); + }, + + getInitialState () { + return { + day: days[ 0 ], + }; + }, + + render () { + return ( +
+ + +
+ ); + } +}); + +export default App; diff --git a/examples/barChart/Page.js b/examples/barChart/Page.js new file mode 100644 index 0000000..054ee89 --- /dev/null +++ b/examples/barChart/Page.js @@ -0,0 +1,41 @@ +import React, { PropTypes } from 'react'; + +const propTypes = { + app: PropTypes.string.isRequired, +}; + +const Page = ({ app }) => ( + + + + + +
+