From b1a4e741b26bc38b64fbfee74c3d8166c5e41737 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Tue, 11 Aug 2015 22:38:43 +0100 Subject: [PATCH] Update bubble extension --- extensions/chart-bubble/bubble.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/extensions/chart-bubble/bubble.js b/extensions/chart-bubble/bubble.js index b976f9f..d4f6795 100644 --- a/extensions/chart-bubble/bubble.js +++ b/extensions/chart-bubble/bubble.js @@ -41,8 +41,7 @@ var names = extra.names, values = extra.values, base_length = extra.base_length, x = names[d.x], y = d.id, key = extra.getKey(x, y), value = !values[key] ? 0 : values[key], - max, max_r, max_area, min, min_r, min_area, - a, area, r; + max, max_r, max_area, a, area, r; if (!base_length) { base_length = extra.base_length = d3.min([ @@ -52,14 +51,10 @@ } max = d3.max(Object.keys(values).map(function (key) { return values[key]; })); - min = d3.min(Object.keys(values).map(function (key) { return values[key]; })); - max_r = (base_length / (names.length * 2)); max_area = max_r * max_r * Math.PI; - min_r = Math.sqrt(min * max_r * max_r / max); - min_area = min_r * min_r * Math.PI; - a = (max_area - min_area) / (max - min); + a = max_area / max; area = value * a; r = Math.sqrt(area / Math.PI);