Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #119 from FormidableLabs/639/render-in-portal
Browse files Browse the repository at this point in the history
transform individual pie slices rather than entire group
  • Loading branch information
chrisbolin authored Jul 14, 2017
2 parents 17f3221 + b276133 commit 5d8e8fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions lib/components/victory-pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ export default class extends VictoryPie {
containerComponent: <VictoryContainer/>,
groupComponent: <G/>
};

// Overrides method in victory-pie
renderGroup(props, children) {
const { x, y } = this.getOffset(props);
return React.cloneElement(props.groupComponent, { translateX: x, translateY: y }, children);
}
}
5 changes: 4 additions & 1 deletion lib/components/victory-primitives/slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import { NativeHelpers } from "../../index";
export default class extends Slice {
// Overrides method in victory-core
renderSlice(path, style, events) {
const { role, shapeRendering, className } = this.props;
const { role, shapeRendering, className, origin } = this.props;
const nativeStyle = NativeHelpers.getStyle(style);
const baseTransform = origin ? `translate(${origin.x} ${origin.y})` : undefined;
const transform = NativeHelpers.getTransform(baseTransform);
return (
<Path
className={className}
role={role || "presentation"}
shapeRendering={shapeRendering || "auto"}
d={path}
{...transform}
{...nativeStyle}
{...events}
/>
Expand Down

0 comments on commit 5d8e8fd

Please sign in to comment.