   .duration(1000);
            rects.transition(transition) 
            .attr('width', d => xScale(d.value))
            .attr('fill', () => d3.interpolateRainbow(Math.random()));
            texts.transition(transition)
            .attr('x', d => xScale(d.value))
            .tween("text", function(d) {
                var i = d3.interpolate(this.textContent, d.value);
                return function(t) {
                    this.textContent = formatPercent(i(t));
                };
            });
    