From 2699d7b6c37dcd6954badedb9a315998461101a7 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Wed, 7 Jun 2017 19:16:13 -0400 Subject: [PATCH] PieChart: Fix warning about invalid SVG rotation transformation --- js/components/PieChart.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/components/PieChart.js b/js/components/PieChart.js index dbb8aa9..1910c66 100644 --- a/js/components/PieChart.js +++ b/js/components/PieChart.js @@ -3,21 +3,23 @@ var React = require('react'); class Slice extends React.Component { render() { + var center = this.props.cx + " " + this.props.cy; + var rotateDegrees = this.props.startAngle * 180 / Math.PI; + if (this.props.angle > Math.PI*2 - 0.00001) { var slice = (); } else { - var center = this.props.cx + " " + this.props.cy; var dx = Math.cos(this.props.angle)*this.props.radius - this.props.radius; var dy = Math.sin(this.props.angle)*this.props.radius - 0.00001; var large_arc_flag = this.props.angle > Math.PI ? 1 : 0; - var rotateDegrees = this.props.startAngle * 180 / Math.PI; var slice = (); } + return ( {this.props.title}