@symblight/react-stockcharts
Advanced tools
Comparing version 0.7.9 to 0.7.91
@@ -526,2 +526,3 @@ 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; }; | ||
onDragStart: noop, | ||
onDoubleClick: noop, | ||
onMouseMove: noop, | ||
@@ -528,0 +529,0 @@ onMouseDown: noop, |
@@ -34,2 +34,3 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
_this.handleDrag = _this.handleDrag.bind(_this); | ||
_this.handleDouble = _this.handleDouble.bind(_this); | ||
_this.handleDoubleClick = _this.handleDoubleClick.bind(_this); | ||
@@ -50,2 +51,3 @@ _this.handleDragComplete = _this.handleDragComplete.bind(_this); | ||
value: function handleDrag(index, position) { | ||
console.log(index, "drag"); | ||
this.setState({ | ||
@@ -103,16 +105,17 @@ override: { | ||
var onDoubleClick = this.props.onDoubleClick; | ||
var currentText = this.state.currentText; | ||
var _moreProps$mouseXY = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY[1], | ||
yScale = moreProps.chartConfig.yScale, | ||
xAccessor = moreProps.xAccessor, | ||
currentItem = moreProps.currentItem; | ||
var xyValue = [xAccessor(currentItem), yScale.invert(mouseY)]; | ||
if (onDoubleClick) { | ||
onDoubleClick(xyValue, moreProps, e); | ||
onDoubleClick(currentText, moreProps, e); | ||
} | ||
} | ||
}, { | ||
key: "handleDouble", | ||
value: function handleDouble(props) { | ||
this.setState({ | ||
currentText: props | ||
}); | ||
} | ||
}, { | ||
key: "handleDraw", | ||
@@ -122,4 +125,4 @@ value: function handleDraw(moreProps, e) { | ||
var _moreProps$mouseXY2 = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY2[1], | ||
var _moreProps$mouseXY = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY[1], | ||
yScale = moreProps.chartConfig.yScale, | ||
@@ -170,2 +173,3 @@ xAccessor = moreProps.xAccessor, | ||
onDrag: _this3.handleDrag, | ||
onDoubleClick: _this3.handleDouble, | ||
onDragComplete: _this3.handleDragComplete, | ||
@@ -176,3 +180,2 @@ edgeInteractiveCursor: "react-stockcharts-move-cursor" | ||
React.createElement(GenericChartComponent, { | ||
onClick: this.handleDraw, | ||
@@ -223,2 +226,3 @@ onDoubleClick: this.handleDoubleClick, | ||
onSelect: noop, | ||
onDoubleClick: noop, | ||
@@ -225,0 +229,0 @@ defaultText: { |
@@ -37,2 +37,3 @@ 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; }; | ||
_this.handleDrag = _this.handleDrag.bind(_this); | ||
_this.handleDouble = _this.handleDouble.bind(_this); | ||
@@ -100,11 +101,2 @@ _this.isHover = isHover.bind(_this); | ||
value: function handleHover(moreProps) { | ||
if (this.state.hover !== moreProps.hovering) { | ||
this.setState({ | ||
hover: moreProps.hovering | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _props2 = this.props, | ||
@@ -124,4 +116,52 @@ position = _props2.position, | ||
selected = _props2.selected, | ||
onDragComplete = _props2.onDragComplete, | ||
onDoubleClick = _props2.onDoubleClick; | ||
onDoubleClick({ position: position, | ||
bgFill: bgFill, | ||
bgOpacity: bgOpacity, | ||
bgStroke: bgStroke, | ||
bgStrokeWidth: bgStrokeWidth, | ||
textFill: textFill, | ||
fontFamily: fontFamily, | ||
fontSize: fontSize, | ||
fontWeight: fontWeight, | ||
fontStyle: fontStyle, | ||
text: text, | ||
hoverText: hoverText, | ||
selected: selected, moreProps: moreProps }); | ||
if (this.state.hover !== moreProps.hovering) { | ||
this.setState({ | ||
hover: moreProps.hovering | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "handleDouble", | ||
value: function handleDouble(moreProps, e) { | ||
var _props3 = this.props, | ||
onDoubleClick = _props3.onDoubleClick, | ||
position = _props3.position; | ||
onDoubleClick(moreProps, e, position); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _props4 = this.props, | ||
position = _props4.position, | ||
bgFill = _props4.bgFill, | ||
bgOpacity = _props4.bgOpacity, | ||
bgStroke = _props4.bgStroke, | ||
bgStrokeWidth = _props4.bgStrokeWidth, | ||
textFill = _props4.textFill, | ||
fontFamily = _props4.fontFamily, | ||
fontSize = _props4.fontSize, | ||
fontWeight = _props4.fontWeight, | ||
fontStyle = _props4.fontStyle, | ||
text = _props4.text, | ||
hoverText = _props4.hoverText, | ||
selected = _props4.selected, | ||
onDragComplete = _props4.onDragComplete, | ||
onDoubleClick = _props4.onDoubleClick; | ||
var hover = this.state.hover; | ||
@@ -209,3 +249,3 @@ | ||
onDragComplete: PropTypes.func.isRequired, | ||
onDoubleClick: PropTypes.func, | ||
onDoubleClick: PropTypes.func.isRequired, | ||
@@ -218,2 +258,3 @@ hoverText: PropTypes.object.isRequired | ||
onDragComplete: noop, | ||
onDoubleClick: noop, | ||
bgOpacity: 1, | ||
@@ -220,0 +261,0 @@ bgStrokeWidth: 1, |
@@ -542,2 +542,3 @@ "use strict"; | ||
onDragStart: _utils.noop, | ||
onDoubleClick: _utils.noop, | ||
onMouseMove: _utils.noop, | ||
@@ -544,0 +545,0 @@ onMouseDown: _utils.noop, |
@@ -57,2 +57,3 @@ "use strict"; | ||
_this.handleDrag = _this.handleDrag.bind(_this); | ||
_this.handleDouble = _this.handleDouble.bind(_this); | ||
_this.handleDoubleClick = _this.handleDoubleClick.bind(_this); | ||
@@ -73,2 +74,3 @@ _this.handleDragComplete = _this.handleDragComplete.bind(_this); | ||
value: function handleDrag(index, position) { | ||
console.log(index, "drag"); | ||
this.setState({ | ||
@@ -126,16 +128,17 @@ override: { | ||
var onDoubleClick = this.props.onDoubleClick; | ||
var currentText = this.state.currentText; | ||
var _moreProps$mouseXY = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY[1], | ||
yScale = moreProps.chartConfig.yScale, | ||
xAccessor = moreProps.xAccessor, | ||
currentItem = moreProps.currentItem; | ||
var xyValue = [xAccessor(currentItem), yScale.invert(mouseY)]; | ||
if (onDoubleClick) { | ||
onDoubleClick(xyValue, moreProps, e); | ||
onDoubleClick(currentText, moreProps, e); | ||
} | ||
} | ||
}, { | ||
key: "handleDouble", | ||
value: function handleDouble(props) { | ||
this.setState({ | ||
currentText: props | ||
}); | ||
} | ||
}, { | ||
key: "handleDraw", | ||
@@ -145,4 +148,4 @@ value: function handleDraw(moreProps, e) { | ||
var _moreProps$mouseXY2 = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY2[1], | ||
var _moreProps$mouseXY = _slicedToArray(moreProps.mouseXY, 2), | ||
mouseY = _moreProps$mouseXY[1], | ||
yScale = moreProps.chartConfig.yScale, | ||
@@ -193,2 +196,3 @@ xAccessor = moreProps.xAccessor, | ||
onDrag: _this3.handleDrag, | ||
onDoubleClick: _this3.handleDouble, | ||
onDragComplete: _this3.handleDragComplete, | ||
@@ -199,3 +203,2 @@ edgeInteractiveCursor: "react-stockcharts-move-cursor" | ||
_react2.default.createElement(_GenericChartComponent2.default, { | ||
onClick: this.handleDraw, | ||
@@ -246,2 +249,3 @@ onDoubleClick: this.handleDoubleClick, | ||
onSelect: _utils.noop, | ||
onDoubleClick: _utils.noop, | ||
@@ -248,0 +252,0 @@ defaultText: { |
@@ -57,2 +57,3 @@ "use strict"; | ||
_this.handleDrag = _this.handleDrag.bind(_this); | ||
_this.handleDouble = _this.handleDouble.bind(_this); | ||
@@ -120,11 +121,2 @@ _this.isHover = _utils2.isHover.bind(_this); | ||
value: function handleHover(moreProps) { | ||
if (this.state.hover !== moreProps.hovering) { | ||
this.setState({ | ||
hover: moreProps.hovering | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _props2 = this.props, | ||
@@ -144,4 +136,52 @@ position = _props2.position, | ||
selected = _props2.selected, | ||
onDragComplete = _props2.onDragComplete, | ||
onDoubleClick = _props2.onDoubleClick; | ||
onDoubleClick({ position: position, | ||
bgFill: bgFill, | ||
bgOpacity: bgOpacity, | ||
bgStroke: bgStroke, | ||
bgStrokeWidth: bgStrokeWidth, | ||
textFill: textFill, | ||
fontFamily: fontFamily, | ||
fontSize: fontSize, | ||
fontWeight: fontWeight, | ||
fontStyle: fontStyle, | ||
text: text, | ||
hoverText: hoverText, | ||
selected: selected, moreProps: moreProps }); | ||
if (this.state.hover !== moreProps.hovering) { | ||
this.setState({ | ||
hover: moreProps.hovering | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "handleDouble", | ||
value: function handleDouble(moreProps, e) { | ||
var _props3 = this.props, | ||
onDoubleClick = _props3.onDoubleClick, | ||
position = _props3.position; | ||
onDoubleClick(moreProps, e, position); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _props4 = this.props, | ||
position = _props4.position, | ||
bgFill = _props4.bgFill, | ||
bgOpacity = _props4.bgOpacity, | ||
bgStroke = _props4.bgStroke, | ||
bgStrokeWidth = _props4.bgStrokeWidth, | ||
textFill = _props4.textFill, | ||
fontFamily = _props4.fontFamily, | ||
fontSize = _props4.fontSize, | ||
fontWeight = _props4.fontWeight, | ||
fontStyle = _props4.fontStyle, | ||
text = _props4.text, | ||
hoverText = _props4.hoverText, | ||
selected = _props4.selected, | ||
onDragComplete = _props4.onDragComplete, | ||
onDoubleClick = _props4.onDoubleClick; | ||
var hover = this.state.hover; | ||
@@ -229,3 +269,3 @@ | ||
onDragComplete: _propTypes2.default.func.isRequired, | ||
onDoubleClick: _propTypes2.default.func, | ||
onDoubleClick: _propTypes2.default.func.isRequired, | ||
@@ -238,2 +278,3 @@ hoverText: _propTypes2.default.object.isRequired | ||
onDragComplete: _utils.noop, | ||
onDoubleClick: _utils.noop, | ||
bgOpacity: 1, | ||
@@ -240,0 +281,0 @@ bgStrokeWidth: 1, |
{ | ||
"name": "@symblight/react-stockcharts", | ||
"version": "0.7.9", | ||
"version": "0.7.91", | ||
"description": "Highly customizable stock charts with ReactJS and d3", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
4727731
48079