victory-candlestick
Advanced tools
Comparing version 36.8.2 to 36.8.3
# victory-candlestick | ||
## 36.8.3 | ||
### Patch Changes | ||
- Refactor param reassignments ([#2724](https://github.com/FormidableLabs/victory/pull/2724)) | ||
## 36.8.2 | ||
@@ -4,0 +10,0 @@ |
export declare const getData: (props: any) => any; | ||
export declare const getDomain: (props: any, axis: any) => any; | ||
export declare const getBaseProps: (props: any, fallbackProps: any) => any; | ||
export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any; | ||
//# sourceMappingURL=helper-methods.d.ts.map |
@@ -156,3 +156,6 @@ import _isPlainObject from "lodash/isPlainObject"; | ||
var getDataStyles = function (datum, style, props) { | ||
var getDataStyles = function (datum) { | ||
var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var props = arguments.length > 2 ? arguments[2] : undefined; | ||
if (props.disableInlineStyles) { | ||
@@ -162,3 +165,2 @@ return {}; | ||
style = style || {}; | ||
var candleColor = datum._open > datum._close ? props.candleColors.negative : props.candleColors.positive; | ||
@@ -343,5 +345,5 @@ var fill = style.fill || candleColor; | ||
export var getBaseProps = function (props, fallbackProps) { | ||
export var getBaseProps = function (initialProps, fallbackProps) { | ||
// eslint-disable-line max-statements | ||
props = Helpers.modifyProps(props, fallbackProps, "candlestick"); | ||
var props = Helpers.modifyProps(initialProps, fallbackProps, "candlestick"); | ||
var calculatedValues = getCalculatedValues(props); | ||
@@ -354,19 +356,18 @@ var data = calculatedValues.data, | ||
labelOrientation = calculatedValues.labelOrientation; | ||
var _props = props, | ||
groupComponent = _props.groupComponent, | ||
width = _props.width, | ||
height = _props.height, | ||
padding = _props.padding, | ||
standalone = _props.standalone, | ||
name = _props.name, | ||
candleWidth = _props.candleWidth, | ||
candleRatio = _props.candleRatio, | ||
theme = _props.theme, | ||
polar = _props.polar, | ||
wickStrokeWidth = _props.wickStrokeWidth, | ||
labels = _props.labels, | ||
events = _props.events, | ||
sharedEvents = _props.sharedEvents, | ||
horizontal = _props.horizontal, | ||
disableInlineStyles = _props.disableInlineStyles; | ||
var groupComponent = props.groupComponent, | ||
width = props.width, | ||
height = props.height, | ||
padding = props.padding, | ||
standalone = props.standalone, | ||
name = props.name, | ||
candleWidth = props.candleWidth, | ||
candleRatio = props.candleRatio, | ||
theme = props.theme, | ||
polar = props.polar, | ||
wickStrokeWidth = props.wickStrokeWidth, | ||
labels = props.labels, | ||
events = props.events, | ||
sharedEvents = props.sharedEvents, | ||
horizontal = props.horizontal, | ||
disableInlineStyles = props.disableInlineStyles; | ||
var initialChildProps = { | ||
@@ -393,8 +394,7 @@ parent: { | ||
var x = scale.x(datum._x1 !== undefined ? datum._x1 : datum._x); | ||
datum = formatDataFromDomain(datum, domain); | ||
var _datum = datum, | ||
_low = _datum._low, | ||
_open = _datum._open, | ||
_close = _datum._close, | ||
_high = _datum._high; | ||
var formattedDatum = formatDataFromDomain(datum, domain); | ||
var _low = formattedDatum._low, | ||
_open = formattedDatum._open, | ||
_close = formattedDatum._close, | ||
_high = formattedDatum._high; | ||
var high = scale.y(_high); | ||
@@ -404,3 +404,3 @@ var close = scale.y(_close); | ||
var low = scale.y(_low); | ||
var dataStyle = getDataStyles(datum, style.data, props); | ||
var dataStyle = getDataStyles(formattedDatum, style.data, props); | ||
var dataProps = { | ||
@@ -414,3 +414,3 @@ x: x, | ||
data: data, | ||
datum: datum, | ||
datum: formattedDatum, | ||
groupComponent: groupComponent, | ||
@@ -438,3 +438,3 @@ index: index, | ||
if (labels) { | ||
var text = LabelHelpers.getText(props, datum, index); | ||
var text = LabelHelpers.getText(props, formattedDatum, index); | ||
@@ -441,0 +441,0 @@ if (text !== undefined && text !== null || labels && (events || sharedEvents)) { |
export declare const getData: (props: any) => any; | ||
export declare const getDomain: (props: any, axis: any) => any; | ||
export declare const getBaseProps: (props: any, fallbackProps: any) => any; | ||
export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any; | ||
//# sourceMappingURL=helper-methods.d.ts.map |
@@ -182,3 +182,6 @@ "use strict"; | ||
var getDataStyles = function (datum, style, props) { | ||
var getDataStyles = function (datum) { | ||
var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var props = arguments.length > 2 ? arguments[2] : undefined; | ||
if (props.disableInlineStyles) { | ||
@@ -188,3 +191,2 @@ return {}; | ||
style = style || {}; | ||
var candleColor = datum._open > datum._close ? props.candleColors.negative : props.candleColors.positive; | ||
@@ -369,5 +371,6 @@ var fill = style.fill || candleColor; | ||
var getBaseProps = function (props, fallbackProps) { | ||
var getBaseProps = function (initialProps, fallbackProps) { | ||
// eslint-disable-line max-statements | ||
props = _victoryCore.Helpers.modifyProps(props, fallbackProps, "candlestick"); | ||
var props = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "candlestick"); | ||
var calculatedValues = getCalculatedValues(props); | ||
@@ -380,19 +383,18 @@ var data = calculatedValues.data, | ||
labelOrientation = calculatedValues.labelOrientation; | ||
var _props = props, | ||
groupComponent = _props.groupComponent, | ||
width = _props.width, | ||
height = _props.height, | ||
padding = _props.padding, | ||
standalone = _props.standalone, | ||
name = _props.name, | ||
candleWidth = _props.candleWidth, | ||
candleRatio = _props.candleRatio, | ||
theme = _props.theme, | ||
polar = _props.polar, | ||
wickStrokeWidth = _props.wickStrokeWidth, | ||
labels = _props.labels, | ||
events = _props.events, | ||
sharedEvents = _props.sharedEvents, | ||
horizontal = _props.horizontal, | ||
disableInlineStyles = _props.disableInlineStyles; | ||
var groupComponent = props.groupComponent, | ||
width = props.width, | ||
height = props.height, | ||
padding = props.padding, | ||
standalone = props.standalone, | ||
name = props.name, | ||
candleWidth = props.candleWidth, | ||
candleRatio = props.candleRatio, | ||
theme = props.theme, | ||
polar = props.polar, | ||
wickStrokeWidth = props.wickStrokeWidth, | ||
labels = props.labels, | ||
events = props.events, | ||
sharedEvents = props.sharedEvents, | ||
horizontal = props.horizontal, | ||
disableInlineStyles = props.disableInlineStyles; | ||
var initialChildProps = { | ||
@@ -419,8 +421,7 @@ parent: { | ||
var x = scale.x(datum._x1 !== undefined ? datum._x1 : datum._x); | ||
datum = formatDataFromDomain(datum, domain); | ||
var _datum = datum, | ||
_low = _datum._low, | ||
_open = _datum._open, | ||
_close = _datum._close, | ||
_high = _datum._high; | ||
var formattedDatum = formatDataFromDomain(datum, domain); | ||
var _low = formattedDatum._low, | ||
_open = formattedDatum._open, | ||
_close = formattedDatum._close, | ||
_high = formattedDatum._high; | ||
var high = scale.y(_high); | ||
@@ -430,3 +431,3 @@ var close = scale.y(_close); | ||
var low = scale.y(_low); | ||
var dataStyle = getDataStyles(datum, style.data, props); | ||
var dataStyle = getDataStyles(formattedDatum, style.data, props); | ||
var dataProps = { | ||
@@ -440,3 +441,3 @@ x: x, | ||
data: data, | ||
datum: datum, | ||
datum: formattedDatum, | ||
groupComponent: groupComponent, | ||
@@ -462,3 +463,3 @@ index: index, | ||
if (labels) { | ||
var text = _victoryCore.LabelHelpers.getText(props, datum, index); | ||
var text = _victoryCore.LabelHelpers.getText(props, formattedDatum, index); | ||
@@ -465,0 +466,0 @@ if (text !== undefined && text !== null || labels && (events || sharedEvents)) { |
{ | ||
"name": "victory-candlestick", | ||
"version": "36.8.2", | ||
"version": "36.8.3", | ||
"description": "Candlestick Component for Victory", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"prop-types": "^15.8.1", | ||
"victory-core": "^36.8.2" | ||
"victory-core": "^36.8.3" | ||
}, | ||
@@ -32,4 +32,4 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"victory-vendor": "^36.8.2", | ||
"victory-chart": "^36.8.2", | ||
"victory-vendor": "^36.8.3", | ||
"victory-chart": "^36.8.3", | ||
"victory-candlestick": "*" | ||
@@ -36,0 +36,0 @@ }, |
@@ -193,7 +193,10 @@ import { assign, defaults, isNil, isFunction, isPlainObject } from "lodash"; | ||
const getDataStyles = (datum, style, props) => { | ||
const getDataStyles = ( | ||
datum, | ||
style: { fill?: string; stroke?: string } = {}, | ||
props, | ||
) => { | ||
if (props.disableInlineStyles) { | ||
return {}; | ||
} | ||
style = style || {}; | ||
const candleColor = | ||
@@ -374,5 +377,5 @@ datum._open > datum._close | ||
export const getBaseProps = (props, fallbackProps) => { | ||
export const getBaseProps = (initialProps, fallbackProps) => { | ||
// eslint-disable-line max-statements | ||
props = Helpers.modifyProps(props, fallbackProps, "candlestick"); | ||
const props = Helpers.modifyProps(initialProps, fallbackProps, "candlestick"); | ||
const calculatedValues = getCalculatedValues(props); | ||
@@ -421,4 +424,4 @@ const { data, style, scale, domain, origin, labelOrientation } = | ||
const x = scale.x(datum._x1 !== undefined ? datum._x1 : datum._x); | ||
datum = formatDataFromDomain(datum, domain); | ||
const { _low, _open, _close, _high } = datum; | ||
const formattedDatum = formatDataFromDomain(datum, domain); | ||
const { _low, _open, _close, _high } = formattedDatum; | ||
const high = scale.y(_high); | ||
@@ -429,3 +432,3 @@ const close = scale.y(_close); | ||
const dataStyle = getDataStyles(datum, style.data, props); | ||
const dataStyle = getDataStyles(formattedDatum, style.data, props); | ||
const dataProps = { | ||
@@ -439,3 +442,3 @@ x, | ||
data, | ||
datum, | ||
datum: formattedDatum, | ||
groupComponent, | ||
@@ -462,3 +465,3 @@ index, | ||
if (labels) { | ||
const text = LabelHelpers.getText(props, datum, index); | ||
const text = LabelHelpers.getText(props, formattedDatum, index); | ||
if ( | ||
@@ -465,0 +468,0 @@ (text !== undefined && text !== null) || |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1269048
21961
Updatedvictory-core@^36.8.3