question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Range sliders specs

See original GitHub issue

@mdtusz @alexcjohnson @jackparmer @chriddyp

Range sliders à la Highcharts are coming to plotly.js.

I’m thinking that the most intuitive way to plug them into our attribute schema would be as part of the layout.xaxis object (and the layout.yaxis object down the road).

Range sliders would be an axis component similar to axis titles. They would be drawn below their corresponding axes, and in the bottom margin if necessary.

Here’s a tentative version of the specs:

layout: {
  xaxis: {
    rangeslider: {
      visible: true,  // or xaxis.showrangeslider ?

      range: [0, 2],  // range of the highlighted region (in data coordinates)

      // some attribute combination to determine what to show in the slider box e.g.
      mode: 'traces',   // or 'array' or maybe 'mean' 
      showtraces: [0],  // would show the first trace (this is the Highcharts default)
      array: []  // would show custom data in the slider box 

      len: 0.1,    // length in the vertical in normalized coordinates 
                   // (N.B. len is a colorbar attribute)

      // some border options e.g.
      borderwidth: 1,
      bordercolor: '#fff',

     // maybe later
     side: 'bottom'   // 'top'
    }
  }
}

Some re-factoring in axes.js may be required to ensure that slider changes don’t have to go through Plotly.relayout on every update.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
etpinardcommented, Feb 7, 2017

We’d set up our main graph as is and then additionally we’d down-sample somehow and produce a second set of traces that are shown on the range slider (which could be some or all of what we plot on our normal graph).

Exactly.

Getting the API right will be tricky, but I’m thinking something like:

var trace0 = {
  type: 'scatter',
  name: 'trace on main plot'
  x: [1,2,3],
  y: [2,1,2]
}

var trace1 = {
  type: 'scatter',
  name: 'trace in range slider plot',
  visible: 'rangeslideronly',  // similar to `visible: 'legendonly'`
  x: [1,2,3],
  y: [1.5]
}

Plotly.plot('graph', [trace0, trace1])
2reactions
adamjosephjensencommented, Feb 7, 2017

Hi Guys,

My company adopted Plot.ly js partially because we were excited about the range slider. However, in development we noticed that the range slider renders the whole graph again and it doubles rendering time. Our customers are used to viewing a lot of data all at once. We decided the performance hit wasn’t acceptable so we’re shipping without it.

What do you think about providing a more basic skin for the range slider behavior that doesn’t introduce 100% more rendering cost? Something like:

screen shot 2017-02-07 at 2 34 44 pm

from: http://codepen.io/davidchin/full/GpNvqw/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Range Sliders - W3Schools
Learn how to create custom range sliders with CSS and JavaScript. ... <input type="range" min="1" max="100" value="50" class="slider" id="myRange">
Read more >
<input type="range"> - HTML: HyperText Markup Language
elements of type range let the user specify a numeric value which must be no less than a given value, and no more...
Read more >
Sliders - Material Design
Sliders allow users select from a range of values. ... dimensions specifications for a continuous slider showing 3 measurements. Active track: 6dp height...
Read more >
How to Create a Range Slider in HTML + CSS - HubSpot Blog
A range slider is an input where you select a value from a control or sliding bar. We can slide the handlebar to...
Read more >
21 CSS Range Sliders - Free Frontend
Slider Range. Range slider for weight in HTML, CSS and JavaScript. Compatible browsers: Chrome, Firefox, Opera, Safari. Dependencies: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found