plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Better rangeslider positioning

Open alexcjohnson opened this issue 7 years ago • 6 comments

As mentioned by @PavelGolodoniuc in #2443, rangesliders don't have very flexible positioning - they always go right below the associated axis (and tick labels if they're shown) and you can set their thickness as a fraction of plot area, but perhaps we could allow them to get a full domain: [bottom, top] or even domain: {x: [left, right], y: [bottom, top]} so you can control the width too, not be restricted to the same width as the x axis.

alexcjohnson avatar Mar 07 '18 21:03 alexcjohnson

Does this issue also cover using a rangeslider along the yaxis? I want to use a rangeslider with {type: 'histogram', y: myData} Or should I create a new GitHub issue to cover that situation?

yaxis rangeslider not working: https://codepen.io/arlowhite/pen/rvxKwB

arlowhite avatar Apr 23 '18 18:04 arlowhite

@arlowhite y-axis range sliders would be a separate effort - feel free to create a new issue for it.

alexcjohnson avatar Apr 23 '18 19:04 alexcjohnson

is there a way to position the rangeslider under subplots? have 4 subplots..and it always appears just under the first and partially covers the 2nd subplot.

dss010101 avatar May 03 '21 21:05 dss010101

Is there a workaround to make this work?

ludomitch avatar Jul 14 '21 21:07 ludomitch

Would love a good workaround for this

flightmansam avatar Jul 21 '21 15:07 flightmansam

I did a small "hack" in js to move the slider (JQuery needed):

function move_slider(id,translation) {
    let slider = $(".rangeslider-container", `#${id}`)
    let regex = /\(([^)]+)\)/
    let translate = regex.exec(translation)[1].split(",").map((val) => { return parseInt(val); });
    let position = regex.exec(slider.attr("transform"))[1].split(",").map((val) => { return parseInt(val); });
    slider.attr("transform", `translate(${translate[0] + position[0]},${translate[1] + position[1]})`)

The id is the div.id of the plot and the translation variable should be something like '(0,-30)' to move it up by 30px (not sure about the units).

filipesmg avatar Sep 05 '22 15:09 filipesmg