refactor(axis/grid): render grid lines in separate layer from axis#30
Merged
emmacunningham merged 10 commits intoelastic:masterfrom Feb 6, 2019
Merged
Conversation
markov00
reviewed
Feb 4, 2019
Collaborator
markov00
left a comment
There was a problem hiding this comment.
Code overall looks good. I've added a minor comment to address.
The grid lines should appear beneath the chart so we need to render the grid lines first. Previously, grid lines were render as part of the axis; moving them out allows us to independently control the grid lines layer. addresses elastic#16
Now that we're rendering grid lines in their own layer, we can draw them relative to the chart itself, which allows for much simpler logic around computing the line positions. addresses elastic#16
1791f6a to
1ef4f06
Compare
markov00
approved these changes
Feb 5, 2019
Collaborator
markov00
left a comment
There was a problem hiding this comment.
Code LGTM. Tested locally
Collaborator
|
I've only a minor stylistic comment: |
Contributor
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

addresses #16
Previously, we were rendering the grid lines relative to each axis in the same layer as the axis. Now, each axis' grid lines are rendered in a separate layer just for grid lines and the coordinates for the lines are relative to the chart (instead of the axis). This simplifies much of the positioning logic and also gives us the option to draw anything we might want onto the grid layer without affect the axes.
Also, in combination with PR #29, this fixes the issues with rendering grid lines for multiple axes with the same position (there was both overflow and spacing issues previously).
Since we render the grid layer first, the lines render behind the chart elements: