Implementation
Javascript
let x_ticks = getTicks(TICK_COUNT, MAX_X);
let y_ticks = getTicks(TICK_COUNT, MAX_Y).reverse();
function getTicks (count, max) {
return [...Array(count).keys()].map(d => {
return max / (count - 1) * parseInt(d);
});
}
d3
let x_ticks = x.ticks(TICK_COUNT);
let y_ticks = y.ticks(TICK_COUNT);