src/rendering.js
// Wide Y values range and adjust to bucket size
Wide Y values range and adjust to bucket size
Wide Y values range and adjust to bucket size
function wideYAxisRange(min, max, tickInterval) {
    let y_widing = (max * (dataRangeWidingFactor - 1) - min * (dataRangeWidingFactor - 1)) / 2;
    let y_min, y_max;
    if (tickInterval === 0) {
      y_max = max * dataRangeWidingFactor;
      y_min = min - min * (dataRangeWidingFactor - 1);
      tickInterval = (y_max - y_min) / 2;
    } else {
      y_max = Math.ceil((max + y_widing) / tickInterval) * tickInterval;
      y_min = Math.floor((min - y_widing) / tickInterval) * tickInterval;
    }
    if (min >= 0 && y_min < 0) {
      y_min = 0;
    }
    return {y_min, y_max};
  }
function wideYAxisRange ( min , max , tickInterval ) { let y_widing = ( max * ( dataRangeWidingFactor - 1 ) - min * ( dataRangeWidingFactor - 1 ) ) / 2 ; let y_min , y_max ; if ( tickInterval === 0 ) { y_max = max * dataRangeWidingFactor ; y_min = min - min * ( dataRangeWidingFactor - 1 ) ; tickInterval = ( y_max - y_min ) / 2 ; } else { y_max = Math . ceil ( ( max + y_widing ) / tickInterval ) * tickInterval ; y_min = Math . floor ( ( min - y_widing ) / tickInterval ) * tickInterval ; } if ( min >= 0 && y_min < 0 ) { y_min = 0 ; } return { y_min , y_max } ; }
Wide Y values range and adjust to bucket size
Wide Y values range and adjust to bucket size
// Don't wide axis below 0 if all values are positive