mirror of
https://github.com/bendtherules/react-vis-gridarea.git
synced 2026-08-18 13:51:59 +00:00
Support styles with default style done
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
1. Support styles and colors
|
1. [X] Support styles with default style
|
||||||
2. Support setting both horizontal and vertical gridareas
|
2. Support setting both horizontal and vertical gridareas
|
||||||
3. Support events
|
3. Support events
|
||||||
4. Remove unwanted sample ts files
|
4. Remove unwanted sample ts files
|
||||||
|
|||||||
+6
-1
@@ -63,15 +63,20 @@ class GridArea extends PureComponent<GridAreaProps, {}> {
|
|||||||
|
|
||||||
static requiresSVG = true;
|
static requiresSVG = true;
|
||||||
|
|
||||||
|
static defaultStyle = {
|
||||||
|
fill: 'rgba(0,0,0,0.25)'
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
innerWidth: width,
|
innerWidth: width,
|
||||||
innerHeight: height,
|
innerHeight: height,
|
||||||
marginTop: top,
|
marginTop: top,
|
||||||
marginLeft: left,
|
marginLeft: left,
|
||||||
style
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
const style = {...GridArea.defaultStyle, ...this.props.style};
|
||||||
|
|
||||||
const isVertical = (this.props.direction === Direction.VERTICAL);
|
const isVertical = (this.props.direction === Direction.VERTICAL);
|
||||||
const tickXAttr = isVertical ? 'y' : 'x';
|
const tickXAttr = isVertical ? 'y' : 'x';
|
||||||
const tickYAttr = isVertical ? 'x' : 'y';
|
const tickYAttr = isVertical ? 'x' : 'y';
|
||||||
|
|||||||
Reference in New Issue
Block a user