-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Revise flags of rangebreak pattern #4653
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
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
84e54e4
replace rangebrekas.pattern (%w) with (week of day)
archmoj 918abca
replace rangebrekas.pattern (%H) with (time of day)
archmoj 0bf5ceb
update pattern description
archmoj d82db2e
replace rangebrekas.pattern (time of day) with (hour)
archmoj c0e4104
remove refs to d3 format
archmoj 94f8ef8
revert hour flag description - add operation fix for now
archmoj ee2d07a
define constants for *hour* and *day of week* flags
archmoj 8cc498e
add test for pattern integer hours over night
archmoj db38ce9
update description to mention integer hours - use constants for flags
archmoj 5e4ad36
simplify pattern logic in set_convert
archmoj 2d2e627
refactor rangebreak handle pattern
archmoj a333acb
handle decimal bounds and simplify cross period logic
archmoj 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 hidden or 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 |
---|---|---|
|
@@ -278,22 +278,19 @@ module.exports = { | |
|
||
pattern: { | ||
valType: 'enumerated', | ||
// TODO could add '%H:%M:%S' | ||
values: ['%w', '%H', ''], | ||
values: ['day of week', 'hour', ''], | ||
dflt: '', | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Determines a pattern on the time line that generates breaks.', | ||
'If *%w* - Sunday-based weekday as a decimal number [0, 6].', | ||
'If *%H* - hour (24-hour clock) as a decimal number [0, 23].', | ||
'These are the same directive as in `tickformat`, see', | ||
'https://github.com/d3/d3-time-format#locale_format', | ||
'If *day of week* - Sunday-based weekday as a decimal number [0, 6].', | ||
'If *hour* - hour (24-hour clock) as a decimal number [0, 23].', | ||
'for more info.', | ||
'Examples:', | ||
'- { pattern: \'%w\', bounds: [6, 0], operation: \'[]\' }', | ||
'- { pattern: \'day of week\', bounds: [6, 0] }', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this PR implement the default operation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. Those changes would be done in a separate PR. |
||
' breaks from Saturday to Monday (i.e. skips the weekends).', | ||
'- { pattern: \'%H\', bounds: [17, 8] }', | ||
'- { pattern: \'hour\', bounds: [17, 8], operation: \'()\' }', // TODO: simplify after revise defaults | ||
' breaks from 5pm to 8am (i.e. skips non-work hours).' | ||
].join(' ') | ||
}, | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
this accepts numbers from 0 to 23.999999 right?
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 sure.
cc: @alexcjohnson
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.
let's check in on the time-strings here too plz. I don't mind if they're not supported but if they are we should leave it in and document it. :)
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.
Fractional hours worked in my testing, and time strings did not, but the gold standard is adding a test :)
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.
@archmoj your call whether to add these tests here or in another PR but they should be somewhere before the release.
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.
I am adding them in this PR.
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.
Tests are added in 8cc498e.
At the moment this only works properly for integers [0, 24] as mentioned in db38ce9.
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.
demo for the bug
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.
Fixed in a333acb.