Skip to content

Commit 86a3167

Browse files
committed
pass axis name to Plots.autoMargin,
- so that running auto-margin on multiple selectors does not result in an infinite loop
1 parent 616d77d commit 86a3167

File tree

1 file changed

+3
-3
lines changed
  • src/components/rangeselector

1 file changed

+3
-3
lines changed

src/components/rangeselector/draw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = function draw(gd) {
6868
});
6969

7070
// N.B. this mutates selectorLayout
71-
reposition(gd, buttons, selectorLayout);
71+
reposition(gd, buttons, selectorLayout, axisLayout._name);
7272

7373
selector.attr('transform', 'translate(' +
7474
selectorLayout.lx + ',' + selectorLayout.ly +
@@ -143,7 +143,7 @@ function getLabel(opts) {
143143
return opts.label || opts.count + ' ' + opts.step.charAt(0);
144144
}
145145

146-
function reposition(gd, buttons, opts) {
146+
function reposition(gd, buttons, opts, axName) {
147147
opts.width = 0;
148148
opts.height = 0;
149149

@@ -230,7 +230,7 @@ function reposition(gd, buttons, opts) {
230230
opts.lx = Math.round(opts.lx);
231231
opts.ly = Math.round(opts.ly);
232232

233-
Plots.autoMargin(gd, 'range-selector', {
233+
Plots.autoMargin(gd, axName + '-range-selector', {
234234
x: opts.x,
235235
y: opts.y,
236236
l: opts.width * ({right: 1, center: 0.5}[xanchor] || 0),

0 commit comments

Comments
 (0)