mirror of
https://github.com/bendtherules/react-vis-gridarea.git
synced 2026-08-18 13:51:59 +00:00
GridArea - Make class vars static + change arg obj to getAttributeScale
This commit is contained in:
+11
-5
@@ -47,11 +47,11 @@ const GridAreaPropTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class GridArea extends PureComponent<GridAreaProps, {}> {
|
class GridArea extends PureComponent<GridAreaProps, {}> {
|
||||||
displayName = 'GridArea';
|
static displayName = 'GridArea';
|
||||||
propTypes = GridAreaPropTypes;
|
static propTypes = GridAreaPropTypes;
|
||||||
defaultProps = {};
|
static defaultProps = {};
|
||||||
|
|
||||||
requiresSVG = true;
|
static requiresSVG = true;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
@@ -67,7 +67,13 @@ class GridArea extends PureComponent<GridAreaProps, {}> {
|
|||||||
const tickYAttr = isVertical ? 'x' : 'y';
|
const tickYAttr = isVertical ? 'x' : 'y';
|
||||||
const length = isVertical ? height : width;
|
const length = isVertical ? height : width;
|
||||||
|
|
||||||
const scale = getAttributeScale(this.props, 'y');
|
const scale = getAttributeScale({
|
||||||
|
...this.props,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
top,
|
||||||
|
left
|
||||||
|
}, 'y');
|
||||||
const values = [[4, 5.76], [8.5, 11.25]];
|
const values = [[4, 5.76], [8.5, 11.25]];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user