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

Initial rangeslider ranges #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 26, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add range attribute and default to rangeslider
  • Loading branch information
mdtusz committed Apr 25, 2016
commit 63658e18766ac52ebc212f7974667b08ec9f9e4d
16 changes: 16 additions & 0 deletions 16 src/components/rangeslider/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ module.exports = {
role: 'style',
description: 'Sets the border color of the range slider.'
},
range: {
valType: 'info_array',
role: 'info',
items: [
{valType: 'number'},
{valType: 'number'}
],
description: [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cldougl wording clear enough?

'Sets the range of the range slider.',
'If not set, defaults to the full xaxis range.',
'If the axis `type` is *log*, then you must take the',
'log of your desired range.',
'If the axis `type` is *date*, then you must convert',
'the date to unix time in milliseconds.'
].join(' ')
},
thickness: {
valType: 'number',
dflt: 0.15,
Expand Down
16 changes: 14 additions & 2 deletions 16 src/components/rangeslider/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,23 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, axName, coun
attributes, attr, dflt);
}

coerce('visible');
coerce('thickness');
coerce('bgcolor');
coerce('bordercolor');
coerce('borderwidth');
coerce('thickness');
coerce('visible');
coerce('range');

// Expand slider range to the axis range
if(containerOut.range && !layoutOut[axName].autorange) {
var outRange = containerOut.range,
axRange = layoutOut[axName].range;

outRange[0] = Math.min(outRange[0], axRange[0]);
outRange[1] = Math.max(outRange[1], axRange[1]);
} else {
layoutOut[axName]._needsExpand = true;
}

if(containerOut.visible) {
counterAxes.forEach(function(ax) {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.