How to use the vega-statistics.dotbin function in vega-statistics

To help you get started, we’ve selected a few vega-statistics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vega / vega / packages / vega-transforms / src / DotBin.js View on Github external
const source = pulse.materialize(pulse.SOURCE).source,
        groups = partition(pulse.source, _.groupby, identity),
        smooth = _.smooth || false,
        field = _.field,
        step = _.step || autostep(source, field),
        sort = stableCompare((a, b) => field(a) - field(b)),
        as = _.as || Output,
        n = groups.length;

  // compute dotplot bins per group
  let min = Infinity, max = -Infinity, i = 0, j;
  for (; i max) max = v;
      g[++j][as] = v;
    }
  }

  this.value = {
    start: min,
    stop: max,
    step: step
  };
  return pulse.reflow(true).modifies(as);
};