-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add possibility to define custom tickformat per zoom levels #1946
Comments
This sounds like a nice solution for #1812 |
Based on @etpinard feedback here apalchys#1 (comment), I suggested the following change: Add a new field which sets a tick format for defined span.
I doubt about naming - any improvements are welcome.
|
@etpinard @alexcjohnson @rreusser if you don't have objections/comments, I am starting work on the implementation. |
@apalchys It's probably best to wait for us to reach a consensus. Sorry if things are slow, but it's the middle of summer and this ticket isn't a high priority. |
I like the concept! Trying to pin down exactly what tickformatstops: [{
min: number, // optional: minimum span to use this format
max: number, // optional: maximum span to use this format
value: string // tick format string
}] And then we take the first format that satisfies the min/max criteria, falling back on default formatting if none match. That way you could do things like: tickformatstops: [{max: 100, value: '.2f'}, {value: 'e'}] which would mean tickformatstops: [{min: 1, max: 100, value: '.2f'}] which would mean Now, as to The question then is whether we support more than we do for |
I like the idea of optional tickformatstops: [{
range: [/* 2-item array */],
value: string // tick format string
}] where |
|
just confirm: |
Yes. I suppose that could be confusing though if it's named @apalchys I think we're agreed on the structure anyway - so go for it, looking forward to this! |
Hi there. I see superseded issue #1812 and was wondering where does the current issue stand? Thanks, |
Closed by #1965 |
We have a requirement to use custom tick format at some zoom level. For example:
I want to add "Year" postfix for years but keep default formatting for other zoom levels.
I prepared a PR to add possibility to pass not only string but also a configuration object to axis tickformat. Since it is my first PR I did it in my fork as per the guideline
apalchys#1
@rreusser / @etpinard could you please review?
The text was updated successfully, but these errors were encountered: