packages/victory-core/src/victory-util/data.js
function sortData(dataset, sortKey, sortOrder = "ascending") {
  if (!sortKey) {
    return dataset;
  }

  // Ensures previous VictoryLine api for sortKey prop stays consistent
  if (sortKey === "x" || sortKey === "y") {
    sortKey = `_${sortKey}`;
  }
  const order = sortOrder === "ascending" ? "asc" : "desc";
  return orderBy(dataset, sortKey, order);
}
function sortData(dataset, sortKey, sortOrder = "ascending") {
  if (!sortKey) {
    return dataset;
  }

  // Ensures previous VictoryLine api for sortKey prop stays consistent
  if (sortKey === "x" || sortKey === "y") {
    sortKey = `_${sortKey}`;
  }
  const order = sortOrder === "ascending" ? "asc" : "desc";
  return orderBy(dataset, sortKey, order);
}
function sortData ( dataset , sortKey , sortOrder = "ascending" ) { if ( ! sortKey ) { return dataset ; } // Ensures previous VictoryLine api for sortKey prop stays consistent if ( sortKey === "x" || sortKey === "y" ) { sortKey = ` ${ sortKey } ` ; } const order = sortOrder === "ascending" ? "asc" : "desc" ; return orderBy ( dataset , sortKey , order ) ; }
Returns sorted data. If no sort keys are provided, data is returned unaltered.
Returns sorted data . If no sort keys are provided data is returned unaltered .