Skip to content

Commit

Permalink
Add new Graphs,.
Browse files Browse the repository at this point in the history
  • Loading branch information
gen BTC authored and gen BTC committed May 10, 2016
1 parent 8f27f6b commit ad52924
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
https.py
server.pem
AutoTrimps2 - Copy.js
AutoTrimps2 - Copy (2).js
AutoTrimps2 - Copy (2).js
AutoTrimps2.js.orig
95 changes: 93 additions & 2 deletions Graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ settingbarRow.insertBefore(newItem, settingbarRow.childNodes[10]);
document.getElementById("settingsRow").innerHTML += '<div id="graphParent" style="display: none;"><div id="graph" style="margin-bottom: 2vw;margin-top: 2vw;"></div></div>';

//Create the dropdown for what graph to show
var graphList = ['HeliumPerHour', 'Helium', 'Clear Time', 'Void Maps', 'Loot Sources', 'Run Time'];
var graphList = ['HeliumPerHour', 'Helium', 'Clear Time', 'Void Maps', 'Loot Sources', 'Run Time', 'Void Map History', 'Coord', 'Gigas', 'Lastwarp'];
var btn = document.createElement("select");
btn.id = 'graphSelection';
if(game.options.menu.darkTheme.enabled == 2) btn.setAttribute("style", "color: #C8C8C8");
Expand Down Expand Up @@ -168,7 +168,11 @@ function pushData() {
challenge: game.global.challengeActive,
voids: game.global.totalVoidMaps,
heirlooms: game.stats.totalHeirlooms,
nullifium: game.global.nullifium
nullifium: game.global.nullifium,
gigas: game.upgrades.Gigastation.done,
trimps: game.resources.trimps.realMax(),
coord: game.upgrades.Coordination.done,
lastwarp: game.global.lastWarp
});
//only keep 10 portals worth of runs to prevent filling storage
clearData(10);
Expand Down Expand Up @@ -386,6 +390,93 @@ function setGraphData(graph) {

};
break;

case 'Void Map History':
var currentPortal = -1;
graphData = [];
for (var i in allSaveData) {
if (allSaveData[i].totalPortals != currentPortal) {
graphData.push({
name: 'Portal ' + allSaveData[i].totalPortals + ': ' + allSaveData[i].challenge,
data: []
})
currentPortal = allSaveData[i].totalPortals;
}
graphData[graphData.length - 1].data.push(allSaveData[i].voids);
}
title = 'Void Map History';
xTitle = 'Zone';
yTitle = 'Number of Void Maps'
yType = 'Linear';
break;


title = 'MetalCost of Equipment to Buildings\' Ratio - (Artisan vs Resourceful)';
xTitle = 'Zone';
yTitle = 'Percent'
yType = 'Linear';
break;

case 'Coord':
var currentPortal = -1;
graphData = [];
for (var i in allSaveData) {
if (allSaveData[i].totalPortals != currentPortal) {
graphData.push({
name: 'Portal ' + allSaveData[i].totalPortals + ': ' + allSaveData[i].challenge,
data: []
})
currentPortal = allSaveData[i].totalPortals;
}
if (allSaveData[i].coord)
graphData[graphData.length - 1].data.push(allSaveData[i].coord);
}
title = 'Coordination History';
xTitle = 'Zone';
yTitle = 'Coordination'
yType = 'Linear';
break;

case 'Gigas':
var currentPortal = -1;
graphData = [];
for (var i in allSaveData) {
if (allSaveData[i].totalPortals != currentPortal) {
graphData.push({
name: 'Portal ' + allSaveData[i].totalPortals + ': ' + allSaveData[i].challenge,
data: []
})
currentPortal = allSaveData[i].totalPortals;
}
if (allSaveData[i].gigas >= 0)
graphData[graphData.length - 1].data.push(allSaveData[i].gigas);
}
title = 'Gigastation History';
xTitle = 'Zone';
yTitle = 'Number of Gigas'
yType = 'Linear';
break;

case 'Lastwarp':
var currentPortal = -1;
graphData = [];
for (var i in allSaveData) {
if (allSaveData[i].totalPortals != currentPortal) {
graphData.push({
name: 'Portal ' + allSaveData[i].totalPortals + ': ' + allSaveData[i].challenge,
data: []
})
currentPortal = allSaveData[i].totalPortals;
}
if (allSaveData[i].lastwarp >= 0)
graphData[graphData.length - 1].data.push(allSaveData[i].lastwarp);
}
title = 'Warpstation History';
xTitle = 'Zone';
yTitle = 'Previous Giga\'s Number of Warpstations'
yType = 'Linear';
break;

}
if (oldData != JSON.stringify(graphData)) {
setGraph(title, xTitle, yTitle, valueSuffix, formatter, graphData, yType);
Expand Down

0 comments on commit ad52924

Please sign in to comment.