Merge branch 'master' of https://github.com/F1Vis/f1vis
This commit is contained in:
commit
ff2bed5239
@ -34,7 +34,17 @@ var processor = {
|
|||||||
//Attach Qualifying Data
|
//Attach Qualifying Data
|
||||||
lapData.qualifying = processor.getQualifyingForDriver(raceData, driver);
|
lapData.qualifying = processor.getQualifyingForDriver(raceData, driver);
|
||||||
//add Qualifying Data to the Laps
|
//add Qualifying Data to the Laps
|
||||||
var lap0 = {'driverId': driver.driverId, 'lap': 0, 'position': lapData.qualifying.position};
|
var lap0 = {'driverId': driver.driverId, 'lap': 0};
|
||||||
|
// Figure out the position of that driver
|
||||||
|
if (lapData.qualifying !== undefined) {
|
||||||
|
// Use qualifying data, if available
|
||||||
|
lap0['position'] = lapData.qualifying.position;
|
||||||
|
} else {
|
||||||
|
// TODO: Easy fallback.
|
||||||
|
// Maybe just take result from first lap - Future: Perhaps leave out that data point at all
|
||||||
|
lap0['position'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
var endResult = raceData.results.filter(res => res.driverId == driver.driverId && res.laps == 0);
|
var endResult = raceData.results.filter(res => res.driverId == driver.driverId && res.laps == 0);
|
||||||
if(endResult.length > 0){
|
if(endResult.length > 0){
|
||||||
lap0.finished = endResult[0];
|
lap0.finished = endResult[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user