Conversation
|
I don't mind it being applied to color as well, in the linear case. But it's probably less important. Adding a default rule seems a tad too opinionated. The new visible tick at 0 is enough to ground the chart. |
Fil
left a comment
There was a problem hiding this comment.
When the domain is explicit and zero is implicit, we should not modify the domain.
For example:
Plot.plot({x: { domain: [1, 16] }})should result in a domain of [1, 16], not [0, 16]. However we want [0, 16] when we ask for
Plot.plot({x: { domain: [1, 16], zero: true }})When the two statements are present, zero has priority. It's useful in some cases.
However when zero is implicit, the domain statement should be respected, if present, and the implicit zero should only be applied if the domain is derived from the data.
I've pushed new code to that effect (and double-checked all tests).
Fixes #2331. Breaks a bunch of tests, of course. And should probably only apply to positional scales, not to (e.g.) color? And having an implicit rule would also be nice. Is this too opinionated?