diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a3dbc66c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +.idea/ +*.sublime-* +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index f2e06d91..e2e88fab 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,46 @@ # react-charts -Charts for React +Chart library for React + +# Examples + +If you just want to run the examples locally: + +1. Clone this repo and `cd` to the newly-created directory +2. Run `npm serve` in your terminal +3. Go to [http://localhost:8000](http://localhost:8000) + +# Development + +If you'd like to contribute to the development this project, first fork & clone this repo, and then follow these steps: + +### Global dependencies + +* This project uses NPM to manage dependencies and run scripts. Run `npm -v` to check if you already have it installed. +If you don't have it, NPM is packaged with Node.js - download and run the +[install package located on nodejs.org](https://nodejs.org/) to install. +* Babel is used to transpile ES6+ code to ES5 syntax. Install by running `npm install --global babel` +* Webpack is used to bundle the JS & styles for the examples. Install by running `npm install --global webpack` + +### Project dependencies + +* Run `npm install` in the project root directory. This will install all of the project dependencies into the +`node_modules` directory. + +### Development process + +* Run `npm run dev` to run the development server (webpack-dev-server), which will serve a live development version of +the examples at [localhost:9876](http://localhost:9876) +* Make changes to the library code in the `src` directory, and/or changes to the examples in the `examples/src` +directory. +* Once you are happy with your changes, run `npm run build` to generate a production build. (This transpiles the ES6 +library code, and transpiles + bundles the examples). +* `git commit` and `git push` your changes to your forked version of the repo. +* Open a Github pull request if you'd like to get your changes merged into the official repository. + +### Notes + +* **Do not make any changes in the `lib` or `examples/build` directories**, as these directories are destroyed and +regenerated on each build. +* The development server uses [react-hot-loader](https://github.com/gaearon/react-hot-loader) to automatically +"hot reload" changes to React components, so refreshing your web browser is usually not necessary. However, some +changes will still require a refresh to propagate. diff --git a/examples/build/bundle.js b/examples/build/bundle.js new file mode 100644 index 00000000..5ada2b20 --- /dev/null +++ b/examples/build/bundle.js @@ -0,0 +1,20868 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/build/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(1); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + __webpack_require__(2); + + var _react = __webpack_require__(6); + + var _react2 = _interopRequireDefault(_react); + + var _src = __webpack_require__(162); + + var App = _react2['default'].createClass({ + displayName: 'App', + + render: function render() { + return _react2['default'].createElement( + 'div', + null, + _react2['default'].createElement(_src.Component1, null), + _react2['default'].createElement(_src.Component2, null) + ); + } + }); + + _react2['default'].render(_react2['default'].createElement(App, null), document.getElementById('container')); + + exports['default'] = App; + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a