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 #181 from FormidableLabs/bug/container-rendering
Browse files Browse the repository at this point in the history
Bug/container rendering
  • Loading branch information
boygirl authored Nov 13, 2017
2 parents fb46cda + c52dd47 commit 755451d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export default class Demo extends Component {
{ x: 5, y: 5 }
]}
interpolation="cardinal"
labels="LINE"
labels={() => "LINE"}
style={{
data: {
stroke: "#822722",
Expand Down
18 changes: 7 additions & 11 deletions lib/components/victory-container.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import Svg from "react-native-svg";
import { assign, get } from "lodash";
import { assign, get, omit } from "lodash";
import { View, PanResponder } from "react-native";
import { VictoryContainer } from "victory-core/src";

Expand Down Expand Up @@ -76,20 +76,16 @@ export default class extends VictoryContainer {
const children = this.getChildren(props);
// const parentProps = Object.assign({ className }, nativeStyle, svgProps);
const dimensions = responsive ? { width: "100%", height: "100%" } : { width, height };
const divStyle = NativeHelpers.getStyle(style);
const portalDivStyle = NativeHelpers.getStyle(assign(
{ zIndex: portalZIndex, position: "absolute", top: 0, left: 0 }, dimensions
));
const svgStyle = NativeHelpers.getStyle(assign({ pointerEvents: "all" }, dimensions));
const portalSvgStyle = NativeHelpers.getStyle(assign({ overflow: "visible" }, dimensions));
const portalProps = {
width, height, viewBox: svgProps.viewBox, style: portalSvgStyle
};
const baseStyle = NativeHelpers.getStyle(omit(style, ["width", "height"]));
const divStyle = assign({}, baseStyle, { position: "relative" });
const portalDivStyle = { zIndex: portalZIndex, position: "absolute", top: 0, left: 0 };
const portalSvgStyle = assign({ overflow: "visible" }, dimensions);
const portalProps = { width, height, viewBox: svgProps.viewBox, style: portalSvgStyle };
return (
<View {...this.panResponder.panHandlers} style={divStyle}
className={className} ref={props.containerRef}
>
<Svg {...svgProps} style={svgStyle}>
<Svg {...svgProps} style={dimensions}>
{title ? <title id="title">{title}</title> : null}
{desc ? <desc id="desc">{desc}</desc> : null}
{children}
Expand Down
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 755451d

Please sign in to comment.