Remove pie animation

parent 83d05d4e
...@@ -265,8 +265,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf ...@@ -265,8 +265,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
.attr("transform", withTransform ? "scale(0)" : $$.wrapExplode()) .attr("transform", withTransform ? "scale(0)" : $$.wrapExplode())
.style("opacity", function (d) { return d === this._current ? 0 : 1; }) .style("opacity", function (d) { return d === this._current ? 0 : 1; })
.each(function () { $$.transiting = true; }) .each(function () { $$.transiting = true; })
.transition().duration(duration) .attr("d", function (d) {
.attrTween("d", function (d) {
var updated = $$.updateAngle(d), interpolate; var updated = $$.updateAngle(d), interpolate;
if (! updated) { if (! updated) {
return function () { return "M 0 0"; }; return function () { return "M 0 0"; };
...@@ -276,20 +275,15 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf ...@@ -276,20 +275,15 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
} }
interpolate = d3.interpolate(this._current, updated); interpolate = d3.interpolate(this._current, updated);
this._current = interpolate(0); this._current = interpolate(0);
return function (t) { var interpolated = interpolate(1);
var interpolated = interpolate(t); interpolated.data = d.data; // data.id will be updated by interporator
interpolated.data = d.data; // data.id will be updated by interporator return $$.getArc(interpolated, true);
return $$.getArc(interpolated, true);
};
}) })
.attr("transform", withTransform ? "scale(1)" : $$.wrapExplode()) .attr("transform", withTransform ? "scale(1)" : $$.wrapExplode())
.style("fill", function (d) { .style("fill", function (d) {
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id); return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
}) // Where gauge reading color would receive customization. }) // Where gauge reading color would receive customization.
.style("opacity", 1) .style("opacity", 1);
.call($$.endall, function () {
$$.transiting = false;
});
mainArc.exit().transition().duration(durationForExit) mainArc.exit().transition().duration(durationForExit)
.style('opacity', 0) .style('opacity', 0)
.remove(); .remove();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment