victory-area
Advanced tools
Comparing version 35.8.2 to 35.9.0
@@ -94,3 +94,4 @@ import _isNil from "lodash/isNil"; | ||
labels = _props.labels, | ||
name = _props.name; | ||
name = _props.name, | ||
disableInlineStyles = _props.disableInlineStyles; | ||
var initialChildProps = { | ||
@@ -121,3 +122,4 @@ parent: { | ||
groupComponent: groupComponent, | ||
style: style.data | ||
style: disableInlineStyles ? {} : style.data, | ||
disableInlineStyles: disableInlineStyles | ||
} | ||
@@ -124,0 +126,0 @@ } |
@@ -114,3 +114,4 @@ "use strict"; | ||
labels = _props.labels, | ||
name = _props.name; | ||
name = _props.name, | ||
disableInlineStyles = _props.disableInlineStyles; | ||
var initialChildProps = { | ||
@@ -141,3 +142,4 @@ parent: { | ||
groupComponent: groupComponent, | ||
style: style.data | ||
style: disableInlineStyles ? {} : style.data, | ||
disableInlineStyles: disableInlineStyles | ||
} | ||
@@ -144,0 +146,0 @@ } |
{ | ||
"name": "victory-area", | ||
"version": "35.8.2", | ||
"version": "35.9.0", | ||
"description": "Area Component for Victory", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^35.8.1" | ||
"victory-core": "^35.9.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
@@ -40,3 +40,4 @@ /*eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/ | ||
const { polar, scale, horizontal } = props; | ||
const interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationFunction = | ||
typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationName = | ||
@@ -61,3 +62,4 @@ typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
const { horizontal, scale } = props; | ||
const interpolationFunction = typeof interpolation === "function" && interpolation; | ||
const interpolationFunction = | ||
typeof interpolation === "function" && interpolation; | ||
const interpolationName = typeof interpolation === "string" && interpolation; | ||
@@ -83,3 +85,4 @@ return horizontal | ||
const { polar, scale } = props; | ||
const interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationFunction = | ||
typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationName = | ||
@@ -111,3 +114,6 @@ typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
const id = Helpers.evaluateProp(props.id, props); | ||
const style = Helpers.evaluateStyle(assign({ fill: "black" }, props.style), props); | ||
const style = Helpers.evaluateStyle( | ||
assign({ fill: "black" }, props.style), | ||
props | ||
); | ||
const tabIndex = Helpers.evaluateProp(props.tabIndex, props); | ||
@@ -137,5 +143,7 @@ | ||
} = props; | ||
const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : undefined; | ||
const defaultTransform = | ||
polar && origin ? `translate(${origin.x}, ${origin.y})` : undefined; | ||
const transform = props.transform || defaultTransform; | ||
const renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent"; | ||
const renderLine = | ||
style.stroke && style.stroke !== "none" && style.stroke !== "transparent"; | ||
const areaFunction = getAreaFunction(props); | ||
@@ -184,3 +192,5 @@ const lineFunction = renderLine && getLineFunction(props); | ||
return renderLine ? React.cloneElement(groupComponent, {}, [area, line]) : area; | ||
return renderLine | ||
? React.cloneElement(groupComponent, {}, [area, line]) | ||
: area; | ||
}; | ||
@@ -187,0 +197,0 @@ |
import { assign, isNil } from "lodash"; | ||
import { Helpers, LabelHelpers, Data, Domain, Scale, Collection } from "victory-core"; | ||
import { | ||
Helpers, | ||
LabelHelpers, | ||
Data, | ||
Domain, | ||
Scale, | ||
Collection | ||
} from "victory-core"; | ||
@@ -10,3 +17,4 @@ const getDataWithBaseline = (props, scale) => { | ||
const getDefaultMin = (axis) => { | ||
const defaultZero = Scale.getType(scale[axis]) === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0; | ||
const defaultZero = | ||
Scale.getType(scale[axis]) === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0; | ||
const domain = scale[axis].domain(); | ||
@@ -53,3 +61,5 @@ const minY = Collection.getMinValue(domain); | ||
}; | ||
const origin = polar ? props.origin || Helpers.getPolarOrigin(props) : undefined; | ||
const origin = polar | ||
? props.origin || Helpers.getPolarOrigin(props) | ||
: undefined; | ||
const data = getDataWithBaseline(props, scale); | ||
@@ -80,3 +90,4 @@ return { style, data, scale, domain, origin }; | ||
labels, | ||
name | ||
name, | ||
disableInlineStyles | ||
} = props; | ||
@@ -108,3 +119,4 @@ const initialChildProps = { | ||
groupComponent, | ||
style: style.data | ||
style: disableInlineStyles ? {} : style.data, | ||
disableInlineStyles | ||
} | ||
@@ -115,3 +127,6 @@ } | ||
const text = LabelHelpers.getText(props, datum, index); | ||
if ((text !== undefined && text !== null) || (labels && (events || sharedEvents))) { | ||
if ( | ||
(text !== undefined && text !== null) || | ||
(labels && (events || sharedEvents)) | ||
) { | ||
const eventKey = !isNil(datum.eventKey) ? datum.eventKey : index; | ||
@@ -118,0 +133,0 @@ childProps[eventKey] = { labels: LabelHelpers.getProps(props, index) }; |
@@ -35,3 +35,10 @@ import PropTypes from "prop-types"; | ||
class VictoryArea extends React.Component { | ||
static animationWhitelist = ["data", "domain", "height", "padding", "style", "width"]; | ||
static animationWhitelist = [ | ||
"data", | ||
"domain", | ||
"height", | ||
"padding", | ||
"style", | ||
"width" | ||
]; | ||
@@ -78,3 +85,4 @@ static propTypes = { | ||
static defaultTransitions = DefaultTransitions.continuousTransitions(); | ||
static defaultPolarTransitions = DefaultTransitions.continuousPolarTransitions(); | ||
static defaultPolarTransitions = | ||
DefaultTransitions.continuousPolarTransitions(); | ||
static getDomain = Domain.getDomainWithZero; | ||
@@ -104,3 +112,5 @@ static getData = Data.getData; | ||
const children = this.renderContinuousData(props); | ||
return props.standalone ? this.renderContainer(props.containerComponent, children) : children; | ||
return props.standalone | ||
? this.renderContainer(props.containerComponent, children) | ||
: children; | ||
} | ||
@@ -107,0 +117,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1472305
25325
Updatedvictory-core@^35.9.0