victory-bar
Advanced tools
Comparing version 30.0.0 to 30.1.0
@@ -218,9 +218,9 @@ import _isObject from "lodash/isObject"; | ||
var scale = props.scale, | ||
data = props.data; | ||
data = props.data, | ||
defaultBarWidth = props.defaultBarWidth; | ||
var range = scale.x.range(); | ||
var extent = Math.abs(range[1] - range[0]); | ||
var bars = data.length + 2; | ||
var barRatio = props.barRatio || 0.5; // eslint-disable-next-line no-magic-numbers | ||
var defaultWidth = data.length < 2 ? 8 : barRatio * extent / bars; | ||
var barRatio = props.barRatio || 0.5; | ||
var defaultWidth = barRatio * (data.length < 2 ? defaultBarWidth : extent / bars); | ||
return Math.max(1, defaultWidth); | ||
@@ -264,3 +264,4 @@ } | ||
pathComponent = _props.pathComponent, | ||
events = _props.events; | ||
events = _props.events, | ||
clipPath = _props.clipPath; | ||
var stroke = this.props.style && this.props.style.fill || "black"; | ||
@@ -284,3 +285,4 @@ var baseStyle = { | ||
shapeRendering: shapeRendering, | ||
events: events | ||
events: events, | ||
clipPath: clipPath | ||
}); | ||
@@ -319,5 +321,6 @@ } | ||
value: { | ||
pathComponent: React.createElement(Path, null) | ||
pathComponent: React.createElement(Path, null), | ||
defaultBarWidth: 8 | ||
} | ||
}); | ||
export { Bar as default }; |
@@ -72,3 +72,4 @@ import _assign from "lodash/assign"; | ||
width = _props.width, | ||
labels = _props.labels; | ||
labels = _props.labels, | ||
name = _props.name; | ||
var initialChildProps = { | ||
@@ -82,2 +83,3 @@ parent: { | ||
standalone: standalone, | ||
name: name, | ||
theme: theme, | ||
@@ -84,0 +86,0 @@ polar: polar, |
@@ -235,9 +235,9 @@ "use strict"; | ||
var scale = props.scale, | ||
data = props.data; | ||
data = props.data, | ||
defaultBarWidth = props.defaultBarWidth; | ||
var range = scale.x.range(); | ||
var extent = Math.abs(range[1] - range[0]); | ||
var bars = data.length + 2; | ||
var barRatio = props.barRatio || 0.5; // eslint-disable-next-line no-magic-numbers | ||
var defaultWidth = data.length < 2 ? 8 : barRatio * extent / bars; | ||
var barRatio = props.barRatio || 0.5; | ||
var defaultWidth = barRatio * (data.length < 2 ? defaultBarWidth : extent / bars); | ||
return Math.max(1, defaultWidth); | ||
@@ -281,3 +281,4 @@ } | ||
pathComponent = _props.pathComponent, | ||
events = _props.events; | ||
events = _props.events, | ||
clipPath = _props.clipPath; | ||
var stroke = this.props.style && this.props.style.fill || "black"; | ||
@@ -303,3 +304,4 @@ var baseStyle = { | ||
shapeRendering: shapeRendering, | ||
events: events | ||
events: events, | ||
clipPath: clipPath | ||
}); | ||
@@ -339,4 +341,5 @@ } | ||
value: { | ||
pathComponent: _react.default.createElement(_victoryCore.Path, null) | ||
pathComponent: _react.default.createElement(_victoryCore.Path, null), | ||
defaultBarWidth: 8 | ||
} | ||
}); |
@@ -89,3 +89,4 @@ "use strict"; | ||
width = _props.width, | ||
labels = _props.labels; | ||
labels = _props.labels, | ||
name = _props.name; | ||
var initialChildProps = { | ||
@@ -99,2 +100,3 @@ parent: { | ||
standalone: standalone, | ||
name: name, | ||
theme: theme, | ||
@@ -101,0 +103,0 @@ polar: polar, |
{ | ||
"name": "victory-bar", | ||
"version": "30.0.0", | ||
"description": "Chart Component for Victory", | ||
"version": "30.1.0", | ||
"description": "Bar Component for Victory", | ||
"keywords": [ | ||
"data visualization", | ||
"React", | ||
"d3", | ||
"charting" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/formidablelabs/victory.git" | ||
}, | ||
"homepage": "https://formidable.com/open-source/victory", | ||
"main": "lib/index.js", | ||
@@ -13,3 +24,4 @@ "module": "es/index.js", | ||
"lodash": "^4.17.5", | ||
"victory-core": "^30.0.0" | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^30.1.0" | ||
}, | ||
@@ -16,0 +28,0 @@ "scripts": { |
@@ -35,3 +35,4 @@ import React from "react"; | ||
static defaultProps = { | ||
pathComponent: <Path/> | ||
pathComponent: <Path/>, | ||
defaultBarWidth: 8 | ||
}; | ||
@@ -193,3 +194,3 @@ | ||
} | ||
const { scale, data } = props; | ||
const { scale, data, defaultBarWidth } = props; | ||
const range = scale.x.range(); | ||
@@ -199,4 +200,3 @@ const extent = Math.abs(range[1] - range[0]); | ||
const barRatio = props.barRatio || 0.5; | ||
// eslint-disable-next-line no-magic-numbers | ||
const defaultWidth = data.length < 2 ? 8 : (barRatio * extent / bars); | ||
const defaultWidth = barRatio * (data.length < 2 ? defaultBarWidth : extent / bars); | ||
return Math.max(1, defaultWidth); | ||
@@ -224,3 +224,3 @@ } | ||
const { | ||
role, datum, active, shapeRendering, className, origin, polar, pathComponent, events | ||
role, datum, active, shapeRendering, className, origin, polar, pathComponent, events, clipPath | ||
} = this.props; | ||
@@ -238,5 +238,5 @@ const stroke = this.props.style && this.props.style.fill || "black"; | ||
return React.cloneElement(pathComponent, { | ||
d: path, transform, className, style, role, shapeRendering, events | ||
d: path, transform, className, style, role, shapeRendering, events, clipPath | ||
}); | ||
} | ||
} |
@@ -43,6 +43,6 @@ import { assign } from "lodash"; | ||
alignment, barRatio, cornerRadius, data, domain, events, height, horizontal, origin, padding, | ||
polar, scale, sharedEvents, standalone, style, theme, width, labels | ||
polar, scale, sharedEvents, standalone, style, theme, width, labels, name | ||
} = props; | ||
const initialChildProps = { parent: { | ||
domain, scale, width, height, data, standalone, | ||
domain, scale, width, height, data, standalone, name, | ||
theme, polar, origin, padding, style: style.parent | ||
@@ -49,0 +49,0 @@ } }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1344412
24427
1
4
18
+ Addedprop-types@^15.5.8
Updatedvictory-core@^30.1.0