This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 143
Omit marks that are outside of range specified by min and max. #695
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
709f46c
Omit marks that are outside of range specified by min and max.
3bf1241
Merge branch 'dev' into 517-rangeslider-labels
480511f
Handle case in which marks prop is not defined.
01324bf
Add test for out-of-range numbers.
5cb8509
Use pickBy.
9c94308
Add mark at point below minimum value.
396756e
Also omit out-of-range marks for slider.
4bdaf71
Add test for slider.
1f5d15d
Add padding to Slider and RangeSlider containers.
a93fa42
Update test for persistence.
fdd296b
Change test for always visible rangeslider.
ad838fc
Only add top padding if there are always-visible tooltips on the top.
c8070d4
Preserve whitespace in marks.
9e2ee6b
Add optional verticalHeight prop for vertical sliders.
4d03221
Update slider stylesheet.
5a6a845
Merge branch 'dev' into 517-rangeslider-labels
bbb4fea
Update coordinates to reflect new padding.
a0aad56
Remove file.
1261f90
Use fixed-width slider for rangeslider test.
e4476ea
Merge branch 'dev' into 517-rangeslider-labels
b7dee1a
Fix persistence test.
edc2784
Memoize computation of style and move function to utils.
df14f7d
Simplify style code.
b9a8fcf
Fix eslint errors.
dfee39a
Merge branch 'dev' into 517-rangeslider-labels
3e32f28
Modify style object directly.
473e86a
Update CHANGELOG.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {memoizeWith, identity, contains} from 'ramda'; | ||
|
||
export default () => { | ||
return memoizeWith(identity, (vertical, verticalHeight, tooltip) => { | ||
const style = { | ||
padding: '25px', | ||
}; | ||
|
||
if (vertical) { | ||
style.height = verticalHeight + 'px'; | ||
|
||
if ( | ||
!tooltip || | ||
!tooltip.always_visible || | ||
!contains(tooltip.placement, [ | ||
'left', | ||
'topRight', | ||
'bottomRight', | ||
]) | ||
) { | ||
style.paddingLeft = '0px'; | ||
} | ||
} else { | ||
if ( | ||
!tooltip || | ||
!tooltip.always_visible || | ||
!contains(tooltip.placement, ['top', 'topLeft', 'topRight']) | ||
) { | ||
style.paddingTop = '0px'; | ||
} | ||
} | ||
|
||
return style; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now, but just because I'm thinking about it: I'd like us to consider moving away from
omit
for forwarding props to 3rd-party components, and usepick
instead. IMOomit
makes it too hard to follow which props are being passed on, too easy to forget to remove newly added props, and makes us lazy about accepting someone else's choice of names and values even if they don't make sense in our case. (cc @Marc-Andre-Rivet )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson Agreed for DCC! There's also a bit of this happening in the table fragments / d3-format wrappers that should be looked into. Due to its generated nature I'd say whether this makes sense on HTML components would have to be evaluated independently. Can you open an issue for follow up and tag it for
Dash v1.x
milestone? Thanks.