react-vis
Advanced tools
Comparing version 0.3.4 to 0.4.0
@@ -53,3 +53,64 @@ 'use strict'; | ||
// As a performance enhancement, we want to only listen once | ||
var resizeSubscribers = []; | ||
var DEBOUNCE_DURATION = 100; | ||
var timeoutId = null; | ||
/** | ||
* Calls each subscriber, debounced to the | ||
*/ | ||
function debounceEmitResize() { | ||
_window2.default.clearTimeout(timeoutId); | ||
timeoutId = _window2.default.setTimeout(emitResize, DEBOUNCE_DURATION); | ||
} | ||
/** | ||
* Calls each subscriber once syncronously. | ||
*/ | ||
function emitResize() { | ||
resizeSubscribers.forEach(function (cb) { | ||
return cb(); | ||
}); | ||
} | ||
/** | ||
* Add the given callback to the list of subscribers to be caled when the | ||
* window resizes. Returns a function that, when called, removes the given | ||
* callback from the list of subscribers. This function is also resposible for | ||
* adding and removing the resize listener on `window`. | ||
* | ||
* @param {Function} cb - Subscriber callback function | ||
* @returns {Function} Unsubscribe function | ||
*/ | ||
function subscribeToDebouncedResize(cb) { | ||
resizeSubscribers.push(cb); | ||
// if we go from zero to one Flexible components instances, add the listener | ||
if (resizeSubscribers.length === 1) { | ||
_window2.default.addEventListener('resize', debounceEmitResize); | ||
} | ||
return function unsubscribe() { | ||
removeSubscriber(resizeSubscribers, cb); | ||
// if we have no Flexible components, remove the listener | ||
if (resizeSubscribers.length === 0) { | ||
_window2.default.clearTimeout(timeoutId); | ||
_window2.default.removeEventListener('resize', debounceEmitResize); | ||
} | ||
}; | ||
} | ||
/** | ||
* Helper for removing the given callback from the list of subscribers. | ||
* | ||
* @param {Function} item - Subscriber callback function | ||
*/ | ||
function removeSubscriber(item) { | ||
var index = resizeSubscribers.indexOf(item); | ||
if (index > -1) { | ||
resizeSubscribers.splice(index, 1); | ||
} | ||
} | ||
/** | ||
* Add the ability to stretch the visualization on window resize. | ||
@@ -84,5 +145,3 @@ * @param {*} Component React class for the child component. | ||
}; | ||
_this._resizeTimeout = null; | ||
_this._onResize = _this._onResize.bind(_this); | ||
_this._onResizeDebounced = _this._onResizeDebounced.bind(_this); | ||
return _this; | ||
@@ -109,12 +168,6 @@ } | ||
}, { | ||
key: '_onResizeDebounced', | ||
value: function _onResizeDebounced() { | ||
_window2.default.clearTimeout(this._resizeTimeout); | ||
this._resizeTimeout = _window2.default.setTimeout(this._onResize, 100); | ||
} | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this._onResize(); | ||
_window2.default.addEventListener('resize', this._onResizeDebounced); | ||
this.cancelSubscription = subscribeToDebouncedResize(this._onResize); | ||
} | ||
@@ -129,4 +182,3 @@ }, { | ||
value: function componentWillUnmount() { | ||
_window2.default.clearTimeout(this._resizeTimeout); | ||
_window2.default.removeEventListener('resize', this._onResizeDebounced); | ||
this.cancelSubscription(); | ||
} | ||
@@ -133,0 +185,0 @@ }, { |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -24,2 +24,4 @@ var _pureRenderComponent = require('../pure-render-component'); | ||
var _axisUtils = require('../utils/axis-utils'); | ||
var _scalesUtils = require('../utils/scales-utils'); | ||
@@ -101,3 +103,3 @@ | ||
axis.tickSize(0, 0); | ||
axis.outerTickSize(0); | ||
axis.tickSizeOuter(0); | ||
axis.tickPadding(14); | ||
@@ -129,3 +131,3 @@ return axis; | ||
axis.tickSize(tickSize); | ||
axis.outerTickSize(0); | ||
axis.tickSizeOuter(0); | ||
return axis; | ||
@@ -155,8 +157,7 @@ } | ||
var selectedLabels = _d2.default.select((0, _reactUtils.getDOMNode)(labels)); | ||
var selectedTicks = _d2.default.select((0, _reactUtils.getDOMNode)(ticks)); | ||
var selectedLabels = _d3Selection2.default.select((0, _reactUtils.getDOMNode)(labels)); | ||
var selectedTicks = _d3Selection2.default.select((0, _reactUtils.getDOMNode)(ticks)); | ||
var axisFn = (0, _axisUtils.getAxisFnByOrientation)(orientation); | ||
var axis = this._setAxisLabels(axisFn(scale)); | ||
var axis = _d2.default.svg.axis().scale(scale).orient(orientation); | ||
axis = this._setAxisLabels(axis); | ||
(0, _animationUtils.applyTransition)(this.props, selectedLabels).call(this._setAxisLabels(axis)); | ||
@@ -182,2 +183,3 @@ (0, _animationUtils.applyTransition)(this.props, selectedTicks).call(this._setAxisTicks(axis)); | ||
var top = _props4.top; | ||
var className = _props4.className; | ||
@@ -187,3 +189,3 @@ var hasTitle = title && title !== ''; | ||
'g', | ||
{ className: 'rv-xy-plot__axis', | ||
{ className: 'rv-xy-plot__axis ' + className, | ||
transform: 'translate(' + left + ',' + top + ')', | ||
@@ -217,3 +219,3 @@ ref: 'container' }, | ||
attr: _react2.default.PropTypes.string.isRequired, | ||
orientation: _react2.default.PropTypes.string.isRequired, | ||
orientation: _react2.default.PropTypes.oneOf(_axisUtils.AXIS_ORIENTATIONS), | ||
labelFormat: _react2.default.PropTypes.func, | ||
@@ -220,0 +222,0 @@ labelValues: _react2.default.PropTypes.array, |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -26,2 +26,4 @@ var _pureRenderComponent = require('../pure-render-component'); | ||
var _axisUtils = require('../utils/axis-utils'); | ||
var _animationUtils = require('../utils/animation-utils'); | ||
@@ -84,4 +86,5 @@ | ||
} | ||
var container = _d2.default.select((0, _reactUtils.getDOMNode)(this.refs.container)); | ||
var axis = _d2.default.svg.axis().scale(scale).orient(orientation).tickFormat('').tickSize(tickSize, 0, 0); | ||
var container = _d3Selection2.default.select((0, _reactUtils.getDOMNode)(this.refs.container)); | ||
var axisFn = (0, _axisUtils.getAxisFnByOrientation)(orientation); | ||
var axis = axisFn(scale).tickFormat('').tickSize(tickSize, 0, 0); | ||
if (!values) { | ||
@@ -131,3 +134,3 @@ axis.ticks(ticksTotal); | ||
attr: _react2.default.PropTypes.string.isRequired, | ||
orientation: _react2.default.PropTypes.oneOf(['left', 'top', 'bottom', 'right']), | ||
orientation: _react2.default.PropTypes.oneOf(_axisUtils.AXIS_ORIENTATIONS), | ||
top: _react2.default.PropTypes.number, | ||
@@ -134,0 +137,0 @@ left: _react2.default.PropTypes.number, |
@@ -15,5 +15,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -57,9 +57,144 @@ var _pureRenderComponent = require('../../pure-render-component'); | ||
function AbstractSeries() { | ||
_createClass(AbstractSeries, null, [{ | ||
key: 'propTypes', | ||
get: function get() { | ||
return _extends({}, (0, _scalesUtils.getScalePropTypesByAttribute)('x'), (0, _scalesUtils.getScalePropTypesByAttribute)('y'), (0, _scalesUtils.getScalePropTypesByAttribute)('size'), (0, _scalesUtils.getScalePropTypesByAttribute)('opacity'), (0, _scalesUtils.getScalePropTypesByAttribute)('color'), { | ||
width: _react2.default.PropTypes.number, | ||
height: _react2.default.PropTypes.number, | ||
data: _react2.default.PropTypes.array, | ||
onValueMouseOver: _react2.default.PropTypes.func, | ||
onValueMouseOut: _react2.default.PropTypes.func, | ||
onValueClick: _react2.default.PropTypes.func, | ||
onSeriesMouseOver: _react2.default.PropTypes.func, | ||
onSeriesMouseOut: _react2.default.PropTypes.func, | ||
onSeriesClick: _react2.default.PropTypes.func, | ||
onNearestX: _react2.default.PropTypes.func, | ||
animation: _animationUtils.AnimationPropType | ||
}); | ||
} | ||
}]); | ||
function AbstractSeries(props) { | ||
_classCallCheck(this, AbstractSeries); | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(AbstractSeries).apply(this, arguments)); | ||
/** | ||
* Mouse over handler for the series without single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AbstractSeries).call(this, props)); | ||
_this._mouseOver = _this._mouseOverHandler.bind(_this, false); | ||
/** | ||
* Mouse over handler for the series **with** single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
_this._mouseOverWithValue = _this._mouseOverHandler.bind(_this, true); | ||
/** | ||
* Mouse out handler for the series without single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
_this._mouseOut = _this._mouseOutHandler.bind(_this, false); | ||
/** | ||
* Mouse out handler for the series **with** single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
_this._mouseOutWithValue = _this._mouseOutHandler.bind(_this, true); | ||
/** | ||
* Click handler for the series without single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
_this._click = _this._clickHandler.bind(_this, false); | ||
/** | ||
* Click handler for the series **with** single values. | ||
* @type {function} | ||
* @protected | ||
*/ | ||
_this._clickWithValue = _this._clickHandler.bind(_this, true); | ||
return _this; | ||
} | ||
/** | ||
* Mouse over handler for all series. | ||
* @param {boolean} useValue Use value handler if true. | ||
* @param {Object} d Value object | ||
* @private | ||
*/ | ||
_createClass(AbstractSeries, [{ | ||
key: '_mouseOverHandler', | ||
value: function _mouseOverHandler(useValue, d) { | ||
var _props = this.props; | ||
var onValueMouseOver = _props.onValueMouseOver; | ||
var onSeriesMouseOver = _props.onSeriesMouseOver; | ||
if (useValue && onValueMouseOver) { | ||
onValueMouseOver(d, { event: _d3Selection2.default.event }); | ||
} | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d3Selection2.default.event }); | ||
} | ||
} | ||
/** | ||
* Mouse out handler for all series. | ||
* @param {boolean} useValue Use value handler if true. | ||
* @param {Object} d Value object | ||
* @private | ||
*/ | ||
}, { | ||
key: '_mouseOutHandler', | ||
value: function _mouseOutHandler(useValue, d) { | ||
var _props2 = this.props; | ||
var onValueMouseOut = _props2.onValueMouseOut; | ||
var onSeriesMouseOut = _props2.onSeriesMouseOut; | ||
if (useValue && onValueMouseOut) { | ||
onValueMouseOut(d, { event: _d3Selection2.default.event }); | ||
} | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d3Selection2.default.event }); | ||
} | ||
} | ||
/** | ||
* Click handler for all series. | ||
* @param {boolean} useValue Use value handler if true. | ||
* @param {Object} d Value object | ||
* @private | ||
*/ | ||
}, { | ||
key: '_clickHandler', | ||
value: function _clickHandler(useValue, d) { | ||
var _props3 = this.props; | ||
var onValueClick = _props3.onValueClick; | ||
var onSeriesClick = _props3.onSeriesClick; | ||
if (useValue && onValueClick) { | ||
onValueClick(d, { event: _d3Selection2.default.event }); | ||
} | ||
if (onSeriesClick) { | ||
onSeriesClick({ event: _d3Selection2.default.event }); | ||
} | ||
} | ||
/** | ||
* Tells the rest of the world that it requires SVG to work. | ||
* @returns {boolean} Result. | ||
*/ | ||
}, { | ||
key: '_getAttributeFunctor', | ||
@@ -134,7 +269,7 @@ | ||
value: function onParentMouseMove(event) { | ||
var _props = this.props; | ||
var _props$marginLeft = _props.marginLeft; | ||
var marginLeft = _props$marginLeft === undefined ? 0 : _props$marginLeft; | ||
var onNearestX = _props.onNearestX; | ||
var data = _props.data; | ||
var _props4 = this.props; | ||
var _props4$marginLeft = _props4.marginLeft; | ||
var marginLeft = _props4$marginLeft === undefined ? 0 : _props4$marginLeft; | ||
var onNearestX = _props4.onNearestX; | ||
var data = _props4.data; | ||
@@ -148,4 +283,4 @@ if (!onNearestX || !data) { | ||
// TODO(antonb): WAT? | ||
_d2.default.event = event.nativeEvent; | ||
var coordinate = _d2.default.mouse(event.currentTarget)[0] - marginLeft; | ||
_d3Selection2.default.event = event.nativeEvent; | ||
var coordinate = _d3Selection2.default.mouse(event.currentTarget)[0] - marginLeft; | ||
var xScaleFn = this._getAttributeFunctor('x'); | ||
@@ -181,23 +316,2 @@ | ||
}, { | ||
key: 'propTypes', | ||
get: function get() { | ||
return _extends({}, (0, _scalesUtils.getScalePropTypesByAttribute)('x'), (0, _scalesUtils.getScalePropTypesByAttribute)('y'), (0, _scalesUtils.getScalePropTypesByAttribute)('size'), (0, _scalesUtils.getScalePropTypesByAttribute)('opacity'), (0, _scalesUtils.getScalePropTypesByAttribute)('color'), { | ||
width: _react2.default.PropTypes.number, | ||
height: _react2.default.PropTypes.number, | ||
data: _react2.default.PropTypes.array, | ||
onValueMouseOver: _react2.default.PropTypes.func, | ||
onValueMouseOut: _react2.default.PropTypes.func, | ||
onSeriesMouseOver: _react2.default.PropTypes.func, | ||
onSeriesMouseOut: _react2.default.PropTypes.func, | ||
onNearestX: _react2.default.PropTypes.func, | ||
animation: _animationUtils.AnimationPropType | ||
}); | ||
} | ||
/** | ||
* Tells the rest of the world that it requires SVG to work. | ||
* @returns {boolean} Result. | ||
*/ | ||
}, { | ||
key: 'requiresSVG', | ||
@@ -204,0 +318,0 @@ get: function get() { |
@@ -13,6 +13,10 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
var _d3Shape = require('d3-shape'); | ||
var _d3Shape2 = _interopRequireDefault(_d3Shape); | ||
var _abstractSeries = require('./abstract-series'); | ||
@@ -55,10 +59,6 @@ | ||
function AreaSeries(props) { | ||
function AreaSeries() { | ||
_classCallCheck(this, AreaSeries); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AreaSeries).call(this, props)); | ||
_this._mouseOut = _this._mouseOut.bind(_this); | ||
_this._mouseOver = _this._mouseOver.bind(_this); | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(AreaSeries).apply(this, arguments)); | ||
} | ||
@@ -77,30 +77,2 @@ | ||
}, { | ||
key: '_mouseOver', | ||
value: function _mouseOver(d) { | ||
var _props = this.props; | ||
var onValueMouseOver = _props.onValueMouseOver; | ||
var onSeriesMouseOver = _props.onSeriesMouseOver; | ||
if (onValueMouseOver) { | ||
onValueMouseOver(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_mouseOut', | ||
value: function _mouseOut(d) { | ||
var _props2 = this.props; | ||
var onValueMouseOut = _props2.onValueMouseOut; | ||
var onSeriesMouseOut = _props2.onSeriesMouseOut; | ||
if (onValueMouseOut) { | ||
onValueMouseOut(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_updateSeries', | ||
@@ -122,3 +94,3 @@ value: function _updateSeries() { | ||
var line = _d2.default.svg.area().x(x).y0(y0).y1(y); | ||
var line = _d3Shape2.default.area().x(x).y0(y0).y1(y); | ||
@@ -128,3 +100,3 @@ var opacity = this._getAttributeValue('opacity') || _theme.DEFAULT_OPACITY; | ||
var path = _d2.default.select(lineElement).on('mouseover', this._onMouseOver).on('mouseout', this._onMouseOut); | ||
var path = _d3Selection2.default.select(lineElement).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut).on('click', this._click); | ||
@@ -136,6 +108,6 @@ this._applyTransition(path).attr('d', d).style('stroke', stroke).style('fill', fill).style('opacity', opacity); | ||
value: function render() { | ||
var _props3 = this.props; | ||
var data = _props3.data; | ||
var marginLeft = _props3.marginLeft; | ||
var marginTop = _props3.marginTop; | ||
var _props = this.props; | ||
var data = _props.data; | ||
var marginLeft = _props.marginLeft; | ||
var marginTop = _props.marginTop; | ||
@@ -142,0 +114,0 @@ if (!data) { |
@@ -15,5 +15,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -55,22 +55,6 @@ var _abstractSeries = require('./abstract-series'); | ||
_createClass(BarSeries, null, [{ | ||
key: 'propTypes', | ||
get: function get() { | ||
return _extends({}, _abstractSeries2.default.propTypes, { | ||
linePosAttr: _react2.default.PropTypes.string, | ||
valuePosAttr: _react2.default.PropTypes.string, | ||
lineSizeAttr: _react2.default.PropTypes.string, | ||
valueSizeAttr: _react2.default.PropTypes.string | ||
}); | ||
} | ||
}]); | ||
function BarSeries(props) { | ||
function BarSeries() { | ||
_classCallCheck(this, BarSeries); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BarSeries).call(this, props)); | ||
_this._mouseOver = _this._mouseOver.bind(_this); | ||
_this._mouseOut = _this._mouseOut.bind(_this); | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(BarSeries).apply(this, arguments)); | ||
} | ||
@@ -88,60 +72,18 @@ | ||
} | ||
/** | ||
* Mouseover handler. Triggers mouseover-related actions if they were set. | ||
* @param {Object} d Data point. | ||
* @private | ||
*/ | ||
}, { | ||
key: '_mouseOver', | ||
value: function _mouseOver(d) { | ||
var _props = this.props; | ||
var onValueMouseOver = _props.onValueMouseOver; | ||
var onSeriesMouseOver = _props.onSeriesMouseOver; | ||
if (onValueMouseOver) { | ||
onValueMouseOver(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d2.default.event }); | ||
} | ||
} | ||
/** | ||
* Mouseout handler. Triggers mouseout-related actions if they were set. | ||
* @param {Object} d Data point. | ||
* @private | ||
*/ | ||
}, { | ||
key: '_mouseOut', | ||
value: function _mouseOut(d) { | ||
var _props2 = this.props; | ||
var onValueMouseOut = _props2.onValueMouseOut; | ||
var onSeriesMouseOut = _props2.onSeriesMouseOut; | ||
if (onValueMouseOut) { | ||
onValueMouseOut(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_updateSeries', | ||
value: function _updateSeries() { | ||
var container = (0, _reactUtils.getDOMNode)(this.refs.container); | ||
var _props3 = this.props; | ||
var _stackBy = _props3._stackBy; | ||
var data = _props3.data; | ||
var lineSizeAttr = _props3.lineSizeAttr; | ||
var valuePosAttr = _props3.valuePosAttr; | ||
var linePosAttr = _props3.linePosAttr; | ||
var valueSizeAttr = _props3.valueSizeAttr; | ||
var _props4 = this.props; | ||
var _props4$sameTypeTotal = _props4.sameTypeTotal; | ||
var sameTypeTotal = _props4$sameTypeTotal === undefined ? 1 : _props4$sameTypeTotal; | ||
var _props4$sameTypeIndex = _props4.sameTypeIndex; | ||
var sameTypeIndex = _props4$sameTypeIndex === undefined ? 0 : _props4$sameTypeIndex; | ||
var _props = this.props; | ||
var _stackBy = _props._stackBy; | ||
var data = _props.data; | ||
var lineSizeAttr = _props.lineSizeAttr; | ||
var valuePosAttr = _props.valuePosAttr; | ||
var linePosAttr = _props.linePosAttr; | ||
var valueSizeAttr = _props.valueSizeAttr; | ||
var _props2 = this.props; | ||
var _props2$sameTypeTotal = _props2.sameTypeTotal; | ||
var sameTypeTotal = _props2$sameTypeTotal === undefined ? 1 : _props2$sameTypeTotal; | ||
var _props2$sameTypeIndex = _props2.sameTypeIndex; | ||
var sameTypeIndex = _props2$sameTypeIndex === undefined ? 0 : _props2$sameTypeIndex; | ||
@@ -163,3 +105,3 @@ | ||
var rects = _d2.default.select(container).selectAll('rect').data(data).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut); | ||
var rects = _d3Selection2.default.select(container).selectAll('rect').data(data).on('mouseover', this._mouseOverWithValue).on('mouseout', this._mouseOutWithValue).on('click', this._clickWithValue); | ||
@@ -179,6 +121,6 @@ var itemSize = distance / 2 * 0.85; | ||
value: function render() { | ||
var _props5 = this.props; | ||
var data = _props5.data; | ||
var marginLeft = _props5.marginLeft; | ||
var marginTop = _props5.marginTop; | ||
var _props3 = this.props; | ||
var data = _props3.data; | ||
var marginLeft = _props3.marginLeft; | ||
var marginTop = _props3.marginTop; | ||
@@ -199,2 +141,12 @@ if (!data) { | ||
} | ||
}], [{ | ||
key: 'propTypes', | ||
get: function get() { | ||
return _extends({}, _abstractSeries2.default.propTypes, { | ||
linePosAttr: _react2.default.PropTypes.string, | ||
valuePosAttr: _react2.default.PropTypes.string, | ||
lineSizeAttr: _react2.default.PropTypes.string, | ||
valueSizeAttr: _react2.default.PropTypes.string | ||
}); | ||
} | ||
}]); | ||
@@ -201,0 +153,0 @@ |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -53,18 +53,6 @@ var _abstractSeries = require('./abstract-series'); | ||
_createClass(HeatmapSeries, null, [{ | ||
key: 'getParentConfig', | ||
value: function getParentConfig(attr) { | ||
var isDomainAdjustmentNeeded = attr === 'x' || attr === 'y'; | ||
return { isDomainAdjustmentNeeded: isDomainAdjustmentNeeded }; | ||
} | ||
}]); | ||
function HeatmapSeries(props) { | ||
function HeatmapSeries() { | ||
_classCallCheck(this, HeatmapSeries); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(HeatmapSeries).call(this, props)); | ||
_this._mouseOver = _this._mouseOver.bind(_this); | ||
_this._mouseOut = _this._mouseOut.bind(_this); | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(HeatmapSeries).apply(this, arguments)); | ||
} | ||
@@ -83,30 +71,2 @@ | ||
}, { | ||
key: '_mouseOver', | ||
value: function _mouseOver(d) { | ||
var _props = this.props; | ||
var onValueMouseOver = _props.onValueMouseOver; | ||
var onSeriesMouseOver = _props.onSeriesMouseOver; | ||
if (onValueMouseOver) { | ||
onValueMouseOver(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_mouseOut', | ||
value: function _mouseOut(d) { | ||
var _props2 = this.props; | ||
var onValueMouseOut = _props2.onValueMouseOut; | ||
var onSeriesMouseOut = _props2.onSeriesMouseOut; | ||
if (onValueMouseOut) { | ||
onValueMouseOut(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_updateSeries', | ||
@@ -125,3 +85,3 @@ value: function _updateSeries() { | ||
var rects = _d2.default.select(container).selectAll('rect').data(data).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut); | ||
var rects = _d3Selection2.default.select(container).selectAll('rect').data(data).on('mouseover', this._mouseOverWithValue).on('mouseout', this._mouseOutWithValue).on('click', this._clickWithValue); | ||
@@ -137,6 +97,6 @@ this._applyTransition(rects).style('opacity', this._getAttributeFunctor('opacity')).style('fill', this._getAttributeFunctor('fill') || this._getAttributeFunctor('color')).style('stroke', this._getAttributeFunctor('stroke') || this._getAttributeFunctor('color')).attr('x', function getX(d) { | ||
value: function render() { | ||
var _props3 = this.props; | ||
var data = _props3.data; | ||
var marginLeft = _props3.marginLeft; | ||
var marginTop = _props3.marginTop; | ||
var _props = this.props; | ||
var data = _props.data; | ||
var marginLeft = _props.marginLeft; | ||
var marginTop = _props.marginTop; | ||
@@ -157,2 +117,8 @@ if (!data) { | ||
} | ||
}], [{ | ||
key: 'getParentConfig', | ||
value: function getParentConfig(attr) { | ||
var isDomainAdjustmentNeeded = attr === 'x' || attr === 'y'; | ||
return { isDomainAdjustmentNeeded: isDomainAdjustmentNeeded }; | ||
} | ||
}]); | ||
@@ -159,0 +125,0 @@ |
@@ -13,6 +13,10 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
var _d3Shape = require('d3-shape'); | ||
var _d3Shape2 = _interopRequireDefault(_d3Shape); | ||
var _abstractSeries = require('./abstract-series'); | ||
@@ -60,20 +64,6 @@ | ||
_createClass(LineSeries, null, [{ | ||
key: 'defaultProps', | ||
get: function get() { | ||
return { | ||
strokeStyle: 'solid', | ||
opacity: 1 | ||
}; | ||
} | ||
}]); | ||
function LineSeries(props) { | ||
function LineSeries() { | ||
_classCallCheck(this, LineSeries); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LineSeries).call(this, props)); | ||
_this._mouseOver = _this._mouseOver.bind(_this); | ||
_this._mouseOut = _this._mouseOut.bind(_this); | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(LineSeries).apply(this, arguments)); | ||
} | ||
@@ -92,20 +82,2 @@ | ||
}, { | ||
key: '_mouseOver', | ||
value: function _mouseOver() { | ||
var onSeriesMouseOver = this.props.onSeriesMouseOver; | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_mouseOut', | ||
value: function _mouseOut() { | ||
var onSeriesMouseOut = this.props.onSeriesMouseOut; | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_updateSeries', | ||
@@ -123,5 +95,5 @@ value: function _updateSeries() { | ||
var opacity = this._getAttributeValue('opacity') || _theme.DEFAULT_OPACITY; | ||
var line = _d2.default.svg.line().x(x).y(y); | ||
var line = _d3Shape2.default.line().x(x).y(y); | ||
var d = line(data); | ||
var path = _d2.default.select(lineElement).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut); | ||
var path = _d3Selection2.default.select(lineElement).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut).on('click', this._click); | ||
this._applyTransition(path).attr('d', d).style('stroke', stroke).style('opacity', opacity); | ||
@@ -135,2 +107,3 @@ } | ||
var strokeStyle = _props.strokeStyle; | ||
var strokeWidth = _props.strokeWidth; | ||
var marginLeft = _props.marginLeft; | ||
@@ -146,4 +119,16 @@ var marginTop = _props.marginTop; | ||
transform: 'translate(' + marginLeft + ',' + marginTop + ')', | ||
style: { opacity: 0, strokeDasharray: STROKE_STYLES[strokeStyle] } }); | ||
style: { | ||
opacity: 0, | ||
strokeDasharray: STROKE_STYLES[strokeStyle], | ||
strokeWidth: strokeWidth | ||
} }); | ||
} | ||
}], [{ | ||
key: 'defaultProps', | ||
get: function get() { | ||
return { | ||
strokeStyle: 'solid', | ||
opacity: 1 | ||
}; | ||
} | ||
}]); | ||
@@ -150,0 +135,0 @@ |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
@@ -55,10 +55,6 @@ var _abstractSeries = require('./abstract-series'); | ||
function MarkSeries(props) { | ||
function MarkSeries() { | ||
_classCallCheck(this, MarkSeries); | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(MarkSeries).call(this, props)); | ||
_this._mouseOver = _this._mouseOver.bind(_this); | ||
_this._mouseOut = _this._mouseOut.bind(_this); | ||
return _this; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(MarkSeries).apply(this, arguments)); | ||
} | ||
@@ -77,30 +73,2 @@ | ||
}, { | ||
key: '_mouseOver', | ||
value: function _mouseOver(d) { | ||
var _props = this.props; | ||
var onValueMouseOver = _props.onValueMouseOver; | ||
var onSeriesMouseOver = _props.onSeriesMouseOver; | ||
if (onValueMouseOver) { | ||
onValueMouseOver(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOver) { | ||
onSeriesMouseOver({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_mouseOut', | ||
value: function _mouseOut(d) { | ||
var _props2 = this.props; | ||
var onValueMouseOut = _props2.onValueMouseOut; | ||
var onSeriesMouseOut = _props2.onSeriesMouseOut; | ||
if (onValueMouseOut) { | ||
onValueMouseOut(d, { event: _d2.default.event }); | ||
} | ||
if (onSeriesMouseOut) { | ||
onSeriesMouseOut({ event: _d2.default.event }); | ||
} | ||
} | ||
}, { | ||
key: '_updateSeries', | ||
@@ -114,3 +82,3 @@ value: function _updateSeries() { | ||
} | ||
var circles = _d2.default.select(container).selectAll('circle').data(data).on('mouseover', this._mouseOver).on('mouseout', this._mouseOut); | ||
var circles = _d3Selection2.default.select(container).selectAll('circle').data(data).on('mouseover', this._mouseOverWithValue).on('mouseout', this._mouseOutWithValue).on('click', this._clickWithValue); | ||
@@ -123,6 +91,6 @@ // TODO(anton): radius should be the half of the size. | ||
value: function render() { | ||
var _props3 = this.props; | ||
var data = _props3.data; | ||
var marginLeft = _props3.marginLeft; | ||
var marginTop = _props3.marginTop; | ||
var _props = this.props; | ||
var data = _props.data; | ||
var marginLeft = _props.marginLeft; | ||
var marginTop = _props.marginTop; | ||
@@ -129,0 +97,0 @@ if (!data) { |
@@ -308,3 +308,3 @@ 'use strict'; | ||
dataProps = data[seriesIndex]; | ||
dataProps = { data: data[seriesIndex] }; | ||
} | ||
@@ -311,0 +311,0 @@ return _react2.default.cloneElement(child, _extends({}, dimensions, { |
@@ -39,6 +39,10 @@ 'use strict'; | ||
var _d2 = require('d3'); | ||
var _d3Selection = require('d3-selection'); | ||
var _d3 = _interopRequireDefault(_d2); | ||
var _d3Selection2 = _interopRequireDefault(_d3Selection); | ||
var _d3Shape = require('d3-shape'); | ||
var _d3Shape2 = _interopRequireDefault(_d3Shape); | ||
var _scalesUtils = require('../utils/scales-utils'); | ||
@@ -171,3 +175,3 @@ | ||
handler(d.data, { event: _d3.default.event, x: x, y: y }); | ||
handler(d.data, { event: _d3Selection2.default.event, x: x, y: y }); | ||
} | ||
@@ -310,3 +314,3 @@ } | ||
var container = (0, _reactUtils.getDOMNode)(this.refs.container); | ||
var pie = _d3.default.layout.pie().sort(null).value(function (d) { | ||
var pie = _d3Shape2.default.pie().sort(null).value(function (d) { | ||
return d.angle; | ||
@@ -320,6 +324,6 @@ }); | ||
} | ||
var arc = _d3.default.svg.arc().outerRadius(radiusFn).innerRadius(innerRadiusFn); | ||
var arc = _d3Shape2.default.arc().outerRadius(radiusFn).innerRadius(innerRadiusFn); | ||
this._arc = arc; | ||
var sections = _d3.default.select(container).selectAll('path').data(pie(data)).on('click', this._sectionClick).on('mouseover', this._sectionMouseOver).on('mouseout', this._sectionMouseOut); | ||
var sections = _d3Selection2.default.select(container).selectAll('path').data(pie(data)).on('click', this._sectionClick).on('mouseover', this._sectionMouseOver).on('mouseout', this._sectionMouseOut); | ||
this._applyTransition(sections).attr('d', arc).style('opacity', this._getAttributeFunctor('opacity')).style('fill', this._getAttributeFunctor('fill') || this._getAttributeFunctor('color')).style('stroke', this._getAttributeFunctor('stroke')); | ||
@@ -326,0 +330,0 @@ } |
@@ -15,6 +15,10 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Hierarchy = require('d3-hierarchy'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Hierarchy2 = _interopRequireDefault(_d3Hierarchy); | ||
var _d3Color = require('d3-color'); | ||
var _d3Color2 = _interopRequireDefault(_d3Color); | ||
var _animationUtils = require('../utils/animation-utils'); | ||
@@ -52,5 +56,12 @@ | ||
var TREEMAP_TILE_MODES = { | ||
squarify: _d3Hierarchy2.default.treemapSquarify, | ||
slice: _d3Hierarchy2.default.treemapSlice, | ||
dice: _d3Hierarchy2.default.treemapDice, | ||
slicedice: _d3Hierarchy2.default.treemapSliceDice | ||
}; | ||
function getFontColorFromBackground(background) { | ||
if (background) { | ||
return _d2.default.hsl(background).l > 0.57 ? '#222' : '#fff'; | ||
return _d3Color2.default.hsl(background).l > 0.57 ? '#222' : '#fff'; | ||
} | ||
@@ -70,3 +81,3 @@ return null; | ||
data: _react2.default.PropTypes.object.isRequired, | ||
mode: _react2.default.PropTypes.string.isRequired, | ||
mode: _react2.default.PropTypes.oneOf(Object.keys(TREEMAP_TILE_MODES)), | ||
padding: _react2.default.PropTypes.number.isRequired, | ||
@@ -81,3 +92,3 @@ animation: _animationUtils.AnimationPropType | ||
mode: 'squarify', | ||
padding: 0, | ||
padding: 1, | ||
data: { | ||
@@ -143,19 +154,19 @@ children: [] | ||
value: function _getNodesToRender() { | ||
var data = this.props.data; | ||
var height = this.props.height; | ||
var width = this.props.width; | ||
var mode = this.props.mode; | ||
var padding = this.props.padding; | ||
var nodes = []; | ||
var layout = void 0; | ||
var _props = this.props; | ||
var data = _props.data; | ||
var height = _props.height; | ||
var width = _props.width; | ||
var mode = _props.mode; | ||
var padding = _props.padding; | ||
if (data) { | ||
layout = _d2.default.layout.treemap().padding(padding).mode(mode).sort(function (a, b) { | ||
var tileFn = TREEMAP_TILE_MODES[mode]; | ||
return _d3Hierarchy2.default.treemap(tileFn).tile(_d3Hierarchy2.default.treemapSquarify).size([width, height]).padding(padding)(_d3Hierarchy2.default.hierarchy(data).sort(function (a, b) { | ||
return a.size - b.size; | ||
}); | ||
nodes = layout.size([width, height]).value(function (d) { | ||
}).sum(function (d) { | ||
return d.size; | ||
}).sticky(true).nodes(data); | ||
})).descendants(); | ||
} | ||
return nodes; | ||
return []; | ||
} | ||
@@ -174,9 +185,14 @@ }, { | ||
var color = getFontColorFromBackground(background); | ||
var width = Math.max(0, node.dx - 1); | ||
var height = Math.max(0, node.dy - 1); | ||
var x0 = node.x0; | ||
var x1 = node.x1; | ||
var y0 = node.y0; | ||
var y1 = node.y1; | ||
var title = node.data.title; | ||
var style = (0, _animationUtils.getCSSAnimation)(this.props, { | ||
top: node.y + 'px', | ||
left: node.x + 'px', | ||
width: width + 'px', | ||
height: height + 'px', | ||
top: y0 + 'px', | ||
left: x0 + 'px', | ||
width: x1 - x0 + 'px', | ||
height: y1 - y0 + 'px', | ||
background: background, | ||
@@ -195,3 +211,3 @@ opacity: opacity, | ||
{ className: 'rv-treemap__leaf__content' }, | ||
node.title | ||
title | ||
) | ||
@@ -203,5 +219,5 @@ ); | ||
value: function render() { | ||
var _props = this.props; | ||
var width = _props.width; | ||
var height = _props.height; | ||
var _props2 = this.props; | ||
var width = _props2.width; | ||
var height = _props2.height; | ||
@@ -208,0 +224,0 @@ var nodes = this._getNodesToRender(); |
@@ -28,2 +28,6 @@ 'use strict'; | ||
// Not obvious: d3-transition adds .transition() method to the selection | ||
// prototype (!!!). Do not remove this import. | ||
exports.applyTransition = applyTransition; | ||
@@ -36,2 +40,4 @@ exports.getCSSAnimation = getCSSAnimation; | ||
require('d3-transition'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,0 +44,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -6,4 +6,18 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.AXIS_ORIENTATIONS = undefined; | ||
exports.getAxisFnByOrientation = getAxisFnByOrientation; | ||
exports.getTicksTotalFromSize = getTicksTotalFromSize; | ||
// Copyright (c) 2016 Uber Technologies, Inc. | ||
var _d3Axis = require('d3-axis'); | ||
var _d3Axis2 = _interopRequireDefault(_d3Axis); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var AXIS_FNS = { | ||
left: _d3Axis2.default.axisLeft, | ||
right: _d3Axis2.default.axisRight, | ||
top: _d3Axis2.default.axisTop, | ||
bottom: _d3Axis2.default.axisBottom | ||
}; // Copyright (c) 2016 Uber Technologies, Inc. | ||
// | ||
@@ -28,2 +42,8 @@ // Permission is hereby granted, free of charge, to any person obtaining a copy | ||
var AXIS_ORIENTATIONS = exports.AXIS_ORIENTATIONS = Object.keys(AXIS_FNS); | ||
function getAxisFnByOrientation(orientation) { | ||
return AXIS_FNS[orientation]; | ||
} | ||
/** | ||
@@ -30,0 +50,0 @@ * Get total amount of ticks from a given size in pixels. |
@@ -21,6 +21,14 @@ 'use strict'; | ||
var _d = require('d3'); | ||
var _d3Scale = require('d3-scale'); | ||
var _d2 = _interopRequireDefault(_d); | ||
var _d3Scale2 = _interopRequireDefault(_d3Scale); | ||
var _d3Array = require('d3-array'); | ||
var _d3Array2 = _interopRequireDefault(_d3Array); | ||
var _d3Collection = require('d3-collection'); | ||
var _d3Collection2 = _interopRequireDefault(_d3Collection); | ||
var _react = require('react'); | ||
@@ -96,2 +104,9 @@ | ||
/** | ||
* Time UTC scale name. | ||
* @type {string} | ||
* @const | ||
*/ | ||
var TIME_UTC_SCALE_TYPE = 'time-utc'; | ||
/** | ||
* Scale functions that are supported in the library. | ||
@@ -101,3 +116,3 @@ * @type {Object} | ||
*/ | ||
var SCALE_FUNCTIONS = (_SCALE_FUNCTIONS = {}, _defineProperty(_SCALE_FUNCTIONS, LINEAR_SCALE_TYPE, _d2.default.scale.linear), _defineProperty(_SCALE_FUNCTIONS, ORDINAL_SCALE_TYPE, _d2.default.scale.ordinal), _defineProperty(_SCALE_FUNCTIONS, CATEGORY_SCALE_TYPE, _d2.default.scale.ordinal), _defineProperty(_SCALE_FUNCTIONS, LOG_SCALE_TYPE, _d2.default.scale.log), _defineProperty(_SCALE_FUNCTIONS, TIME_SCALE_TYPE, _d2.default.time.scale), _SCALE_FUNCTIONS); | ||
var SCALE_FUNCTIONS = (_SCALE_FUNCTIONS = {}, _defineProperty(_SCALE_FUNCTIONS, LINEAR_SCALE_TYPE, _d3Scale2.default.scaleLinear), _defineProperty(_SCALE_FUNCTIONS, ORDINAL_SCALE_TYPE, _d3Scale2.default.scaleOrdinal), _defineProperty(_SCALE_FUNCTIONS, CATEGORY_SCALE_TYPE, _d3Scale2.default.scaleOrdinal), _defineProperty(_SCALE_FUNCTIONS, LOG_SCALE_TYPE, _d3Scale2.default.scaleLog), _defineProperty(_SCALE_FUNCTIONS, TIME_SCALE_TYPE, _d3Scale2.default.scaleTime), _defineProperty(_SCALE_FUNCTIONS, TIME_UTC_SCALE_TYPE, _d3Scale2.default.scaleUtc), _SCALE_FUNCTIONS); | ||
@@ -181,5 +196,5 @@ /** | ||
if (type !== ORDINAL_SCALE_TYPE && type !== CATEGORY_SCALE_TYPE) { | ||
domain = _d2.default.extent(values); | ||
domain = _d3Array2.default.extent(values); | ||
} else { | ||
domain = _d2.default.set(values).values(); | ||
domain = _d3Collection2.default.set(values).values(); | ||
} | ||
@@ -186,0 +201,0 @@ return domain; |
@@ -40,3 +40,5 @@ ## Scales and data | ||
Time scale. Similar to [d3.time.scale](https://github.com/mbostock/d3/wiki/Time-Scales). | ||
* `'time-utc'` | ||
Time UTC scale. Similar to [d3.time.scale.utc](https://github.com/d3/d3/wiki/Time-Scales#utc). | ||
* `'log'` | ||
Log scale. Similar to [d3.scale.log](https://github.com/mbostock/d3/wiki/Quantitative-Scales#log). |
@@ -52,2 +52,3 @@ # XYPlot | ||
* `stroke` (optional) | ||
* `strokeWidth` (optional), `strokeStyle` (optional) - to control the width of the line series and whether they are dashed or solid. | ||
* `color` (optional, used instead of `fill` and `stroke` if none of them is passed) | ||
@@ -78,3 +79,3 @@ * `size` (optional) | ||
Type: `number` | ||
Width of the chart. The height should be passed. | ||
Width of the chart. The width should be passed. | ||
@@ -253,2 +254,14 @@ #### height | ||
### Series-specific properties: | ||
#### LineSeries/LineMarkSeries: | ||
##### strokeStyle (optional) | ||
Type: `string` | ||
If set to `dashed`, your series will use dashed lines. If set to `solid` or unspecified, your series will use solid lines. | ||
##### strokeWidth (optional) | ||
Type: `string|number` | ||
Specifies the width of the line for the series. By default, this is determined by react-vis css (2px). | ||
### Hint | ||
@@ -255,0 +268,0 @@ |
{ | ||
"name": "react-vis", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -25,3 +25,11 @@ "author": "Anton Bulyenov <antonb@uber.com>", | ||
"dependencies": { | ||
"d3": "^3.5.6", | ||
"d3-array": "^0.7.1", | ||
"d3-axis": "^0.3.1", | ||
"d3-collection": "^0.1.2", | ||
"d3-color": "^0.4.2", | ||
"d3-hierarchy": "^0.2.2", | ||
"d3-scale": "^0.7.0", | ||
"d3-selection": "^0.7.1", | ||
"d3-shape": "^0.6.0", | ||
"d3-transition": "^0.2.8", | ||
"deep-equal": "^1.0.1", | ||
@@ -41,2 +49,3 @@ "global": "^4.3.0", | ||
"budo": "^8.0.3", | ||
"enzyme": "^2.3.0", | ||
"eslint": "^1.10.3", | ||
@@ -46,6 +55,6 @@ "eslint-plugin-react": "^3.16.1", | ||
"react": ">=0.14.0", | ||
"react-addons-shallow-compare": ">=0.14.0", | ||
"react-addons-test-utils": ">=0.14.0", | ||
"react-addons-shallow-compare": ">=0.14.0", | ||
"react-dom": ">=0.14.0", | ||
"run-browser-babel": "^4.0.1", | ||
"run-browser-babel": "^5.2.0", | ||
"tape": "^4.0.0", | ||
@@ -69,5 +78,5 @@ "uglify-js": "^2.6.1" | ||
"lint": "eslint src", | ||
"execute-tests": "run-browser-babel dist/test/index.js --phantom", | ||
"execute-tests": "run-browser-babel dist/test/index.js --bx react/addons --bx react/lib/ReactContext --bx react/lib/ExecutionEnvironment --phantom", | ||
"test": "npm run build-js && npm run execute-tests", | ||
"cover": "npm run test -- --report=text --report=cobertura --report=html --report=json-summary", | ||
"cover": "npm run build-js && npm run execute-tests -- --report=text --report=cobertura --report=html --report=json-summary", | ||
"precommit": "npm run lint -s", | ||
@@ -74,0 +83,0 @@ "prepublish": "npm run build" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1321183
97
5219
14
20
+ Addedd3-array@^0.7.1
+ Addedd3-axis@^0.3.1
+ Addedd3-collection@^0.1.2
+ Addedd3-color@^0.4.2
+ Addedd3-hierarchy@^0.2.2
+ Addedd3-scale@^0.7.0
+ Addedd3-selection@^0.7.1
+ Addedd3-shape@^0.6.0
+ Addedd3-transition@^0.2.8
+ Addedd3-array@0.7.1(transitive)
+ Addedd3-axis@0.3.2(transitive)
+ Addedd3-collection@0.1.20.2.0(transitive)
+ Addedd3-color@0.4.2(transitive)
+ Addedd3-dispatch@0.4.4(transitive)
+ Addedd3-ease@0.7.0(transitive)
+ Addedd3-format@0.5.1(transitive)
+ Addedd3-hierarchy@0.2.4(transitive)
+ Addedd3-interpolate@0.8.3(transitive)
+ Addedd3-path@0.1.5(transitive)
+ Addedd3-scale@0.7.2(transitive)
+ Addedd3-selection@0.7.3(transitive)
+ Addedd3-shape@0.6.1(transitive)
+ Addedd3-time@0.2.6(transitive)
+ Addedd3-time-format@0.3.2(transitive)
+ Addedd3-timer@0.4.4(transitive)
+ Addedd3-transition@0.2.10(transitive)
- Removedd3@^3.5.6
- Removedd3@3.5.17(transitive)