How to use the d3-array.descending function in d3-array

To help you get started, we’ve selected a few d3-array 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 DefinitelyTyped / DefinitelyTyped / d3-array / d3-array-tests.ts View on Github external
// bisect right
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14));
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1);
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4);

// ascending() -----------------------------------------------------------------

num = d3Array.ascending(undefined, 20);
num = d3Array.ascending(10, 20);
num = d3Array.ascending('10', '20');
num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// descending() ----------------------------------------------------------------

num = d3Array.descending(undefined, 20);
num = d3Array.descending(10, 20);
num = d3Array.descending('10', '20');
num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// -----------------------------------------------------------------------------
// Test Transforming  Arrays
// -----------------------------------------------------------------------------

// merge() ---------------------------------------------------------------------

let testArrays: MixedObject[][] = [
    [
        new MixedObject(10, new Date(2016, 6, 1)),
        new MixedObject(20, new Date(2016, 7, 30)),
        new MixedObject(30, new Date(2015, 3, 15)),
        new MixedObject(40, new Date(2014, 3, 15)),
github DefinitelyTyped / DefinitelyTyped / d3-array / d3-array-tests.ts View on Github external
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1);
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4);

// ascending() -----------------------------------------------------------------

num = d3Array.ascending(undefined, 20);
num = d3Array.ascending(10, 20);
num = d3Array.ascending('10', '20');
num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// descending() ----------------------------------------------------------------

num = d3Array.descending(undefined, 20);
num = d3Array.descending(10, 20);
num = d3Array.descending('10', '20');
num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// -----------------------------------------------------------------------------
// Test Transforming  Arrays
// -----------------------------------------------------------------------------

// merge() ---------------------------------------------------------------------

let testArrays: MixedObject[][] = [
    [
        new MixedObject(10, new Date(2016, 6, 1)),
        new MixedObject(20, new Date(2016, 7, 30)),
        new MixedObject(30, new Date(2015, 3, 15)),
        new MixedObject(40, new Date(2014, 3, 15)),
        new MixedObject(50, new Date(2017, 4, 15))
    ],
    [
github DefinitelyTyped / DefinitelyTyped / d3-array / d3-array-tests.ts View on Github external
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14));
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1);
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4);

// ascending() -----------------------------------------------------------------

num = d3Array.ascending(undefined, 20);
num = d3Array.ascending(10, 20);
num = d3Array.ascending('10', '20');
num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// descending() ----------------------------------------------------------------

num = d3Array.descending(undefined, 20);
num = d3Array.descending(10, 20);
num = d3Array.descending('10', '20');
num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14));

// -----------------------------------------------------------------------------
// Test Transforming  Arrays
// -----------------------------------------------------------------------------

// merge() ---------------------------------------------------------------------

let testArrays: MixedObject[][] = [
    [
        new MixedObject(10, new Date(2016, 6, 1)),
        new MixedObject(20, new Date(2016, 7, 30)),
        new MixedObject(30, new Date(2015, 3, 15)),
        new MixedObject(40, new Date(2014, 3, 15)),
        new MixedObject(50, new Date(2017, 4, 15))
    ],
github orbiting / republik-frontend / components / Card / Table.js View on Github external
(a, b) =>
          descending(
            Math.max(
              a.card.payload.nationalCouncil.votes || 0,
              a.card.payload.councilOfStates.votes || 0
            ),
            Math.max(
              b.card.payload.nationalCouncil.votes || 0,
              b.card.payload.councilOfStates.votes || 0
            )
          ) ||
          ascending(
            a.card.payload.nationalCouncil.listNumbers[0],
            b.card.payload.nationalCouncil.listNumbers[0]
          )
      )
github react-d3 / react-d3-basic / src / commonProps.jsx View on Github external
margins: margins,
  x: (d) => {return +d;},
  xScale: 'linear',
  yScale: 'linear',
  showXGrid: true,
  showYGrid: true,
  showLegend: true
}

export const pieProps = {
  width: width,
  height: height,
  margins: margins,
  innerRadius: 0,
  categoricalColors: D3Scale.scaleCategory10(),
  pieSort: D3Array.descending
}
github orbiting / publikator-frontend / components / Tree / transformData.js View on Github external
return paths.sort(function (a, b) {
    return descending(a.length, b.length)
  })
}
github orbiting / crowdfunding-frontend / components / Vote / Result.js View on Github external
.sort((a, b) => (
      descending(a.winner, b.winner) ||
      descending(a.count, b.count)
    ))
  const order = orderedOptions
github orbiting / crowdfunding-frontend / components / Shareholder / Sunburst.js View on Github external
.sort((a, b) => (
    ascending(visSort[a.data.Kategorie], visSort[b.data.Kategorie]) ||
    descending(a.value, b.value)
  ))
github chrisrzhou / react-wordcloud / src / index.tsx View on Github external
        .sort((x, y) => descending(x.value, y.value))
        .slice(0, maxWords);
github openstreetmap / iD / modules / ui / background.js View on Github external
function sortSources(a, b) {
            return a.best() && !b.best() ? -1
                : b.best() && !a.best() ? 1
                : d3_descending(a.area(), b.area()) || d3_ascending(a.name(), b.name()) || 0;
        }