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.
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
feat: add grid lines #1179
base: dev
Are you sure you want to change the base?
feat: add grid lines #1179
Changes from 2 commits
9dfa15b
e875f7c
70105ef
5956678
6e6492b
9dd491a
cdc7451
d905261
a950796
8d47c1c
abbddeb
e8355ea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Probably next "layers" will "overlay" the grid & make it less visible. I am thinking about drawing the grid AFTER these layers. But let's leave it this way & 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.
I tried to move it around, but I don't see any visual changes to that
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.
OK, we'll test it together
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.
Assume we have
hours_to_show=2
&grid_line_type=hour
.Then
numLines = 2
&xRatio = 250
.Then we will have 2 lines - for
125
&375
, i.e. forhour=0.5
&hour=1.5
.And the 1st line will be "thin" (0 % 2 === 0), the 2nd line will be "thick" (1 % 2 = 1).
Not nice.
ALternatively we can make "thin" lines for "hour=0.5" & "hour=1.5", and "thick" line for "hour=1".
What do you think?
Also, can we turn a "frequency" - that "2" value - into an option like
grid_line_?????
to define which lines should be "thin"?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.
done
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.
We still have an issue here.
If hours_to_show = 2, we will get the left picture (thick line on 125, thin on 375), but we need to get the right picture (thick line on 250):
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.
yeah that's the 0.5 in this line const x = xRatio * (i + 0.5);
If I remove it the first line is kinda hidden in the border and I find it wierd, that's why there is an offset
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 trying now to adapt the algorithm to a fractional
hours_to_show
. For int values already made it, but for fractional more difficult story.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.
Please check my addition below (currently last comment in the thread).
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.
refactored
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.
Very good.
Look, I have a little experience in JS - so have lots of doubts.
In C we need to provide things like
to avoid undesired conversions.
Is it properly handled in JS? Don't we need to write additional checks or explicit conversions ?