commit
6a4ea225c4
|
@ -28,7 +28,7 @@ const parseWarLog = (lineArray, war) => {
|
||||||
|
|
||||||
lineArray.some(line => {
|
lineArray.some(line => {
|
||||||
/**
|
/**
|
||||||
* sanitize nameToLongError coming up in first line
|
* sanitize nameTooLongError coming up in first line
|
||||||
*/
|
*/
|
||||||
if (line.includes(nameToLongError)) {
|
if (line.includes(nameToLongError)) {
|
||||||
line = line.substring(line.indexOf(nameToLongError) + nameToLongError.length);
|
line = line.substring(line.indexOf(nameToLongError) + nameToLongError.length);
|
||||||
|
@ -65,7 +65,7 @@ const parseWarLog = (lineArray, war) => {
|
||||||
if (line.includes('Endbudget')) {
|
if (line.includes('Endbudget')) {
|
||||||
stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]);
|
stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]);
|
||||||
stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]);
|
stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]);
|
||||||
war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5] +'.000+02:00');
|
war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5]);
|
||||||
} else if (line.includes('Startbudget')) {
|
} else if (line.includes('Startbudget')) {
|
||||||
stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00.000+02:00');
|
stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00.000+02:00');
|
||||||
stats.war['budgetBlufor'] = transformMoneyString(budg[11]);
|
stats.war['budgetBlufor'] = transformMoneyString(budg[11]);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "opt-cc",
|
"name": "opt-cc",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Florian Hartwich <hardi@noarch.de>",
|
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
|
@ -101,7 +101,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -119,7 +118,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -137,7 +135,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -155,7 +152,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -173,7 +169,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -191,7 +186,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
@ -209,7 +203,6 @@
|
||||||
[gradient]="gradient"
|
[gradient]="gradient"
|
||||||
[xAxis]="xAxis"
|
[xAxis]="xAxis"
|
||||||
[yAxis]="yAxis"
|
[yAxis]="yAxis"
|
||||||
[curve]="monotoneYCurve"
|
|
||||||
[legend]="legend"
|
[legend]="legend"
|
||||||
[legendTitle]="legendTitle"
|
[legendTitle]="legendTitle"
|
||||||
[showXAxisLabel]="showXAxisLabel"
|
[showXAxisLabel]="showXAxisLabel"
|
||||||
|
|
|
@ -66,7 +66,6 @@ export class WarDetailComponent {
|
||||||
yAxisLabelStabilize = 'Stabilisiert';
|
yAxisLabelStabilize = 'Stabilisiert';
|
||||||
yAxisLabelFlag = 'Flaggenbesitz';
|
yAxisLabelFlag = 'Flaggenbesitz';
|
||||||
|
|
||||||
monotoneYCurve = d3.curveMonotoneY;
|
|
||||||
stepCurve = d3.curveStepAfter;
|
stepCurve = d3.curveStepAfter;
|
||||||
gradient = false;
|
gradient = false;
|
||||||
yAxis = true;
|
yAxis = true;
|
||||||
|
@ -187,12 +186,22 @@ export class WarDetailComponent {
|
||||||
"name": startDateObj,
|
"name": startDateObj,
|
||||||
"value": this.war.budgetOpfor
|
"value": this.war.budgetOpfor
|
||||||
});
|
});
|
||||||
data.budget.forEach(budgetEntry => {
|
// This adds an entry for both fractions on every event
|
||||||
this.tmpBudgetData[budgetEntry.fraction === 'BLUFOR' ? 0 : 1].series.push({
|
for (let i = 0; i < data.budget.length; i++) {
|
||||||
|
const budgetEntry = data.budget[i];
|
||||||
|
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
|
||||||
|
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
|
||||||
|
|
||||||
|
this.tmpBudgetData[fractionChange].series.push({
|
||||||
"name": new Date(budgetEntry.time),
|
"name": new Date(budgetEntry.time),
|
||||||
"value": budgetEntry.newBudget
|
"value": budgetEntry.newBudget
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.tmpBudgetData[fractionOld].series.push({
|
||||||
|
"name": new Date(budgetEntry.time),
|
||||||
|
"value": this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length-1].value
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// KILLS
|
// KILLS
|
||||||
let killCountBlufor = 0;
|
let killCountBlufor = 0;
|
||||||
|
@ -290,11 +299,11 @@ export class WarDetailComponent {
|
||||||
if (reviveEntry.stabilized === false) {
|
if (reviveEntry.stabilized === false) {
|
||||||
reviveCountBlufor++;
|
reviveCountBlufor++;
|
||||||
} else {
|
} else {
|
||||||
reviveCountOpfor++;
|
stabilizeCountBlufor++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (reviveEntry.stabilized === false) {
|
if (reviveEntry.stabilized === false) {
|
||||||
stabilizeCountBlufor++;
|
reviveCountOpfor++;
|
||||||
} else {
|
} else {
|
||||||
stabilizeCountOpfor++;
|
stabilizeCountOpfor++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,8 @@ export class ChartUtils {
|
||||||
|
|
||||||
public static getShortDateString(date): string {
|
public static getShortDateString(date): string {
|
||||||
const isoDate = date.slice(0, 10);
|
const isoDate = date.slice(0, 10);
|
||||||
const dayDate = parseInt(isoDate.slice(8, 10)) + 1;
|
const dayDate = parseInt(isoDate.slice(8, 10));
|
||||||
return (dayDate < 10 ? "0" + dayDate : dayDate) + '.'
|
return (dayDate < 10 ? "0" + dayDate : dayDate) + '.'
|
||||||
+ isoDate.slice(5, 7) + '.' + isoDate.slice(2, 4);
|
+ isoDate.slice(5, 7) + '.' + isoDate.slice(2, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue