function interpolate(points, threshold = 0.5) {
  return Object.entries(points.reduce((o, p) => {
    return explode(p).reduce((o, p) => {
      o[p] = (o[p] || 0) + p.alpha;
      return o;
    }, o);
  }, {})).reduce((o, [p,a]) => {
    if (a < threshold) return o;
    let v = p.split(',').map(Number);
    v.alpha = a; // TODO: maybe not include this?
    o.push(v);
    return o;
  }, []);
}
// TODO: threshold here might be an anti-pattern
threshold here might be an anti-pattern
threshold here might be an anti - pattern
function interpolate(points, threshold = 0.5) {
  return Object.entries(points.reduce((o, p) => {
    return explode(p).reduce((o, p) => {
      o[p] = (o[p] || 0) + p.alpha;
      return o;
    }, o);
  }, {})).reduce((o, [p,a]) => {
    if (a < threshold) return o;
    let v = p.split(',').map(Number);
    v.alpha = a; 
    o.push(v);
    return o;
  }, []);
}
function interpolate ( points , threshold = 0.5 ) { return Object . entries ( points . reduce ( ( o , p ) => { return explode ( p ) . reduce ( ( o , p ) => { o [ p ] = ( o [ p ] || 0 ) + p . alpha ; return o ; } , o ) ; } , { } ) ) . reduce ( ( o , [ p , a ] ) => { if ( a < threshold ) return o ; let v = p . split ( ',' ) . map ( Number ) ; v . alpha = a ; o . push ( v ) ; return o ; } , [ ] ) ; }
TODO: threshold here might be an anti-pattern
TODO : threshold here might be an anti - pattern
// TODO: maybe not include this?