1.0.0 • Published 4 years ago

formula-one-six-degree-graph-util v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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')
   )
);