refactored percent calculation to use d3.quantile