victory-chart
Advanced tools
Comparing version 23.0.0 to 23.0.1
# VictoryChart Changelog | ||
## 23.0.1 ( 2017-10-04) | ||
-[524](https://github.com/FormidableLabs/victory-chart/pull/524) Fix naming changes for `VictoryCursorContainer` | ||
## 23.0.0 (2017-09-30) | ||
@@ -4,0 +8,0 @@ |
@@ -10,4 +10,4 @@ import _isFunction from "lodash/isFunction"; | ||
onMouseMove: function (evt, targetProps) { | ||
var onChange = targetProps.onChange, | ||
dimension = targetProps.dimension, | ||
var onCursorChange = targetProps.onCursorChange, | ||
cursorDimension = targetProps.cursorDimension, | ||
domain = targetProps.domain; | ||
@@ -29,8 +29,8 @@ | ||
if (_isFunction(onChange)) { | ||
if (_isFunction(onCursorChange)) { | ||
if (inBounds) { | ||
var value = dimension ? cursorValue[dimension] : cursorValue; | ||
onChange(value, targetProps); | ||
var value = cursorDimension ? cursorValue[cursorDimension] : cursorValue; | ||
onCursorChange(value, targetProps); | ||
} else if (cursorValue !== targetProps.cursorValue) { | ||
onChange(targetProps.defaultCursorValue || null, targetProps); | ||
onCursorChange(targetProps.defaultCursorValue || null, targetProps); | ||
} | ||
@@ -37,0 +37,0 @@ } |
@@ -45,3 +45,3 @@ import _isObject from "lodash/isObject"; | ||
defaultCursorValue = props.defaultCursorValue, | ||
dimension = props.dimension, | ||
cursorDimension = props.cursorDimension, | ||
domain = props.domain; | ||
@@ -57,3 +57,3 @@ | ||
y: (domain.y[0] + domain.y[1]) / 2 | ||
}, dimension, defaultCursorValue); | ||
}, cursorDimension, defaultCursorValue); | ||
} | ||
@@ -94,3 +94,3 @@ | ||
var scale = props.scale, | ||
dimension = props.dimension, | ||
cursorDimension = props.cursorDimension, | ||
cursorLabelComponent = props.cursorLabelComponent, | ||
@@ -125,3 +125,3 @@ cursorLabel = props.cursorLabel, | ||
if (dimension === "x" || dimension === undefined) { | ||
if (cursorDimension === "x" || cursorDimension === undefined) { | ||
newElements.push(React.cloneElement(cursorComponent, { | ||
@@ -135,3 +135,3 @@ key: "x-cursor", | ||
} | ||
if (dimension === "y" || dimension === undefined) { | ||
if (cursorDimension === "y" || cursorDimension === undefined) { | ||
newElements.push(React.cloneElement(cursorComponent, { | ||
@@ -138,0 +138,0 @@ key: "y-cursor", |
@@ -25,4 +25,4 @@ Object.defineProperty(exports, "__esModule", { | ||
onMouseMove: function (evt, targetProps) { | ||
var onChange = targetProps.onChange, | ||
dimension = targetProps.dimension, | ||
var onCursorChange = targetProps.onCursorChange, | ||
cursorDimension = targetProps.cursorDimension, | ||
domain = targetProps.domain; | ||
@@ -44,8 +44,8 @@ | ||
if ((0, _isFunction3.default)(onChange)) { | ||
if ((0, _isFunction3.default)(onCursorChange)) { | ||
if (inBounds) { | ||
var value = dimension ? cursorValue[dimension] : cursorValue; | ||
onChange(value, targetProps); | ||
var value = cursorDimension ? cursorValue[cursorDimension] : cursorValue; | ||
onCursorChange(value, targetProps); | ||
} else if (cursorValue !== targetProps.cursorValue) { | ||
onChange(targetProps.defaultCursorValue || null, targetProps); | ||
onCursorChange(targetProps.defaultCursorValue || null, targetProps); | ||
} | ||
@@ -52,0 +52,0 @@ } |
@@ -71,3 +71,3 @@ Object.defineProperty(exports, "__esModule", { | ||
defaultCursorValue = props.defaultCursorValue, | ||
dimension = props.dimension, | ||
cursorDimension = props.cursorDimension, | ||
domain = props.domain; | ||
@@ -83,3 +83,3 @@ | ||
y: (domain.y[0] + domain.y[1]) / 2 | ||
}, dimension, defaultCursorValue); | ||
}, cursorDimension, defaultCursorValue); | ||
} | ||
@@ -120,3 +120,3 @@ | ||
var scale = props.scale, | ||
dimension = props.dimension, | ||
cursorDimension = props.cursorDimension, | ||
cursorLabelComponent = props.cursorLabelComponent, | ||
@@ -151,3 +151,3 @@ cursorLabel = props.cursorLabel, | ||
if (dimension === "x" || dimension === undefined) { | ||
if (cursorDimension === "x" || cursorDimension === undefined) { | ||
newElements.push(_react2.default.cloneElement(cursorComponent, { | ||
@@ -161,3 +161,3 @@ key: "x-cursor", | ||
} | ||
if (dimension === "y" || dimension === undefined) { | ||
if (cursorDimension === "y" || cursorDimension === undefined) { | ||
newElements.push(_react2.default.cloneElement(cursorComponent, { | ||
@@ -164,0 +164,0 @@ key: "y-cursor", |
{ | ||
"name": "victory-chart", | ||
"version": "23.0.0", | ||
"version": "23.0.1", | ||
"description": "Chart Component for Victory", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -8,3 +8,3 @@ import { Selection } from "victory-core"; | ||
onMouseMove(evt, targetProps) { | ||
const { onChange, dimension, domain } = targetProps; | ||
const { onCursorChange, cursorDimension, domain } = targetProps; | ||
const cursorSVGPosition = Selection.getSVGEventCoordinates(evt); | ||
@@ -29,8 +29,8 @@ let cursorValue = Selection.getDataCoordinates( | ||
if (isFunction(onChange)) { | ||
if (isFunction(onCursorChange)) { | ||
if (inBounds) { | ||
const value = dimension ? cursorValue[dimension] : cursorValue; | ||
onChange(value, targetProps); | ||
const value = cursorDimension ? cursorValue[cursorDimension] : cursorValue; | ||
onCursorChange(value, targetProps); | ||
} else if (cursorValue !== targetProps.cursorValue) { | ||
onChange(targetProps.defaultCursorValue || null, targetProps); | ||
onCursorChange(targetProps.defaultCursorValue || null, targetProps); | ||
} | ||
@@ -37,0 +37,0 @@ } |
@@ -73,3 +73,3 @@ import PropTypes from "prop-types"; | ||
getCursorPosition(props) { | ||
const { cursorValue, defaultCursorValue, dimension, domain } = props; | ||
const { cursorValue, defaultCursorValue, cursorDimension, domain } = props; | ||
if (cursorValue) { return cursorValue; } | ||
@@ -81,3 +81,3 @@ | ||
y: (domain.y[0] + domain.y[1]) / 2, | ||
[dimension]: defaultCursorValue | ||
[cursorDimension]: defaultCursorValue | ||
}; | ||
@@ -115,3 +115,3 @@ } | ||
const { | ||
scale, dimension, cursorLabelComponent, cursorLabel, cursorComponent, width, height | ||
scale, cursorDimension, cursorLabelComponent, cursorLabel, cursorComponent, width, height | ||
} = props; | ||
@@ -146,3 +146,3 @@ const cursorValue = this.getCursorPosition(props); | ||
if (dimension === "x" || dimension === undefined) { | ||
if (cursorDimension === "x" || cursorDimension === undefined) { | ||
newElements.push(React.cloneElement(cursorComponent, { | ||
@@ -156,3 +156,3 @@ key: "x-cursor", | ||
} | ||
if (dimension === "y" || dimension === undefined) { | ||
if (cursorDimension === "y" || cursorDimension === undefined) { | ||
newElements.push(React.cloneElement(cursorComponent, { | ||
@@ -159,0 +159,0 @@ key: "y-cursor", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2795530
50571