Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bedb673

Browse filesBrowse files
authored
Merge pull request #962 from plotly/range-slider-v2
Range slider second iteration (part 1)
2 parents 5a08fbc + 2a7696a commit bedb673
Copy full SHA for bedb673

File tree

Expand file treeCollapse file tree

10 files changed

+692
-407
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+692
-407
lines changed

‎src/components/dragelement/index.js

Copy file name to clipboardExpand all lines: src/components/dragelement/index.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ function coverSlip() {
177177
return cover;
178178
}
179179

180+
dragElement.coverSlip = coverSlip;
181+
180182
function finishDrag(gd) {
181183
gd._dragging = false;
182184
if(gd._replotPending) Plotly.plot(gd);
+51Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
13+
// attribute container name
14+
name: 'rangeslider',
15+
16+
// class names
17+
18+
containerClassName: 'rangeslider-container',
19+
bgClassName: 'rangeslider-bg',
20+
rangePlotClassName: 'rangeslider-rangeplot',
21+
22+
maskMinClassName: 'rangeslider-mask-min',
23+
maskMaxClassName: 'rangeslider-mask-max',
24+
slideBoxClassName: 'rangeslider-slidebox',
25+
26+
grabberMinClassName: 'rangeslider-grabber-min',
27+
grabAreaMinClassName: 'rangeslider-grabarea-min',
28+
handleMinClassName: 'rangeslider-handle-min',
29+
30+
grabberMaxClassName: 'rangeslider-grabber-max',
31+
grabAreaMaxClassName: 'rangeslider-grabarea-max',
32+
handleMaxClassName: 'rangeslider-handle-max',
33+
34+
// style constants
35+
36+
maskColor: 'rgba(0,0,0,0.4)',
37+
38+
slideBoxFill: 'transparent',
39+
slideBoxCursor: 'ew-resize',
40+
41+
grabAreaFill: 'transparent',
42+
grabAreaCursor: 'col-resize',
43+
grabAreaWidth: 10,
44+
grabAreaMinOffset: -6,
45+
grabAreaMaxOffset: -2,
46+
47+
handleWidth: 2,
48+
handleRadius: 1,
49+
handleFill: '#fff',
50+
handleStroke: '#666',
51+
};

‎src/components/rangeslider/create_slider.js

Copy file name to clipboardExpand all lines: src/components/rangeslider/create_slider.js
-287Lines changed: 0 additions & 287 deletions
This file was deleted.

‎src/components/rangeslider/defaults.js

Copy file name to clipboardExpand all lines: src/components/rangeslider/defaults.js
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ var attributes = require('./attributes');
1515
module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxes) {
1616
if(!layoutIn[axName].rangeslider) return;
1717

18-
var containerIn = Lib.isPlainObject(layoutIn[axName].rangeslider) ?
19-
layoutIn[axName].rangeslider : {},
18+
// not super proud of this (maybe store _ in axis object instead
19+
if(!Lib.isPlainObject(layoutIn[axName].rangeslider)) {
20+
layoutIn[axName].rangeslider = {};
21+
}
22+
23+
var containerIn = layoutIn[axName].rangeslider,
2024
containerOut = layoutOut[axName].rangeslider = {};
2125

2226
function coerce(attr, dflt) {
2327
return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
2428
}
2529

26-
coerce('bgcolor');
30+
coerce('bgcolor', layoutOut.plot_bgcolor);
2731
coerce('bordercolor');
2832
coerce('borderwidth');
2933
coerce('thickness');
@@ -48,4 +52,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
4852
layoutOut[ax] = opposing;
4953
});
5054
}
55+
56+
// to map back range slider (auto) range
57+
containerOut._input = containerIn;
5158
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.