Skip to content
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

custom grid ticks #612

Closed
wants to merge 8 commits into from
Closed

custom grid ticks #612

wants to merge 8 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Dec 15, 2021

@Fil Fil requested a review from mbostock December 15, 2021 01:15
@Fil
Copy link
Contributor Author

Fil commented Dec 15, 2021

I might go back to one mark per grid tick, which would also help support grid lines with various styles (as in #114 (comment)) [edit: done]

@Fil Fil marked this pull request as draft December 15, 2021 09:39
@Fil
Copy link
Contributor Author

Fil commented Dec 17, 2021

Not sure how to design it so that the styles (opacity: 0.1) could be modified through the plot's root style option. It's a generic question though (see #397 #253).

For now the demo adds a custom <style> element: https://observablehq.com/@observablehq/plot-custom-grid-612

@Fil Fil marked this pull request as ready for review December 17, 2021 10:56
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

If you specify explicit values for the scale’s grid, we should extend the default domain to cover those values. I’d also prefer to stick to the existing attributes, rather than extending the inline stylesheets, for consistency with d3-axis. I’m cool with adding a “grid” class to differentiate these grid lines from ticks, though.

…rray of tick values

Other changes:
* The grids are not mixed with the axis ticks any more. Instead, they are created in a g element below the axis, with a .grid className.
* The faceted grids are not generated as interrupted paths, but as groups of lines (making it easier to work with them downstream).
* The code is a few lines longer but (imho) easier to read.

closes #7
* creates only one mark for each grid under each facet, using a single path instead of many lines. (We might have to create separate paths in the future when we do grid transitions)
* much more readable
…sharray) and transitions (which is why we pass the unscaled ticks).
@Fil
Copy link
Contributor Author

Fil commented Jul 13, 2022

superseded by #985 #987 and #992

@Fil Fil closed this Jul 13, 2022
@Fil Fil deleted the fil/custom-grid-ticks branch July 13, 2022 15:00
@mbostock mbostock mentioned this pull request Dec 31, 2022
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom grid density or values.
2 participants