Data Viz - Tick

> (Data|State) Management and Processing > Data Visualization Foundation

1 - Implementation

1.1 - 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);
  });
}

1.2 - d3

let x_ticks = x.ticks(TICK_COUNT);
let y_ticks = y.ticks(TICK_COUNT);
Advertising
data/viz/tick.txt · Last modified: 2019/01/28 17:47 by gerardnico