From 195a0ddbc249bfcac9f11e3653bf9c25a01b982e Mon Sep 17 00:00:00 2001 From: Ryan Moore Date: Wed, 6 Mar 2019 01:29:11 -0500 Subject: [PATCH] Fix bars axis bug --- .../javascripts/viewer_helpers/viewer_draw.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/viewer_helpers/viewer_draw.js b/app/assets/javascripts/viewer_helpers/viewer_draw.js index b3d8354..20babb4 100644 --- a/app/assets/javascripts/viewer_helpers/viewer_draw.js +++ b/app/assets/javascripts/viewer_helpers/viewer_draw.js @@ -88,7 +88,7 @@ function draw_bars() { // If there are some min heights less than 0, some bars will be going backwards and we'd like a little more nudge. if (min_height_data < 0) { // We also want to scale the min height in terms of this max and min. - nudge_horiz += scale_bar_height(min_height_data, max_height_data, min_height_data); + anudge_horiz += scale_bar_height(min_height_data, max_height_data, min_height_data); } @@ -128,7 +128,17 @@ function draw_bars() { for (var i = 0; i < num_bar_sets; ++i) { // First we need to set the start_radius for this set of bars var first_datum = ROOT.descendants().filter(is_leaf)[0]; - start_radii[i] = first_datum.y + global.html.val.bars_padding; + + var aextra = i * 10; + var anudge_horiz = global.html.val.bars_padding + (i * global.html.val.bars_height) + aextra; + + // If there are some min heights less than 0, some bars will be going backwards and we'd like a little more nudge. + if (min_bar_heights[0] < 0) { + // We also want to scale the min height in terms of this max and min. + anudge_horiz += scale_bar_height(min_bar_heights[0], max_bar_heights[0], min_bar_heights[0]); + } + + start_radii[i] = first_datum.y + anudge_horiz; // TODO axis bug var bars = d3.select("#bars-container-" + (i + 1)) .selectAll("rect")