UNPKG

@domoinc/multiline-chart

Version:

MultiLineChart - Domo Widget

23 lines (22 loc) 922 B
//---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- // Is a end transition such that it will call your callback function at the end // of all the transitions occuring. // Example: // d3.selectAll("circles").transition() // .delay(750) // .duration(300) // .attr("r", 10) // .call(d3.DomoTransitionEndAll, function () // { // //Do Somthing, all circles now have a radius of 10. // }); //---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- d3.DomoTransitionEndAll = function (transition, callback) { var n = 0; transition .each(function() { ++n; }) .each("end", function() { if (!--n) callback.apply(this, arguments); }); };