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
How to define how tickLines are rendered? #123
Comments
You can style by class, which is traditionally the way to style axes but yes, in keeping with the many new undocumented features, an axis object accepts a
And produce these... things: If you have any issues let me know. And yes, I'm in the middle of a big doc rewrite so hopefully it will be a better experience in the future. The current docs for |
Ok thank you for the detailed response, I'll get back to you when I've tried it out |
Hi Marcus, I'd be interested in seeing some examples of what you come up with. i.e. how you're looking to customize tick lines. |
I've been doing it like marcus (with css) and usually end up doing something like this:
And then in css:
|
What I would love is the ability to set className to a function rather than a string, but that might be a deeper react issue. I'm trying to do conditional colors for tick labels and haven't figured out a solution for XYFrame yet. It isn't too hard with the ORFrame. |
Hi Ben. You can target singular tick labels, or a range of tick labels, directly via CSS using selectors such as But this assumes you know the tick values and the style(s) you want to apply ahead of time. I'm assuming you want to be able to set a CSS class per tick value because you want to decide in code (dependent on the data etc.) how to exactly style tick values? Have you any images, mockups, or examples done in other frameworks that show the sort of thing you're trying to achieve? And what is your criteria for conditionally coloring tick labels? |
@dgwyer yeah, I want to do it conditionally on the data. I'll make another issue about it instead of hijacking this one :) |
It's for a work project and a higher priority has come up, but I will definitely get to this within a week and document this when I do. And as for my current solution, it is as @bengarvey has said. I just went on my browser's development tools looked at what CSS .tick-line {
stroke: rgba(0,0,0,0);
} |
You can use See this pen for an example of specifying several instances of axes to render multiple tick lines of specific sizes. It works pretty well: https://codepen.io/dgwyer/pen/06ca097f595e2de6d23ac4294f2d4483 |
@dgwyer Good find! Now all we have to do is add it to the wiki and it will become documented :) |
There's an example of using tickSize in the interactive examples, too: https://emeeks.github.io/semiotic/#/semiotic/axis I seriously need to get the docs in order, guys. |
Hi everyone just found this thread useful, I was struggling to find out a solution and tickSize 0 helped..Just wanted to say thanks :) I guess way to think is that all properties of d3-axis applies as documented in xyframe#axes-array- |
I've been searching all the documentation and issues and can't find anything that specifies how to customize tick lines, as opposed to tick values or scaling or labelling. The only solution I've come up with is to take the classNames you've given
tick-line
and specifying a style class for that. Is there any way to pass jsx or at the very least to pass your own class name to each tick line for each orientation?The text was updated successfully, but these errors were encountered: