Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Theme bugs #162

Merged
merged 4 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/victory-shared-events/victory-shared-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class VictorySharedEvents extends React.Component {
React.PropTypes.node
]),
container: React.PropTypes.node,
groupComponent: React.PropTypes.node,
events: PropTypes.arrayOf(PropTypes.shape({
childName: PropTypes.oneOfType([
PropTypes.string,
Expand All @@ -35,6 +36,10 @@ export default class VictorySharedEvents extends React.Component {
])
};

static defaultProps = {
groupComponent: <g/>
};

constructor() {
super();
this.state = {};
Expand Down Expand Up @@ -124,16 +129,17 @@ export default class VictorySharedEvents extends React.Component {
getEvents: partialRight(this.getScopedEvents, null, this.baseProps),
getEventState: partialRight(this.getEventState, null)
} : null;
const container = this.props.container || this.props.groupComponent;
const boundGetEvents = Events.getEvents.bind(this);
const parentEvents = boundGetEvents({sharedEvents}, "parent");
const parentProps = defaults(
{},
this.getEventState("parent", "parent"),
props.container.props,
container.props,
this.baseProps.parent
);
return React.cloneElement(
props.container,
container,
assign(
{}, parentProps, {events: Events.getPartialEvents(parentEvents, "parent", parentProps)}
),
Expand All @@ -143,7 +149,6 @@ export default class VictorySharedEvents extends React.Component {

render() {
const children = this.getNewChildren(this.props);
return this.props.container ? this.getContainer(this.props, children) : <g>{children}</g>;

return this.getContainer(this.props, children);
}
}
1 change: 0 additions & 1 deletion src/victory-theme/grayscale.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default {
},
ticks: {
fill: "transparent",
padding: 10,
size: 1,
stroke: "transparent"
},
Expand Down
1 change: 0 additions & 1 deletion src/victory-theme/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default {
},
ticks: {
fill: "transparent",
padding,
size: 5,
stroke: blueGrey300,
strokeWidth: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/victory-transition/victory-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default class VictoryTransition extends React.Component {

render() {
const props = this.state && this.state.nodesWillExit && !this.state.nodesDoneClipPathExit ?
this.state.oldProps : this.props;
this.state.oldProps || this.props : this.props;
const getTransitionProps = this.props.animate && this.props.animate.getTransitions ?
this.props.animate.getTransitions :
Transitions.getTransitionPropsFactory(
Expand Down
2 changes: 1 addition & 1 deletion src/victory-util/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
// TODO: is this the correct behavior, or should we just error. How do we
// handle charts with just one data point?
if (min === max) {
const adjustedMax = max === 0 ? 1 : max + max;
const adjustedMax = max === 0 ? 1 : max;
return [0, adjustedMax];
}
return [min, max];
Expand Down