mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-27 13:39:59 +00:00
avoid creating useless data
This commit is contained in:
@@ -428,57 +428,72 @@ export class ElevationProfile {
|
|||||||
segment: {},
|
segment: {},
|
||||||
};
|
};
|
||||||
this._chart.data.datasets[1] = {
|
this._chart.data.datasets[1] = {
|
||||||
data: data.local.points.map((point, index) => {
|
data:
|
||||||
return {
|
data.global.time.total > 0
|
||||||
x: getConvertedDistance(data.local.distance.total[index]),
|
? data.local.points.map((point, index) => {
|
||||||
y: getConvertedVelocity(data.local.speed[index]),
|
return {
|
||||||
index: index,
|
x: getConvertedDistance(data.local.distance.total[index]),
|
||||||
};
|
y: getConvertedVelocity(data.local.speed[index]),
|
||||||
}),
|
index: index,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [],
|
||||||
normalized: true,
|
normalized: true,
|
||||||
yAxisID: 'yspeed',
|
yAxisID: 'yspeed',
|
||||||
};
|
};
|
||||||
this._chart.data.datasets[2] = {
|
this._chart.data.datasets[2] = {
|
||||||
data: data.local.points.map((point, index) => {
|
data:
|
||||||
return {
|
data.global.hr.count > 0
|
||||||
x: getConvertedDistance(data.local.distance.total[index]),
|
? data.local.points.map((point, index) => {
|
||||||
y: point.getHeartRate(),
|
return {
|
||||||
index: index,
|
x: getConvertedDistance(data.local.distance.total[index]),
|
||||||
};
|
y: point.getHeartRate(),
|
||||||
}),
|
index: index,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [],
|
||||||
normalized: true,
|
normalized: true,
|
||||||
yAxisID: 'yhr',
|
yAxisID: 'yhr',
|
||||||
};
|
};
|
||||||
this._chart.data.datasets[3] = {
|
this._chart.data.datasets[3] = {
|
||||||
data: data.local.points.map((point, index) => {
|
data:
|
||||||
return {
|
data.global.cad.count > 0
|
||||||
x: getConvertedDistance(data.local.distance.total[index]),
|
? data.local.points.map((point, index) => {
|
||||||
y: point.getCadence(),
|
return {
|
||||||
index: index,
|
x: getConvertedDistance(data.local.distance.total[index]),
|
||||||
};
|
y: point.getCadence(),
|
||||||
}),
|
index: index,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [],
|
||||||
normalized: true,
|
normalized: true,
|
||||||
yAxisID: 'ycad',
|
yAxisID: 'ycad',
|
||||||
};
|
};
|
||||||
this._chart.data.datasets[4] = {
|
this._chart.data.datasets[4] = {
|
||||||
data: data.local.points.map((point, index) => {
|
data:
|
||||||
return {
|
data.global.atemp.count > 0
|
||||||
x: getConvertedDistance(data.local.distance.total[index]),
|
? data.local.points.map((point, index) => {
|
||||||
y: getConvertedTemperature(point.getTemperature()),
|
return {
|
||||||
index: index,
|
x: getConvertedDistance(data.local.distance.total[index]),
|
||||||
};
|
y: getConvertedTemperature(point.getTemperature()),
|
||||||
}),
|
index: index,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [],
|
||||||
normalized: true,
|
normalized: true,
|
||||||
yAxisID: 'yatemp',
|
yAxisID: 'yatemp',
|
||||||
};
|
};
|
||||||
this._chart.data.datasets[5] = {
|
this._chart.data.datasets[5] = {
|
||||||
data: data.local.points.map((point, index) => {
|
data:
|
||||||
return {
|
data.global.power.count > 0
|
||||||
x: getConvertedDistance(data.local.distance.total[index]),
|
? data.local.points.map((point, index) => {
|
||||||
y: point.getPower(),
|
return {
|
||||||
index: index,
|
x: getConvertedDistance(data.local.distance.total[index]),
|
||||||
};
|
y: point.getPower(),
|
||||||
}),
|
index: index,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [],
|
||||||
normalized: true,
|
normalized: true,
|
||||||
yAxisID: 'ypower',
|
yAxisID: 'ypower',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user