packages/victory-core/src/victory-util/data.js
function cleanData(dataset, props) {
  const smallNumber = 1 / Number.MAX_SAFE_INTEGER;
  const scaleType = {
    x: Scale.getScaleType(props, "x"),
    y: Scale.getScaleType(props, "y")
  };
  if (scaleType.x !== "log" && scaleType.y !== "log") {
    return dataset;
  }
  const rules = (datum, axis) => {
    return scaleType[axis] === "log" ? datum[`_${axis}`] !== 0 : true;
  };

  const sanitize = (datum) => {
    const _x = rules(datum, "x") ? datum._x : smallNumber;
    const _y = rules(datum, "y") ? datum._y : smallNumber;
    const _y0 = rules(datum, "y0") ? datum._y0 : smallNumber;
    return assign({}, datum, { _x, _y, _y0 });
  };

  return dataset.map((datum) => {
    if (rules(datum, "x") && rules(datum, "y") && rules(datum, "y0")) {
      return datum;
    }
    return sanitize(datum);
  });
}
function cleanData(dataset, props) {
  const smallNumber = 1 / Number.MAX_SAFE_INTEGER;
  const scaleType = {
    x: Scale.getScaleType(props, "x"),
    y: Scale.getScaleType(props, "y")
  };
  if (scaleType.x !== "log" && scaleType.y !== "log") {
    return dataset;
  }
  const rules = (datum, axis) => {
    return scaleType[axis] === "log" ? datum[`_${axis}`] !== 0 : true;
  };

  const sanitize = (datum) => {
    const _x = rules(datum, "x") ? datum._x : smallNumber;
    const _y = rules(datum, "y") ? datum._y : smallNumber;
    const _y0 = rules(datum, "y0") ? datum._y0 : smallNumber;
    return assign({}, datum, { _x, _y, _y0 });
  };

  return dataset.map((datum) => {
    if (rules(datum, "x") && rules(datum, "y") && rules(datum, "y0")) {
      return datum;
    }
    return sanitize(datum);
  });
}
function cleanData ( dataset , props ) { const smallNumber = 1 / Number . MAX_SAFE_INTEGER ; const scaleType = { x : Scale . getScaleType ( props , "x" ) , y : Scale . getScaleType ( props , "y" ) } ; if ( scaleType . x !== "log" && scaleType . y !== "log" ) { return dataset ; } const rules = ( datum , axis ) => { return scaleType [ axis ] === "log" ? datum [ ` ${ axis } ` ] !== 0 : true ; } ; const sanitize = ( datum ) => { const _x = rules ( datum , "x" ) ? datum . _x : smallNumber ; const _y = rules ( datum , "y" ) ? datum . _y : smallNumber ; const _y0 = rules ( datum , "y0" ) ? datum . _y0 : smallNumber ; return assign ( { } , datum , { _x , _y , _y0 } ) ; } ; return dataset . map ( ( datum ) => { if ( rules ( datum , "x" ) && rules ( datum , "y" ) && rules ( datum , "y0" ) ) { return datum ; } return sanitize ( datum ) ; } ) ; }
This method will remove data points that break certain scales. (log scale only)
This method will remove data points that break certain scales . ( log scale only )