From 3317e8a6835bd4dee20becbd0c78ff06312fc558 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Sun, 2 Jun 2013 02:16:13 +1200 Subject: Plot average str as map chart y axis --- public/index.html | 3 +-- public/js/mv/chart.js | 6 +++--- public/js/mv/heap.js | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/public/index.html b/public/index.html index 733f7b5..f7c67a1 100644 --- a/public/index.html +++ b/public/index.html @@ -53,8 +53,7 @@

Map

-

The larger the bubble, the more XP instances for that map.

-
Total job XP gain
+
Average str
Total level XP gain
diff --git a/public/js/mv/chart.js b/public/js/mv/chart.js index ebb62da..9bf11f6 100644 --- a/public/js/mv/chart.js +++ b/public/js/mv/chart.js @@ -53,12 +53,12 @@ var mv = function(mv) { /* X */ .keyAccessor(function(d) { return d.value.e + 1; }) /* Y */ - .valueAccessor(function(d) { return d.value.j + 1; }) + .valueAccessor(function(d) { return d.value.r ? (d.value.str / d.value.r) : 0; }) /* R */ - .radiusValueAccessor(function(d) { return Math.sqrt(d.value.r); }) + .radiusValueAccessor(function(d) { return 1; }) .maxBubbleRelativeSize(0.045) .x(d3.scale.log().domain([1, 100000])) - .y(d3.scale.log().domain([1, 300000])) + .y(d3.scale.linear().domain([1, 100])) .axisPixelPadding({left:5, top: 10, right: 15, bottom: 5}) .elasticX(true) .elasticY(true) diff --git a/public/js/mv/heap.js b/public/js/mv/heap.js index 4ba5c06..0706dfa 100644 --- a/public/js/mv/heap.js +++ b/public/js/mv/heap.js @@ -5,9 +5,9 @@ var mv = function(mv) { var monoGroups = {}; var statGran = 10; heap.init = function() { - function ea(p, d) { p.e += d.e; p.j += d.j; p.r++; return p; } - function es(p, d) { p.e -= d.e; p.j -= d.j; p.r--; return p; } - function ez(p, d) { return { e: 0, j: 0, r: 0 }; } + function ea(p, d) { p.e += d.e; p.j += d.j; p.r++; p.str += d.pcstat.str; p.agi += d.pcstat.agi; return p; } + function es(p, d) { p.e -= d.e; p.j -= d.j; p.r--; p.str -= d.pcstat.str; p.agi -= d.pcstat.agi; return p; } + function ez(p, d) { return { e: 0, j: 0, r: 0, str: 0, agi: 0 }; } heap.cfdata = crossfilter(mv.parser.records); heap.all = heap.cfdata.groupAll().reduce(ea, es, ez); monoGroup("date", function(d) { return d3.time.hour.round(d.date); }); -- cgit v1.2.3-60-g2f50