formula-one-six-degree-graph-util
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Formula One Graph Names

Website https://pratikpc.github.io/six-degree-f1/

License: MIT TypeScript code style: prettier

Graph Operations utilised by the website to parse JSON and Abstract processing

import Graph from 'formula-one-six-degree-graph-util';

console.log(Graph.GetDriverName('5'));
const graph = new Graph();

graph.CalculateDistancesBetweenAllElements({ cache: true });

console.log(graph.GetSixDegreesOfFreedomInMainComponent());
console.log(
   'Closest between 1950 and 2020',
   Graph.GetDriverName(graph.GetClosestDriverPairingBetweenSeasons(1950, 2020))
);
console.log(
   Graph.GetDriverName(graph.GetClosestTeamPairing('mclaren', 'lotus'))
);
console.log(
   Graph.GetDriverName(
      graph.GetClosestTeamAndDriverPairing('mclaren', 'kimi-raikkonen')
   )
);
console.log('Farthest');
console.log(
   Graph.GetDriverName(graph.GetFarthestDriverPairingBetweenSeasons(1950, 2020))
);
console.log(
   Graph.GetDriverName(graph.GetFarthestTeamPairing('mclaren', 'lotus'))
);
console.log(
   Graph.GetDriverName(
      graph.GetClosestTeamAndDriverPairing('mclaren', 'kimi-raikkonen')
   )
);

Package Sidebar

Install

npm i formula-one-six-degree-graph-util

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

240 kB

Total Files

14

Last publish

Collaborators

  • pratikpc