From cd2fe75e04e28f8ce00a7e7b965655cc679c3192 Mon Sep 17 00:00:00 2001 From: boygirl Date: Mon, 13 Nov 2017 14:34:43 -0800 Subject: [PATCH 1/2] fix container styles --- lib/components/victory-container.js | 18 +++++++----------- package-lock.json | 6 ++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/components/victory-container.js b/lib/components/victory-container.js index cee682ca..321b2986 100644 --- a/lib/components/victory-container.js +++ b/lib/components/victory-container.js @@ -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"; @@ -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 ( - + {title ? {title} : null} {desc ? {desc} : null} {children} diff --git a/package-lock.json b/package-lock.json index c46f3a50..5370e006 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "victory-native", - "version": "0.15.0", + "version": "0.16.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6342,7 +6342,9 @@ } }, "react-native-svg-mock": { - "version": "git+https://github.com/FormidableLabs/react-native-svg-mock.git#e6c1fe56dbcae07d4361ba774480657bcdd3ef6e", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/react-native-svg-mock/-/react-native-svg-mock-2.0.0.tgz", + "integrity": "sha512-+Op91zndXy+fUHZlcYo2YU3RzW5yXvKXE/mqMgYOdJLLS2kWwZBjAGt+CiKGl/+ZKnJ8/h0TWiiT0vCSv2NxEA==", "dev": true }, "react-proxy": { From c52dd4746121431623c6acb11d80284a98df704f Mon Sep 17 00:00:00 2001 From: boygirl Date: Mon, 13 Nov 2017 14:35:56 -0800 Subject: [PATCH 2/2] fix demo error --- demo/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/demo.js b/demo/demo.js index e4d7f94f..5cf4440d 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -548,7 +548,7 @@ export default class Demo extends Component { { x: 5, y: 5 } ]} interpolation="cardinal" - labels="LINE" + labels={() => "LINE"} style={{ data: { stroke: "#822722",