From 4166f8abf6eb100705edcc7542e0486fa21a605c Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Fri, 3 May 2013 00:38:24 +1200 Subject: Relate Map bubble area to instances Also set a sane maximum bubble size. Previously, it operated on a logarithmic scale, which meant some bubbles weren't being given their due weight. Thanks to Nard for the suggestion! --- js/mv/chart.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/mv/chart.js b/js/mv/chart.js index 779a612..99c67d5 100644 --- a/js/mv/chart.js +++ b/js/mv/chart.js @@ -42,14 +42,15 @@ var mv = function(mv) { /* Y */ .valueAccessor(function(d) { return d.value.j + 1; }) /* R */ - .radiusValueAccessor(function(d) { return Math.log(d.value.r + 1); }) + .radiusValueAccessor(function(d) { return Math.sqrt(d.value.r); }) + .maxBubbleRelativeSize(0.05) .x(d3.scale.log().domain([1, 100000])) .y(d3.scale.log().domain([1, 300000])) .elasticX(true) .elasticY(true) .renderHorizontalGridLines(true) .renderVerticalGridLines(true) - .title(function(d) { return "Map " + d.key; }) + .title(function(d) { return "Map " + d.key + ":" + d.value.r; }) .renderTitle(true) ; mv.charts.stats = trellisChart("#stat-chart", ["str", "agi", "vit", "dex", "int", "luk"].map(function(d) { mv.heap[d].name = d; return mv.heap[d]; })); -- cgit v1.2.3-60-g2f50