Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up to date react and babel modules. #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
node_modules
example/dist/
lib
104 changes: 104 additions & 0 deletions lib/area.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactD3Core = require('react-d3-core');

var _reactD3Shape = require('react-d3-shape');

var _commonProps = require('./commonProps');

var _commonProps2 = _interopRequireDefault(_commonProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var AreaChart = function (_Component) {
_inherits(AreaChart, _Component);

function AreaChart(props) {
_classCallCheck(this, AreaChart);

return _possibleConstructorReturn(this, (AreaChart.__proto__ || Object.getPrototypeOf(AreaChart)).call(this, props));
}

_createClass(AreaChart, [{
key: 'render',
value: function render() {
var _props = this.props,
width = _props.width,
height = _props.height,
margins = _props.margins,
data = _props.data,
chartSeries = _props.chartSeries,
showXGrid = _props.showXGrid,
showYGrid = _props.showYGrid,
showLegend = _props.showLegend,
categoricalColors = _props.categoricalColors;


var xgrid, ygrid;

if (showXGrid) xgrid = _react2.default.createElement(_reactD3Core.Xgrid, null);
if (showYGrid) ygrid = _react2.default.createElement(_reactD3Core.Ygrid, null);

return _react2.default.createElement(
'div',
null,
showLegend ? _react2.default.createElement(_reactD3Core.Legend, _extends({}, this.props, {
width: width,
margins: margins,
chartSeries: chartSeries,
categoricalColors: categoricalColors
})) : null,
_react2.default.createElement(
_reactD3Shape.Chart,
_extends({}, this.props, {
width: width,
height: height,
data: data,
chartSeries: chartSeries
}),
_react2.default.createElement(_reactD3Shape.Area, {
chartSeries: chartSeries
}),
xgrid,
ygrid,
_react2.default.createElement(_reactD3Core.Xaxis, null),
_react2.default.createElement(_reactD3Core.Yaxis, null),
this.props.children
)
);
}
}]);

return AreaChart;
}(_react.Component);

AreaChart.defaultProps = _extends({
showScatter: false
}, _commonProps2.default);
AreaChart.propTypes = {
width: _react.PropTypes.number.isRequired,
height: _react.PropTypes.number.isRequired,
margins: _react.PropTypes.object.isRequired,
data: _react.PropTypes.array.isRequired,
chartSeries: _react.PropTypes.array.isRequired
};
exports.default = AreaChart;
module.exports = exports['default'];
103 changes: 103 additions & 0 deletions lib/area_stack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactD3Core = require('react-d3-core');

var _reactD3Shape = require('react-d3-shape');

var _commonProps = require('./commonProps');

var _commonProps2 = _interopRequireDefault(_commonProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var AreaStackChart = function (_Component) {
_inherits(AreaStackChart, _Component);

function AreaStackChart(props) {
_classCallCheck(this, AreaStackChart);

return _possibleConstructorReturn(this, (AreaStackChart.__proto__ || Object.getPrototypeOf(AreaStackChart)).call(this, props));
}

_createClass(AreaStackChart, [{
key: 'render',
value: function render() {
var _props = this.props,
width = _props.width,
height = _props.height,
margins = _props.margins,
data = _props.data,
chartSeries = _props.chartSeries,
showXGrid = _props.showXGrid,
showYGrid = _props.showYGrid,
showLegend = _props.showLegend,
categoricalColors = _props.categoricalColors;


var xgrid, ygrid;

if (showXGrid) xgrid = _react2.default.createElement(_reactD3Core.Xgrid, null);
if (showYGrid) ygrid = _react2.default.createElement(_reactD3Core.Ygrid, null);

return _react2.default.createElement(
'div',
null,
showLegend ? _react2.default.createElement(_reactD3Core.Legend, _extends({}, this.props, {
width: width,
margins: margins,
chartSeries: chartSeries,
categoricalColors: categoricalColors
})) : null,
_react2.default.createElement(
_reactD3Shape.Chart,
_extends({}, this.props, {
width: width,
height: height,
data: data,
chartSeries: chartSeries,
stack: true
}),
_react2.default.createElement(_reactD3Shape.AreaStack, {
chartSeries: chartSeries
}),
xgrid,
ygrid,
_react2.default.createElement(_reactD3Core.Xaxis, null),
_react2.default.createElement(_reactD3Core.Yaxis, null),
this.props.children
)
);
}
}]);

return AreaStackChart;
}(_react.Component);

AreaStackChart.defaultProps = _commonProps2.default;
AreaStackChart.propTypes = {
width: _react.PropTypes.number.isRequired,
height: _react.PropTypes.number.isRequired,
margins: _react.PropTypes.object.isRequired,
data: _react.PropTypes.array.isRequired,
chartSeries: _react.PropTypes.array.isRequired
};
exports.default = AreaStackChart;
module.exports = exports['default'];
105 changes: 105 additions & 0 deletions lib/bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactD3Core = require('react-d3-core');

var _reactD3Shape = require('react-d3-shape');

var _commonProps = require('./commonProps');

var _commonProps2 = _interopRequireDefault(_commonProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var BarChart = function (_Component) {
_inherits(BarChart, _Component);

function BarChart(props) {
_classCallCheck(this, BarChart);

return _possibleConstructorReturn(this, (BarChart.__proto__ || Object.getPrototypeOf(BarChart)).call(this, props));
}

_createClass(BarChart, [{
key: 'render',
value: function render() {
var _props = this.props,
width = _props.width,
height = _props.height,
margins = _props.margins,
data = _props.data,
chartSeries = _props.chartSeries,
showXGrid = _props.showXGrid,
showYGrid = _props.showYGrid,
showLegend = _props.showLegend,
categoricalColors = _props.categoricalColors;


var xgrid, ygrid;

if (showXGrid) xgrid = _react2.default.createElement(_reactD3Core.Xgrid, null);
if (showYGrid) ygrid = _react2.default.createElement(_reactD3Core.Ygrid, null);

return _react2.default.createElement(
'div',
null,
showLegend ? _react2.default.createElement(_reactD3Core.Legend, _extends({}, this.props, {
width: width,
margins: margins,
chartSeries: chartSeries,
categoricalColors: categoricalColors
})) : null,
_react2.default.createElement(
_reactD3Shape.Chart,
_extends({}, this.props, {
width: width,
height: height,
data: data,
chartSeries: chartSeries
}),
_react2.default.createElement(_reactD3Shape.Bar, {
chartSeries: chartSeries
}),
xgrid,
ygrid,
_react2.default.createElement(_reactD3Core.Xaxis, null),
_react2.default.createElement(_reactD3Core.Yaxis, null),
this.props.children
)
);
}
}]);

return BarChart;
}(_react.Component);

BarChart.defaultProps = _extends({
onMouseOver: function onMouseOver() {},
onMouseOut: function onMouseOut() {}
}, _commonProps2.default);
BarChart.propTypes = {
width: _react.PropTypes.number.isRequired,
height: _react.PropTypes.number.isRequired,
margins: _react.PropTypes.object.isRequired,
data: _react.PropTypes.array.isRequired,
chartSeries: _react.PropTypes.array.isRequired
};
exports.default = BarChart;
module.exports = exports['default'];
Loading